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.7 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. {{- $name := include "catalog-api.fullname" . -}}
  2. {{- $cfgname := printf "%s-%s" "cfg" $name -}}
  3. apiVersion: apps/v1beta2
  4. kind: Deployment
  5. metadata:
  6. name: {{ template "catalog-api.fullname" . }}
  7. labels:
  8. ufo: {{ $cfgname}}
  9. app: {{ template "catalog-api.name" . }}
  10. chart: {{ template "catalog-api.chart" . }}
  11. release: {{ .Release.Name }}
  12. heritage: {{ .Release.Service }}
  13. spec:
  14. replicas: {{ .Values.replicaCount }}
  15. selector:
  16. matchLabels:
  17. app: {{ template "catalog-api.name" . }}
  18. release: {{ .Release.Name }}
  19. template:
  20. metadata:
  21. labels:
  22. app: {{ template "catalog-api.name" . }}
  23. release: {{ .Release.Name }}
  24. spec:
  25. {{ if .Values.inf.registry -}}
  26. imagePullSecrets:
  27. - name: {{ .Values.inf.registry.secretName }}
  28. {{- end }}
  29. containers:
  30. - name: {{ .Chart.Name }}
  31. {{ if .Values.probes -}}
  32. {{- if .Values.probes.liveness -}}
  33. livenessProbe:
  34. httpGet:
  35. port: {{ .Values.probes.liveness.port }}
  36. path: {{ .Values.probes.liveness.path }}
  37. initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
  38. periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
  39. {{- end -}}
  40. {{- end -}}
  41. {{- if .Values.probes -}}
  42. {{- if .Values.probes.readiness }}
  43. readinessProbe:
  44. httpGet:
  45. port: {{ .Values.probes.readiness.port }}
  46. path: {{ .Values.probes.readiness.path }}
  47. initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
  48. periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
  49. timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
  50. {{- end -}}
  51. {{- end }}
  52. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  53. imagePullPolicy: {{ .Values.image.pullPolicy }}
  54. env:
  55. - name: PATH_BASE
  56. value: {{ include "pathBase" . }}
  57. - name: k8sname
  58. value: {{ .Values.clusterName }}
  59. {{- if .Values.env.values -}}
  60. {{- range .Values.env.values }}
  61. - name: {{ .name }}
  62. value: {{ .value | quote }}
  63. {{- end -}}
  64. {{- end -}}
  65. {{- if .Values.env.configmap -}}
  66. {{- range .Values.env.configmap }}
  67. - name: {{ .name }}
  68. valueFrom:
  69. configMapKeyRef:
  70. name: {{ $cfgname }}
  71. key: {{ .key }}
  72. {{- end -}}
  73. {{- end }}
  74. ports:
  75. - name: http
  76. containerPort: 5000
  77. protocol: TCP
  78. - name: grpc
  79. containerPort: 5001
  80. protocol: TCP
  81. resources:
  82. {{ toYaml .Values.resources | indent 12 }}
  83. - name: envoy-proxy
  84. image: envoyproxy/envoy
  85. imagePullPolicy: IfNotPresent
  86. ports:
  87. - name: envoy
  88. containerPort: 51051
  89. protocol: TCP
  90. volumeMounts:
  91. - name: envoy-config
  92. mountPath: /etc/envoy
  93. {{- with .Values.nodeSelector }}
  94. nodeSelector:
  95. {{ toYaml . | indent 8 }}
  96. {{- end }}
  97. {{- with .Values.affinity }}
  98. affinity:
  99. {{ toYaml . | indent 8 }}
  100. {{- end }}
  101. {{- with .Values.tolerations }}
  102. tolerations:
  103. {{ toYaml . | indent 8 }}
  104. {{- end }}
  105. volumes:
  106. - name: envoy-config
  107. configMap:
  108. name: envoy-{{ $name }}
  109. items:
  110. - key: _envoy.yaml
  111. path: envoy.yaml
  112. - key: _catalog.proto-descriptor.pb
  113. path: catalog.proto-descriptor.pb