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
  1. {{- $name := include "apigwms.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 "apigwms.fullname" . }}
  8. labels:
  9. ufo: {{ $cfgname}}
  10. app: {{ template "apigwms.name" . }}
  11. chart: {{ template "apigwms.chart" . }}
  12. release: {{ .Release.Name }}
  13. heritage: {{ .Release.Service }}
  14. spec:
  15. replicas: {{ .Values.replicaCount }}
  16. selector:
  17. matchLabels:
  18. app: {{ template "apigwms.name" . }}
  19. release: {{ .Release.Name }}
  20. template:
  21. metadata:
  22. labels:
  23. app: {{ template "apigwms.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-mobile-shopping.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. {{- end -}}
  58. {{- end }}
  59. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  60. imagePullPolicy: {{ .Values.image.pullPolicy }}
  61. volumeMounts:
  62. - name: config
  63. mountPath: /app/configuration
  64. env:
  65. - name: PATH_BASE
  66. value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }}
  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 }}