<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Arushi shukla</title>
    <description>The latest articles on Forem by Arushi shukla (@arushi09).</description>
    <link>https://forem.com/arushi09</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F692521%2F10f53998-9c65-47b2-b427-25934fbb7830.jpeg</url>
      <title>Forem: Arushi shukla</title>
      <link>https://forem.com/arushi09</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/arushi09"/>
    <language>en</language>
    <item>
      <title>Local Kubernetes development made easy with Minikube - Devtron</title>
      <dc:creator>Arushi shukla</dc:creator>
      <pubDate>Mon, 25 Oct 2021 13:33:33 +0000</pubDate>
      <link>https://forem.com/arushi09/local-kubernetes-development-made-easy-with-minikube-devtron-17hf</link>
      <guid>https://forem.com/arushi09/local-kubernetes-development-made-easy-with-minikube-devtron-17hf</guid>
      <description>&lt;p&gt;Devtron being an open source platform appreciates the contributions coming from the community all across the globe. Everyday, the team of Devtron is leveraging the idea of building the platform more developer-friendly. To contribute and provide your ideas we came up with a solution to let our contributors know how the process will work.&lt;br&gt;
Frequently installing devtron to check your applied changes can be a tedious task and will not give a speedy development. Try out this hassle-free setup to locally set up devtron.&lt;/p&gt;

&lt;p&gt;Before starting up with the setup lets first understand, &lt;strong&gt;What Devtron is?&lt;/strong&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/devtron-labs" rel="noopener noreferrer"&gt;
        devtron-labs
      &lt;/a&gt; / &lt;a href="https://github.com/devtron-labs/devtron" rel="noopener noreferrer"&gt;
        devtron
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Tool integration platform for Kubernetes
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Devtron is an open source software delivery workflow for Kubernetes written in Go. It is known for its slick user interface which allows developers to deploy their Microservices over Kubernetes in no-time. Not only application deployment, but also it helps in monitoring and logging just through the Devtron dashboard itself. Moreover it allows developers to integrate their existing open-source systems like ArgoCD, Jenkins, Clair, and others.&lt;/p&gt;

&lt;p&gt;Starting with the setup few prerequisites are to be taken into consideration which are listed below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites -
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Docker installed&lt;/li&gt;
&lt;li&gt;Kubernetes installed&lt;/li&gt;
&lt;li&gt;Having a basic architectural knowledge about devtron and a local Kubernetes cluster is a prerequisite for this setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my case, I took a single node Minikube cluster. You can  choose any as per your requirement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Minikube Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What is minikube?
&lt;/h3&gt;

&lt;p&gt;Minikube is a utility to run Kubernetes on your local machine. It creates a VM on your local machine and deploys a simple cluster containing only one node.&lt;br&gt;
To set up a Minikube cluster , you first need to install Minikube using this &lt;a href="https://minikube.sigs.k8s.io/docs/start/?ref=hackernoon.com" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;. After the successful installation of Minikube , now it’s time to create a cluster.&lt;br&gt;
Cluster creation in Minikube is quite simple using a single command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;minikube start --cpus 3 --memory 7168
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let the command completely run, and create a cluster. The CPU and memory requirements are given explicitly because by only running &lt;code&gt;minikube start&lt;/code&gt; a cluster is created with the default configurations of 2 CPUs and 2048 memory which is insufficient for devtron installation.&lt;br&gt;
Afterwards, run the below command to check the health of the nodes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get nodes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Now, let's start installing Devtron!!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Devtron Installation
&lt;/h2&gt;

&lt;p&gt;Installation of Devtron can be done using multiple command line programs. Eg - helm3, helm2 and kubectl. Among these, helm3 is the recommended one. Before that, refer to the following &lt;a href="https://helm.sh/docs/intro/install/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; to install helm.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 1:&lt;/strong&gt; To install devtron using helm3 run the following commands -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;helm repo add devtron https://helm.devtron.ai
helm install devtron devtron/devtron-operator --create-namespace --namespace devtroncd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installation time will be dependent on the internet speed on your local machine. Generally the installation takes upto 20-25 mins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 2:&lt;/strong&gt; Keep on executing the command below to check the status of the installation. If it is still in progress it will show &lt;strong&gt;Downloaded&lt;/strong&gt;  and once finished it will show  &lt;strong&gt;Applied&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl -n devtroncd get installers installer-devtron -o jsonpath='{.status.sync.status}'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also run the following command to keep track of your pods.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl -n devtroncd get pods - w 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 3:&lt;/strong&gt; After the successful installation of devtron, now we are ready to access the dashboard. As the cluster is locally created  it will accessible on localhost or localhost IP - 127.0.0.1&lt;br&gt;
Use the below command to access the dashboard locally&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;minikube -n devtroncd svc/devtron-service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can also use minikube tunnel  to create an EXTERNAL IP to access the dashboard, or port-forwarding the devtron-service will also work.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 4:&lt;/strong&gt; Logging into the dashboard using admin access will require a password which will be generated from the below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl -n devtroncd get secret devtron-secret -o jsonpath='{.data.ACD_PASSWORD}' | base64 -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Hurray..! Your devtron installation is successfully done.To know more about installation refer to official site of &lt;a href="https://docs.devtron.ai/" rel="noopener noreferrer"&gt;Devtron&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting the Local Setup
&lt;/h2&gt;

&lt;p&gt;As we move forward, devtron installation was the first step we successfully completed. We are ready to set up our local development environment for Devtron and play around with it. For building any features or fixing bugs, we need to have the source code of the project at the very first place.&lt;br&gt;
&lt;code&gt;[Note: Please make sure that the wire module is installed in your system]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow the steps below for the setup -&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 1:&lt;/strong&gt; Clone the project&lt;br&gt;
The below command will clone the devtron repo in your system. If you haven’t installed git,  install it from here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/devtron-labs/devtron.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 2:&lt;/strong&gt; Build the project. &lt;br&gt;
Go to the devtron directory which you cloned, using the command  &lt;code&gt;cd devtron&lt;/code&gt; and build the devtron source code by the following command.&lt;br&gt;
&lt;code&gt;make build&lt;/code&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;STEP 3:&lt;/strong&gt; Port Forwarding the Services&lt;br&gt;
Now we need to port forward a few services to establish a connection between Devtron running with the binary we will execute in the next step. Execute the following commands in different terminals which can help you to check the logs and debug if any connection issues occur and also do not close the terminal or stop these commands until the work is done. If any commands are stopped, then please execute it again to maintain the connection with local setup.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl -n devtroncd port-forward svc/argocd-server 8000:80

kubectl -n devtroncd port-forward svc/argocd-dex-server 5556:5556

kubectl -n devtroncd port-forward svc/postgresql-postgresql 5432:5432

kubectl -n devtroncd port-forward svc/devtron-nats 4222:4222
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;STEP 4:&lt;/strong&gt; Setting up Environment Variables and executing Binary&lt;/p&gt;

&lt;p&gt;Now we need to set up a few environment variables to connect the source code with the Devtron which we installed initially. Please run the following commands from the root directory where you build the project. It will setup the environment variable and execute the binary as well. Do not stop the command until the work is not done.&lt;br&gt;
&lt;code&gt;[Note: python3 must be installed in the system]&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget https://raw.githubusercontent.com/devtron-labs/devtron/main/developers-guide/scripts/exporter.py
python3 exporter.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Yayy! We have successfully set up devtron locally in our system and now we can start building features, fixing bugs, etc and start contributing to the project.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>opensource</category>
      <category>kubernetes</category>
      <category>devops</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
