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.

95 lines
3.1 KiB

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