/kubernetes-platform-skills:complete-kubernetes-deployment-with-k3s-from-scratchfrom kubernetes-platform-skills
Guides the full K3s deployment from bare hosts to a production-ready cluster, covering topology/datastore, CNI, ingress, load balancer, cert-manager, and first workload.
Ships in kubernetes-platform-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
K3s's whole value proposition is that most of a full Kubernetes stack (CNI, Ingress, a LoadBalancer implementation, a datastore) ships bundled and pre-decided — which means the end-to-end deployment sequence for K3s looks different in kind, not just in vendor-specific detail, from EKS/ AKS/GKE/OKE or a self-managed kubeadm cluster: several phases that are mandatory elsewhere (install a CNI, install an Ingress controller, solve the bare-metal LoadBalancer problem) are instead "confirm the bundled default is acceptable, or deliberately disable and replace it." Getting this sequence wrong most commonly means either fighting K3s's own defaults without realizing they're what's causing the odd behavior, or skipping the datastore-HA decision entirely and discovering the single-server control plane is a hard single point of failure only after an outage. This skill sequences topology/datastore choice, the bundled Flannel CNI, Traefik-vs-ingress-nginx, ServiceLB-vs-MetalLB, cert-manager sized for the deployment's actual reachability, a scaled-down conformance gate, and a first workload into one ordered path for K3s specifically.
curl reachability to get.k3s.io, or
a pre-staged air-gapped bundle for sites with no internet access.helm ≥ 3.14 on a machine with kubectl access to the cluster.This is the phase sequence. Each phase links to the skill that covers its full depth; the text here covers only K3s-specific sequencing and integration decisions.
Phase 1 — Decide topology and datastore before installing anything. This is the single highest-leverage decision in the whole sequence and the hardest to change after the fact. See lightweight-kubernetes-k3s for the full single-server-SQLite vs. multi-server-embedded-etcd vs. multi-server-external-datastore tradeoff. Decide explicitly which one this deployment needs based on its actual availability requirement, and — if HA — reserve a stable registration address (load balancer or DNS name) now, since it must be set as a TLS SAN from the very first server node.
Phase 2 — Install K3s, disabling bundled components deliberately rather than discovering the conflict later:
# single-server (dev/edge/CI)
curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644
# multi-server HA with embedded etcd, Traefik/ServiceLB disabled up front
# because Phase 4 will install ingress-nginx and MetalLB instead
curl -sfL https://get.k3s.io | sh -s - server --cluster-init \
--tls-san k3s-lb.internal.example.com \
--disable traefik --disable servicelb
Decide the Traefik/ServiceLB disable flags in this phase, at install time — re-disabling them on a running server requires a restart with changed flags and risks a brief window where both the bundled and replacement components are active simultaneously.
Phase 3 — CNI: bundled Flannel by default. K3s ships Flannel (VXLAN backend) pre-installed and running the moment a node joins — there is no separate "apply a CNI manifest" step the way a fresh kubeadm cluster requires. Confirm it's healthy:
kubectl get pods -n kube-system -l app=flannel
Alternative: if NetworkPolicy enforcement is required, Flannel's
bundled default does not provide it — swap in Calico following
cni-networking-calico-flannel,
installed at k3s server startup via --flannel-backend=none plus a
separate Calico install, decided in this phase rather than attempted
as a live swap on a cluster with running workloads.
Phase 4 — Ingress and the LoadBalancer story: Traefik/ServiceLB vs.
ingress-nginx/MetalLB. K3s bundles both an Ingress controller
(Traefik) and a LoadBalancer Service implementation (ServiceLB,
formerly "Klipper LB") by default — this is the biggest structural
difference from every other skill in this sequence's family, since
EKS/AKS/GKE/OKE need a cloud LB and on-prem kubeadm needs MetalLB, but
K3s needs neither by default:
hostPort trick than a real load balancer), which is adequate for
small clusters but has no real load-spreading or health-aware
failover the way MetalLB's BGP mode or a cloud LB does.IngressClass/Service objects fighting the replacement.Phase 5 — cert-manager, sized to the deployment's actual reachability. Install cert-manager per cert-manager-tls-automation, but choose the issuance mechanism based on what this specific K3s deployment can actually reach — an edge site with no public IP and no port-80 ingress cannot use HTTP-01 at all, and may not have a DNS-provider API credential available either:
Issuer (cert-manager's self-signed root plus
an intermediate CA Issuer, or an existing internal CA's key
pair) is usually the only viable option — plan trust-bundle
distribution to any client that must validate the resulting
certificates, since there is no public CA trust to rely on.Phase 6 — Conformance and smoke validation, scaled to K3s's
footprint. Full CNCF certified-conformance is designed for
clusters with real spare scheduling capacity — running it against a
512MB-RAM edge device is likely to produce capacity-driven false
failures rather than a meaningful conformance signal. See
kubernetes-cluster-post-provision-conformance-validation
for the base procedure, and adapt it for K3s:
certified-conformance only on a cluster with genuine
spare capacity (a dev/CI K3s cluster, or a staging cluster built with
the same config as the target edge fleet) rather than directly
against a resource-constrained production edge device.Phase 7 — Deploy the first workload, via Helm or K3s's built-in
HelmChart CRD. Standard helm upgrade --install works exactly as
helm-chart-authoring describes.
K3s-specific alternative: its built-in Helm controller reconciles
HelmChart/HelmChartConfig custom resources declaratively, useful
for GitOps-style bootstrap of a chart at cluster creation time without
a separate helm invocation:
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: payments-api
namespace: kube-system
spec:
chart: oci://ghcr.io/example/charts/payments-api
version: 2.3.0
targetNamespace: payments
valuesContent: |-
replicaCount: 2
Prefer this path specifically when the chart install should be part of
the same GitOps-applied manifest set as the rest of the cluster's
bootstrap config; otherwise plain helm is simpler to reason about.
Phase 8 — Node/cluster health baseline, including the datastore backup Phases 3–6 didn't finalize. Establish node drain/cordon discipline via kubernetes-node-maintenance-and-troubleshooting, and — unlike the managed-Kubernetes skills in this family — actually schedule the datastore backup now, since K3s's control plane is entirely self-managed regardless of topology:
k3s etcd-snapshot save --name baseline-$(date +%F) # embedded etcd (HA) only
For single-server embedded-SQLite deployments, back up
/var/lib/rancher/k3s/server/db/state.db directly (K3s's own
etcd-snapshot command only covers the embedded-etcd path); for an
external SQL datastore, back it up through that database's own
tooling. See
etcd-backup-restore-and-cluster-health
for the restore procedure and quorum-monitoring detail this baseline
depends on.
k3s server command ever
runs — both are far more disruptive to change once nodes have joined
and workloads are scheduled./etc/rancher/k3s/config.yaml) rather than long, easy-to-typo CLI
flag strings passed by hand at each site.Symptom: Both Traefik and a separately installed ingress-nginx are
active, and Ingress routing behaves unpredictably — some hosts route
through one controller, some through the other.
Fix: Traefik was never disabled in Phase 2 before ingress-nginx was
installed in Phase 4. Disable Traefik at the K3s server level
(--disable traefik, which typically requires reinstalling/restarting
the server with the flag rather than a live toggle) and confirm no
stray IngressClass: traefik resources remain claiming Ingress objects
intended for nginx.
Symptom: LoadBalancer Services get an EXTERNAL-IP from
ServiceLB, but behavior differs confusingly from a MetalLB-based
on-prem cluster running the "same" configuration elsewhere.
Fix: ServiceLB and MetalLB are different mechanisms with different
failover/load-spreading characteristics (see Phase 4) — this is
expected once compared side by side, not a bug in either. If
configuration parity across K3s and kubeadm/MetalLB clusters is the
actual goal, disable ServiceLB and install MetalLB on K3s too rather
than trying to make ServiceLB behave identically.
Symptom: cert-manager's Certificate in Phase 5 never issues, and
the Challenge resource shows the HTTP-01 solver's temporary pod is
unreachable from Let's Encrypt's validation servers.
Fix: Confirm the deployment's actual internet reachability was
assessed honestly in Phase 5 before choosing HTTP-01 — a NAT'd or
firewalled edge site with no inbound port 80 cannot complete an HTTP-01
challenge no matter how correctly cert-manager itself is configured;
switch to an internal CA Issuer instead of continuing to debug a
network path that structurally cannot work.
Symptom: A single-server K3s cluster's node goes offline for
unrelated maintenance, and every kubectl command (and any GitOps
reconciliation depending on API access) fails simultaneously.
Fix: This is the expected consequence of the Phase 1 topology
decision, not a new problem — a single-server cluster has no control-
plane HA by design. If this outage class is unacceptable, the fix is
revisiting Phase 1's topology choice (multi-server embedded etcd or
external datastore) for this deployment, not patching around a single
incident after the fact.
Symptom: An edge device runs fine for months, then a K3s version
upgrade corrupts or loses cluster state.
Fix: Phase 8's datastore backup was scheduled as a "someday" task
rather than actually configured at deployment time. Confirm
k3s etcd-snapshot save (or the SQLite file backup / external-database
backup, depending on Phase 1's topology) has been running on a real
schedule with verified restorability before treating any upgrade as
routine.
Scenario: Stand up a 3-node HA K3s cluster (embedded etcd) for a regional edge site with intermittent-but-present internet connectivity, swapping Traefik/ServiceLB for ingress-nginx/MetalLB to match the company's on-prem kubeadm clusters, with Let's Encrypt DNS-01 (the site has no reliably reachable inbound port 80) and a footprint-appropriate validation gate.
# Phase 1/2 — server-1, HA topology decided, bundled components disabled up front
curl -sfL https://get.k3s.io | sh -s - server --cluster-init \
--tls-san k3s-edge-lb.internal.example.com \
--disable traefik --disable servicelb
sudo cat /var/lib/rancher/k3s/server/node-token # shared join token
# server-2, server-3
curl -sfL https://get.k3s.io | sh -s - server \
--server https://k3s-edge-lb.internal.example.com:6443 \
--token <TOKEN_FROM_SERVER_1> --disable traefik --disable servicelb
# Phase 3 — bundled Flannel confirmed healthy (no NetworkPolicy requirement here)
kubectl get pods -n kube-system -l app=flannel
# Phase 4 — MetalLB + ingress-nginx instead of ServiceLB/Traefik
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.8/config/manifests/metallb-native.yaml
kubectl apply -f metallb-pool-and-l2advertisement.yaml
helm install ingress-nginx ingress-nginx/ingress-nginx \
--namespace ingress-nginx --create-namespace \
--set controller.service.type=LoadBalancer
# Phase 5 — cert-manager with DNS-01 (no reliable inbound HTTP-01 path)
helm install cert-manager jetstack/cert-manager \
--namespace cert-manager --create-namespace --version v1.15.1 --set crds.enabled=true
kubectl apply -f dns01-staging-issuer.yaml # validate, then swap to prod
# Phase 6 — quick mode always; full conformance run against an identically-configured staging cluster, not this edge site directly
sonobuoy run --mode quick --wait && sonobuoy results "$(sonobuoy retrieve)"
kubectl run dns-check --image=busybox:1.36 --rm -it --restart=Never -- \
nslookup kubernetes.default.svc.cluster.local
# Phase 7 — first workload via K3s's built-in HelmChart CRD
kubectl apply -f payments-api-helmchart.yaml
# Phase 8 — datastore backup and node health baseline
k3s etcd-snapshot save --name baseline-$(date +%F)
kubectl get nodes -o wide
kubectl get nodes shows all three server nodes Ready on separate
underlying hardware, curl -I https://payments-edge.example.com returns
HTTP/2 200 with a production Let's Encrypt certificate issued via
DNS-01, and the etcd snapshot confirms the datastore backup discipline
from Phase 8 is active before the site is considered handed off.
helm install path in Phase 7.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin kubernetes-platform-skills35 skills in this plugin
/cert-manager-tls-automationGuides installing and configuring cert-manager for automated TLS certificate issuance and renewal — Issuers vs. ClusterIssuers, ACME/ Let's Encrypt HTTP-01 and DNS-01 challenges, private-CA issuance, and integration with Ingress-nginx and Istio gateways. Use when a user asks to "automate TLS certificates on Kubernetes," "set up cert-manager with Let's Encrypt," "fix a stuck Certificate that won't become Ready," "use DNS-01 for a wildcard cert," "rotate mTLS certs automatically," or "issue certs from an internal CA."
/cni-networking-calico-flannelGuides choosing and installing a Kubernetes CNI plugin — Calico vs. Flannel — including NetworkPolicy enforcement capability differences, BGP vs. VXLAN/overlay data paths, and IP address management (IPAM) tradeoffs. Use when a user asks to "choose a CNI plugin for Kubernetes," "enable NetworkPolicy enforcement," "set up Calico with BGP peering," "install Flannel," "debug pod-to-pod connectivity across nodes," or "migrate from Flannel to Calico."
/complete-kubernetes-deployment-on-aks-from-scratchSequences a complete, end-to-end AKS deployment from a bare Azure subscription to a production-ready cluster serving a first workload — Azure landing zone prerequisites, AKS cluster and node pool provisioning, Azure CNI (with the Calico/Cilium alternative noted), ingress (Application Gateway Ingress Controller vs. ingress-nginx), cert-manager with Azure DNS, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on AKS from scratch," "set up a new AKS environment end to end," "build a production AKS cluster from a fresh Azure subscription," or "give me the full sequence to go from nothing to a working AKS cluster."
/complete-kubernetes-deployment-on-eks-from-scratchSequences a complete, end-to-end EKS deployment from a bare AWS account to a production-ready cluster serving a first workload — landing zone/IAM prerequisites, EKS cluster and node group provisioning, VPC CNI (with the Calico/Cilium alternative noted), ingress (ALB vs. ingress-nginx), cert- manager with Route 53 DNS-01, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/ orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on EKS from scratch," "stand up a new EKS environment end to end," "build a production EKS cluster from a fresh AWS account," or "give me the full sequence to go from nothing to a working EKS cluster."
/complete-kubernetes-deployment-on-gke-from-scratchSequences a complete, end-to-end GKE deployment from a bare GCP project to a production-ready cluster serving a first workload — GCP landing zone prerequisites, GKE cluster and node pool provisioning, VPC-native/ Dataplane V2 CNI (with the Calico alternative noted), ingress (GKE Ingress/Gateway API vs. ingress-nginx), cert-manager with Cloud DNS, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill that sequences several existing tool-specific skills in the correct order and flags the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on GKE from scratch," "set up a new GKE environment end to end," "build a production GKE cluster from a fresh GCP project," or "give me the full sequence to go from nothing to a working GKE cluster."
/complete-kubernetes-deployment-on-oke-oci-from-scratchSequences a complete, end-to-end OKE (Oracle Container Engine for Kubernetes) deployment from a bare OCI tenancy to a production-ready cluster serving a first workload — OCI landing zone prerequisites (Compartments, Dynamic Groups), OKE Enhanced cluster and node pool provisioning, VCN-Native pod networking (with the Calico NetworkPolicy add-on noted), ingress (Native Ingress Controller vs. ingress-nginx), cert-manager with OCI DNS via a community webhook solver, conformance validation, a Helm-deployed workload, and a node/cluster health baseline. This is an integration/orchestration skill sequencing several existing tool-specific skills in the correct order and flagging the handoff points between them — it does not restate their internals. Use when a user asks to "deploy a Kubernetes cluster on OKE from scratch," "set up OKE on OCI end to end," "build a production OKE cluster from a fresh OCI tenancy," or "give me the full sequence to go from nothing to a working OKE cluster."
Other plugins' skills for the same job