Skip to main content
  1. Posts/
  2. Learning ArgoCD/
  3. Environments/

Minikube Profile Management

·526 words·3 mins
Ravi Singh
Author
Ravi Singh
Software engineer with 15+ years building backend systems and cloud platforms across fintech, automotive, and academia. I write about the things I build, debug, and learn — so I don’t forget them.
Learning ArgoCD - This article is part of a series.
Part 4: This Article

Minikube Profile Management
#

Quick reference for managing the Minikube profiles used in this repo (eu-prod, eu-staging) day-to-day.


Profiles in This Repo
#

Profilekubectl contextEnvironment
eu-prodeu-prodProduction (Minikube)
eu-stagingeu-stagingStaging (Minikube)

List All Profiles
#

1
minikube profile list

Shows profile name, driver, state (Running / Stopped), Kubernetes version, and IP for each profile.


Start a Profile
#

1
2
minikube start -p eu-prod
minikube start -p eu-staging

If Minikube fails with docker: No such file or directory (happens after a Rancher Desktop restart - the Docker socket path shifts), pass the socket path explicitly:

1
2
DOCKER_HOST=unix:///Users/ravisingh/.rd/docker.sock minikube start -p eu-prod
DOCKER_HOST=unix:///Users/ravisingh/.rd/docker.sock minikube start -p eu-staging

Memory constraint: Each profile uses ~1.5–2 GB of the Rancher Desktop VM’s memory. Running both simultaneously alongside Rancher Desktop’s own k3s causes API server OOM crashes. Start only one Minikube profile at a time.


Stop a Profile (preserves state)
#

1
2
minikube stop -p eu-prod
minikube stop -p eu-staging

The cluster state (all Kubernetes objects, ArgoCD config) is preserved on disk. The next minikube start resumes exactly where you left off.


Delete a Profile (destroys all state)
#

1
2
minikube delete -p eu-prod
minikube delete -p eu-staging

This removes the VM, all Kubernetes objects, and the kubeconfig context entry. After deletion you must re-run the full bootstrap to recreate the environment - see docs/12-eu-prod-minikube.md or docs/14-eu-staging-minikube.md.


Switch kubectl Context
#

Minikube sets the active context automatically on start. To switch manually:

1
2
3
kubectl config use-context eu-prod
kubectl config use-context eu-staging
kubectl config use-context rancher-desktop   # back to dev

Check which context is active:

1
kubectl config current-context

Typical Session Workflow
#

Starting a session
#

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Stop any other Minikube profile first (avoid OOM)
minikube stop -p eu-staging          # if eu-staging was running

# Start the profile you want
DOCKER_HOST=unix:///Users/ravisingh/.rd/docker.sock minikube start -p eu-prod

# Switch context
kubectl config use-context eu-prod

# Verify cluster is up
kubectl get nodes
kubectl get pods -n argocd

Accessing services (port-forward in a dedicated terminal)
#

minikube tunnel conflicts with Rancher Desktop’s port 80/443 bindings. Use kubectl port-forward instead:

1
2
3
4
5
# eu-prod
kubectl --context eu-prod port-forward -n ingress svc/traefik 8443:443 8080:80

# eu-staging
kubectl --context eu-staging port-forward -n ingress svc/traefik 8443:443 8880:80

Keep this terminal open for the duration of the session.

Ending a session
#

1
2
3
4
5
# Stop the profile (preserves state)
minikube stop -p eu-prod

# Optionally switch back to dev context
kubectl config use-context rancher-desktop

Full Reset (nuke and rebuild)
#

Use this when a profile is in a bad state or you want a clean slate.

1
2
3
4
5
6
# 1. Delete the profile
minikube delete -p eu-prod

# 2. Rebuild - follow the bootstrap steps in the relevant doc
#    eu-prod:    docs/12-eu-prod-minikube.md
#    eu-staging: docs/14-eu-staging-minikube.md

Checking Resource Usage
#

1
2
3
4
5
# Docker containers backing each Minikube profile (Docker driver)
docker ps --format 'table {{.Names}}\t{{.Status}}\t{{.Ports}}' | grep minikube

# Memory used by the Rancher Desktop VM (all clusters share this VM)
docker stats --no-stream
Learning ArgoCD - This article is part of a series.
Part 4: This Article