Skip to content

Commit

Permalink
Merge pull request kubernetes-sigs#3770 from huonguyenlt/feat/add-env…
Browse files Browse the repository at this point in the history
…From

Move envFrom to the correct position and update example
  • Loading branch information
k8s-ci-robot authored Aug 13, 2024
2 parents 9e2cbe7 + cd2d4d1 commit cb5271e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 5 additions & 4 deletions helm/aws-load-balancer-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,14 @@ spec:
{{- if .Values.loadBalancerClass }}
- --load-balancer-class={{ .Values.loadBalancerClass }}
{{- end }}
{{- if or .Values.env .Values.envSecretName .Values.envFrom }}
{{- if or .Values.env .Values.envSecretName }}
env:
{{- if .Values.env}}
{{- range $key, $value := .Values.env }}
- name: {{ $key }}
value: "{{ $value }}"
{{- end }}
{{- end }}
{{- if .Values.envFrom }}
{{ .Values.envFrom | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.envSecretName }}
- name: AWS_ACCESS_KEY_ID
valueFrom:
Expand All @@ -196,6 +193,10 @@ spec:
optional: true
{{- end }}
{{- end }}
{{- if .Values.envFrom }}
envFrom:
{{- toYaml .Values.envFrom | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 10 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand Down
7 changes: 3 additions & 4 deletions helm/aws-load-balancer-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -282,10 +282,9 @@ env:
# envSecretName: aws-secret

# Use envFrom to set environment variables from a Secret or ConfigMap
envFrom:
# valueFrom:
# - secretKeyRef:
# name: aws-load-balancer-controller
# envFrom:
# - secretRef:
# name: my-secret

# Specifies if aws-load-balancer-controller should be started in hostNetwork mode.
# This is required if using a custom CNI where the managed control plane nodes are unable to initiate
Expand Down

0 comments on commit cb5271e

Please sign in to comment.