diff --git a/gremlin/templates/_helpers.tpl b/gremlin/templates/_helpers.tpl index c5db6d8..20054c2 100644 --- a/gremlin/templates/_helpers.tpl +++ b/gremlin/templates/_helpers.tpl @@ -142,6 +142,18 @@ Create a computed value for the intended Gremlin secret type which can either be {{- end -}} {{- end -}} +{{- /* GKE Container Optimized OS with Containerd cannot */ -}} +{{- /* mount the state/logs volumes, so detect that here */ -}} +{{- define "gkeCOSContainerd" -}} +{{- $output := false }} +{{- range $index, $node := (lookup "v1" "Node" "" "").items -}} + {{- $gkeRuntime := index $node.metadata.labels "cloud.google.com/gke-container-runtime" -}} + {{- $gkeOS := index $node.metadata.labels "cloud.google.com/gke-os-distribution" -}} + {{- $output = (or $output (and (eq $gkeRuntime "containerd") (eq $gkeOS "cos"))) -}} +{{- end -}} +{{ $output }} +{{- end -}} + {{- define "pspApiVersion" -}} {{- if .Capabilities.APIVersions.Has "policy/v1/PodSecurityPolicy" -}} {{- "policy/v1" -}} diff --git a/gremlin/templates/daemonset.yaml b/gremlin/templates/daemonset.yaml index 25b4a23..1608750 100644 --- a/gremlin/templates/daemonset.yaml +++ b/gremlin/templates/daemonset.yaml @@ -126,12 +126,14 @@ spec: value: {{ .Values.ssl.certDir }} {{- end }} volumeMounts: + {{- if not (include "gkeCOSContainerd" .) }} - name: gremlin-state mountPath: /var/lib/gremlin readOnly: false - name: gremlin-logs mountPath: /var/log/gremlin readOnly: false + {{- end }} - name: cgroup-root mountPath: /sys/fs/cgroup readOnly: true