_utils.tpl 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. {{/*
  2. Retrieve deployment metadata
  3. */}}
  4. {{- define "common.deployment.metadata" -}}
  5. metadata:
  6. name: {{ template "common.names.fullname" . }}
  7. labels: {{ include "common.labels.selectorLabels" . | nindent 4 }}
  8. {{- end -}}
  9. {{/*
  10. Retrieve replicas/strategy/selector
  11. */}}
  12. {{- define "common.deployment.common_spec" -}}
  13. replicas: {{ (default 1 .Values.replicas) }}
  14. strategy:
  15. type: {{ (default "Recreate" .Values.updateStrategy ) }}
  16. selector:
  17. matchLabels: {{ include "common.labels.selectorLabels" . | nindent 4 }}
  18. {{- end -}}
  19. {{/*
  20. Retrieve deployment pod's metadata
  21. */}}
  22. {{- define "common.deployment.pod.metadata" -}}
  23. metadata:
  24. name: {{ template "common.names.fullname" . }}
  25. labels: {{ include "common.labels.selectorLabels" . | nindent 4 }}
  26. annotations: {{ include "common.annotations" . | nindent 4 }}
  27. {{- end -}}
  28. {{/*
  29. Retrieve common deployment configuration
  30. */}}
  31. {{- define "common.deployment.common_config" -}}
  32. apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
  33. kind: Deployment
  34. {{ include "common.deployment.metadata" . | nindent 0 }}
  35. {{- end -}}