- How to install gitlab runner on kubernetes how to#
- How to install gitlab runner on kubernetes update#
- How to install gitlab runner on kubernetes registration#
Start by updating your repositories by using the command: $ sudo apt update Log in to your runner-manager instance using the following example command in your terminal: ssh other examples of SSH follow the Getting Started guide. The flavor c2.small is chosen with the image Ubuntu 18.04 LTS. Launch a new instance on Fuga, in this tutorial the instance is called runner-manager. These runners will receive the jobs from the runner-manager which received the jobs from GitLab. This runner, called the runner-manager, will be used to connect to your GitLab and manages the runners with Docker Machine.
How to install gitlab runner on kubernetes registration#
In this section the installation and the registration of the GitLab runner will be done. Installing and registering the GitLab runner Save this file to your machine, it will be needed later for the SSH connections between the runners. On your Fuga dashboard go to Compute and click on the Key Pairs tab.Ĭhoose a fitting name for the Key Pair, this tutorial uses name gitlab. Instead of using your personal private SSH keys, a new key is generated and used specifically for the runners. It should look like this:īetween the runner-manager and the runner instances, an SSH connection is used by Docker-Machine. In the Port field enter 2376 and keep the rest of the form at the default values. In the top right corner, click on + Add Rule to add a new security rule. Once the new security group has been created, click on the Manage Rules button that belongs to the new security group you just made. You can enter a description for clarification if you’d like to.Ĭlick on Create Security Group to create the new security group. To open this port, go to Networking and click on the Security Groups tab.Ĭlick on + Create Security Group to create a new security group.Įnter a fitting name for this Security Group, for example, gitlabrunner. In this section is explained how you can open this port with a security group. In order to autoscale your runners, Docker Machine requires port 2376 to be opened for every new runner that gets automatically deployed.
This pipeline can be customized to your liking, for example how many idle runners are available or the number of jobs each runner can handle concurrently. The runner-manager will pass down this job to an available runner, if there are none available, the runner-manager will create a new instance with a runner. GitLab will notify the runner-manager that a new job is available.
How to install gitlab runner on kubernetes how to#
Then use your cloud providers instructions on how to SSH into a node.When a commit is made, a CI/CD pipeline will be started. Kubectl -n gitlab-managed-apps get pod runner-gitlab-runner-6987ddf6b5-rgjmw -o yaml | grep nodeName nodeName: gke-cluster-1-default-pool-1937372-fhepo You can find the node with the following command If your config.toml is not in the home directory then you'll need to gain root access to the node that is running your pod. GitLab Runner also reloads the configuration in response to the SIGHUP signal. GitLab Runner checks for configuration modifications every 3 seconds and reloads if necessary. If a runner was already registered, you don’t need to register it again. This includes parameters in the ] section and most parameters in the global section, except for listen_address. The GitLab Runner does not require a restart when you change most options. Name = "runner-gitlab-runner-6987ddf6b5-rgjmw" Run the following command and it will output your current config file.Ĭat ~/.gitlab-runner/config.toml listen_address = ":9252" I found the config.toml at ~/.gitlab-runner/config.toml.