Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/moshclouds/managing-kubernetes-deployments-with-argocd

ArgoCD πŸš€ is a GitOps πŸ”„ tool for Kubernetes ☸️, automating deployments ⚑ with real-time monitoring πŸ“Š, rollback πŸ”„, and multi-cluster management 🌍. This guide covers installing, configuring, and deploying applications using ArgoCD on Minikube πŸ’».
https://github.com/moshclouds/managing-kubernetes-deployments-with-argocd

argocd gitops kubernetes minikube

Last synced: 5 days ago
JSON representation

ArgoCD πŸš€ is a GitOps πŸ”„ tool for Kubernetes ☸️, automating deployments ⚑ with real-time monitoring πŸ“Š, rollback πŸ”„, and multi-cluster management 🌍. This guide covers installing, configuring, and deploying applications using ArgoCD on Minikube πŸ’».

Awesome Lists containing this project

README

        

# πŸš€ Managing-Kubernetes-Deployments-with-ArgoCD


Image

## πŸ”₯ Introduction

ArgoCD πŸš€ is a powerful, declarative GitOps πŸ”„ continuous delivery tool designed for Kubernetes ☸️, enabling seamless automatic deployment ⚑ and lifecycle management of applications. It ensures that the desired application state, defined in a Git repository πŸ“‚, is automatically synchronized with the actual state in a Kubernetes cluster πŸ—οΈ. This makes deployments more reliable, automated, and version-controlled βœ…. With ArgoCD, teams can achieve real-time monitoring πŸ“Š, rollback capabilities πŸ”„, and multi-cluster management 🌍, enhancing both security πŸ” and efficiency in DevOps workflows.

In this beginner-friendly guide πŸ“–, we will walk through the installation and configuration of ArgoCD on Minikube πŸ’», a lightweight Kubernetes environment ideal for testing and development. We will then demonstrate how to deploy an application πŸš€, monitor its deployment status βœ…, and expose it for external access 🌍. By the end of this guide, you will have a fully functional ArgoCD setup 🎯, understand its key features, and be equipped to manage Kubernetes applications declaratively using GitOps principles πŸ”₯.

This guide is **beginner-friendly** and covers essential steps in detail. 🎯

---

## βœ… Prerequisites

Ensure you have the following installed:

- **Minikube** ([Install Guide](https://minikube.sigs.k8s.io/docs/start/))
- **kubectl** ([Install Guide](https://kubernetes.io/docs/tasks/tools/))

To verify Minikube installation:
```sh
minikube version
```

---

## βš™οΈ Step 1: Start Minikube

Start your Minikube cluster:
```sh
minikube start
```

Check the status:
```sh
minikube status
```

---

## πŸ“¦ Step 2: Create Namespaces

Create a namespace for ArgoCD:
```sh
kubectl create namespace argocd
```

Create a namespace for applications:
```sh
kubectl create namespace argocd-apps
```

---

## πŸš€ Step 3: Install ArgoCD

Apply the ArgoCD installation manifest:
```sh
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
```

Verify installation:
```sh
kubectl get pods -n argocd -w
```

Check services:
```sh
kubectl get svc -n argocd
```

---

## 🌐 Step 4: Expose ArgoCD Server

By default, the ArgoCD server runs as a ClusterIP service. Change it to **NodePort**:
```sh
kubectl edit svc argocd-server -n argocd
```

Locate `type: ClusterIP` and change it to `type: NodePort`. Save and exit.

Expose the ArgoCD server:
```sh
minikube service argocd-server -n argocd
```

You will receive a URL similar to:
```
http://127.0.0.1:6516
```
Use this URL to access the ArgoCD dashboard. 🎯

---

## πŸ”‘ Step 5: Retrieve ArgoCD Admin Password

Find the secret containing the initial admin password:
```sh
kubectl get secrets -n argocd
```

Edit the secret file:
```sh
kubectl edit secret argocd-initial-admin-secret -n argocd
```

Decode the base64 password using or any other third party services:
```sh
echo | base64 --decode
```

Use `admin` as the username and the decoded password to log in.

---

## πŸ“Œ Step 6.1: Deploy Application via ArgoCD(CLI)

1️⃣ **Login to ArgoCD CLI**:
```sh
argocd login :
```

2️⃣ **Create an Application in ArgoCD**:
```sh
argocd app create "hello-argocd" \
--repo https://github.com/argoproj/argocd-example-apps.git \
--path guestbook \
--dest-server https://kubernetes.default.svc \
--dest-namespace argocd-apps
```

3️⃣ **Sync the Application**:
```sh
argocd app sync "hello-argocd"
```

4️⃣ **Verify Application Status**:
```sh
kubectl get pods -n argocd-apps
```

---

## πŸ–₯️ Step 6.2: Deploy Application via ArgoCD (GUI)

1️⃣ **Access ArgoCD Web UI**:
Open the ArgoCD dashboard in your browser using the URL from Step 4:
```
http://127.0.0.1:6516
```

Image


2️⃣ **Login**:
Use `admin` as the username and the password obtained in Step 5.

3️⃣ **Create an Application**:
- In the ArgoCD dashboard, click on **+ NEW APP**.
- In the **Application Name** field, enter

```sh
hello-argocd
```
- Set the **Project** to

```sh
default
```
- Under **Repository URL**, enter

```sh
https://github.com/argoproj/argocd-example-apps.git
```
- Set **Path** to
```sh
guestbook
```
- Set **Destination Cluster** to
```sh
https://kubernetes.default.svc
```
- Set **Namespace** to
```sh
argocd-apps
```

Click **Create** to add the application.

Image

Image

Image


4️⃣ **Sync the Application**:
Once the application is created, click the **Sync** button on the application details page to sync the app.

5️⃣ **Verify Application Status**:
You will see the status of your application under **Application Details**. Wait until the status shows as **Synced** and **Healthy**.

Image

Image

---

## 🌍 Step 7: Expose the Guestbook Application

Find the service:
```sh
kubectl get svc -n argocd-apps
```

Edit the service to get the NodePort:
```sh
kubectl edit svc guestbook-ui -n argocd-apps
```

Expose the application:
```sh
kubectl expose service guestbook-ui --type=NodePort --target-port=80 --name=guestbook-ui-ext -n argocd-apps
```

Access the application:
```sh
minikube service guestbook-ui-ext -n argocd-apps
```

πŸŽ‰ Your application is now deployed via ArgoCD!

Image

---

## 🎯 Conclusion

Congratulations! You have successfully set up **ArgoCD on Minikube**, deployed an application, and exposed it.

βœ… **Key Takeaways:**
- ArgoCD is a **GitOps continuous delivery tool** for Kubernetes.
- Applications are managed declaratively from a **Git repository**.
- Minikube helps simulate a **real Kubernetes cluster** for testing.

πŸš€ **Next Steps:**
- Explore **Argo Rollouts** for advanced deployment strategies.
- Set up **RBAC and authentication** for ArgoCD security.
- Deploy a **real-world application** using ArgoCD.

---

πŸ”— Useful Links:
- [ArgoCD Docs](https://argo-cd.readthedocs.io/en/stable/)
- [ArgoCD GitHub](https://github.com/argoproj/argo-cd)
- [Minikube Docs](https://minikube.sigs.k8s.io/docs/start/)