Move the au-syd1 haproxy edge into Kubernetes #485
Reference in New Issue
Block a user
Delete Branch "benvin/haproxy-app"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The au-syd1 edge proxy runs on a hand-managed LXD container outside the cluster, with no HA and no shared config source.
apps/base/haproxy/: 3 replicas behind the DMZ LoadBalancer 198.18.199.1, config from a ConfigMap, wildcard certs from reflected secrets.externalTrafficPolicy: Local;sessionAffinity: ClientIPstands in for the stick-table peers a Deployment cannot name.hard-stop-after 2m, a preStop SIGUSR1 soft-stop, 150s grace.apps/base/haproxy/configmap.yaml:187,199—be_ausyd1pve_apiandbe_ausyd1pve_webhave zeroserverlines. On the VM these are filled by exportedHaproxy::Balancermemberfromprofiles::proxmox::weblb(port 8006,cookie <hostname> ssl verify none check inter 2s rise 3 fall 2; api has no cookie). As writtenau-syd1-pve.main.unkin.netandau-syd1-pve-api.main.unkin.net503 → add the pve node servers.apps/base/haproxy/configmap.yaml:306—be_letsencryptis pinned to one host198.18.25.3:8888, butcertbot::initincludescertbot::haproxyso every certbot client in au-syd1-prod exports an:8888member. HTTP-01 renewals for the remaining VM certs break when that single host is down → list all certbot members or drop the backend if VM certbot is going away.apps/base/haproxy/configmap.yaml:480-484—listen statsbinds0.0.0.0:9090withstats auth admin:admincommitted in a ConfigMap; Puppet bound it to the node IP inside the DMZ, in-pod it is reachable from every pod in the cluster → drop the listener (metrics already on :8405) or move the credential to a Secret.apps/base/haproxy/configmap.yaml:120-133—haproxy -con 3.2.24 emits "acl 'acl_X' will never match because it only involves keywords that are incompatible with 'frontend http-response header rule'" for all 14acl_*, so noX-Frame-Optionsheader is ever set. Carried over from Puppet, but silently dead → set the host into a var in the request phase and test the var, or emit the header unconditionally.apps/base/haproxy/deployment.yaml— nopreStop/terminationGracePeriodSeconds. HAProxy treats SIGTERM as an immediate stop (soft stop is SIGUSR1), so every ConfigMap/cert reload cuts in-flight IMAP/SMTP sessions on all 3 replicas → add apreStopthat sends SIGUSR1 and raise the grace period pasttimeout client 5m, or sethard-stop-after.apps/base/haproxy/configmap.yaml:159—fe_metricssilently loses the Puppetssl crt /etc/pki/tls/vault/certificate.pembind; the exporter is now plaintext and unauthenticated on the pod network. Fine for a VMPodScrape, but it is not in the PR description.