|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "aws-load-balancer-controller.fullname" . }} |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | + labels: |
| 7 | + {{- include "aws-load-balancer-controller.labels" . | nindent 4 }} |
| 8 | +spec: |
| 9 | + replicas: {{ .Values.replicaCount }} |
| 10 | + selector: |
| 11 | + matchLabels: |
| 12 | + {{- include "aws-load-balancer-controller.selectorLabels" . | nindent 6 }} |
| 13 | + template: |
| 14 | + metadata: |
| 15 | + labels: |
| 16 | + {{- include "aws-load-balancer-controller.selectorLabels" . | nindent 8 }} |
| 17 | + {{- if .Values.podLabels }} |
| 18 | + {{- toYaml .Values.podLabels | nindent 8 }} |
| 19 | + {{- end }} |
| 20 | + annotations: |
| 21 | + prometheus.io/scrape: "true" |
| 22 | + prometheus.io/port: "{{ (split ":" .Values.metricsBindAddr)._1 | default 8080 }}" |
| 23 | + {{- if .Values.podAnnotations }} |
| 24 | + {{- toYaml .Values.podAnnotations | nindent 8 }} |
| 25 | + {{- end }} |
| 26 | + spec: |
| 27 | + {{- with .Values.imagePullSecrets }} |
| 28 | + imagePullSecrets: |
| 29 | + {{- toYaml . | nindent 8 }} |
| 30 | + {{- end }} |
| 31 | + serviceAccountName: {{ include "aws-load-balancer-controller.serviceAccountName" . }} |
| 32 | + volumes: |
| 33 | + - name: cert |
| 34 | + secret: |
| 35 | + defaultMode: 420 |
| 36 | + secretName: {{ template "aws-load-balancer-controller.namePrefix" . }}-tls |
| 37 | + {{- with .Values.extraVolumes }} |
| 38 | + {{ toYaml . | nindent 6 }} |
| 39 | + {{- end }} |
| 40 | + securityContext: |
| 41 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 42 | + {{- if .Values.hostNetwork }} |
| 43 | + hostNetwork: true |
| 44 | + {{- end }} |
| 45 | + containers: |
| 46 | + - name: {{ .Chart.Name }} |
| 47 | + args: |
| 48 | + - --cluster-name={{ required "Chart cannot be installed without a valid clusterName!" .Values.clusterName }} |
| 49 | + {{- if .Values.ingressClass }} |
| 50 | + - --ingress-class={{ .Values.ingressClass }} |
| 51 | + {{- end }} |
| 52 | + {{- if .Values.region }} |
| 53 | + - --aws-region={{ .Values.region }} |
| 54 | + {{- end }} |
| 55 | + {{- if .Values.vpcId }} |
| 56 | + - --aws-vpc-id={{ .Values.vpcId }} |
| 57 | + {{- end }} |
| 58 | + {{- if .Values.awsMaxRetries }} |
| 59 | + - --aws-max-retries={{ .Values.awsMaxRetries }} |
| 60 | + {{- end }} |
| 61 | + {{- if kindIs "bool" .Values.enablePodReadinessGateInject }} |
| 62 | + - --enable-pod-readiness-gate-inject={{ .Values.enablePodReadinessGateInject }} |
| 63 | + {{- end }} |
| 64 | + {{- if kindIs "bool" .Values.enableShield }} |
| 65 | + - --enable-shield={{ .Values.enableShield }} |
| 66 | + {{- end }} |
| 67 | + {{- if kindIs "bool" .Values.enableWaf }} |
| 68 | + - --enable-waf={{ .Values.enableWaf }} |
| 69 | + {{- end }} |
| 70 | + {{- if kindIs "bool" .Values.enableWafv2 }} |
| 71 | + - --enable-wafv2={{ .Values.enableWafv2 }} |
| 72 | + {{- end }} |
| 73 | + {{- if .Values.metricsBindAddr }} |
| 74 | + - --metrics-bind-addr={{ .Values.metricsBindAddr }} |
| 75 | + {{- end }} |
| 76 | + {{- if .Values.ingressMaxConcurrentReconciles }} |
| 77 | + - --ingress-max-concurrent-reconciles={{ .Values.ingressMaxConcurrentReconciles }} |
| 78 | + {{- end }} |
| 79 | + {{- if .Values.serviceMaxConcurrentReconciles }} |
| 80 | + - --service-max-concurrent-reconciles={{ .Values.serviceMaxConcurrentReconciles }} |
| 81 | + {{- end }} |
| 82 | + {{- if .Values.targetgroupbindingMaxConcurrentReconciles }} |
| 83 | + - --targetgroupbinding-max-concurrent-reconciles={{ .Values.targetgroupbindingMaxConcurrentReconciles }} |
| 84 | + {{- end }} |
| 85 | + {{- if .Values.logLevel }} |
| 86 | + - --log-level={{ .Values.logLevel }} |
| 87 | + {{- end }} |
| 88 | + {{- if .Values.webhookBindPort }} |
| 89 | + - --webhook-bind-port={{ .Values.webhookBindPort }} |
| 90 | + {{- end }} |
| 91 | + {{- if .Values.syncPeriod }} |
| 92 | + - --sync-period={{ .Values.syncPeriod }} |
| 93 | + {{- end }} |
| 94 | + {{- if .Values.watchNamespace }} |
| 95 | + - --watch-namespace={{ .Values.watchNamespace }} |
| 96 | + {{- end }} |
| 97 | + {{- if kindIs "bool" .Values.disableIngressClassAnnotation }} |
| 98 | + - --disable-ingress-class-annotation={{ .Values.disableIngressClassAnnotation }} |
| 99 | + {{- end }} |
| 100 | + {{- if kindIs "bool" .Values.disableIngressGroupNameAnnotation }} |
| 101 | + - --disable-ingress-group-name-annotation={{ .Values.disableIngressGroupNameAnnotation }} |
| 102 | + {{- end }} |
| 103 | + {{- if .Values.defaultSSLPolicy }} |
| 104 | + - --default-ssl-policy={{ .Values.defaultSSLPolicy }} |
| 105 | + {{- end }} |
| 106 | + {{- if .Values.externalManagedTags }} |
| 107 | + - --external-managed-tags={{ join "," .Values.externalManagedTags }} |
| 108 | + {{- end }} |
| 109 | + {{- if .Values.defaultTags }} |
| 110 | + - --default-tags={{ include "aws-load-balancer-controller.convert-map-to-csv" .Values.defaultTags | trimSuffix "," }} |
| 111 | + {{- end }} |
| 112 | + {{- if .Values.env }} |
| 113 | + env: |
| 114 | + {{- range $key, $value := .Values.env }} |
| 115 | + - name: {{ $key }} |
| 116 | + value: "{{ $value }}" |
| 117 | + {{- end }} |
| 118 | + {{- end }} |
| 119 | + command: |
| 120 | + - /controller |
| 121 | + securityContext: |
| 122 | + {{- toYaml .Values.securityContext | nindent 10 }} |
| 123 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" |
| 124 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 125 | + volumeMounts: |
| 126 | + - mountPath: /tmp/k8s-webhook-server/serving-certs |
| 127 | + name: cert |
| 128 | + readOnly: true |
| 129 | + {{- with .Values.extraVolumeMounts }} |
| 130 | + {{ toYaml . | nindent 8 }} |
| 131 | + {{- end }} |
| 132 | + ports: |
| 133 | + - name: webhook-server |
| 134 | + containerPort: {{ .Values.webhookBindPort | default 9443 }} |
| 135 | + protocol: TCP |
| 136 | + - name: metrics-server |
| 137 | + containerPort: {{ (split ":" .Values.metricsBindAddr)._1 | default 8080 }} |
| 138 | + protocol: TCP |
| 139 | + resources: |
| 140 | + {{- toYaml .Values.resources | nindent 10 }} |
| 141 | + {{- with .Values.livenessProbe }} |
| 142 | + livenessProbe: |
| 143 | + {{- toYaml . | nindent 10 }} |
| 144 | + {{- end }} |
| 145 | + terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} |
| 146 | + {{- with .Values.nodeSelector }} |
| 147 | + nodeSelector: |
| 148 | + {{- toYaml . | nindent 8 }} |
| 149 | + {{- end }} |
| 150 | + {{- if .Values.affinity }} |
| 151 | + affinity: |
| 152 | + {{- toYaml .Values.affinity | nindent 8 }} |
| 153 | + {{- else }} |
| 154 | + affinity: |
| 155 | + podAntiAffinity: |
| 156 | + preferredDuringSchedulingIgnoredDuringExecution: |
| 157 | + - weight: 100 |
| 158 | + podAffinityTerm: |
| 159 | + labelSelector: |
| 160 | + matchExpressions: |
| 161 | + - key: app.kubernetes.io/name |
| 162 | + operator: In |
| 163 | + values: |
| 164 | + - {{ include "aws-load-balancer-controller.name" . }} |
| 165 | + topologyKey: kubernetes.io/hostname |
| 166 | + {{- end }} |
| 167 | + {{- with .Values.tolerations }} |
| 168 | + tolerations: |
| 169 | + {{- toYaml . | nindent 8 }} |
| 170 | + {{- end }} |
| 171 | + {{- if .Values.priorityClassName }} |
| 172 | + priorityClassName: {{ .Values.priorityClassName | quote }} |
| 173 | + {{- end }} |
0 commit comments