Sin descripción

_helpers.tpl 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {{/*
  2. Return the common name for frontend components
  3. */}}
  4. {{- define "shuffle.frontend.name" -}}
  5. {{- printf "%s-frontend" (include "common.names.fullname" .) | trunc 63 -}}
  6. {{- end -}}
  7. {{/*
  8. Return the common labels for frontend components
  9. */}}
  10. {{- define "shuffle.frontend.labels" -}}
  11. {{- include "common.labels.standard" . }}
  12. app.kubernetes.io/component: frontend
  13. {{- end -}}
  14. {{/*
  15. Return the match labels for frontend components
  16. */}}
  17. {{- define "shuffle.frontend.matchLabels" -}}
  18. {{- include "common.labels.matchLabels" . }}
  19. app.kubernetes.io/component: frontend
  20. {{- end -}}
  21. {{/*
  22. Return the proper Shuffle frontend image name
  23. */}}
  24. {{- define "shuffle.frontend.image" -}}
  25. {{- include "common.images.image" ( dict "imageRoot" .Values.frontend.image "global" .Values.global "chart" .Chart ) -}}
  26. {{- end -}}
  27. {{/*
  28. Return the proper Docker Image Registry Secret Names for the frontend pod
  29. */}}
  30. {{- define "shuffle.frontend.imagePullSecrets" -}}
  31. {{- include "common.images.renderPullSecrets" (dict "images" (list .Values.frontend.image) "context" $) -}}
  32. {{- end -}}
  33. {{/*
  34. Create the name of the service account to use for the Shuffle frontend
  35. */}}
  36. {{- define "shuffle.frontend.serviceAccount.name" -}}
  37. {{- if .Values.frontend.serviceAccount.create -}}
  38. {{ default (include "shuffle.frontend.name" .) .Values.frontend.serviceAccount.name | trunc 63 | trimSuffix "-" }}
  39. {{- else -}}
  40. {{ default "default" .Values.frontend.serviceAccount.name }}
  41. {{- end -}}
  42. {{- end -}}
  43. {{/*
  44. Return the proper Docker Image Registry Secret Names for the frontend service account
  45. */}}
  46. {{- define "shuffle.frontend.serviceAccount.imagePullSecrets" -}}
  47. {{- $pullSecrets := list }}
  48. {{- range .Values.global.imagePullSecrets -}}
  49. {{- if kindIs "map" . -}}
  50. {{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" .name "context" .)) -}}
  51. {{- else -}}
  52. {{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" .)) -}}
  53. {{- end -}}
  54. {{- end -}}
  55. {{- range .Values.frontend.serviceAccount.imagePullSecrets -}}
  56. {{- if kindIs "map" . -}}
  57. {{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" .name "context" .)) -}}
  58. {{- else -}}
  59. {{- $pullSecrets = append $pullSecrets (include "common.tplvalues.render" (dict "value" . "context" .)) -}}
  60. {{- end -}}
  61. {{- end -}}
  62. {{- if (not (empty $pullSecrets)) -}}
  63. imagePullSecrets:
  64. {{- range $pullSecrets | uniq }}
  65. - name: {{ . }}
  66. {{- end }}
  67. {{- end }}
  68. {{- end -}}