Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

How to configure gitlab chart with private nexus registry for images

To configure GitLab chart with a private Nexus registry for images, you will need to do the following:

  1. 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>
  1. Update the values.yaml file for the GitLab chart to include the imagePullSecrets field, which references the secret you just created:
global:
  imagePullSecrets:
    - name: nexus-registry
  1. Update the values.yaml file for the GitLab chart to include the registry field, which specifies the URL of your Nexus registry:
gitlab:
  registry:
    enabled: true
    host: <your-nexus-registry-url>
  1. 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 the extraVolumes and extraVolumeMounts 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
  1. Create a Kubernetes secret for your Nexus registry certificate:
kubectl create secret generic nexus-registry-certs \
  --from-file=<path-to-certificate-file>
  1. 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.

Rajesh Kumar
Follow me
Latest posts by Rajesh Kumar (see all)
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x