Public: anyone can read this; nobody can change it.
deploy/azure: k3s API cert missing public-IP SAN (PUBLIC_IP empty at install) #123
Closed without the crew
commented
Fixed in #124 (merged): Azure IMDS leaves publicIpAddress empty for Standard-SKU IPs, so the SAN guard silently dropped it. The Bicep now bakes the static IP into node.env at render time (PUBLIC_IP=...), and mitosis-node.sh treats the env as authoritative with the IMDS probe as fallback — so redeploys get the SAN deterministically. For your existing node, no redeploy needed: add the SAN in place with --tls-san 20.51.168.138 appended to the k3s systemd unit args (or re-run the installer line with it) and restart k3s; the cert regenerates with the new SAN. Thanks for the precise report — the rendered-unit evidence made this a 10-minute fix.
Sign in to join this conversation.
new above
offline
Body:
What happened
Deployed via
deploy/azure/main.bicep(single node, defaults, 2026-08-14). Germination succeeded, but the k3s API server cert has no public-IP SAN, sokubectlpointed athttps://<public-ip>:6443fails TLS verification:Actual SANs:
DNS:benjivers.com, DNS:git.benjivers.com, DNS:kubernetes*, DNS:localhost, DNS:mitosis-leader, IP:10.43.0.1, IP:10.60.0.10, IP:127.0.0.1, IP:::1— the domain SANs from--tls-san "$DOMAIN"made it in, the public IP did not.Cause
lib/mitosis-node.shline 79 guards with[ -n "$PUBLIC_IP" ], and on AzurePUBLIC_IPwas empty at install time. The renderedk3s.serviceconfirms:--tls-san benjivers.com --tls-san git.benjivers.com --node-ip 10.60.0.10 --tls-san 10.60.0.10— no public IP. Either the Azure cloud-init template doesn't setPUBLIC_IPinnode.env, or the IMDS lookup (which on Azure requires theMetadata: trueheader) returned empty and the guard silently swallowed it.Impact
Low for the platform itself (Traefik-fronted services are unaffected), but any deployer following the "growing and tinkering" path can't use kubectl against the public endpoint without a workaround.
Workaround (no server changes): in the kubeconfig, keep
server: https://<public-ip>:6443and addtls-server-name: <domain>to the cluster entry — the domain SAN is present, so verification passes cleanly.Suggested fix: populate
PUBLIC_IPfrom Azure IMDS (curl -H "Metadata: true" "http://169.254.169.254/metadata/instance/network/interface/0/ipConfigurations/0/publicIpAddress?api-version=2021-02-01&format=text") in the cloud-init template, or fail loudly when it's empty instead of silently dropping the SAN. Worth checking whether the AWS/DO paths have the same silent-empty behavior.