creating k8s registry secrets

29-03-20

%

Hosting side projects in kubernetes and using gitlab container registry? This is the command I run to create the needed secret for the cluster to pull the image:

$ kubectl create secret docker-registry cool-project-gitlab \
    --docker-server=registry.gitlab.com \
    --docker-username=gitlab+deploy-token-666666 \
    --docker-password=xxxxxxxxxxxxxxxxxxxx \
    --docker-email=xxxxxxxxx@xmail.com

Then in the deployment.yml use the gitlab registry image and newly created image secret:

containers:
    image: registry.gitlab.com/btbtravis/cool-project:0.0.1
    imagePullPolicy: IfNotPresent
    name: cool-project-api
imagePullSecrets:
- name: cool-projects-gitlab

- [ kubernetes]

all snippets