You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
2.1 KiB

  1. {{- $name := include "webhooks-api.fullname" . -}}
  2. {{- $cfgname := printf "%s-%s" "cfg" $name -}}
  3. apiVersion: apps/v1beta2
  4. kind: Deployment
  5. metadata:
  6. name: {{ template "webhooks-api.fullname" . }}
  7. labels:
  8. ufo: {{ $cfgname}}
  9. app: {{ template "webhooks-api.name" . }}
  10. chart: {{ template "webhooks-api.chart" . }}
  11. release: {{ .Release.Name }}
  12. heritage: {{ .Release.Service }}
  13. spec:
  14. replicas: {{ .Values.replicaCount }}
  15. selector:
  16. matchLabels:
  17. app: {{ template "webhooks-api.name" . }}
  18. release: {{ .Release.Name }}
  19. template:
  20. metadata:
  21. labels:
  22. app: {{ template "webhooks-api.name" . }}
  23. release: {{ .Release.Name }}
  24. spec:
  25. {{ if .Values.inf.registry -}}
  26. imagePullSecrets:
  27. - name: {{ .Values.inf.registry.secretName }}
  28. {{- end }}
  29. containers:
  30. - name: {{ .Chart.Name }}
  31. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  32. imagePullPolicy: {{ .Values.image.pullPolicy }}
  33. env:
  34. - name: PATH_BASE
  35. value: {{ include "pathBase" . }}
  36. - name: k8sname
  37. value: {{ .Values.clusterName }}
  38. {{- if .Values.env.values -}}
  39. {{- range .Values.env.values }}
  40. - name: {{ .name }}
  41. value: {{ .value | quote }}
  42. {{- end -}}
  43. {{- end -}}
  44. {{- if .Values.env.configmap -}}
  45. {{- range .Values.env.configmap }}
  46. - name: {{ .name }}
  47. valueFrom:
  48. configMapKeyRef:
  49. name: {{ $cfgname }}
  50. key: {{ .key }}
  51. {{- end -}}
  52. {{- end }}
  53. ports:
  54. - name: http
  55. containerPort: 80
  56. protocol: TCP
  57. resources:
  58. {{ toYaml .Values.resources | indent 12 }}
  59. {{- with .Values.nodeSelector }}
  60. nodeSelector:
  61. {{ toYaml . | indent 8 }}
  62. {{- end }}
  63. {{- with .Values.affinity }}
  64. affinity:
  65. {{ toYaml . | indent 8 }}
  66. {{- end }}
  67. {{- with .Values.tolerations }}
  68. tolerations:
  69. {{ toYaml . | indent 8 }}
  70. {{- end }}