https://github.com/narcello/my-kube-app
https://github.com/narcello/my-kube-app
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/narcello/my-kube-app
- Owner: narcello
- Created: 2025-07-22T15:37:36.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-27T14:24:51.000Z (11 months ago)
- Last Synced: 2025-08-06T04:44:15.084Z (11 months ago)
- Language: Smarty
- Size: 24.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ๐ง Full Local Dev Setup: Docker + Kubernetes (Minikube) + Helm + ArgoCD
This guide walks you through setting up a full GitOps-based local Kubernetes environment using Docker, Helm, Minikube, and ArgoCD.
---
## โ
Prerequisites
- Docker installed
- `kubectl` CLI
- `minikube` installed
- `helm` CLI installed
- `argocd` CLI (optional but helpful)
- GitHub repository with a valid Helm chart (e.g. `values.yaml`, `templates/`, `Chart.yaml`)
---
## ๐ Step-by-Step Setup
### 1. **Start Minikube**
```bash
minikube start
```
### 2. **Use Minikubeโs Docker Daemon**
```bash
eval $(minikube docker-env)
```
### 3. **Build Your Image**
```bash
docker build -t my-kube-app:v1 .
```
### 4. **Create a Helm Chart**
If not already done:
```bash
helm create my-kube-chart
```
Customize:
- `values.yaml`
- `deployment.yaml`, `service.yaml`, etc in `templates/`
Set image info in `values.yaml`:
```yaml
image:
repository: my-kube-app
tag: v1
pullPolicy: IfNotPresent
```
### 5. **Install Helm Chart Locally (optional test)**
```bash
helm install my-kube-chart ./my-kube-chart
```
### 6. **Expose the App via NodePort**
```bash
kubectl expose deployment my-app-my-kube-chart --type=NodePort --port=3000
minikube service list
```
Use the `NodePort` in your browser.
---
### 7. **Install ArgoCD**
```bash
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
```
Port forward ArgoCD UI:
```bash
kubectl port-forward svc/argocd-server -n argocd 8080:443
```
Open [https://localhost:8080](https://localhost:8080)
Login:
```bash
kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath="{.data.password}" | base64 -d
```
Username: `admin`
---
### 8. **Create ArgoCD Application**
```yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-kube-chart
namespace: argocd
spec:
destination:
namespace: default
server: https://kubernetes.default.svc
source:
repoURL: https://github.com/your-username/my-kube-chart
path: .
targetRevision: main
project: default
syncPolicy:
automated:
prune: true
selfHeal: true
```
Apply it:
```bash
kubectl apply -f app.yaml
```
---
### 9. **Test New Image (v2+)**
```bash
eval $(minikube docker-env)
docker build -t my-kube-app:v2 .
# Update tag in values.yaml in GitHub repo
# Commit and push
# ArgoCD will detect the change, pull and deploy v2
```
---
## ๐ Key Concepts & Terminology
| Term | Explanation |
| ---------------- | ------------------------------------------------- |
| **Docker Image** | Packaged application environment |
| **Container** | Running instance of a Docker image |
| **Minikube** | Lightweight Kubernetes cluster on your machine |
| **Helm** | Package manager for Kubernetes (like apt or npm) |
| **Chart** | Helm package: includes templates and values |
| **ArgoCD** | GitOps controller: syncs Kubernetes from Git |
| **Deployment** | Describes desired state: pods, replicas, image |
| **ReplicaSet** | Ensures N pods are always running |
| **Pod** | Basic Kubernetes runtime unit, wraps containers |
| **NodePort** | Exposes a service to be accessible on a node's IP |
| **Service** | Abstraction to expose pods |
| **Namespace** | Virtual cluster inside Kubernetes cluster |
| **Prune** | ArgoCD removes resources not defined in Git |
| **Self-heal** | ArgoCD restores cluster to Git-defined state |
---
โ
You now have a Git-driven, production-like environment running entirely locally!