Setup a GitLab GitOps workflow for Kubernetes
c2d-ks1 and manage it using GitLab Agent.
This how-to demonstrates how we can manage a MicroK8s Kubernetes cluster running on
c2d-ks using a GitLab Agent running in the cluster. This GitLab Agent configuration and Kubernetes manifest files are in a separate project
c2platform/examples/kubernetes/gitlab-gitops. Separate from the Ansible project
c2platform/ansible that is used to initially create the cluster using Ansible.
This example project uses GitOps workflow to manage OpenShift resources in two namespaces
njp. The first namespace is for is the “acceptance” environment, the second for “production”. See
manifests/production.yml. The diagram below only shows
njp. The setup for
njp is identical with the exception of the fact that
njp is configured to pull only images with tag
production. This project uses the Docker image from project
To register an GitLab Agent you will have to configure an “access token” for Ansible. In this “development” project these type of local secrets are stored using var
c2_gitlab_agent_access_token in file
group_vars/all/local_stuff.yml. See Local Stuff.
Create an access token see Install Gitlab Agent for more information. This how-to describes the manual install of an GitLab Agent.
Create ( or update ) the file
group_vars/all/local_stuff.yml and add
To create the Kubernetes node
c2d-ks1 perform following steps:
If the GitLab Agent for gitlab-gitops
project is successfully created, a simple application is deployed that should be accessible http://126.96.36.199:3000/
c2platform/examples/kubernetes/gitlab-gitops for more information.
If you have the Kubernetes Dashboard add-on enabled you should be able to navigate to Kubernetes Dashboard
and then see for example the service
frontend-service in namespace
nja with external endpoint http://188.8.131.52:3000/
Using your browser, you can navigate to http://184.108.40.206:3000/
and see the text. Or use
vagrant@c2d-ks1:~$ curl http://220.127.116.11:3000/
Hello World! Version: 0.1.5vagrant@c2d-ks1:~$
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.