Gitlab and Gitlab Runner Installation will be explained under this topic. This installation tried on the kubernetes cluster which has a one worker node. Also if you have multiple worker node you can use the node selector to run application on the specific worker node. If you decide to use node selector you must create the mount folder under the selected node.
In there,we will use persistent volume, persistent volume claim, deployment and service resources. Also we will use nginx reverse proxy and self signed certificate, to connect gitlab application after created all kubernetes resources. And We can use the ingrees to acces the our applicaiton. You can follow below commands;
Step1:
Create mount folder under your selected worker node and create yaml file for persistent volume and volume claim. If you want to use the node selector for deployment you must add label on your node and you should edit the your deployment yaml file.
Then, we can see our pv and pvc resources above picture. PVC resources bounded with the PV resources.
Step2: Create deployment file after the node labeled. We suppose the we have multiple worker node and we choose the specific node to run the gitlab application.
Now we can check the our created service and we should take the node port number to establish connection for gitlab with our browser.
kubectl get svc
If you access the gitlab application like picture below, you must chenge the default root password with connect the pod with “exec” command and use the following lines.
Step4: Create Self Signed Certficate, secret and Ingress yaml file Secure to access the gitlab application without to using node port ip address. Also if you don’t have a Ingress Controller, you can get a lot of information about the Nginx Controller Installation to click here. Also I have been used the nip.io for DNS solving.
Step7: Now We can test it. Create basic project with echo messages and some steps. Create bash Template .gitlab-ci.yml file for this project on gitlab like below. Take your ip address and token from project CI/CD Settings. And you must write your gitlab url address with https.
Step8: Go to your worker node which Gitlab-Runner running and put your certificate under volume path “/opt/gitlab/gitlab-runner/SSL”. Then you will use the this certficate for trusted connection during gitlab runner register.
No responses yet