To configure GitLab chart with a private Nexus registry for images, you will need to do the following:
- Create a Kubernetes secret for your Nexus registry credentials:
kubectl create secret docker-registry nexus-registry \
--docker-server=<your-nexus-registry-url> \
--docker-username=<your-nexus-registry-username> \
--docker-password=<your-nexus-registry-password> \
--docker-email=<your-email-address>
- Update the
values.yaml
file for the GitLab chart to include theimagePullSecrets
field, which references the secret you just created:
global:
imagePullSecrets:
- name: nexus-registry
- Update the
values.yaml
file for the GitLab chart to include theregistry
field, which specifies the URL of your Nexus registry:
gitlab:
registry:
enabled: true
host: <your-nexus-registry-url>
- If you are using a self-signed certificate for your Nexus registry, you will need to add the certificate to the GitLab Runner’s trusted certificates. You can do this by adding the certificate as a Kubernetes secret and updating the
values.yaml
file for the GitLab Runner chart to include theextraVolumes
andextraVolumeMounts
fields:
gitlab-runner:
runners:
config: |
[[runners.kubernetes.volumes.hostPath]]
name = "certs"
hostPath = "/etc/gitlab-runner/certs"
mountPath = "/etc/gitlab-runner/certs"
readOnly = true
extraVolumes:
- name: certs
secret:
secretName: nexus-registry-certs
extraVolumeMounts:
- name: certs
mountPath: "/etc/gitlab-runner/certs"
readOnly: true
- Create a Kubernetes secret for your Nexus registry certificate:
kubectl create secret generic nexus-registry-certs \
--from-file=<path-to-certificate-file>
- Install the GitLab chart and the GitLab Runner chart with the updated
values.yaml
files:
helm install gitlab gitlab/gitlab -f gitlab-values.yaml
helm install gitlab-runner gitlab/gitlab-runner -f gitlab-runner-values.yaml
After following these steps, GitLab and GitLab Runner will be configured to use your private Nexus registry for images.
I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND