_serviceAccount.tpl 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. {{/* Service Account Class */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.class.serviceAccount" (dict "rootCtx" $ "objectData" $objectData) }}
  4. rootCtx: The root context of the chart.
  5. objectData:
  6. name: The name of the serviceAccount.
  7. labels: The labels of the serviceAccount.
  8. annotations: The annotations of the serviceAccount.
  9. */}}
  10. {{- define "ix.v1.common.class.serviceAccount" -}}
  11. {{- $rootCtx := .rootCtx -}}
  12. {{- $objectData := .objectData }}
  13. ---
  14. apiVersion: v1
  15. kind: ServiceAccount
  16. metadata:
  17. name: {{ $objectData.name }}
  18. {{- $labels := (mustMerge ($objectData.labels | default dict) (include "ix.v1.common.lib.metadata.allLabels" $rootCtx | fromYaml)) -}}
  19. {{- with (include "ix.v1.common.lib.metadata.render" (dict "rootCtx" $rootCtx "labels" $labels) | trim) }}
  20. labels:
  21. {{- . | nindent 4 }}
  22. {{- end -}}
  23. {{- $annotations := (mustMerge ($objectData.annotations | default dict) (include "ix.v1.common.lib.metadata.allAnnotations" $rootCtx | fromYaml)) -}}
  24. {{- with (include "ix.v1.common.lib.metadata.render" (dict "rootCtx" $rootCtx "annotations" $annotations) | trim) }}
  25. annotations:
  26. {{- . | nindent 4 }}
  27. {{- end -}}
  28. {{- /* We already allow to override it on per pod basis, let's hard default to false globally */}}
  29. automountServiceAccountToken: false
  30. {{- end -}}