timogoosen.github.io

Github pages blog

View My GitHub Profile

Gitlab

Maintenence stuff:

General

The general gitlab config file:


# vim /etc/gitlab/gitlab.rb

Good practices for upgrades and testing:

E.g:



external_url 'https://staging-gitlab.timo.test'
# external_url 'https://gitlab.timo.test'

Grant access to private gitlab registry from CI JOB:

Do this:

echo -n "my_username:my_password" | base64

Take the output and put it in a file in this format:


{
    "auths": {
        "registry.example.com:5000": {
            "auth": "(Base64 content from above)"
        }
    }
}

Then put it in an env variable in your CI job as:


DOCKER_AUTH_CONFIG

Create secret in Kubernetes to pull from gitlab private registry:



kubectl -n test-app create secret generic gitlab-registry \
    --from-file=.dockerconfigjson=/tmp/docker.json \
    --type=kubernetes.io/dockerconfigjson