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.

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