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.

82 lines
2.4 KiB

  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. ufo: {{ $cfgname}}
  10. app: {{ template "apigwws.name" . }}
  11. chart: {{ template "apigwws.chart" . }}
  12. release: {{ .Release.Name }}
  13. heritage: {{ .Release.Service }}
  14. spec:
  15. replicas: {{ .Values.replicaCount }}
  16. selector:
  17. matchLabels:
  18. app: {{ template "apigwws.name" . }}
  19. release: {{ .Release.Name }}
  20. template:
  21. metadata:
  22. labels:
  23. app: {{ template "apigwws.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-shopping.json
  36. path: configuration.json
  37. containers:
  38. - name: {{ .Chart.Name }}
  39. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  40. imagePullPolicy: {{ .Values.image.pullPolicy }}
  41. volumeMounts:
  42. - name: config
  43. mountPath: /app/configuration
  44. env:
  45. - name: PATH_BASE
  46. value: {{ include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) }}
  47. - name: k8sname
  48. value: {{ .Values.clusterName }}
  49. {{- if .Values.env.values -}}
  50. {{- range .Values.env.values }}
  51. - name: {{ .name }}
  52. value: {{ .value | quote }}
  53. {{- end -}}
  54. {{- end -}}
  55. {{- if .Values.env.configmap -}}
  56. {{- range .Values.env.configmap }}
  57. - name: {{ .name }}
  58. valueFrom:
  59. configMapKeyRef:
  60. name: {{ $cfgname }}
  61. key: {{ .key }}
  62. {{- end -}}
  63. {{- end }}
  64. ports:
  65. - name: http
  66. containerPort: 80
  67. protocol: TCP
  68. resources:
  69. {{ toYaml .Values.resources | indent 12 }}
  70. {{- with .Values.nodeSelector }}
  71. nodeSelector:
  72. {{ toYaml . | indent 8 }}
  73. {{- end }}
  74. {{- with .Values.affinity }}
  75. affinity:
  76. {{ toYaml . | indent 8 }}
  77. {{- end }}
  78. {{- with .Values.tolerations }}
  79. tolerations:
  80. {{ toYaml . | indent 8 }}
  81. {{- end }}