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.

101 lines
3.3 KiB

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