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.

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