Skip to content

Commit

Permalink
Revert to named script from sillsdev/aws-kubectl
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Oct 23, 2024
1 parent eb272b6 commit 1447459
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 28 deletions.
15 changes: 1 addition & 14 deletions deploy/helm/aws-login/templates/aws-ecr-login-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,7 @@ spec:
imagePullPolicy: IfNotPresent
name: {{ .Values.awsEcr.cronJobName }}
command:
- /bin/sh
- -c
- |-
TOKEN=`aws ecr get-login --region ${AWS_DEFAULT_REGION} --registry-ids ${AWS_ACCOUNT} | cut -d' ' -f6`
echo "ENV variables setup done."
kubectl -n ${NAMESPACES} delete secret --ignore-not-found ${PULL_SECRET_NAME}
kubectl -n ${NAMESPACES} create secret docker-registry ${PULL_SECRET_NAME} \
--docker-server=https://${AWS_ACCOUNT}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com \
--docker-username=AWS \
--docker-password="${TOKEN}" \
--docker-email="${DOCKER_EMAIL}"
echo "Secret created by name: $PULL_SECRET_NAME"
kubectl -n ${NAMESPACES} patch serviceaccount default -p '{"imagePullSecrets":[{"name":"'$PULL_SECRET_NAME'"}]}' # custom script | update the default service account
echo "All done."
- ecr-get-login.sh
env:
- name: AWS_DEFAULT_REGION
valueFrom:
Expand Down
15 changes: 1 addition & 14 deletions deploy/helm/aws-login/templates/aws-ecr-login-oneshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,7 @@ spec:
imagePullPolicy: IfNotPresent
name: "{{ .Values.awsEcr.jobName }}"
command:
- /bin/sh
- -c
- |-
TOKEN=`aws ecr get-login --region ${AWS_DEFAULT_REGION} --registry-ids ${AWS_ACCOUNT} | cut -d' ' -f6`
echo "ENV variables setup done."
kubectl -n ${NAMESPACES} delete secret --ignore-not-found ${PULL_SECRET_NAME}
kubectl -n ${NAMESPACES} create secret docker-registry ${PULL_SECRET_NAME} \
--docker-server=https://${AWS_ACCOUNT}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com \
--docker-username=AWS \
--docker-password="${TOKEN}" \
--docker-email="${DOCKER_EMAIL}"
echo "Secret created by name: $PULL_SECRET_NAME"
kubectl -n ${NAMESPACES} patch serviceaccount default -p '{"imagePullSecrets":[{"name":"'$PULL_SECRET_NAME'"}]}' # custom script | update the default service account
echo "All done."
- ecr-get-login.sh
env:
- name: AWS_DEFAULT_REGION
valueFrom:
Expand Down

0 comments on commit 1447459

Please sign in to comment.