Skip to content

Deploying Your Development Kubernetes Cluster

This repository uses ArgoCD to deploy and manage a Kubernetes development cluster for Vyra systems. It includes configurations for core components, namespaces, and applications needed for development and testing.

Repository link: Vyra-io/k8s-dev-cluster

Creating a minikube cluster

Assuming you're running a real OS and not shitdows, deploy minikube.

Once installed from below, start a HA cluster. 4 nodes allows rolling to the next deployment without affecting current HA deployments of 3 replicas.

minikube start --nodes 4 -p vyra-dev

MacOS

Assuming you already have Docker installed because who doesn't:

brew install minikube

Linux

That's right, just like everything else in Linux, you're on you're own here.

Initiating the cluster pre-requisites

We use ArgoCD to manage Argocd, an ArgoCeption type deal I guess. We must first init Argocd with standard manifests and then tell it to manage itself.

Step 1: Creating the ArgoCD namespace

kubectl create namespace argocd

Step 2: Applying the ArgoCD CRDs and HA Manifests

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/ha/install.yaml

Authenticating ArgoCD to this repo

Assuming you have logged in via the CLI and have generated a GitHub fine grained PAT with read only contents of just this repo. For prod obviously this would be a deploy token or a GitHub app.

export ARGO_VYRA_DEV_PAT=<token>
argocd repo add https://github.com/Vyra-io/k8s-dev-cluster --username git --password $ARGO_VYRA_DEV_PAT

Accessing Private Registries With Authenticated Harbor Proxy Caching

During Dev we will use an Image pull secret to auth to ghcr. This token must be a classic PAT with read:packages permissions.

export VYRA_DEV_PAT=<token>
kubectl -n default create secret docker-registry ghcr-credentials \
  --docker-username=vyra \
  --docker-password=$VYRA_DEV_PAT \
  --docker-server=ghcr.io

Point ArgoCD at the ApplicationSet

This tells ArgoCD to watch the apps/ dir for new apps and updates to old ones.

kubectl apply -f bootstrap.yaml

And that is all folks, you have a cluster that always matches the dev config that can be blown away and rebuilt in minutes.

ProTips

Install the ArgoCD CLI:

brew install argocd

Making the UI available

kubectl port-forward svc/argocd-server -n argocd 8080:443

Listing and then selecting a Minikube profile

minikube profile list
minikube profile vyra-dev

Listing and then selecting a kubeconfig context

kubectl config get-contexts
kubectl config use-context vyra-dev
Powered by Vyra, Sweat and Tears™