Skip to content

Commit

Permalink
Make the AWS environment variables optional (#53)
Browse files Browse the repository at this point in the history
* Make the AWS environment variables optional

* Bump the chart version

* Bug fix

* Add comment in values file.
  • Loading branch information
nabsul authored Mar 12, 2023
1 parent adba342 commit 9803c58
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: k8s-ecr-login-renew
version: 1.0.3
version: 1.0.4
appVersion: 1.7.1
description: Deploys a cronJob which will renew ECR imagePullSecrets automatically
maintainers:
Expand Down
2 changes: 2 additions & 0 deletions chart/templates/005-CronJob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ spec:
imagePullPolicy: IfNotPresent
image: {{ required "Docker image must be specficed" .values.cronjob.dockerImage }}
env:
{{- if .Values.aws -}}
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
Expand All @@ -52,6 +53,7 @@ spec:
secretKeyRef:
name: {{ required "AWS credentials secret name is required" .Values.aws.secretName }}
key: {{ required "AWS credentials secret key secret acceess key is required" .Values.aws.secretKeys.secretAccessKey }}
{{- end -}}
- name: AWS_REGION
value: {{ required "AWS region must be specified" .Values.awsRegion }}
- name: DOCKER_SECRET_NAME
Expand Down
1 change: 1 addition & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ names:
# AWS is accessed using an access key ID and secret access key.
# You can either pre-populate a Kubernetes secret with this information,
# or provide them as Helm values for the secret to be automatically created.
# Set `aws` to null if you will not be authenticating with environment variables.
aws:
secretName: 'k8s-ecr-login-renew-aws-secret'
secretKeys:
Expand Down

0 comments on commit 9803c58

Please sign in to comment.