Skip to content

Task Targets Reference

This repo is orchestrated with Task. List every available target with:

bash
task --list

Targets are grouped into namespaces (<namespace>:<task>). The base stack, monitoring, and security components are deployed declaratively via Helm charts + ArgoCD — the tasks below cover provisioning, secrets, and day-2 operations.


Provisioning (Ansible)

TargetRequiredDescription
task provision:inventoryTerraform outputs / hostsGenerate the Ansible inventory
task provision:serverinventoryProvision the server node (common + k3s server)
task provision:agentsinventory + running serverJoin agent nodes to the cluster
task provision:siteinventoryFull provisioning: common + k3s server + agents + kubeconfig
task provision:resetinventory⚠️ Uninstall k3s from all nodes (destructive)

Kubeconfig

TargetRequired varsDescription
task kubeconfig:fetchSERVER_IP, SSH_USER, KUBECONFIG_CONTEXTFetch k3s.yaml from the server and merge it into ~/.kube/config.

task provision:site already fetches the kubeconfig — use this task only to (re)fetch it standalone. After running:

bash
kubectl config use-context k3s-infra
kubectl get nodes

Deployment & secrets

The base stack, monitoring, and security are deployed via Helm charts + ArgoCD. These tasks create the secrets those charts consume and handle teardown.

TargetRequired varsDescription
task deploy:dashboard-secretDASHBOARD_PASSWORDCreate the traefik-dashboard-auth BasicAuth secret (ingress).
task deploy:grafana-secretGRAFANA_PASSWORD, KUBECONFIG_CONTEXTCreate the grafana-admin-secret (monitoring).
task deploy:grafana-oauthGRAFANA_DOMAINRestart Grafana to pick up the OAuth secret from Vault.
task deploy:uninstall⚠️ Tear down all deployed workloads (destructive).

ArgoCD

TargetDescription
task argocd:deployInstall / upgrade ArgoCD
task argocd:add-repoRegister the GitOps repo with ArgoCD
task argocd:statusShow ArgoCD application sync/health status
task argocd:passwordPrint the initial admin password
task argocd:delete-initial-secretRemove the bootstrap admin secret
task argocd:disable-adminDisable the built-in admin account

Vault

TargetDescription
task vault:initInitialize Vault (one-time)
task vault:unsealUnseal Vault
task vault:configureConfigure Vault auth/policies/secret engines
task vault:seedSeed application secrets into Vault
task vault:seed-cloudflareSeed Cloudflare credentials into Vault
task vault:statusShow Vault status

Status

TargetDescription
task status:nodesShow cluster nodes (kubectl get nodes -o wide)
task status:allShow all non-completed pods across namespaces
task status:podsShow pod resource usage (requires metrics-server)
task status:certsShow cert-manager certificate status
task status:securityShow NetworkPolicies and Pod Security Standards labels

SSH shortcuts

TargetRequired varsDescription
task ssh:serverSERVER_IPOpen an interactive SSH shell on the server node
task ssh:agentAGENT_IPOpen an interactive SSH shell on the agent node
task ssh:known-hosts-resetRemove stale ~/.ssh/known_hosts entries

Dev tools

TargetDescription
task dev:testRun BATS unit tests (offline, no cluster required)
task dev:test-watchRe-run tests on every file change (requires entr)
task dev:lintRun all linters via prek
task dev:lint-installInstall prek git hooks
task dev:hooks-updateUpdate prek hook revisions to latest

Full workflow example

bash
# 1. Copy and configure environment
cp .env.example .env
# Edit .env with your VPS IPs, domain, etc.

# 2. Provision the cluster with Ansible
task provision:inventory
task provision:site        # common + k3s server + agents + kubeconfig

# 3. Configure kubectl
kubectl config use-context k3s-infra
task status:nodes          # Verify nodes are Ready

# 4. Create stack secrets (charts are reconciled by ArgoCD)
task deploy:dashboard-secret
task deploy:grafana-secret

# 5. Verify
task status:all

Using from a private infra repo

k3s-lab is consumed from a private infra repo via a SHA/tag-pinned git submodule at vendor/k3s-lab. The infra Taskfile.yml includes the taskfiles from that submodule. See the Using with infra guide for the full walkthrough.