GitOps — How to deploy an app in Kubernetes with ArgoCD — Step1

Setup Environment

Cesar Augusto
3 min readAug 12, 2023

Main goal: In this article, we will use the tools ArgoCD and Helm Charts to deploy an application in a Kubernetes environment using the GitOps approach.

What is GitOps?

GitOps is a modern software development and operations approach that simplifies and streamlines the management of complex applications and infrastructure.
As a single source of truth for both application code and the configuration required to deploy and manage that application:

Read more about it: https://about.gitlab.com/topics/gitops/

What is Argo CD?

ArgoCD is a declarative, GitOps continuous delivery tool for Kubernetes. With this tool, you can manage your application in a Kubernetes environment.

You can read more about it: https://argo-cd.readthedocs.io/en/stable/#what-is-argo-cd

What are Helm Charts?

Helm Charts is a collection of files with multiple charts that describe a set of Kubernetes resources.

Read more about it: https://helm.sh/docs/topics/charts/

How to Setup Our Environment?

Firstly, we need to configure our kubernetes environment, for this, follow the steps below.

I understand that you already have a docker environment configured.

First step
For this article I’m using the minikube and kubectl tools, but, you can use anything other kubernetes environment, such as Azure AKS, AWS EKS, GKE, or others.

Install minikube
https://minikube.sigs.k8s.io/docs/start/

Install kubectl
https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

After completing the installations, start the environment.

minikube start
Expected output after running the command

Second step
Now, with a Kubernetes environment running, we need to install ArgoCD.

kubectl create namespace argocd
Expected output after running the command
kubectl apply --namespace argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Expected output after running the command.

Now, run the command below to verify the ArgoCd health pods.

kubectl get all --namespace argocd
Expected output after running the command.

Third step
Now, we already have ArgoCD and Kubernetes environments running. Let’s access the argoCD UI.

Let’s get the password to access the ArgoCD.
copy the output and save it to use forward.

kubectl --namespace argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

Run the command below to expose the ArgoCD port.
This command will expose the ArgoCD internal port to access the IU.

kubectl port-forward service/argocd-server --namespace argocd 8443:443
Expected output after running the command.

Now, open your browser and access: https://localhost:8443

username: admin
password: the value copied before.

Done! We already have an ArgoCD Environment.

In the next article, we will deploy our application.

Second step: https://medium.com/@educador.cesar/how-to-deploy-helm-charts-with-argo-cd-and-private-repositories-8fcd54a07134

--

--

Cesar Augusto

Software & Solutions Architect | Software Engineer | 6X Microsoft Azure Certified | 4X AWS Certified