deployment.yaml (3737B)
1 --- 2 apiVersion: apps/v1 3 kind: Deployment 4 metadata: 5 name: {{ include "element_call.fullname" . }} 6 labels: 7 {{- include "element_call.labels" . | nindent 4 }} 8 spec: 9 {{- if not .Values.element_call.autoscaling.enabled }} 10 replicas: {{ .Values.element_call.replicaCount }} 11 {{- end }} 12 selector: 13 matchLabels: 14 {{- include "element_call.selectorLabels" . | nindent 6 }} 15 template: 16 metadata: 17 {{- with .Values.element_call.podAnnotations }} 18 annotations: 19 {{- toYaml . | nindent 8 }} 20 {{- end }} 21 labels: 22 {{- include "element_call.labels" . | nindent 8 }} 23 {{- with .Values.element_call.podLabels }} 24 {{- toYaml . | nindent 8 }} 25 {{- end }} 26 spec: 27 {{- with .Values.imagePullSecrets }} 28 imagePullSecrets: 29 {{- toYaml . | nindent 8 }} 30 {{- end }} 31 securityContext: 32 {{- toYaml .Values.element_call.podSecurityContext | nindent 8 }} 33 containers: 34 - name: {{ .Chart.Name }} 35 securityContext: 36 {{- toYaml .Values.element_call.securityContext | nindent 12 }} 37 image: "{{ .Values.element_call.image.repository }}:{{ .Values.element_call.image.tag | default .Chart.AppVersion }}" 38 imagePullPolicy: {{ .Values.element_call.image.pullPolicy }} 39 ports: 40 - name: http 41 containerPort: 8080 42 protocol: TCP 43 livenessProbe: 44 httpGet: 45 path: / 46 port: 8080 47 initialDelaySeconds: 3 48 periodSeconds: 3 49 readinessProbe: 50 httpGet: 51 path: / 52 port: 8080 53 initialDelaySeconds: 3 54 periodSeconds: 3 55 resources: 56 {{- toYaml .Values.element_call.resources | nindent 12 }} 57 volumeMounts: 58 - name: config 59 mountPath: /app/config.json 60 subPath: config.json 61 {{- with .Values.element_call.volumeMounts }} 62 {{- toYaml . | nindent 12 }} 63 {{- end }} 64 volumes: 65 - name: config 66 configMap: 67 name: {{ include "element_call.fullname" . }} 68 {{- with .Values.element_call.volumes }} 69 {{- toYaml . | nindent 8 }} 70 {{- end }} 71 {{- with .Values.element_call.nodeSelector }} 72 nodeSelector: 73 {{- toYaml . | nindent 8 }} 74 {{- end }} 75 {{- with .Values.element_call.affinity }} 76 affinity: 77 {{- toYaml . | nindent 8 }} 78 {{- end }} 79 {{- with .Values.element_call.tolerations }} 80 tolerations: 81 {{- toYaml . | nindent 8 }} 82 {{- end }} 83 {{- if .Values.element_call.autoscaling.enabled }} 84 --- 85 apiVersion: autoscaling/v2 86 kind: HorizontalPodAutoscaler 87 metadata: 88 name: {{ include "element_call.fullname" . }} 89 labels: 90 {{- include "element_call.labels" . | nindent 4 }} 91 spec: 92 scaleTargetRef: 93 apiVersion: apps/v1 94 kind: Deployment 95 name: {{ include "element_call.fullname" . }} 96 minReplicas: {{ .Values.element_call.autoscaling.minReplicas }} 97 maxReplicas: {{ .Values.element_call.autoscaling.maxReplicas }} 98 metrics: 99 {{- if .Values.element_call.autoscaling.targetCPUUtilizationPercentage }} 100 - type: Resource 101 resource: 102 name: cpu 103 target: 104 type: Utilization 105 averageUtilization: {{ .Values.element_call.autoscaling.targetCPUUtilizationPercentage }} 106 {{- end }} 107 {{- if .Values.element_call.autoscaling.targetMemoryUtilizationPercentage }} 108 - type: Resource 109 resource: 110 name: memory 111 target: 112 type: Utilization 113 averageUtilization: {{ .Values.element_call.autoscaling.targetMemoryUtilizationPercentage }} 114 {{- end }} 115 {{- end }}