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.

99 lines
3.2 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. {{- $name := include "ordering-api.fullname" . -}}
  2. {{- $cfgname := printf "%s-%s" "cfg" $name -}}
  3. apiVersion: apps/v1
  4. kind: Deployment
  5. metadata:
  6. name: {{ template "ordering-api.fullname" . }}
  7. labels:
  8. ufo: {{ $cfgname}}
  9. app: {{ template "ordering-api.name" . }}
  10. chart: {{ template "ordering-api.chart" . }}
  11. release: {{ .Release.Name }}
  12. heritage: {{ .Release.Service }}
  13. spec:
  14. replicas: {{ .Values.replicaCount }}
  15. selector:
  16. matchLabels:
  17. app: {{ template "ordering-api.name" . }}
  18. release: {{ .Release.Name }}
  19. template:
  20. metadata:
  21. labels:
  22. app: {{ template "ordering-api.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. containers:
  34. - name: {{ .Chart.Name }}
  35. {{ if .Values.probes -}}
  36. {{- if .Values.probes.liveness -}}
  37. livenessProbe:
  38. httpGet:
  39. port: {{ .Values.probes.liveness.port }}
  40. path: {{ .Values.probes.liveness.path }}
  41. initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
  42. periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
  43. {{- end -}}
  44. {{- end -}}
  45. {{- if .Values.probes -}}
  46. {{- if .Values.probes.readiness }}
  47. readinessProbe:
  48. httpGet:
  49. port: {{ .Values.probes.readiness.port }}
  50. path: {{ .Values.probes.readiness.path }}
  51. initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
  52. periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
  53. timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
  54. {{- end -}}
  55. {{- end }}
  56. image: "{{ template "fqdn-image" . }}:{{ .Values.image.tag }}"
  57. imagePullPolicy: {{ .Values.image.pullPolicy }}
  58. env:
  59. - name: PATH_BASE
  60. value: {{ include "pathBase" . }}
  61. - name: k8sname
  62. value: {{ .Values.clusterName }}
  63. {{- if .Values.env.values -}}
  64. {{- range .Values.env.values }}
  65. - name: {{ .name }}
  66. value: {{ .value | quote }}
  67. {{- end -}}
  68. {{- end -}}
  69. {{- if .Values.env.configmap -}}
  70. {{- range .Values.env.configmap }}
  71. - name: {{ .name }}
  72. valueFrom:
  73. configMapKeyRef:
  74. name: {{ $cfgname }}
  75. key: {{ .key }}
  76. {{- end -}}
  77. {{- end }}
  78. ports:
  79. - name: http
  80. containerPort: 80
  81. protocol: TCP
  82. - name: grpc
  83. containerPort: 81
  84. protocol: TCP
  85. resources:
  86. {{ toYaml .Values.resources | indent 12 }}
  87. {{- with .Values.nodeSelector }}
  88. nodeSelector:
  89. {{ toYaml . | indent 8 }}
  90. {{- end }}
  91. {{- with .Values.affinity }}
  92. affinity:
  93. {{ toYaml . | indent 8 }}
  94. {{- end }}
  95. {{- with .Values.tolerations }}
  96. tolerations:
  97. {{ toYaml . | indent 8 }}
  98. {{- end }}