Working with argoCD and microk8s

Working with argoCD and microk8s

Background:

Today, I will be going to demonstrate the concept of deploying application on microk8s using argoCD. As most of us are aware that argoCD is a pull based CICD framework which listens to GIT repository continuously/partially.  Once the changes to GIT repository is been made – it will automatically detects the changes and deploy things to microk8s.. Microk8s is like Minikube which is popular as a local container orchestration tool which is used by most of the DevOps engineers. Microk8s is CNCF-certified distribution and it’s built by Kubernetes team at Canonical....

Now since we got the background, let’s jump into a quick lab.


For the sake of simplicity and understanding, let’s try to create simple Nginx application and deploy it to Microk8s cluster. Let’s try to divide this experiment into 3 steps..

  1. Setup microk8s with basic steps.
  2. Manage Kubernetes deployment YAML files.
  3. Deploying argoCD in a separate namespace of micork8s cluster and try auto deployment of YAML code to a cluster.


Now let’s go into each step one by one!

Setup microk8s with basic steps.

Official documentation of microk8s helps you to install it on desired machine.. I personally used windows OS for this experiment. Once the microk8s is installed you can check it’s installation with below commands.

microk8s status
microk8s kubernetes get nodes

It will show the list of available nodes. (Observe that kubernetes command is written in front of microk8s word.) You can set the context of microk8s by updating the config file of Kubernetes. I.e which is at ~/.kube/config. 

microk8s config view

Above command is used to show the config of a cluster. If you have the ~/.config file already, you can add the new context in it. In this way, you will be able interact with cluster using kubectl syntax.

No alt text provided for this image
microk8s installation verification


Manage Kubernetes deployment YAML files

Let’s create a sample GITHUB repository and create ssh file. So that we should be able to clone the repository... For the sake of simplicity, we will be going to add simple NGINX deployment and service YAML at the root location of this repository.  This repository will be linked to argoCD which will pull the latest changes and deploy stuffs to our microk8s cluster. I have created a sample repository here. You can use it for testing purpose.

No alt text provided for this image



Deploying argoCD in a separate namespace of a cluster and try auto deploy YAML code to a cluster.

Let’s assume you deployed microk8s to a separate namespace, we will be able to visualize it’s UI by port forwarding the deployment of argoCD. Check the below command.. 

kubectl port-forward svc/argocd-server -n <namespace> 8080:443

If we create an application with auto sync ON then whatever changes we added to our GIT repository will be automatically get's deployed to microk8s and dashboard looks like this way..


No alt text provided for this image
NGINX deployment


Note: This is an introductory article.. This will help you to understand the basics of making deployment working using argo and microk8s.

To view or add a comment, sign in

More articles by Chinmay Kulkarni

  • Flux - A silent Deployer

    In this article, we will going to understand the working mechanism of Flux - a GitOps family toolkit. It's advantages…

  • DevOps: Jenkins + Prometheus + Grafana

    Requirements: The whole idea of this document is to give a quick idea about how to manage/maintain Jenkins jobs OR…

  • Working with Application logs

    Quick overview: Many applications uses AWS ElasticSearch to perform search on unstructured data. Data may be in form of…

    5 Comments

Insights from the community

Others also viewed

Explore topics