Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Enhance securityContext in ha manifests (#9810) #9930

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions manifests/ha/base/redis-ha/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,16 @@ patchesJson6902:
name: argocd-redis-ha-haproxy
path: overlays/haproxy-service-selector.yaml

# add container-level security contexts
- target:
group: apps
version: v1
kind: Deployment
name: argocd-redis-ha-haproxy
path: overlays/deployment-containers-securityContext.yaml
- target:
group: apps
version: v1
kind: StatefulSet
name: argocd-redis-ha-server
path: overlays/statefulset-containers-securityContext.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
- op: add
path: /spec/template/spec/initContainers/0/securityContext
value:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
- op: add
path: /spec/template/spec/containers/0/securityContext
value:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
- op: add
path: /spec/template/spec/initContainers/0/securityContext
value:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
- op: add
path: /spec/template/spec/containers/0/securityContext
value:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
- op: add
path: /spec/template/spec/containers/1/securityContext
value:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
35 changes: 35 additions & 0 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10727,6 +10727,13 @@ spec:
port: 8888
initialDelaySeconds: 5
periodSeconds: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /usr/local/etc/haproxy
name: data
Expand All @@ -10740,6 +10747,13 @@ spec:
image: haproxy:2.0.25-alpine
imagePullPolicy: IfNotPresent
name: config-init
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /readonly
name: config-volume
Expand Down Expand Up @@ -11541,6 +11555,13 @@ spec:
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 15
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /data
name: data
Expand Down Expand Up @@ -11579,6 +11600,13 @@ spec:
periodSeconds: 15
successThreshold: 3
timeoutSeconds: 15
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /data
name: data
Expand All @@ -11599,6 +11627,13 @@ spec:
image: redis:7.0.0-alpine
imagePullPolicy: IfNotPresent
name: config-init
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /readonly-config
name: config
Expand Down
35 changes: 35 additions & 0 deletions manifests/ha/namespace-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,13 @@ spec:
port: 8888
initialDelaySeconds: 5
periodSeconds: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /usr/local/etc/haproxy
name: data
Expand All @@ -1514,6 +1521,13 @@ spec:
image: haproxy:2.0.25-alpine
imagePullPolicy: IfNotPresent
name: config-init
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /readonly
name: config-volume
Expand Down Expand Up @@ -2315,6 +2329,13 @@ spec:
periodSeconds: 15
successThreshold: 1
timeoutSeconds: 15
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /data
name: data
Expand Down Expand Up @@ -2353,6 +2374,13 @@ spec:
periodSeconds: 15
successThreshold: 3
timeoutSeconds: 15
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /data
name: data
Expand All @@ -2373,6 +2401,13 @@ spec:
image: redis:7.0.0-alpine
imagePullPolicy: IfNotPresent
name: config-init
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
seccompProfile:
type: RuntimeDefault
volumeMounts:
- mountPath: /readonly-config
name: config
Expand Down