Skip to content

fix(taskfile/eso/cert-manager): align k0s cluster auth on the shared convention#1406

Open
ixxeL2097 wants to merge 3 commits into
mainfrom
fix/vault-taskfile-cluster-override
Open

fix(taskfile/eso/cert-manager): align k0s cluster auth on the shared convention#1406
ixxeL2097 wants to merge 3 commits into
mainfrom
fix/vault-taskfile-cluster-override

Conversation

@ixxeL2097

Copy link
Copy Markdown
Member

Summary

Three-part fix that unblocks task vault:eso-auth-setup cluster=beelink / task vault:certmanager-auth-setup cluster=beelink and aligns the k0s (beelink) cluster auth wiring on the same convention already used by genmachine (<cluster>-k8s mount path, certmanager/eso roles, certmanager-auth / eso-auth SA names).

  • taskfile: vars: { cluster: genmachine } at task level was winning over the CLI value in Taskfile v3, so cluster=beelink was silently ignored. Replaced with requires: vars: [cluster] at entry tasks, and made kubernetes_host extract dynamically from the current kubectl context instead of the hardcoded K8S_API root var (now removed). Calling the task without cluster= now fails fast instead of quietly targeting genmachine.
  • external-secrets (beelink): ClusterSecretStore was wired to mountPath: kubernetes / role: external-secrets, not matching the Vault mount the taskfile creates. Aligned on beelink-k8s / eso like the genmachine manifest.
  • cert-manager (k0s): ClusterIssuer and its companion SA/Secret were named certmanager-vault-auth-k0s with mountPath: /v1/auth/kubernetes, so task vault:certmanager-auth-setup was hanging on ServiceAccount certmanager-auth not found. Renamed SA/Secret to certmanager-auth, role to certmanager, mountPath to /v1/auth/beelink-k8s.

Test plan

  • task vault:eso-auth-setup cluster=beelink (kubectl context on k0s) configures auth/beelink-k8s/ end-to-end
  • task vault:certmanager-auth-setup cluster=beelink finds SA certmanager-auth and creates the certmanager role
  • task vault:eso-auth-setup (no cluster arg) fails with the requires: vars message instead of silently using genmachine
  • ArgoCD sync of external-secrets-beelink and cert-manager-k0s applies the renamed manifests cleanly
  • ClusterSecretStore/admin reaches Ready=True
  • ClusterIssuer/fredcorp-ca reaches Ready=True
  • Same tasks against cluster=genmachine still pass (no regression on the existing cluster)

Commits

  • fix(taskfile): allow cluster override via CLI in vault auth setup
  • fix(external-secrets): align beelink ClusterSecretStore with cluster/role convention
  • fix(cert-manager): align k0s ClusterIssuer naming with taskfile convention

ixxeL2097 and others added 3 commits April 18, 2026 15:40
The hardcoded `cluster: genmachine` task-level var in vault entry tasks
prevented `task vault:eso-auth-setup cluster=k0s` from targeting a
different cluster — task-level vars win over CLI in Taskfile v3.

- Replace the hardcoded default with `requires: vars: [cluster]` so the
  cluster name must be passed explicitly on the CLI
- Extract `kubernetes_host` dynamically from the current kubectl context
  instead of the hardcoded K8S_API root var, so configuring auth follows
  whichever cluster kubectl is pointed at
- Drop the now-unused K8S_API root var

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…role convention

The beelink ClusterSecretStore authenticated against Vault via
`mountPath: kubernetes` + `role: external-secrets`, which didn't match
the naming convention enforced by `.taskfiles/vault/Taskfile.yaml`
(`{{.cluster}}-k8s/` mount, `eso` role) — same convention already used
by the genmachine manifest.

Align the beelink manifest on the same convention so ESO can authenticate
against the mount created by `task vault:eso-auth-setup cluster=beelink`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ntion

The k0s ClusterIssuer referenced `mountPath: /v1/auth/kubernetes`, role
`certmanager-vault-auth-k0s`, and SA/Secret `certmanager-vault-auth-k0s`,
but `.taskfiles/vault/Taskfile.yaml` creates `{{.cluster}}-k8s/` mounts
with role `certmanager` and looks up SA `certmanager-auth` — causing
`task vault:certmanager-auth-setup cluster=beelink` to hang on
"ServiceAccount certmanager-auth not found".

Align the k0s manifest with the genmachine convention already in use:
- mountPath → /v1/auth/beelink-k8s
- role → certmanager
- SA + Secret → certmanager-auth

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@ixxeL2097 ixxeL2097 force-pushed the main branch 10 times, most recently from 99be2b4 to 0ff926a Compare April 26, 2026 19:16
@ixxeL2097 ixxeL2097 force-pushed the main branch 3 times, most recently from 5248ff3 to 5c29049 Compare May 14, 2026 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant