Skip to content

Commit

Permalink
Merge pull request openshift#2178 from 2uasimojo/HIVE-2350/secure-dep…
Browse files Browse the repository at this point in the history
…loyments

Read-only root file system
  • Loading branch information
openshift-merge-bot[bot] committed Feb 1, 2024
2 parents 5fbe0d1 + dc7d630 commit 194c4d4
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
11 changes: 11 additions & 0 deletions config/clustersync/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ spec:
fieldPath: metadata.name
- name: HIVE_SKIP_LEADER_ELECTION
value: "true"
- name: TMPDIR
value: /tmp
volumeMounts:
- name: tmp
mountPath: /tmp
securityContext:
privileged: false
readOnlyRootFilesystem: true
livenessProbe:
failureThreshold: 3
httpGet:
Expand All @@ -72,3 +80,6 @@ spec:
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
volumes:
- name: tmp
emptyDir: {}
9 changes: 9 additions & 0 deletions config/controllers/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ spec:
volumes:
- name: kubectl-cache
emptyDir: {}
- name: tmp
emptyDir: {}
containers:
# By default we will use the latest CI images published from hive master:
- image: registry.ci.openshift.org/openshift/hive-v4.0:hive
Expand All @@ -42,13 +44,20 @@ spec:
volumeMounts:
- name: kubectl-cache
mountPath: /var/cache/kubectl
- name: tmp
mountPath: /tmp
env:
- name: CLI_CACHE_DIR
value: /var/cache/kubectl
- name: HIVE_NS
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TMPDIR
value: /tmp
securityContext:
privileged: false
readOnlyRootFilesystem: true
readinessProbe:
httpGet:
path: /readyz
Expand Down
10 changes: 10 additions & 0 deletions config/hiveadmission/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,17 @@ spec:
envFrom:
- configMapRef:
name: hive-feature-gates
env:
- name: TMPDIR
value: /tmp
volumeMounts:
- mountPath: /var/serving-cert
name: serving-cert
- name: tmp
mountPath: /tmp
securityContext:
privileged: false
readOnlyRootFilesystem: true
readinessProbe:
httpGet:
path: /healthz
Expand All @@ -55,3 +63,5 @@ spec:
secret:
defaultMode: 420
secretName: hiveadmission-serving-cert
- name: tmp
emptyDir: {}
9 changes: 9 additions & 0 deletions config/operator/operator_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ spec:
volumes:
- name: kubectl-cache
emptyDir: {}
- name: tmp
emptyDir: {}
containers:
# By default we will use the latest CI images published from hive master:
- image: registry.ci.openshift.org/openshift/hive-v4.0:hive
Expand All @@ -50,13 +52,20 @@ spec:
volumeMounts:
- name: kubectl-cache
mountPath: /var/cache/kubectl
- name: tmp
mountPath: /tmp
env:
- name: CLI_CACHE_DIR
value: /var/cache/kubectl
- name: HIVE_OPERATOR_NS
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TMPDIR
value: /tmp
securityContext:
privileged: false
readOnlyRootFilesystem: true
readinessProbe:
httpGet:
path: /readyz
Expand Down
9 changes: 9 additions & 0 deletions hack/app-sre/saas-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7596,6 +7596,8 @@ objects:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: TMPDIR
value: /tmp
image: ${REGISTRY_IMG}@${IMAGE_DIGEST}
imagePullPolicy: Always
livenessProbe:
Expand All @@ -7615,14 +7617,21 @@ objects:
requests:
cpu: 100m
memory: 256Mi
securityContext:
privileged: false
readOnlyRootFilesystem: true
volumeMounts:
- mountPath: /var/cache/kubectl
name: kubectl-cache
- mountPath: /tmp
name: tmp
serviceAccountName: hive-operator
terminationGracePeriodSeconds: 10
volumes:
- emptyDir: {}
name: kubectl-cache
- emptyDir: {}
name: tmp
parameters:
- name: REGISTRY_IMG
required: true
Expand Down
30 changes: 30 additions & 0 deletions pkg/operator/assets/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 194c4d4

Please sign in to comment.