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.

103 lines
3.4 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. {{- $name := include "apigwwm.fullname" . -}}
  2. {{- $cfgname := printf "%s-%s" "cfg" $name -}}
  3. {{- $ocelotcfgname := printf "%s-%s" "ocelot" $name -}}
  4. apiVersion: apps/v1beta2
  5. kind: Deployment
  6. metadata:
  7. name: {{ template "apigwwm.fullname" . }}
  8. labels:
  9. ufo: {{ $cfgname}}
  10. app: {{ template "apigwwm.name" . }}
  11. chart: {{ template "apigwwm.chart" . }}
  12. release: {{ .Release.Name }}
  13. heritage: {{ .Release.Service }}
  14. spec:
  15. replicas: {{ .Values.replicaCount }}
  16. selector:
  17. matchLabels:
  18. app: {{ template "apigwwm.name" . }}
  19. release: {{ .Release.Name }}
  20. template:
  21. metadata:
  22. labels:
  23. app: {{ template "apigwwm.name" . }}
  24. release: {{ .Release.Name }}
  25. spec:
  26. {{ if .Values.inf.registry -}}
  27. imagePullSecrets:
  28. - name: {{ .Values.inf.registry.secretName }}
  29. {{- end }}
  30. volumes:
  31. - name: config
  32. configMap:
  33. name: {{ $ocelotcfgname }}
  34. items:
  35. - key: configuration-web-marketing.json
  36. path: configuration.json
  37. containers:
  38. - name: {{ .Chart.Name }}
  39. {{ if .Values.probes -}}
  40. {{- if .Values.probes.liveness -}}
  41. livenessProbe:
  42. httpGet:
  43. port: {{ .Values.probes.liveness.port }}
  44. path: {{ .Values.probes.liveness.path }}
  45. initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
  46. periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
  47. {{- end -}}
  48. {{- end -}}
  49. {{- if .Values.probes -}}
  50. {{- if .Values.probes.readiness }}
  51. readinessProbe:
  52. httpGet:
  53. port: {{ .Values.probes.readiness.port }}
  54. path: {{ .Values.probes.readiness.path }}
  55. initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
  56. periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
  57. timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
  58. {{- end -}}
  59. {{- end }}
  60. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  61. imagePullPolicy: {{ .Values.image.pullPolicy }}
  62. volumeMounts:
  63. - name: config
  64. mountPath: /app/configuration
  65. env:
  66. - name: PATH_BASE
  67. value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }}
  68. - name: k8sname
  69. value: {{ .Values.clusterName }}
  70. {{- if .Values.env.values -}}
  71. {{- range .Values.env.values }}
  72. - name: {{ .name }}
  73. value: {{ .value | quote }}
  74. {{- end -}}
  75. {{- end -}}
  76. {{- if .Values.env.configmap -}}
  77. {{- range .Values.env.configmap }}
  78. - name: {{ .name }}
  79. valueFrom:
  80. configMapKeyRef:
  81. name: {{ $cfgname }}
  82. key: {{ .key }}
  83. {{- end -}}
  84. {{- end }}
  85. ports:
  86. - name: http
  87. containerPort: 80
  88. protocol: TCP
  89. resources:
  90. {{ toYaml .Values.resources | indent 12 }}
  91. {{- with .Values.nodeSelector }}
  92. nodeSelector:
  93. {{ toYaml . | indent 8 }}
  94. {{- end }}
  95. {{- with .Values.affinity }}
  96. affinity:
  97. {{ toYaml . | indent 8 }}
  98. {{- end }}
  99. {{- with .Values.tolerations }}
  100. tolerations:
  101. {{ toYaml . | indent 8 }}
  102. {{- end }}