- install prerequisites,
- install Docker, kubectl and Minikube,
- start a multi-node Minikube cluster,
- enable useful addons,
- deploy a demo nginx app exposed as a NodePort service,
- and provide convenient access details and fallbacks.

- This guide shows how to install Claude Code on an Ubuntu VM, sign in, and ask it to create a Minikube-based Kubernetes cluster.
- Claude Code can execute Bash commands on the machine where it’s installed. The example uses a VM (for example, Amazon EC2), but any Linux VM (local or cloud) works.
- The final result is a 3-node Minikube cluster named
demo, with an nginx “hello” Deployment exposed through a NodePort.
For a 3-node Minikube cluster sized with 2 CPUs and 4GB memory per node you will need a VM with enough total RAM and CPU (roughly 12GB RAM + host overhead and at least 6 CPUs). If you only have a single smaller VM, reduce node counts and/or memory values.
Installing and signing in to Claude Code
- Install Claude Code on the VM (example):
- Start Claude Code:
- Follow the interactive sign-in flow. If the installer prints an OAuth URL, open it in a browser and paste the code/token back into the Claude prompt. Example installer prompt (truncated):
- Install prerequisites (
ca-certificates,curl,gnupg,apt-transport-https,conntrack,socat,ebtables,ethtool) and apply sysctls for bridge and IP forwarding. - Install Docker (
docker.io), enable/start it, and add the current user to thedockergroup. - Install
kubectlfrom the official APT repo. - Install Minikube (latest Linux binary).
- Start a 3-node Minikube cluster named
demousing the Docker driver with--cpus=2and--memory=4096per node. - Enable addons:
metrics-server,ingress,dashboard. - Deploy a
hellonginx Deployment and expose it as a NodePort service. - Print nodes, services, and a reachable URL via
minikube -p demo service hello --url. Provide a port-forward fallback command. - Make actions idempotent and handle docker-group membership changes by attempting a
newgrp dockerblock if required.
/tmp/minikube-demo.sh. Below is a cleaned, idempotent script (the same, improved and consistent version used in the lesson/article). Save this script as /tmp/minikube-demo.sh if you want to run it yourself.
- Claude created the script at
/tmp/minikube-demo.sh, made it executable, and executed it non-interactively. - When docker-group membership changes blocked some actions, Claude used
newgrp dockerto run the relevant Minikube commands in the correct group context. - Claude validated the demo application by performing a
kubectl port-forwardand running acurlagainst the forwarded port to confirm the nginx default page responded.
- Docker group: after adding your user to the
dockergroup you may need to log out/in, restart the shell, or runnewgrp dockerfor group membership to take effect. - Resource constraints: Minikube multi-node clusters using the Docker driver create multiple containers on the host; ensure sufficient disk, CPU, and memory. If resources are limited, reduce
NODES,CPU, orMEM. - Addon image pulls: if an addon fails to enable due to image pull/network issues, verify network connectivity and retry:
minikube -p demo addons enable <addon>
- If kubectl commands fail due to context, ensure Minikube’s kubeconfig is active for the profile:
minikube -p demo kubectl -- get nodes
/tmp/minikube-demo.sh and adjust PROFILE_NAME, node count, CPU, and memory values to match your available resources.
Links and References
- Minikube: https://minikube.sigs.k8s.io/
- Kubernetes documentation: https://kubernetes.io/docs/
- Docker: https://www.docker.com/
- kubectl installation (APT / official instructions): https://kubernetes.io/docs/tasks/tools/#kubectl
- Claude Code installer (used in examples): https://claude.ai/install.sh