Repository navigation
feat(powfaucet): create the ingress' basic-auth secret from a value - #493
Conversation
Gating the faucet behind nginx basic auth currently means the annotations in values plus a Secret created outside the chart, by hand or by whatever renders the values. Nothing in the chart says the ingress depends on that secret, so a network that forgets it gets a 503 on the whole host with nothing to point at the cause. Take the htpasswd line as a value instead: set ingress.basicAuth and the chart creates the secret and sets the two annotations that reference it. Default is empty, so charts that set nothing render exactly as before.
This comment has been minimized.
This comment has been minimized.
Review catch: `set .Values.ingress.annotations` assumes the map exists.
`ingress.annotations: null` is a valid way to write "no annotations" and
rendered fine before, but with basicAuth set it took the whole release
down with "wrong type for value; expected map[string]interface {}".
Build the map with `default dict` and write it back instead.
|
Good catch, fixed in the follow-up commit.
Now the map is built with
|
There was a problem hiding this comment.
Adds an opt-in ingress basic-auth: setting ingress.basicAuth makes the chart create a -basic-auth Secret and the nginx auth-type/auth-secret annotations, with an empty default so non-users see no change. I rendered the chart in all relevant configurations (no-auth vs 1.1.0 byte-identical, basicAuth, null annotations, custom annotations, ingress disabled) and verified the nginx-facing details against upstream source (ingress-nginx reads secret key 'auth' and resolves a bare auth-secret name to the ingress's own namespace; nginx's ngx_crypt accepts {PLAIN}/{SHA}/{SSHA}/$apr1$). helm lint is clean; the .Values mutation is the repo's established ingress-template pattern with no cross-template leak. No correctness problems found.
Reviewed 5 changed file(s) @ 2d739d53 — no blocking issues found.
"Pets vs. cattle." — Bill Baker
…t's basicAuth (#579) ## Problem The `faucet-agents` ingress asks for basic auth, but the secret it references was never created — the role told the operator to make it by hand: > create the htpasswd secret with the srv credential in the network's namespace Skipping that does not leave the faucet open, it leaves it dead, and silently: the ingress controller returns `503` for the whole host, unauthenticated requests included, so nothing in the response points at the missing object. `glamsterdam-devnet-8` has been in that state since it was deployed — 503 with and without credentials, where devnet-7 returns 401 because someone created the secret by hand. `evm.faucet` through the panda proxy fails on devnet-8 with the ingress' own 503 body. ## Change The chart creates the secret now (ethpandaops/ethereum-helm-charts#493, powfaucet 1.2.0), so this side is just the credential, passed the same way as every other secret we hand to a service. The annotations come with it, so they leave here — the diff is a net six lines lighter. The credential is `node_ingress`, the one the old annotation comment already named, and present as `username`/`password` for all 14 `testnets.*` entries. ## Verification Regenerated against the real `glamsterdam-devnet-8` inventory, with the 1.2.0 chart, and rendered the result: ```yaml # faucet-agents/values.yaml ingress: enabled: true className: ingress-nginx-public basicAuth: "<path:...node_ingress.username}>:{PLAIN}<path:...node_ingress.password}>" ``` ```yaml # helm template faucet-agents ./faucet-agents kind: Secret metadata: name: powfaucet-agents-basic-auth --- kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/auth-secret: powfaucet-agents-basic-auth nginx.ingress.kubernetes.io/auth-type: basic ``` The secret keeps the name the annotation used before, which is also the name of the one already sitting in devnet-7's namespace, so ArgoCD adopts that one rather than creating a second. - the browser `faucet` chart renders no Secret and is otherwise unchanged - `{PLAIN}` checked against nginx directly: no credentials → 401, wrong credentials → 401, correct credentials → 200 - `ansible-lint` clean on the production profile One behaviour change worth naming: the realm string (`auth-realm: "panda proxy only"`) goes away with the annotations, so the browser prompt shows nginx's default realm. ## Merge order ethpandaops/ethereum-helm-charts#493 first, then a chart release, since the dependency pin here moves to 1.2.0.
) The faucet-agents ingress has asked for basic auth since it was deployed, but the secret it referenced was never created — that step was manual and got missed here, so the ingress has been returning 503 for the whole host ever since, unauthenticated requests included. devnet-7 works because someone created the secret there by hand. powfaucet 1.2.0 takes the htpasswd line as a value and creates the secret itself (ethpandaops/ethereum-helm-charts#493), and the ansible template passes the srv credential straight from vault (ethpandaops/ansible-collection-general#579), so regenerating is enough. The secret keeps the name the annotation used, so nothing else moves. Also pin the display name the generated values have been carrying by hand since 3502cc6 and 035e55b, so the next regeneration stops reverting it.
Problem
Gating the faucet behind nginx basic auth today means setting the two annotations in values and creating the
Secretthey reference somewhere else — by hand, or in whatever renders the values. The chart has no idea its ingress depends on that object.That fails badly: when the secret is missing, the ingress controller does not fall through to the upstream, it returns
503for the whole host, unauthenticated requests included. A network that forgot the manual step serves a dead faucet with nothing in the response pointing at the cause. One of ours has been in that state since it was deployed.Change
ingress.basicAuthtakes the htpasswd line. Set it and the chart creates<fullname>-basic-authand setsauth-type/auth-secretfor you; leave it empty and nothing changes.nginx accepts
user:{PLAIN}passwordas well as a hashed line, so deployments that resolve credentials from a secret store at sync time can pass the credential straight through without pre-hashing it.Compatibility
Additive, empty default, hence the minor bump to 1.2.0. Rendered with
--set ingress.enabled=trueand nobasicAuth:With
--set 'ingress.basicAuth=srv:{PLAIN}hunter2':helm lintclean, README regenerated withmake docs.