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(helm): set readOnlyRootFilesystem/runAsUser/runAsGroup on ingress/egress deployments #6164

Merged
merged 3 commits into from
Mar 14, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -470,28 +470,14 @@ ingress:
topologySpreadConstraints:

# -- Security context at the pod level for ingress
podSecurityContext: {}
# # The values below are examples. More values can be added as needed, since the field resolves as free form.
# runAsNonRoot: true
# runAsUser: 1000
# runAsGroup: 3000
# fsGroup: 2000
# fsGroupChangePolicy:
# # to support additional pod level securityContext parameters, please check:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#podsecuritycontext-v1-core
podSecurityContext:
runAsNonRoot: true
runAsUser: 5678
runAsGroup: 5678

# -- Security context at the container level for ingress
containerSecurityContext: {} # for overlapping securityContext between pod and container, the container's value take precedence
# # The values below are examples. More values can be added as needed, since the field resolves as free form.
# allowPrivilegeEscalation: false
# capabilities:
# drop:
# - all
# readOnlyRootFilesystem: true
# privileged: false
# runAsNonRoot: true
# runAsUser: 1000
# runAsGroup: 3000
# # to support additional container level securityContext parameters, please check:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#securitycontext-v1-core
containerSecurityContext:
readOnlyRootFilesystem: true

egress:
# -- If true, it deploys Egress for cross cluster communication
Expand Down Expand Up @@ -581,28 +567,14 @@ egress:
topologySpreadConstraints:

# -- Security context at the pod level for egress
podSecurityContext: {}
# # The values below are examples. More values can be added as needed, since the field resolves as free form.
# runAsNonRoot: true
# runAsUser: 1000
# runAsGroup: 3000
# fsGroup: 2000
# fsGroupChangePolicy:
# # to support additional pod level securityContext parameters, please check:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#podsecuritycontext-v1-core
podSecurityContext:
runAsNonRoot: true
runAsUser: 5678
runAsGroup: 5678

# -- Security context at the container level for egress
containerSecurityContext: {} # for overlapping securityContext between pod and container, the container's value take precedence
# # The values below are examples. More values can be added as needed, since the field resolves as free form.
# allowPrivilegeEscalation: false
# capabilities:
# drop:
# - all
# readOnlyRootFilesystem: true
# privileged: false
# runAsNonRoot: true
# runAsUser: 1000
# runAsGroup: 3000
# # to support additional container level securityContext parameters, please check:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#securitycontext-v1-core
containerSecurityContext:
readOnlyRootFilesystem: true

kumactl:
image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,10 @@ spec:
- kuma-egress
topologyKey: kubernetes.io/hostname
weight: 100
securityContext:
runAsGroup: 5678
runAsNonRoot: true
runAsUser: 5678
serviceAccountName: kuma-egress
nodeSelector:

Expand All @@ -574,6 +578,8 @@ spec:
- name: egress
image: "docker.io/kumahq/kuma-dp:0.0.1"
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
env:
- name: POD_NAME
valueFrom:
Expand Down Expand Up @@ -629,13 +635,17 @@ spec:
- name: control-plane-ca
mountPath: /var/run/secrets/kuma.io/cp-ca
readOnly: true
- name: tmp
mountPath: /tmp
volumes:
- name: control-plane-ca
secret:
secretName: "kuma-tls-cert"
items:
- key: ca.crt
path: ca.crt
- name: tmp
emptyDir: {}
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6046,6 +6046,10 @@ spec:
- kuma-egress
topologyKey: kubernetes.io/hostname
weight: 100
securityContext:
runAsGroup: 5678
runAsNonRoot: true
runAsUser: 5678
serviceAccountName: kuma-egress
nodeSelector:

Expand All @@ -6054,6 +6058,8 @@ spec:
- name: egress
image: "docker.io/kumahq/kuma-dp:0.0.1"
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
env:
- name: POD_NAME
valueFrom:
Expand Down Expand Up @@ -6109,13 +6115,17 @@ spec:
- name: control-plane-ca
mountPath: /var/run/secrets/kuma.io/cp-ca
readOnly: true
- name: tmp
mountPath: /tmp
volumes:
- name: control-plane-ca
secret:
secretName: "kuma-tls-cert"
items:
- key: ca.crt
path: ca.crt
- name: tmp
emptyDir: {}
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -6166,6 +6176,10 @@ spec:
- kuma-ingress
topologyKey: kubernetes.io/hostname
weight: 100
securityContext:
runAsGroup: 5678
runAsNonRoot: true
runAsUser: 5678
serviceAccountName: kuma-ingress
nodeSelector:

Expand All @@ -6175,6 +6189,8 @@ spec:
- name: ingress
image: "docker.io/kumahq/kuma-dp:0.0.1"
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
env:
- name: POD_NAME
valueFrom:
Expand Down Expand Up @@ -6231,13 +6247,17 @@ spec:
- name: control-plane-ca
mountPath: /var/run/secrets/kuma.io/cp-ca
readOnly: true
- name: tmp
mountPath: /tmp
volumes:
- name: control-plane-ca
secret:
secretName: "kuma-tls-cert"
items:
- key: ca.crt
path: ca.crt
- name: tmp
emptyDir: {}
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,10 @@ spec:
- kuma-ingress
topologyKey: kubernetes.io/hostname
weight: 100
securityContext:
runAsGroup: 5678
runAsNonRoot: true
runAsUser: 5678
serviceAccountName: kuma-ingress
nodeSelector:

Expand All @@ -579,6 +583,8 @@ spec:
- name: ingress
image: "docker.io/kumahq/kuma-dp:0.0.1"
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
env:
- name: POD_NAME
valueFrom:
Expand Down Expand Up @@ -635,13 +641,17 @@ spec:
- name: control-plane-ca
mountPath: /var/run/secrets/kuma.io/cp-ca
readOnly: true
- name: tmp
mountPath: /tmp
volumes:
- name: control-plane-ca
secret:
secretName: "kuma-tls-cert"
items:
- key: ca.crt
path: ca.crt
- name: tmp
emptyDir: {}
---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ spec:
- kuma-ingress
topologyKey: kubernetes.io/hostname
weight: 100
securityContext:
runAsGroup: 5678
runAsNonRoot: true
runAsUser: 5678
serviceAccountName: kuma-ingress
nodeSelector:

Expand All @@ -592,6 +596,8 @@ spec:
- name: ingress
image: "docker.io/kumahq/kuma-dp:0.0.1"
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
env:
- name: POD_NAME
valueFrom:
Expand Down Expand Up @@ -648,13 +654,17 @@ spec:
- name: control-plane-ca
mountPath: /var/run/secrets/kuma.io/cp-ca
readOnly: true
- name: tmp
mountPath: /tmp
volumes:
- name: control-plane-ca
secret:
secretName: "kuma-tls-cert"
items:
- key: ca.crt
path: ca.crt
- name: tmp
emptyDir: {}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,10 @@ spec:
- kuma-egress
topologyKey: kubernetes.io/hostname
weight: 100
securityContext:
runAsGroup: 5678
runAsNonRoot: true
runAsUser: 5678
serviceAccountName: kuma-egress
nodeSelector:

Expand All @@ -822,6 +826,8 @@ spec:
- name: egress
image: "docker.io/kumahq/kuma-dp:0.0.1"
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
env:
- name: POD_NAME
valueFrom:
Expand Down Expand Up @@ -877,13 +883,17 @@ spec:
- name: control-plane-ca
mountPath: /var/run/secrets/kuma.io/cp-ca
readOnly: true
- name: tmp
mountPath: /tmp
volumes:
- name: control-plane-ca
secret:
secretName: "kuma-tls-cert"
items:
- key: ca.crt
path: ca.crt
- name: tmp
emptyDir: {}
---
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -937,6 +947,10 @@ spec:
- kuma-ingress
topologyKey: kubernetes.io/hostname
weight: 100
securityContext:
runAsGroup: 5678
runAsNonRoot: true
runAsUser: 5678
serviceAccountName: kuma-ingress
nodeSelector:

Expand All @@ -946,6 +960,8 @@ spec:
- name: ingress
image: "docker.io/kumahq/kuma-dp:0.0.1"
imagePullPolicy: IfNotPresent
securityContext:
readOnlyRootFilesystem: true
env:
- name: POD_NAME
valueFrom:
Expand Down Expand Up @@ -1002,13 +1018,17 @@ spec:
- name: control-plane-ca
mountPath: /var/run/secrets/kuma.io/cp-ca
readOnly: true
- name: tmp
mountPath: /tmp
volumes:
- name: control-plane-ca
secret:
secretName: "kuma-tls-cert"
items:
- key: ca.crt
path: ca.crt
- name: tmp
emptyDir: {}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
Expand Down
Loading