Pod - Hashicorp Vault #33

Merged
tepichord merged 12 commits from feat/18-pod-hashicorp-vault into main 2026-09-09 12:31:05 -07:00
Owner

Closes #18

Automated PR created by forgejo-done adapter.

Closes #18 Automated PR created by forgejo-done adapter.
Append apiserver extraArgs patch to set service-node-port-range to
8080-32767, enabling NodePorts 8443/8200/8080 for Vault. Add plan test
assertion for the new config patch.

Refs: #18
Add 20 GiB qcow2 volume (milner-worker-1-vault.qcow2) attached as vdb,
with a UserVolumeConfig machine-config patch to partition and mount it at
/var/mnt/vault. Update cleanup.sh banner to warn about data volume
destruction. Add plan tests for vault volume, vdb disk, and UserVolumeConfig.

Refs: #18
New vault/ root deploys HashiCorp Vault as a single-replica StatefulSet
on worker-large using the official vault-helm chart (0.34.1, image 2.0.4).
Includes nginx sidecar for Tailscale TLS termination, NodePort services
(8443/8080/8200), PSA privileged namespace label, and TLS secrets from
gitignored cert paths.

Plan tests mock kubernetes/helm providers and verify namespace labels,
helm_release properties, and nginx Service NodePorts.

Refs: #18
Add vault/ to terraform fmt recursive check. Replace hc-vault/yamllint
with vault/values.yaml. Skip hadolint test when no Dockerfiles exist.
Add vault terraform plan test.

Refs: #18
Update all documentation to reflect the in-cluster Vault migration:
README.md (link), AGENTS.md (repo map + tech stack), PLAN.md (phase 2
description + security model), ARCHITECTURE.md (reconciliation table +
NodePort note).

Refs: #18
- Add comment explaining NodePort range purpose in control-plane config patch
- Shorten disk-index explanation in worker plan tests

Refs: #18
README instructs copying mkcert/tailscale certs and private keys into
vault/certs/ and claims the dir is gitignored, but nothing excluded it;
a stray git add would stage real keys, violating the AGENTS.md hard
rule. Add a certs/ ignore entry.

Refs: #18
server_name was interpolated from the kubeconfig apiserver URL
(https://<cp-ip>:6443), which can never match a client Host header —
a leftover translation of the legacy podman nginx's real tailnet
hostname. The block is the sole vhost on :443, so it is the implicit
default server; removing the dead directive is behavior-preserving.

Refs: #18
Vault is now reachable at https://vault.faun-snapper.ts.net through the
Tailscale Kubernetes operator (ingress ProxyGroup + Ingress with
tls.hosts pinning the MagicDNS name), retiring the per-app nginx
sidecar, NodePort services, and file-based tailscale/mkcert certs.

Architecture changes:
- vault/main.tf: remove tailscale cert/key variables, the vault-tls
  secret, the nginx ConfigMap, and the 8443/8080 NodePort service; add
  kubernetes_manifest ProxyGroup (ingress, replicas 1) and a Tailscale
  Ingress (backend vault:8200). No cert files or TLS variables remain.
- vault/values.yaml: tlsDisable true + tls_disable=1 (the operator
  proxies plaintext HTTP; Vault treats a keyless listener as TLS-on,
  which crashed with an empty cert path); mount vault-data hostPath at
  /vault/data (chart's own data mount was missing entirely); disable
  the unused sidecar injector (its Deployment readiness stall wedged
  helm upgrades to timeout); service type ClusterIP.
- Drop mkcert/tailscale certs + terraform.tfvars (no variables left).

Tests/docs:
- vault/tests: plan tests now assert ProxyGroup type and the Ingress
  (tailscale class, tls.hosts=vault, backend vault:8200); unused TLS
  fixture certs deleted. Control-plane range test message de-scoped
  from Vault (range kept widened, no current consumer).
- vault/README, AGENTS, ARCHITECTURE, PLAN: document the operator
  model, admin-console prerequisites (tagOwners, OAuth, service
  approval), plaintext backend rationale, and gotchas.
The in-cluster Vault deployment supersedes the podman-compose stack;
podman-compose era ended when the VM-based cluster came up.
Terraform owns the vault namespace/Helm release/ProxyGroup/Ingress, the
worker data volume, and the apiserver node-port range — but the Tailscale
operator bootstrap, admin-console approvals, Vault init/unseal, and client
daemon flags were all applied by hand and captured by no repo file.

- OPERATIONS.md (new): canonical runbook + audit trail — what lives where
  (Terraform vs imperative vs admin console), ACL/OAuth/HTTPS/service
  approval steps, the helm operator install with env-based OAuth creds, the
  ingress-proxies-0 recycle that fixes 'Not advertising', Vault apply/init/
  unseal/day-2 commands, worker vault-volume attach/reboot, client
  accept-routes/operator flags, and full bring-up order from a wiped
  cluster.
- Root README: 'Out-of-band operations' section linking OPERATIONS.md.
- ARCHITECTURE.md: pointer note beside the network-topology table.
- vault/README.md: out-of-band callout + day-2 status/unseal/health section.
- worker/README.md: 'Vault data volume' section (attach, boot-time mount,
  preservation semantics).
- AGENTS.md: repo-map row for OPERATIONS.md.
tepichord deleted branch feat/18-pod-hashicorp-vault 2026-09-09 12:31:05 -07:00
tepichord referenced this pull request from a commit 2026-09-09 12:31:07 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
tepichord/milner!33
No description provided.