pull private container registry from gitlab
to your repo > setting > repository
expand
Deploy Token
and set tokennam, username and scopeclick
create deploy token
then run:
1
kubectl create secret docker-registry <secrect_name> --docker-server=registry.gitlab.com --docker-username=<username> --docker-password=<gitlab_token> -n <namespace>
in deployment or image spec:
- add
imagePullSecrets
1
2
3
4
5
6
7
8
9
10
11
12
13
14spec:
containers:
- name: <arbitrary name>
image: registry.gitlab.com/<username>/<container-registry-path>:<tag>
imagePullPolicy: Always
securityContext:
privileged: false
imagePullSecrets:
- name: <secrect_name>
restartPolicy: Always
dnsPolicy: ClusterFirst
nodeSelector: #this can be use to specify node
kubernetes.io/hostname: <node-name>
schedulerName: default-scheduler- add
pull private image from github registry (ghcr.io)
apply a personal access token
then run:
1
kubectl create secret docker-registry <secrect_name> --docker-server=ghcr.io --docker-username=<github-username> --docker-password=<personal-access-token> -n <namespace>
in deployment or image spec:
- add
imagePullSecrets
1
2
3
4
5
6
7
8
9
10
11
12
13
14spec:
containers:
- name: <arbitrary name>
image: ghcr.io/<username>/<container-registry-path>:<tag>
imagePullPolicy: Always
securityContext:
privileged: false
imagePullSecrets:
- name: <secrect_name>
restartPolicy: Always
dnsPolicy: ClusterFirst
nodeSelector: #this can be use to specify node
kubernetes.io/hostname: <node-name>
schedulerName: default-scheduler- add