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

Hack to handle GKE COS Containerd #62

Open
wants to merge 2 commits 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
12 changes: 12 additions & 0 deletions gremlin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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" -}}
Expand Down
2 changes: 2 additions & 0 deletions gremlin/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down