kubectl create secret docker-registry <name> \
--docker-server=docker.pkg.github.com \
--docker-username=<github-username> \
--docker-password=<personal-token> \
--docker-email=<github-email>
kubectl create secret docker-registry <name> \
--docker-server=docker.pkg.github.com \
--docker-username=<github-username> \
--docker-password=<personal-token> \
--docker-email=<github-email>
-o yaml > github-secret.yaml
# view the content
cat github-secret.yaml
# apply to k8s
kubectl apply -f github-secret.yaml
apiVersion: v1
kind: Pod
metadata:
name: pod-name
spec:
containers:
- name: name
image: docker.pkg.github.com/duyet/<image-name>:latest
imagePullSecrets:
- name: <name>
kubectl apply -f pod.yaml