GitLab CI with Kubernetes
Implementing CI/CD for your software development cycle is almost a must nowadays. Let’s see how you can implement the CI/CD flow with GitLab CI and integrate the CI into your Kubernetes cluster.
Published in
4 min readDec 17, 2022
With GitLab CI, you have two options : pull-base (aka — the GitOps way) vs push-base. As a GitLab best practice, and also more supported way, pull-base is recommended.
To implement the pull-base approach, you need to set up your GitLab agent.
GitLab agent
The GitLab Agent should be on the same or higher level than the project code you want to access later.
- From the GitLab GUI of the
test-gitlab-agent
project, chooseInfrastructure > Kubernetes clusters.
- Choose
Connect a cluster,
then choose theagent
to configure. You should be able to see the suggested code that installs the GitLab agent into the Kubernetes cluster
helm repo add gitlab https://charts.gitlab.io
helm repo update
helm upgrade --install gitlab-agent gitlab/gitlab-agent \
--set config.kasAddress='wss://kas.gitlab.example.com' \
--set config.token='YOUR.AGENT.TOKEN'
Test service