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

feat(): add security context on the container level #18

Open
wants to merge 1 commit into
base: release/5.0
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions charts/lenses/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ spec:
imagePullSecrets:
- name: {{ .Values.image.registrySecretKey }}
{{- end }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
ports:
- containerPort: {{ .Values.restPort }}
{{- if .Values.lenses.livenessProbe.enabled }}
Expand Down
16 changes: 16 additions & 0 deletions charts/lenses/tests/with-container-security-context.run_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
suite: add securityContext and verify that container is honoring them
templates:
- deployment.yaml
tests:
- it: should not contain containerSecurityContext with default values
asserts:
- isEmpty:
path: spec.template.spec.containers[0].securityContext
- it: should honor containerSecurityContext
set:
containerSecurityContext:
allowPrivilegeEscalation: false
asserts:
- equal:
path: spec.template.spec.containers[0].securityContext.allowPrivilegeEscalation
value: false
1 change: 1 addition & 0 deletions charts/lenses/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ nodeSelector: {}
tolerations: {}
affinity: {}
securityContext: {}
containerSecurityContext: {}

# Add Prometheus annotations to the pod for Lenses metric scraping
monitoring:
Expand Down