Skip to content

Commit 87cb346

Browse files
committed
docker secret
1 parent 4c0c0f1 commit 87cb346

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,20 @@ deploy-secrets-cert:
6666
NAME=$(name-dashed) \
6767
envsubst < deploy/secrets-cert.yml | kubectl apply -f -
6868

69+
## deploy the docker registry secret utilized by the application
70+
deploy-secrets-docker-repo:
71+
$(eval github-token := $(shell aws ssm get-parameter --name "/github/pat" --with-decryption --query "Parameter.Value" --output text))
72+
# test the token
73+
echo $(github-token) | docker login ghcr.io -u $(name) --password-stdin
74+
# create the secret
75+
kubectl create secret docker-registry docker-registry \
76+
--namespace="$(name-dashed)" \
77+
--docker-server=ghcr.io/$(name) \
78+
--docker-username=$(name) \
79+
--docker-password=$(github-token) \
80+
--dry-run=client -o yaml | kubectl apply -f -
81+
82+
6983
# deploy-secrets-bsky:
7084
# kubectl create secret generic "$(name-dashed)"-bsky \
7185
# --namespace="$(name-dashed)" \

deploy/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ spec:
1717
containers:
1818
- name: ${NAME}
1919
image: ${IMAGE}
20+
imagePullSecrets:
21+
- name: docker-registry
2022
resources:
2123
limits:
2224
cpu: 1000m

0 commit comments

Comments
 (0)