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.

92 lines
3.0 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. {{- $name := include "locations-api.fullname" . -}}
  2. {{- $cfgname := printf "%s-%s" "cfg" $name -}}
  3. apiVersion: apps/v1beta2
  4. kind: Deployment
  5. metadata:
  6. name: {{ template "locations-api.fullname" . }}
  7. labels:
  8. ufo: {{ $cfgname}}
  9. app: {{ template "locations-api.name" . }}
  10. chart: {{ template "locations-api.chart" . }}
  11. release: {{ .Release.Name }}
  12. heritage: {{ .Release.Service }}
  13. spec:
  14. replicas: {{ .Values.replicaCount }}
  15. selector:
  16. matchLabels:
  17. app: {{ template "locations-api.name" . }}
  18. release: {{ .Release.Name }}
  19. template:
  20. metadata:
  21. labels:
  22. app: {{ template "locations-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. {{ if .Values.probes -}}
  32. {{- if .Values.probes.liveness -}}
  33. livenessProbe:
  34. httpGet:
  35. port: {{ .Values.probes.liveness.port }}
  36. path: {{ .Values.probes.liveness.path }}
  37. initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
  38. periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
  39. {{- end -}}
  40. {{- end -}}
  41. {{- if .Values.probes -}}
  42. {{- if .Values.probes.readiness }}
  43. readinessProbe:
  44. httpGet:
  45. port: {{ .Values.probes.readiness.port }}
  46. path: {{ .Values.probes.readiness.path }}
  47. initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
  48. periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
  49. timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
  50. {{- end -}}
  51. {{- end }}
  52. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  53. imagePullPolicy: {{ .Values.image.pullPolicy }}
  54. env:
  55. - name: PATH_BASE
  56. value: {{ include "pathBase" . }}
  57. - name: k8sname
  58. value: {{ .Values.clusterName }}
  59. {{- if .Values.env.values -}}
  60. {{- range .Values.env.values }}
  61. - name: {{ .name }}
  62. value: {{ .value | quote }}
  63. {{- end -}}
  64. {{- end -}}
  65. {{- if .Values.env.configmap -}}
  66. {{- range .Values.env.configmap }}
  67. - name: {{ .name }}
  68. valueFrom:
  69. configMapKeyRef:
  70. name: {{ $cfgname }}
  71. key: {{ .key }}
  72. {{- end -}}
  73. {{- end }}
  74. ports:
  75. - name: http
  76. containerPort: 80
  77. protocol: TCP
  78. resources:
  79. {{ toYaml .Values.resources | indent 12 }}
  80. {{- with .Values.nodeSelector }}
  81. nodeSelector:
  82. {{ toYaml . | indent 8 }}
  83. {{- end }}
  84. {{- with .Values.affinity }}
  85. affinity:
  86. {{ toYaml . | indent 8 }}
  87. {{- end }}
  88. {{- with .Values.tolerations }}
  89. tolerations:
  90. {{ toYaml . | indent 8 }}
  91. {{- end }}