SmartCLIDE Gitlab initialization and containerization.
This is a Work In Progress research that focuses on different ways to automate the deployment, initialization and containerization of gitlab instance.
This gitlab instance will be part of the internal SmartCLIDE framework.
Below is a showcase of different ways of setting up and running a gitlab instance.
This is a recommended way to get up and running quickly in a localhost environment that domain name resolution is not possible.
A simple example would be the localhost host. For other custom host names dont forget to include them in /etc/hosts file.
Self-sign certificates will be generated for the hostname by gitlab's let's encrypt, so keep in mind we cannot use an IP address as hostname.
Update the environment variables in .env file and run the following command.
docker-compose up
This will start a gitlab container with registry enabled and a gitlab-runner container.
Below is the initial root password
cat /srv/gitlab/config/initial_root_password
To register a gitlab runner in the gitlab instance fill the runner registration token and the gitlab host variables in .env file and run the following command.
The variables can be found at mygitlab.com/admin/runners
# Must cd to scripts first and not run the script from outside the folder.
user@local:~$ cd scripts
user@local:~/scripts$ ./gitlab-runner-docker-register.sh
Helm is the official recommended way of installing gitlab in the Kubernetes.
Helm will install gitlab packages(charts) in the Kubernetes cluster.
Helm is also very configurable. Take a look here(https://docs.gitlab.com/charts/charts/) for configuration options and here(https://docs.gitlab.com/charts/charts/globals.html) for globals.
The downside of helm is that requires a valid DNS record.
Based on the info taken from https://docs.gitlab.com/charts/quickstart/
You’ll need to have access to a internet accessible domain to which you can add a DNS record.
This can be a sub-domain such as poc.domain.com,
but the Let’s Encrypt servers have to be able to resolve the addresses to be able to issue certificates.
To Helm install gitlab update the values.yaml in script folder and run the following command.
user@local:~$ cd scripts
user@local:~/scripts$ ./helm.sh
This is an experimental way to install Gitlab & Gitlab runner in a Kubernetes cluster by defining k8s custom yaml files.
This is a WIP so it needs a lot of tinkering of YAML files before applying them to kubectl.
user@local:~$ kubectl apply -f k8s
gitlab SmartCLIDE initialization scripts such as initial SmartCLIDE groups, users, projects and other.
To initialize the gitlab instance with a group structure similar to section 4.1.1 from D3.1 Early SmartCLIDE Cloud IDE Design, update the .env variables(TOKEN and GITLAB_HOST) and execute the following script.
user@local:~$ cd scripts
user@local:~/scripts$ ./init-gitlab-groups.sh
Update vars KUBERNETES_GITLAB_RUNNER_DEPLOYMENT_NAME, GITLAB_HOST and GITLAB_RUNNER_REGISTRATION_TOKEN in .env file and run...
user@local:~/scripts$ ./gitlab-runner-kube-register.sh