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.

102 lines
3.3 KiB

6 years ago
6 years ago
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. timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
  57. {{- end -}}
  58. {{- end }}
  59. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  60. imagePullPolicy: {{ .Values.image.pullPolicy }}
  61. volumeMounts:
  62. - name: config
  63. mountPath: {{ .Values.ocelot.configPath }}
  64. env:
  65. - name: PATH_BASE
  66. value: {{ include "pathBase" . }}
  67. - name: k8sname
  68. value: {{ .Values.clusterName }}
  69. {{- if .Values.env.values -}}
  70. {{- range .Values.env.values }}
  71. - name: {{ .name }}
  72. value: {{ .value | quote }}
  73. {{- end -}}
  74. {{- end -}}
  75. {{- if .Values.env.configmap -}}
  76. {{- range .Values.env.configmap }}
  77. - name: {{ .name }}
  78. valueFrom:
  79. configMapKeyRef:
  80. name: {{ $cfgname }}
  81. key: {{ .key }}
  82. {{- end -}}
  83. {{- end }}
  84. ports:
  85. - name: http
  86. containerPort: 80
  87. protocol: TCP
  88. resources:
  89. {{ toYaml .Values.resources | indent 12 }}
  90. {{- with .Values.nodeSelector }}
  91. nodeSelector:
  92. {{ toYaml . | indent 8 }}
  93. {{- end }}
  94. {{- with .Values.affinity }}
  95. affinity:
  96. {{ toYaml . | indent 8 }}
  97. {{- end }}
  98. {{- with .Values.tolerations }}
  99. tolerations:
  100. {{ toYaml . | indent 8 }}
  101. {{- end }}