k8s¶
Bootstrap a minimal set of Kubernetes services into the current cluster.
See References → Common contract for the
USER_WORKING_DIR, pin-strategy, and override-syntax conventions that
apply across every module.
Prerequisites¶
kubectlandhelmbinaries on thePATH.- A reachable Kubernetes cluster, typically a kind cluster
started through
task kind:start. The currentkubectlcontext decides which cluster receives the install.
Tasks¶
| Task | Description |
|---|---|
k8s:bootstrap |
Run the full bootstrap (today: delegates to install-argocd). |
k8s:install-argocd |
Render ArgoCD with helm template and apply it to the argocd namespace. |
install-argocd performs four steps in order:
kubectl create namespace argocd || true: idempotent on re-runs.helm repo add argo https://argoproj.github.io/argo-helm: the helm client returns a warning when the repository already exists with the same address; it exits non-zero only when the address differs from the registered one.helm repo update: refreshes the local index.helm template argocd argo/argo-cd {{.ARGOCD_EXTRA_ARGS}} --namespace=argocd | kubectl --timeout={{.KUBECTL_TIMEOUT}} apply -n argocd -f -: renders the chart and applies it.
Variables¶
| Variable | Default | Purpose |
|---|---|---|
ARGOCD_EXTRA_ARGS |
"" |
Extra arguments passed to helm template argocd argo/argo-cd (for example --set global.image.tag=v2.10.0). |
KUBECTL_TIMEOUT |
120s |
Timeout for the kubectl apply step. |
Example¶
version: '3'
vars:
TASK_COLLECTION_BASE: https://raw.githubusercontent.com/nolte/taskfiles/main/src
includes:
k8s:
taskfile: "{{.TASK_COLLECTION_BASE}}/taskfile-include-k8s.yaml"
vars:
ARGOCD_EXTRA_ARGS: "--set global.image.tag=v2.10.0"
KUBECTL_TIMEOUT: "300s"
Run task k8s:bootstrap (or task k8s:install-argocd directly) from the
consumer's working directory.
Troubleshooting¶
kubectl applytimes out. IncreaseKUBECTL_TIMEOUT. Slower clusters and larger ArgoCD installs need more headroom than the default120s.helm repo addfails on a re-run. The helm client exits non-zero when theargorepository is already registered under a different address. Remove the conflicting entry withhelm repo remove argoand re-run the task.- Wrong cluster receives the install. The task uses the current
kubectlcontext. Checkkubectl config current-contextbefore running the bootstrap.