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.

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