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.

110 lines
3.5 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. {{- $name := include "apigwms.fullname" . -}}
  2. {{- $cfgname := printf "%s-%s" "cfg" $name -}}
  3. {{- $envoycfgname := printf "%s-%s" "envoy" $name -}}
  4. apiVersion: apps/v1
  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. {{ if .Values.inf.mesh.enabled -}}
  26. annotations:
  27. linkerd.io/inject: enabled
  28. {{- end }}
  29. spec:
  30. {{ if .Values.inf.registry -}}
  31. imagePullSecrets:
  32. - name: {{ .Values.inf.registry.secretName }}
  33. {{- end }}
  34. volumes:
  35. - name: config
  36. configMap:
  37. name: {{ $envoycfgname }}
  38. items:
  39. - key: envoy.yaml
  40. path: envoy.yaml
  41. containers:
  42. - name: {{ .Chart.Name }}
  43. {{ if .Values.probes -}}
  44. {{- if .Values.probes.liveness -}}
  45. livenessProbe:
  46. httpGet:
  47. port: {{ .Values.probes.liveness.port }}
  48. path: {{ .Values.probes.liveness.path }}
  49. initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
  50. periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
  51. {{- end -}}
  52. {{- end -}}
  53. {{- if .Values.probes -}}
  54. {{- if .Values.probes.readiness }}
  55. readinessProbe:
  56. httpGet:
  57. port: {{ .Values.probes.readiness.port }}
  58. path: {{ .Values.probes.readiness.path }}
  59. initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
  60. periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
  61. timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
  62. {{- end -}}
  63. {{- end }}
  64. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  65. imagePullPolicy: IfNotPresent
  66. volumeMounts:
  67. - name: config
  68. mountPath: {{ .Values.envoy.configPath }}
  69. env:
  70. - name: PATH_BASE
  71. value: {{ include "pathBase" . }}
  72. - name: k8sname
  73. value: {{ .Values.clusterName }}
  74. {{- if .Values.env.values -}}
  75. {{- range .Values.env.values }}
  76. - name: {{ .name }}
  77. value: {{ .value | quote }}
  78. {{- end -}}
  79. {{- end -}}
  80. {{- if .Values.env.configmap -}}
  81. {{- range .Values.env.configmap }}
  82. - name: {{ .name }}
  83. valueFrom:
  84. configMapKeyRef:
  85. name: {{ $cfgname }}
  86. key: {{ .key }}
  87. {{- end -}}
  88. {{- end }}
  89. ports:
  90. - name: http
  91. containerPort: 80
  92. protocol: TCP
  93. - name: admin
  94. containerPort: 8001
  95. protocol: TCP
  96. resources:
  97. {{ toYaml .Values.resources | indent 12 }}
  98. {{- with .Values.nodeSelector }}
  99. nodeSelector:
  100. {{ toYaml . | indent 8 }}
  101. {{- end }}
  102. {{- with .Values.affinity }}
  103. affinity:
  104. {{ toYaml . | indent 8 }}
  105. {{- end }}
  106. {{- with .Values.tolerations }}
  107. tolerations:
  108. {{ toYaml . | indent 8 }}
  109. {{- end }}