Skip to content

Commit

Permalink
Add additional security options to daemonset chart (closes #62)
Browse files Browse the repository at this point in the history
  • Loading branch information
jparavisini committed Sep 29, 2022
1 parent 67744d9 commit be85ffe
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/daemonset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ helm delete daemonset
| config.args | list | `[]` | |
| config.env | string | `nil` | Map of environment variables to use within the job |
| config.secrets | object | `{}` | Map of secrets that will be exposed as environment variables within the job |
| config.securityContext | object | `{}` | Map of securityContext object applied to pods |
| config.hostPIDAccess | bool | `false` | Allow pods access to host process information |
| config.hostNetworkAccess | bool | `false` | Allow pods access to host network |
| config.dnsPolicy | object | `"Default"` | DNS Policy for pods |
| configMaps | list | `[]` | List of config maps to mount to the deployment |
| daemonsetAnnotations | object | `{}` | Annotations to be applied to the daemonset |
| hostPaths | list | `[]` | List of host paths to mount to the deployment |
Expand Down
8 changes: 8 additions & 0 deletions charts/daemonset/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ spec:
{{- end }}
spec:
enableServiceLinks: false
hostPID: {{ .Values.config.hostPIDAccess | default "false" }}
hostNetwork: {{ .Values.config.hostNetworkAccess | default "false" }}
dnsPolicy: {{ .Values.config.dnsPolicy | default "Default" }}

{{- if .Values.cloudserviceaccount.deploy }}
serviceAccountName: {{ .Values.cloudserviceaccount.name }}
Expand Down Expand Up @@ -95,6 +98,11 @@ spec:
name: {{ include "app.secret.fullname" . }}
{{- end }}

{{- if .Values.config.securityContext }}
securityContext:
{{- toYaml $.Values.config.securityContext | nindent 10 }}
{{- end }}

resources:
{{- toYaml .Values.resources | nindent 10 }}

Expand Down
17 changes: 17 additions & 0 deletions charts/daemonset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ config:
secrets: {}
# username: "password"

# -- Map of securityContext object applied to pods (https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
securityContext: {}
# readOnlyRootFilesystem: true
# privileged: false
# capabilities:
# add:
# - NET_ADMIN

# -- Allow pods access to host proccess information
hostPIDAccess: false

# -- Allow pods access to host network ()
hostNetworkAccess: false

# -- DNS Policy for pods (https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/)
dnsPolicy: Default

# -- List of config maps to mount to the deployment
configMaps: []
# - name: "volume-1"
Expand Down

0 comments on commit be85ffe

Please sign in to comment.