Skip to content

Commit

Permalink
fix: allow configuring fsGroup and projected volumes for AWS EKS
Browse files Browse the repository at this point in the history
  • Loading branch information
tektite-io authored and ivanstanev committed Sep 16, 2021
1 parent c19f074 commit 11904ef
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
11 changes: 11 additions & 0 deletions snyk-monitor/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.securityContext.fsGroup }}
securityContext:
fsGroup: {{ int . }}
{{- end }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -172,6 +176,13 @@ spec:
name: {{ .Values.defaultWorkloadPoliciesMap }}
{{- end }}
optional: true
{{- if .Values.volumes.projected.serviceAccountToken }}
- name: token-vol
projected:
sources:
- serviceAccountToken:
path: token
{{- end }}
- name: registries-conf
configMap:
name: {{ .Values.registriesConfConfigMap }}
Expand Down
15 changes: 15 additions & 0 deletions snyk-monitor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,18 @@ psp:

# Override the excluded namespaces
excludedNamespaces:

# Allow specifying a fsGroup in the PodSpec securityContext:
# spec:
# template:
# spec:
# securityContext:
# fsGroup: <-- here
securityContext:
fsGroup:

# A projected volume maps several existing volume sources into the same directory.
# https://kubernetes.io/docs/concepts/storage/volumes/#projected
volumes:
projected:
serviceAccountToken: false
4 changes: 3 additions & 1 deletion test/setup/deployers/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ async function deployKubernetesMonitor(
'--set pvc.enabled=true ' +
'--set pvc.create=true ' +
'--set log_level="INFO" ' +
'--set rbac.serviceAccount.annotations."foo"="bar"',
'--set rbac.serviceAccount.annotations."foo"="bar" ' +
'--set volumes.projected.serviceAccountToken=true ' +
'--set securityContext.fsGroup=65534 ',
);
console.log(
`Deployed ${imageOptions.nameAndTag} with pull policy ${imageOptions.pullPolicy}`,
Expand Down

0 comments on commit 11904ef

Please sign in to comment.