feat: add the headlamp role #50

Merged
aleksei merged 2 commits from feat/headlamp-role into main 2026-11-23 09:11:53 +00:00
Owner

What changes

Adds roles/headlamp, which installs the official Headlamp Helm chart into the
cluster:

  • release name headlamp, without a host prefix, in kube-system;
  • chart version pinned by headlamp_chart_version (0.46.0);
  • the web UI is published with a NodePort, configured by
    headlamp_node_port and defaulting to 32090;
  • externalTrafficPolicy is explicitly Cluster, configured by
    headlamp_service_external_traffic_policy, so the NodePort is accepted on
    every node interface;
  • the namespace, release name, chart name, chart repository, Helm command and
    rollout timeout are variables as well.

A NodePort is published on all node interfaces by Kubernetes; a Service has no
separate bind address. The explicit Cluster policy makes that intent part of
the role instead of relying on the Kubernetes default.

The role is idempotent: it reads the current release and its values and runs
helm upgrade --install only when the release is missing, not deployed, uses
another chart version, or does not expose the requested NodePort and external
traffic policy. A converged release is left untouched.

--force-conflicts lets Helm take over fields that were previously changed
with kubectl patch; --rollback-on-failure keeps a failed upgrade from
leaving the release in the new state. Both are supported by the Helm 4.3.1 the
helm role installs.

The role is wired into playbooks/dev_delta.yaml after helm.

Rollout

Applied to dev_delta with --tags headlamp. The host already had a manually
patched Headlamp release; the role upgraded it from NodePort 32091 to 32090.
The release is now revision 5, status deployed, and its values are:

{"service":{"externalTrafficPolicy":"Cluster","nodePort":32090,"type":"NodePort"}}

A second run reports changed=0.

Verification

  • ansible-playbook --syntax-check playbooks/dev_delta.yaml passes.
  • dprint check passes.
  • helm list -n kube-system shows headlamp as deployed,
    headlamp-0.46.0.
  • k0s kubectl -n kube-system get svc headlamp shows type NodePort,
    node port 32090, externalTrafficPolicy: Cluster.
  • curl http://127.0.0.1:32090/ and curl http://192.168.70.210:32090/ on
    dev_delta return 200.
  • A request from a non-local network namespace on dev_delta to
    192.168.70.210:32090 also returns 200.
  • A repeated --tags headlamp run reports ok=10 changed=0 skipped=1.

Note: requests from other inventory hosts did not reach dev_delta at all
(tcpdump saw no packets), and those hosts cannot ping or SSH dev_delta
either. That is network segmentation or a firewall outside this role, not a
missing 0.0.0.0 bind.

## What changes Adds `roles/headlamp`, which installs the official Headlamp Helm chart into the cluster: - release name `headlamp`, without a host prefix, in `kube-system`; - chart version pinned by `headlamp_chart_version` (`0.46.0`); - the web UI is published with a NodePort, configured by `headlamp_node_port` and defaulting to `32090`; - `externalTrafficPolicy` is explicitly `Cluster`, configured by `headlamp_service_external_traffic_policy`, so the NodePort is accepted on every node interface; - the namespace, release name, chart name, chart repository, Helm command and rollout timeout are variables as well. A NodePort is published on all node interfaces by Kubernetes; a Service has no separate bind address. The explicit `Cluster` policy makes that intent part of the role instead of relying on the Kubernetes default. The role is idempotent: it reads the current release and its values and runs `helm upgrade --install` only when the release is missing, not `deployed`, uses another chart version, or does not expose the requested NodePort and external traffic policy. A converged release is left untouched. `--force-conflicts` lets Helm take over fields that were previously changed with `kubectl patch`; `--rollback-on-failure` keeps a failed upgrade from leaving the release in the new state. Both are supported by the Helm 4.3.1 the `helm` role installs. The role is wired into `playbooks/dev_delta.yaml` after `helm`. ## Rollout Applied to `dev_delta` with `--tags headlamp`. The host already had a manually patched Headlamp release; the role upgraded it from NodePort `32091` to `32090`. The release is now revision 5, status `deployed`, and its values are: ```json {"service":{"externalTrafficPolicy":"Cluster","nodePort":32090,"type":"NodePort"}} ``` A second run reports `changed=0`. ## Verification - `ansible-playbook --syntax-check playbooks/dev_delta.yaml` passes. - `dprint check` passes. - `helm list -n kube-system` shows `headlamp` as `deployed`, `headlamp-0.46.0`. - `k0s kubectl -n kube-system get svc headlamp` shows type `NodePort`, node port `32090`, `externalTrafficPolicy: Cluster`. - `curl http://127.0.0.1:32090/` and `curl http://192.168.70.210:32090/` on `dev_delta` return `200`. - A request from a non-local network namespace on `dev_delta` to `192.168.70.210:32090` also returns `200`. - A repeated `--tags headlamp` run reports `ok=10 changed=0 skipped=1`. Note: requests from other inventory hosts did not reach `dev_delta` at all (`tcpdump` saw no packets), and those hosts cannot ping or SSH `dev_delta` either. That is network segmentation or a firewall outside this role, not a missing `0.0.0.0` bind.
aleksei deleted branch feat/headlamp-role 2026-11-23 09:11:53 +00:00
Sign in to join this conversation.
No reviewers
No labels
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
zoo/infra!50
No description provided.