Devtron: Complete Package Of Kubernetes Solutions

Shashwat Singh
7 min readJul 6, 2022

--

Lets me first discuss about the flow of this blog
We start from the disscusion of types of architectures then we will start introducing the tools like why we required this tools at this step.
Then when we comes to Devtron part configure the Devtron then we will Deploy an NodeJS application so that we can able to see that How Devtron makes our work easier.

Mostly, When we build any application we have two architectures On which we can develop our complete application.
1. Monolithic Architecture
2. Microserivies Architecture

Monolithic Architecture
As you know monolith applications have a huge codebase, it is a singular, large computing network with one code base. If we need to make any changes then we need to update the entire stack by accessing the code base, which makes the task time-consuming, hard to manage the giants, Scalability Problems, Lack of flexibility, etc.

Monolithic Architecture

Microservices Architecture
Whereas in Microservices each service has there own codebase like,
Authentication is managed by different API, Hotel Booking, Payment Gateway each one has there own codebase, which can easily be managed, Flexible scaling, and continuous deployment but the question arises that in which env we can able to run these microservices (Which makes service as stable as well as easy to manage and deploy).

Microservices Arch

Container Role
So, here the role of the Container Roles Comes into the picture, for running these containers we require the container engine ( which accepts the user requests, including common line options, pull images, and from the end user’s perspective runs the container). There is a number of container engines are available like Docker, RKT, CRI-O, and LXD.

Still, we have some flaws:-
Let’s say there is an update and we have already set up the ci/cd pipeline but due to some reason that container goes down there is no one who is monitoring and can able to restart the container.

→If the load increases there is no one who can able to scale up our containers or scale down our containers.

→Who can help us to monitor the health of an application?

So, the Solution for these problems is Kubernetes.

Kubernetes Role
Commonly also known as Container Management Tool (Container Orchestration). This can help us in terms of monitoring parts, auto-scaling, and built-in monitoring but it is tough to manage.

So, Here I want to introduce a tool name Devtron which makes your workload easier you can able to deploy any application at the production level by just following some steps.

Why do we need to prefer Devtron?

Devtron Logo

We are not only getting the feature of Deployment even we are getting the features like CI/CD, Monitoring, Management of Multiple Cluster, and much more.

Features of Devtron:
Zero code software delivery workflow for Kubernetes
→ Multi-cloud deployment
→ Easy DevSecOps integration
→ Application debugging dashboard
→ Enterprise-Grade security and compliances
→ GitOps aware
→ Operational insights

Let’s Get Started
Note — For Demonstration purposes going to use microK8s

Setup the Cluster

$ sudo snap install microk8s --classic --channel=1.22 
$ sudo usermod -a -G microk8s $USER
$ sudo chown -f -R $USER ~/.kube
$ sudo su - $USER
$ microk8s enable dns storage helm3
$ echo "alias kubectl='microk8s kubectl '" >> .bashrc
$ echo "alias helm='microk8s helm3 '" >> .bashrc
$ source .bashrc

Devtron Setup

$ helm repo add devtron https://helm.devtron.ai$ helm install devtron devtron/devtron-operator \ 
--create-namespace --namespace devtroncd \
--set installer.modules={cicd} \
--set components.devtron.service.type=NodePort
#Here, svc type is NodePort

Devtron Installation Status

$ kubectl -n devtroncd get installers installer-devtron -o jsonpath='{.status.sync.status}'#Downloaded - Installer Downloaded all the manifests, and   installation is in progress.#Applied - Installer has successfully applied all the manifests  and the installation is completed.
Installation Status

Port Number (So, that we can able to access the DashBoard)

$ kubectl get svc -n devtroncd

Configure the Security Group
(allow the traffic on that port number)

Security Group

Let's Access the Dashboard

How we can get the Admin Password?

$ kubectl -n devtroncd get secret devtron-secret -o jsonpath='{.data.ACD_PASSWORD}' | base64 -d

Configure the Following Important Part
1. Add the Host URL
2. GitOps Configuration
3. Container Registry Configuration

Follow These Steps to deploy the Application
Step 1: Create a Custom App

Custom-app

Step 2: Git Repo Setup
→ Give the URL of your repository
→ Set checkout path (Required If you’re using multiple Git Repositories)
→ Pull submodules recursively (If your repo has submodules)

Step 1- Edit Git Repository

Step 3: Container Registry Repo Configuration part
→ Container Rep = username/repo-name
→ Path for Dockerfile = ./ (in my case its present outside only)

Step 3: Docker Build Configuration

Step 4: Deployment Template (By default template provided by the Devtron you can edit according to your use case)
In my case
→ Internal application port is 4000
→ Required CPU = 50m
→ Service Type = NodePort

Step 4: Deployment Template

Step 5: Workflow Editor
1. Setup the Continous Integration Part
Where we set up our pipeline from Devtron to SCM tool basically. Specify the Branch through which you want to deploy your application.Devtron will check for push requests.
You set up the triggered build Automatic or Manually.

Step 5: 1. Setup the CI part.

2. Continous Deployment
(By Clicking on “+” icon of ci )

→ Select the NameSpace
→ Pipeline Execution (Automatic or Manual)
→ Deployment Strategy (I hope you better know about it.)
[ Rolling, Recreate, Blue-Green, Canary]

Step 5: 2. CD configuration

Step 6: ConfigMap
ConfigMap is used to store common configuration variables, allowing users to unify environment variables for different modules in a distributed system into one object.

In this case, I will put the port number of the application.

Step 7: Secrets
A Secret is an object that contains sensitive data such as passwords, OAuth tokens, and SSH keys.
So, yes we have some secret access tokens and some password which is required for this application.

Step 7: Secrets

So, our app configuration part is completed let's try to look for the Deployment part.

Build and Deploy
Build History
Deployment History

It was successfully deployed.

Let's get the port number on which this application is exposed so that we can able to access this application.

Application Port

Let's allow this port at the Security Group

Security Group

Access our Application 🚀

Home Page of Application
View the Logs
Migration

Demonstration Video

References :
Documentation: https://docs.devtron.ai/
Githu Repo: https://github.com/Shashwatsingh22/notion2confluence

I hope Now You Have a Broad Idea About the Devtron.
If this blog helps you gain some knowledge then Please Clap 👏 for it.

and Follow me for such Content 👋.

Support me if you like my work! Buy me a coffee

— — — — — — — — — — — — — — — — — -* — — — — -* — — — — — — —

The above blog is submitted under ‘Blogathon Contest 2022’ conducted by
Devtron (Website Hyperlink here: https://devtron.ai/)

Check out their Github repo: here(Github Hyperlink here: https://github.com/devtron-labs/devtron)

Follow them on: LinkedIn(Hyperlink here: https://www.linkedin.com/company/devtron-labs/),

Twitter(Hyperlink here: https://twitter.com/DevtronL)

--

--