Skip to content
This repository has been archived by the owner on Jan 12, 2023. It is now read-only.

Add option to customize pod/containerSecurityContext #134

Open
wants to merge 1 commit into
base: master
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: 1 addition & 1 deletion charts/k-rail/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
name: k-rail
description: Kubernetes security tool for policy enforcement
home: https://github.com/cruise-automation/k-rail
version: v3.6.1
version: v3.6.2
maintainers:
- name: cruise-automation
url: https://cruise-automation.github.io/k-rail/
8 changes: 7 additions & 1 deletion charts/k-rail/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ spec:
checksum/tls: {{ print $ca.Cert | sha256sum }}
spec:
serviceAccountName: k-rail
{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: k-rail
command: ["/k-rail", "-config=/config/config.yml", "-exemptions-path-glob=/exemptions/*.yml"]
Expand All @@ -100,8 +104,10 @@ spec:
- name: exemptions
mountPath: /exemptions
readOnly: true
{{- with .Values.containerSecurityContext }}
securityContext:
readOnlyRootFilesystem: true
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: 10250
- containerPort: 8000
Expand Down
7 changes: 7 additions & 0 deletions charts/k-rail/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ tolerations: []

affinity: {}

## securityContext to apply to the pod
podSecurityContext: {}

## securityContext to apply to the container
containerSecurityContext:
readOnlyRootFilesystem: true

# Set to the value (in seconds) which the mutatingwebhook should use for a timeout
# for slower clusters (or larger workloads) this may need to be increased
webhookTimeout: 1
Expand Down