kubectl apply -f gitlab/gitlab.yml
*** This stage will take about 40 minutes ***
kubectl exec -it gitlab-deployment-7f5d55d69-6lw4q -- vi /etc/gitlab/gitlab.rb
postgresql['shared_buffers'] = "256MB"
prometheus_monitoring['enable'] = false
sidekiq['max_concurrency'] = 2
kubectl exec -it gitlab-deployment-7f5d55d69-6lw4q -- gitlab-ctl reconfigure
kubectl exec -it gitlab-deployment-7f5d55d69-6lw4q -- cat /etc/gitlab/initial_root_password | grep Password:
Password: qKIoOdGl4tHaI83qU/3bsBN6emN/eZz8GRncZCEgKw8=
kubectl describe pod <pod-name> | grep "Node:"
Node: node002.cluster.local/192.168.56.13
http://192.168.56.13:30080
Username: root
Password: <password-from-previous-step>
On the top bar, select Main menu > Admin. On the left sidebar, select Settings > Network. Expand Outbound requests. Select the Allow requests to the local network from web hooks and services checkbox. Save changes.
sudo snap install helm --classic
helm repo add gitlab https://charts.gitlab.io
Register the runner with this URL:
http://192.168.56.13:30080/
And this registration token:
GR1348941gpsJo71bnku75uVXiCkN
kubectl label nodes node003.cluster.local role=gitlabrunner
helm upgrade --install --namespace gitlab-runner --create-namespace gitlab-runner -f gitlab-runner/values.yaml gitlab/gitlab-runner --set nodeSelector.role=gitlabrunner
Navigate to your project's Settings > CI/CD > Environment variables page and add the following ones (replace them with your current values, of course): !!! Only set this variables if you will upload the image to DockerHub !!!
CI_REGISTRY_USER: dockerhubuser (DockerHub Username)
CI_REGISTRY_PASSWORD: dockerhubpassword (DockerHub Password)
CI_REGISTRY: docker.io (By default DockerHub registy url is docker.io, it must be set)
CI_REGISTRY_IMAGE: dockerhubuser/projectname (Registy image tag from dockerhub repostory created after this step)
cd html-nginx/
rm -rf .git
git init --initial-branch=main
git remote add origin <http://192.168.56.13:30080>/root/sample-project.git
git add .
git commit -m "Initial commit"
git push -u origin main
Input your username and password from step 2-2
kubectl apply -f gitlab-service-account.yaml
kubectl config view --raw -o jsonpath='{.clusters[0].cluster.certificate-authority-data}' |base64 -d > certificate-authority-data.crt
Go to Settings -> CI / CD -> Environment variables: and add the following ones (replace them with your current values, of course):
kubectl config view | grep server
https://192.168.56.10:6443
kubectl -n gitlab-runner create token default
eyJhbGciOiJSUzI1NiIsImtpZCI6ImtJaXdFR2ppS3ItNkpIU1VtemVuXzY4ek8wR0U4MHV6ZDh5Unp4UnA3Rm8ifQ.eyJhdWQiOlsiaHR0cHM6Ly9rdWJlcm5ldGVzLmRlZmF1bHQuc3ZjLmNsdXN0ZXIubG9jYWwiXSwiZXhwIjoxNjc0MTk4OTA4LCJpYXQiOjE2NzQxOTUzMDgsImlzcyI6Imh0dHBzOi8va3ViZXJuZXRlcy5kZWZhdWx0LnN2Yy5jbHVzdGVyLmxvY2FsIiwia3ViZXJuZXRlcy5pbyI6eyJuYW1lc3BhY2UiOiJnaXRsYWItcnVubmVyIiwic2VydmljZWFjY291bnQiOnsibmFtZSI6ImRlZmF1bHQiLCJ1aWQiOiI2NGE1Y2MyMS1iMThkLTRkNTQtYTI2Ny0yZTNiNWRjMDVjOGMifX0sIm5iZiI6MTY3NDE5NTMwOCwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50OmdpdGxhYi1ydW5uZXI6ZGVmYXVsdCJ9.p8RITKsGW7T12plK33p9Gn7OaxZ0ImBTxDs3yvA-m7UCfRdbNKC27u29XL8oTr7XfMVi21NigpAob_xtnsvqpw_H-bjxjqxsy_uV0TZh0bwEBHC3gFJHQMYcJL1GtrT-C4LhdHULaQ3HlVtcZvxap4owjKRR4HR3EoiDGae36tNtQ1Sisz8CXrpuMUCfsM_X7PxL39FxTaGYdPCrvBwvGR4iKbCNnzHbA_Y6vAOEhInAPNOUPvXFLc0PGYr-hv4dEzu8giG_e7AnzLx4sE09esoWa_ca1zwbydWf0n-tMKlFRVirQm07-WSPc2W9ikoM26iyfYsJ36tqLKy578WixQ
kubectl -n gitlab-runner get pods
NAME READY STATUS RESTARTS AGE
gitlab-runner-744f8bb595-cqkpq 1/1 Running 0 155m
project-deployment-85db7fdfb5-555l9 1/1 Running 0 53s
project-deployment-85db7fdfb5-mplf9 1/1 Running 0 53s
kubectl -n gitlab-runner describe pod project-deployment-85db7fdfb5-mplf9 | grep Node:
Node: node004.cluster.local/192.168.56.11