
Goal & Abstract of Blog Post:

- Goal:
- Give phones a real HTTPS address, where each emailed link carries a signed expiring token for one chore, so the MVP is protected without a full login system.
- This finishes Envoy Gateway (HTTPS and rate limiting), adds Route 53 + ACM, and the Load Balancer Controller + NLB.

| Step | Repo / PR | Files | What and why |
|---|---|---|---|
| A: Find your DNS host | — | — | - nslookup -type=NS im-your-huckleberry.com shows where to add the NS records |
| B: Fall #3 carry-over | gitops | – Kyverno config – Argo app | – Exclude argocd from Kyverno’s webhooks, and ignoreDifferences for the image digest. – Do this before Fall #4 adds new controllers. |
| C: Long-lived DNS + certificate | infra · new bootstrap/dns/ (local state, like github-actions) | - versions.tf– main.tf– outputs.tf | – Route 53 zone cleanup.im-your-huckleberry.com– Plus an ACM cert for it and *.cleanup…, validated by DNS. – It survives rebuilds, so the NS records and cert never change. |
| D: Delegate the subdomain (one time) | your DNS host’s dashboard | — | – Add the 4 NS records Terraform outputs. – The cert then validates by itself. |
| E: Cluster-side AWS pieces | infra · cluster workspace | – vpc.tf (subnet elb tags)– new lb-controller.tf,– external-dns.tf | – IAM roles and Pod Identity for the Load Balancer Controller and ExternalDNS. – The LB controller is installed by Terraform, because it needs the VPC ID, which changes every rebuild. |
| F: Signing key | infra (same PR as 3) | – app-secrets.tf | – Add a link_signing_key alongside the admin token– write-only as before |
| G: Signed, expiring chore links | app | main.py, tests | – GET /c/{chore}?exp=&sig= verifies an HMAC signature and expiry. – POST /admin/links (admin-token protected) mints a link. – Tests for valid, expired and tampered links. |
| H: Open the front door | gitops | – EnvoyProxy – Gateway – HTTPRoute – new ExternalDNS app – rate-limit policy – ExternalSecret – Deployment tag | – EnvoyProxy becomes an internet-facing NLB with the ACM cert. – The hostname becomes the real one, HTTP redirects to HTTPS, /c/ is routed, – Envoy rate-limits, and ExternalDNS owns the record. |
| I: Prove it (one session) | — | — | – DNS resolves – Cert is valid – HTTP redirects – The signed link works while expired and tampered ones fail – Rate limit returns 429 – Opens phone |
| J: Teardown, carefully | — | — | – Remove the NLB before terraform destroy. – An orphaned NLB keeps costing money and blocks the VPC from being deleted. |
Step A: Find your DNS host
========nslookup -type=NS im-your-huckleberry.com========
Step B: Previous blog post carry-over
- Kyverno must never be able to lock out Argo CD again, but Argo showed every app
Syncedafter Kyverno pinned it. - Server-side apply doesn’t count fields Kyverno owns as drift, adding
ignoreDifferencesonimagewould actually break deploys - Sources:
| Policy | Mode | Change |
|---|---|---|
disallow-latest-tag, disallow-privilege-escalation, disallow-privileged | Deny | Add argocd and kyverno to their excluded namespaces. Keep Fail |
disallow-host-namespaces, require-drop-all-capabilities, require-run-as-nonroot, require-labels, require-resource-limits | Audit | Add failurePolicy: Ignore. An Audit policy never blocks anything, so it shouldn’t block when Kyverno is down either |
verify-say-when-image | Deny, say-when only | No change: it’s scoped to one namespace |
Audit policies: don’t block when Kyverno is unreachable
- Handful of files under
gitops/apps/kyverno/policies
- 4 files changed
- apps/kyverno/policies/disallow-host-namespaces.yaml
- apps/kyverno/policies/require-drop-all-capabilities.yaml
- apps/kyverno/policies/require-labels.yaml
- apps/kyverno/policies/require-resource-limits.yaml
- apps/kyverno/policies/require-run-as-nonroot.yaml
spec: failurePolicy: Ignore
- 3 files changed
- apps/kyverno/policies/disallow-latest-tag.yaml
- apps/kyverno/policies/disallow-privilege-escalation.yaml
- apps/kyverno/policies/disallow-privileged.yaml
========spec: values: - argocd - kyverno========
Step C: Long-lived DNS + certificate
- In a new
bootstrap/dns/stack. It follows the same pattern asbootstrap/github-actions:- Applied from laptop with local state
- Survives every cluster rebuild.
- That matters for two reasons:
- The NS records at WordPress.com never change.
- If the zone were recreated each session, Route 53 would assign new name servers every time.
- The certificate stays valid, and ACM renews it automatically.
- The NS records at WordPress.com never change.

Long-lived DNS + TLS for the Say When app
- Applied once, like bootstrap/github-actions & survives every cluster rebuild.
- So the NS delegation at WordPress.com & certificate never change.
- ExternalDNS (in the cluster) writes the app’s recordninto this zone each session.
- Sources:
| Choice | Why |
|---|---|
| A delegated subdomain, not the whole domain | The blog, www and email stay at WordPress.com. Only cleanup.… is answered by Route 53. |
force_destroy = false | The zone’s name servers live in WordPress.com’s settings. Deleting the zone by accident would break the delegation. |
| Apex plus wildcard on one cert | cleanup.… for the app now, and *.cleanup.… for anything later (like Grafana) without a new certificate. |
| DNS validation | ACM renews automatically for as long as the validation CNAME exists, with no emails to click. |
aws_acm_certificate_validation | Makes terraform apply wait until the cert is actually issued, so its ARN is only output once it’s usable. |
- Apply in 2 passes:
- The certificate can’t validate until WordPress.com points
cleanupat Route 53, so the zone comes first:
- The certificate can’t validate until WordPress.com points
========terraform init========terraform fmt && terraform validate========terraform apply -target=aws_route53_zone.cleanup========
-targetapplies just the zone. It expects1 to add: typeyes.- Terraform warns that
-targetis for exceptional cases. That’s expected, and this is one of them.
========terraform output name_servers========
infra/bootstrap/dns/variables.tf:
- Mainly use examples in documentation
infra/bootstrap/dns/main.tf:
- Mainly use example in documentation
infra/bootstrap/dns/outsputstf:
- Mainly use example in documentation
Step D: Delegate the subdomain (one time) cleanup to Route 53 at WordPress.com.
- Add X # of DNS Records under NS
========nslookup -type=NS cleanup.im-your-huckleberry.com ns1.wordpress.com========nslookup -type=SOA cleanup.im-your-huckleberry.com 8.8.8.8========terraform apply========aws acm describe-certificate --region us-east-1 \ --certificate-arn "$(terraform output -raw certificate_arn)" \ --query 'Certificate.{status:Status,names:SubjectAlternativeNames}' --output json========cp terraform.tfstate ~/Documents/cluster-app/tfstate-backups/dns-$(date +%Y%m%d-%H%M).tfstate========

Step E: Cluster-Side AWS Pieces – Load Balancer Controller & ExternalDNS
- Purpose:
- Table below
- Sources:
| File | What | Why |
|---|---|---|
vpc.tf (edit) | Tag the public subnets kubernetes.io/role/elb = 1 | Tells the Load Balancer Controller where it may place an internet-facing NLB |
policies/aws-load-balancer-controller-iam-policy.json (new) | AWS’s official IAM policy for the controller | Downloaded from the exact release you install, so the permissions match |
lb-controller.tf (new) | IAM role, Pod Identity, and Helm install of the controller | Installed by Terraform, not Argo, because its chart needs the VPC ID, which changes every rebuild. Terraform knows it, but Git doesn’t. |
external-dns.tf (new) | IAM role and Pod Identity for ExternalDNS | It may edit records only in your cleanup.… zone. The app itself goes in via GitOps in step 6. |
app-secrets.tf (edit) | Add a link_signing_key | The key the app uses to sign chore links (step 5) |
Why built this way
| Choice | Why |
|---|---|
The controller via Terraform helm_release | Its chart needs vpcId, which changes every rebuild. Argo CD reads static Git, while Terraform has the live value. It’s the same reasoning as Argo CD’s own install. |
| The official IAM policy file, pinned to the installed release | That policy is long and changes between releases. Copying it for the exact version avoids “AccessDenied on some new API” surprises. |
| ExternalDNS may change one zone | It can’t touch any other DNS in your account. The two discovery calls can’t be scoped, and grant no write access. |
data "aws_route53_zone" | The zone belongs to bootstrap/dns. This workspace only looks it up, the same pattern as the ECR repo in Fall #3. |
replicaCount = 1 | Lab-sized. The chart’s default is 2. |
infra/vpc.tf
- Tells the Load Balancer Controller where it may place an internet-facing NLB
======== public_subnet_tags = { # Karpenter EC2NodeClass discovers both east subnets. "karpenter.sh/discovery" = local.eks_east_name # AWS Load Balancer Controller may place internet-facing # load balancers (the Fall #4 NLB) in these subnets. "kubernetes.io/role/elb" = "1" }========
infra/policies/aws-load-balancer-controller-iam-policy.json
- Pick the controller version and fetch its IAM policy
- The same method as the Argo CD upgrade: look the version up, don’t guess it.
- This time no placeholders cuz the version goes straight into variables.
- This is how AWS’s own install guide does it:
- Downloads the controller’s IAM policy pinned to a release tag
-
curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.14.1/docs/install/iam_policy.json.
-
- Downloads the controller’s IAM policy pinned to a release tag
- The version Helm reports is utilized instead of a hardcoded one. The controller has also supported this setup for a while: its release notes list support for EKS pod identities.
infra/lb-controller.tf
- Purpose:
- Turns the Envoy Gateway’s LoadBalancer Service into an internet-facing NLB with the ACM certificate.
- Installed by Terraform (not Argo CD) because the chart needs the VPC ID, which changes on every rebuild.
- IAM policy is the official file for this exact controller release (policies/aws-load-balancer-controller-iam-policy.json).
- Basically what hah happen wuzzz…:
- Add policy
- Add eks podID
- Helm repo add of LB
- Helm install
- Curl crds
- Sources:
infra/external-dns.tf
- Purpose:
- ExternalDNS AWS permish only permits itself to be installed by Argo CD (gitops repo).
- Reads the HTTPRoute’s hostname and the Gateway’s NLB address
- Keeps the Route 53 record in the long-lived zone (bootstrap/dns) pointing at whatever NLB exists this session.
- It may change records ONLY in cleanup.im-your-huckleberry.com.
- ExternalDNS AWS permish only permits itself to be installed by Argo CD (gitops repo).
- Sources:
Step F: Signed key
infra/app-secrets.tf
- External Secrets’ IAM policy doesn’t change: it’s still the same secret, now with two keys.
========# Signs chore links (HMAC-SHA256). 64 letters and digits.ephemeral "random_password" "say_when_link_signing_key" { length = 64 special = false}========{ secret_string_wo = jsonencode({ admin_token = ephemeral.random_password.say_when_admin_token.result link_signing_key = ephemeral.random_password.say_when_link_signing_key.result }) secret_string_wo_version = 2}========
Step G: Signed, expiring chore links. & .py stuff
- Sources:

| Choice | Why |
|---|---|
HMAC over chore_id.exp | Both are inside the signature. Change the chore or extend the expiry, and the link breaks. |
| Signature checked before expiry | A forged link always gets 403 and learns nothing. Only a genuine old link gets the friendlier 410 Gone. |
compare_digest again | The same constant-time comparison as the admin token. |
| Minting is admin-only and internal | /admin/links isn’t on the public route. Only you, via port-forward (and in Fall #9 the notifier), can create links. |
| TTL default 1 day, max 7 | Short-lived links limit the damage if an email gets forwarded. |
| Key read per request | Rotate it in Secrets Manager and all old links stop working, with no restart. That’s a built-in “revoke everything”. |
========pytest -qapp/test_main.py::test_healthzapp/test_main.py::test_chores_file_has_ten_valid_choresapp/test_main.py::test_get_one_choreapp/test_main.py::test_unknown_chore_is_404app/test_main.py::test_metrics_counts_requestsapp/test_main.py::test_admin_not_configured_is_503app/test_main.py::test_admin_wrong_or_missing_token_is_401app/test_main.py::test_admin_right_token_is_200app/test_main.py::test_admin_token_rotation_needs_no_restarttests/test_main.py::test_healthztests/test_main.py::test_chores_file_has_ten_valid_chorestests/test_main.py::test_get_one_choretests/test_main.py::test_unknown_chore_is_404tests/test_main.py::test_metrics_counts_requests14 passed, 1 warning ========

========aws ecr describe-images --repository-name say-when-app \ --image-ids imageTag=d1d2 \ --query 'imageDetails[0].imagePushedAt' --output text 2026-12-02T14:55:39.449000-06:00========
Step H: Open the front door – Gitops
- EnvoyProxy becomes an internet-facing NLB with the ACM cert.
- The hostname becomes the real one, HTTP redirects to HTTPS,
/c/is routed, - Envoy rate-limits, and ExternalDNS owns the record.
| Choice | Why |
|---|---|
| TLS at the NLB (ACM cert) | Free and auto-renewing. AWS handles the certificate, and nothing secret is stored in the cluster. |
loadBalancerClass: service.k8s.aws/nlb + nlb-target-type: ip | The LB controller, not the old in-tree code, builds the NLB, and it sends traffic straight to the Envoy pods’ IPs, skipping an extra hop through the nodes. |
ssl-negotiation-policy: …TLS13-1-2… | Modern TLS only: TLS 1.3 and 1.2, no legacy ciphers. |
https listener = HTTP protocol on 443 | TLS already ended at the NLB, so Envoy sees plain HTTP on that port. |
The http listener only accepts routes from its own namespace | The app can’t serve unencrypted traffic, even by mistake. Only the platform’s redirect can attach there. |
301 redirect | Permanent, so browsers remember to use https next time. |
| Rate limit on the Gateway, Local, 60/min | It protects everything behind the front door, with no Redis. The tradeoff: with TLS ending at the NLB, Envoy can’t see the real client IP, so it’s one shared budget, not per visitor. That’s fine for a family app, and it’s noted for the post. |
Get the Cert ARN from bootstrap/dns:
========cd ~/infra/bootstrap/dnsCERT_ARN=$(terraform output -raw certificate_arn)echo "$CERT_ARN" ========
Gitops – Gateway Side
apps/envoy-gateway-config/say-when-gateway.yaml
- Sources:
- Important to note
- 60 requests/minute for the whole front door: plenty for one family’s chores, and a flood gets 429 before it reaches the app.
| Piece | What it does |
|---|---|
EnvoyProxy → LoadBalancer + NLB annotations | – The Load Balancer Controller builds an internet-facing NLB. – Port 443 uses TLS with your ACM cert – Envoy receives plain HTTP inside the VPC |
| Gateway → two listeners on the real hostname | – https (443): the app attaches here. – http (80): reserved for the redirect only |
| Redirect HTTPRoute (new) | – Anything on http:// gets 301 → https:// |
| BackendTrafficPolicy (new) | – Envoy rate-limits the whole front door. – A flood gets 429 Too Many Requests before it ever reaches the app |
Gitops – ExternalDNS Side
apps/external-dns/values.yaml
- ExternalDNS keeps cleanup.im-your-huckleberry.com (Route 53, owned by say_when_infra/bootstrap/dns) pointing at whatever NLB exists this session.
- It reads hostnames from HTTPRoutes and the address from their Gateway.
- AWS access:
- EKS Pod Identity (say_when_infra external-dns.tf), limited to this one zone.
- Sources:
applications/platform/external-dns.yaml
- Source:
applications/projects/lab-projects.yaml
========spec: sourceRepos: - https://kubernetes-sigs.github.io/external-dns/========destinations: - namespace: external-dns server: https://kubernetes.default.svc======== namespaceResourceWhitelist: # EnvoyProxy is an Envoy Gateway configuration resource. - group: gateway.envoyproxy.io kind: EnvoyProxy # BackendTrafficPolicy is an Envoy Gateway configuration resource. - group: gateway.envoyproxy.io kind: BackendTrafficPolicy========
Gitops – App HTTP Side
apps/say-when-app/httproute.yaml
- Purpose:
- Attach the app to the platform’s say-when Gateway (https listener only) and allow-list the public paths.
- /c/ is the signed chore-link page that phones open from email
- /admin and /metrics are deliberately NOT routed: internal only.
- Sources:
========spec: parentRefs: sectionName: https hostnames: - cleanup.im-your-huckleberry.com======== rules: - matches: - path: type: PathPrefix value: /c/========
apps/say-when-app/externalsecret.yaml
- Purpose:
- Copy the app’s settings from Secrets Manager (say-when/app/settings) into a Kubernetes Secret the Deployment mounts as files:
- admin_token
- /admin/status
- /admin/links (Fall #3) link_signing_key
- signs chore links (Fall #4)
- Argo CD manages this ExternalSecret; ESO creates and owns the Secret so neither value ever appears in Git or in Argo CD.
- Copy the app’s settings from Secrets Manager (say-when/app/settings) into a Kubernetes Secret the Deployment mounts as files:
- Sources:
========
data:
- secretKey: link_signing_key
remoteRef:
key: say-when/app/settings
property: link_signing_key
========
apps/say-when-app/deployment.yaml
========image: 026090519635.dkr.ecr.us-east-1.amazonaws.com/say-when-app:d1d27fd19e95bf4fc67d04206868dd72e2d59517========- name: LINK_KEY_FILE value: /etc/say-when/secrets/link_signing_key========items:- key: admin_token path: admin_token- key: link_signing_key path: link_signing_key========yamllint -c .yamllint.yaml apps applications && echo "LINT OK"LINT OK========git status --short M applications/lab/projects/lab-platform.yaml M apps/envoy-gateway-config/say-when-gateway.yaml M apps/say-when-app/deployment.yaml M apps/say-when-app/externalsecret.yaml M apps/say-when-app/httproute.yaml?? applications/lab/platform/external-dns.yaml?? apps/external-dns/========
Step I: Spin up Cluster
- DNS resolves
- Cert is valid
- HTTP redirects
- The signed link works while expired and tampered ones fail
- Rate limit returns 429
- Opens phone
Part 1: HCP $tuff
- About 25 minutes
helm_release.aws_load_balancer_controlleraws_eks_pod_identity_association.lbcand.external_dns- the
kubernetes.io/role/elbsubnet tags - the secret version 2
- Confirm promptly. If the plan fails with the 401 or expired-token error, re-run it once. That’s the known cold-start issue.
========aws eks update-kubeconfig --name say-when-east --region us-east-1========kubectl get nodes -L eks.amazonaws.com/capacityType========
Part 2: Argo is Green as $$$
- About 10 minutes
- In CLI or K9s:
- Wait for everything to be Synced/Healthy, including the new
external-dns, then press Ctrl+C. Then check last week’s Kyverno fix is live:
- Wait for everything to be Synced/Healthy, including the new

========kubectl -n argocd get applications -w========kubectl get validatingpolicy require-labels -o jsonpath='{.spec.failurePolicy}{"\n"}'========kubectl get validatingpolicy disallow-privileged -o jsonpath='{.spec.matchConstraints.namespaceSelector.matchExpressions[0].values}{"\n"}'========

Part 3: NLB Appears to be ALIVE!!
- About 5 minutes
- In CLI or K9s

========kubectl -n kube-system get deploy aws-load-balancer-controller ========kubectl -n envoy-gateway-system get svc -l gateway.envoyproxy.io/owning-gateway-name=say-when -w========


- Wait until EXTERNAL-IP shows a hostname like
k8s-envoyga-…elb.us-east-1.amazonaws.com, which usually takes 1–3 minutes. Then press Ctrl+C. - Expect an
internet-facingnetworkload balancer,active, with listeners 443 TLS (your cert ARN) and 80 TCP.
========aws elbv2 describe-load-balancers --region us-east-1 \ --query 'LoadBalancers[].{name:LoadBalancerName,scheme:Scheme,state:State.Code,type:Type}' --output tableLB_ARN=$(aws elbv2 describe-load-balancers --region us-east-1 --query 'LoadBalancers[0].LoadBalancerArn' --output text)------------------------------------------------------------------------------| DescribeLoadBalancers |+-----------------------------------+-------------------+---------+----------+| name | scheme | state | type |+-----------------------------------+-------------------+---------+----------+| k8s-envoygat-envoyenv-1 | internet-facing | active | network |+-----------------------------------+-------------------+---------+----------+========aws elbv2 describe-listeners --region us-east-1 --load-balancer-arn "$LB_ARN" \ --query 'Listeners[].{port:Port,protocol:Protocol,cert:Certificates[0].CertificateArn}' --output table========
========aws elbv2 describe-listeners --region us-east-1 --load-balancer-arn "$LB_ARN" \ --query 'Listeners[].{port:Port,protocol:Protocol,cert:Certificates[0].CertificateArn}' --output table-------------------------------------------------------------------------------------------------------------| DescribeListeners |+---------------------------------------------------------------------------------------+-------+-----------+| cert | port | protocol |+---------------------------------------------------------------------------------------+-------+-----------+| arn:aws:acm:us-east-1:026 | 443 | TLS || None | 80 | TCP |========
Part 4: DNS
- About 5 – 10 minutes
- In CLI or K9s
========kubectl -n external-dns logs deploy/external-dns --since=10m | grep -iE "desired change|CREATE|UPSERT|error" | tail -10ZONE=$(aws route53 list-hosted-zones-by-name --dns-name cleanup.im-your-huckleberry.com --query 'HostedZones[0].Id' --output text)========aws route53 list-resource-record-sets --hosted-zone-id "$ZONE" \ --query 'ResourceRecordSets[].{name:Name,type:Type}' --output table========---------------------------------------------------------------------------------| ListResourceRecordSets |+----------------------------------------------------------------------+--------+| name | type |+----------------------------------------------------------------------+--------+| cleanup.im-your-huckleberry.com. | A || cleanup.im-your-huckleberry.com. | AAAA || cleanup.im-your-huckleberry.com. | NS || cleanup.im-your-huckleberry.com. | SOA || _e68596c15f8e1f4b0ed1c5bb6a327cdf.cleanup.im-your-huckleberry.com. | CNAME || edns-a.cleanup.im-your-huckleberry.com. | TXT || edns-aaaa.cleanup.im-your-huckleberry.com. | TXT |+----------------------------------------------------------------------+--------+
- Expect an
Arecord forcleanup.im-your-huckleberry.com.(an alias to the NLB), theedns-…TXT ownership markers, and the ACM validation CNAME, untouched. Only now check public DNS: - Both should return the NLB’s IP addresses.
========nslookup cleanup.im-your-huckleberry.com ns-32.awsdns-04.com========nslookup cleanup.im-your-huckleberry.com 8.8.8.8========

Part 5: HTTPS end to end
- About 5 minutes
- In CLI or K9s
- Expect:
- the cert’s
subject: CN=cleanup.im-your-huckleberry.com, issued by Amazon - TLS 1.3
{"version":"d1d27fd…"}301, withlocation: https://…- 404 for both
/metricsand/admin/status, since they’re internal only
- the cert’s
- Expect:
========curl -sv https://cleanup.im-your-huckleberry.com/version 2>&1 | grep -E "subject:|issuer:|SSL connection|HTTP/2|HTTP/1.1 [0-9]|version"========curl -sI http://cleanup.im-your-huckleberry.com/version | grep -iE "^HTTP|^location"========curl -s -o /dev/null -w '/metrics → %{http_code}\n' https://cleanup.im-your-huckleberry.com/metrics========curl -s -o /dev/null -w '/admin/status → %{http_code}\n' https://cleanup.im-your-huckleberry.com/admin/status========

- Does it work?
- Then open https://cleanup.im-your-huckleberry.com/docs in your browser. It should show the padlock.

Part 6: Signed Links
- About 10 minutes
- In CLI or K9s
- The headline moment.
- Mint a link internally, then open it from your phone
Open private door to app
========kubectl -n say-when port-forward svc/say-when-app 8081:8080 >/dev/null 2>&1 &sleep 3curl -s localhost:8081/healthz; echo========
Get Admin Toke
========TOKEN=$(aws secretsmanager get-secret-value --secret-id say-when/app/settings \ --query SecretString --output text | python3 -c 'import json,sys; print(json.load(sys.stdin)["admin_token"])')echo "token length: ${#TOKEN}" # → 48========
Mint it up – Link for 1 Chore
- What that request does:
-X POSTmeans “create something”.X-Admin-Tokenproves you’re the admin.-d '{…}'asks for a link to the rake-leaves chore, valid for 60 minutes.
========curl -s -X POST localhost:8081/admin/links \ -H "X-Admin-Token: $TOKEN" \ -H 'Content-Type: application/json' \ -d '{"chore_id":"rake-leaves","ttl_minutes":60}'echo========
Saved URL into a Variable
========LINK=$(curl -s -X POST localhost:8081/admin/links -H "X-Admin-Token: $TOKEN" \ -H 'Content-Type: application/json' -d '{"chore_id":"rake-leaves","ttl_minutes":60}' \ | python3 -c 'import json,sys; print(json.load(sys.stdin)["url"])')echo "$LINK"========
Open the REALLLL Front Door
- That goes out over the internet, through DNS → NLB (HTTPS) → Envoy → app, and should return the rake-leaves chore plus
expires_at. - You can also paste
$LINKstraight into your browser.
========curl -s "$LINK"; echo========{"chore":{"id":"rake-leaves","name":"Rake leaves","expect":["Rake","Leaf"],"reject":["Basketball","Sports Ball"],"min_confidence":80},"expires_at":1796422771}
BREAK IT / TAMPER IT / DO SOMETHIN DAWWG
- Both should give 403.
${LINK/rake-leaves/last-mow}swaps the chore name in the link. The signature was made forrake-leaves, so it no longer matches.${LINK%%&sig=*}&sig=deadbeefreplaces the signature with a fake one.
========curl -s -o /dev/null -w 'other chore → %{http_code}\n' "${LINK/rake-leaves/last-mow}"========curl -s -o /dev/null -w 'no signature → %{http_code}\n' "${LINK%%&sig=*}&sig=deadbeef"========other chore → 403no signature → 403
Open on Phone aka the $ Shot Homie G
- Paste it into a text or email to yourself. On your phone, turn Wi-Fi off so it uses mobile data, then tap the link. You should see the rake-leaves chore, with the padlock.
========echo -n "$LINK"========https://cleanup.im-your-huckleberry.com/c/rake-leaves?exp=1796422771&sig=0bf6bd1ec81ab24a47207ad8ab78b40629be22fb9d80fd2e095201d3c63e0cd9

- The link went out over the internet, through:
- Route 53 → NLB (HTTPS with your ACM cert) → Envoy → the app.
- The app checked the signature and expiry and returned the rake-leaves chore.

- Reading it piece by piece:
/c/rake-leaves: the chore this link is forexp=1796422771: the expiry in Unix seconds, about an hour after you minted itsig=0bf6…cd9: the HMAC-SHA256 signature overrake-leaves.1796422771, made with your secret key- The response contains the chore plus
expires_at, and never the key

Part 7: Rate Limit
- About 2 minutes
- Expect roughly 60 ×
200, then429for the rest. The limit covers the whole front door, so wait a minute before testing anything else.
========for i in $(seq 1 75); do curl -s -o /dev/null -w '%{http_code}\n' https://cleanup.im-your-huckleberry.com/healthz; done | sort | uniq -c======== 71 200 4 429
- The rate limit works: 4 requests got
429 Too Many Requests, refused by Envoy at the front door before they reached the app. - Why 71 and not about 60: Envoy’s local limiter is a token bucket. It holds 60 tokens and refills them all every minute on its own clock, not when your loop starts. Your loop probably straddled a refill:
Step J: Teardown, carefully
Teardown: ⚠️ the order matters
- The trap:
- Terraform installed the LB controller, so
terraform destroywould remove it before it could delete the NLB. - The NLB would then be orphaned, keep billing, and block the VPC from being deleted.
- And if you just delete the Gateway, Argo would recreate it within seconds.
- Terraform installed the LB controller, so
- So: pause Argo, remove the front door, confirm the NLB is gone, then destroy.
========kill $(jobs -p) 2>/dev/null; unset TOKEN LINK SHORT========# 1. Pause ALL Argo CD syncing (no self-heal while we take things apart)kubectl -n argocd scale statefulset argocd-application-controller --replicas=0========# 2. Remove the Gateway: Envoy deletes its Service, then the LB controller deletes the NLBkubectl -n envoy-gateway-system delete gateway say-when========# 3. Wait until the NLB is gone (about 1-3 min)watch -n 15 "aws elbv2 describe-load-balancers --region us-east-1 --query 'length(LoadBalancers)' --output text"========
- Wait until it prints
0, then press Ctrl+C. ExternalDNS should also remove its record:- Only
NS,SOAand the ACMCNAMEshould remain. If theArecord lingers, it’s harmless: next session overwrites it.
- Only
========aws route53 list-resource-record-sets --hosted-zone-id "$ZONE" --query 'ResourceRecordSets[].{name:Name,type:Type}' --output table========---------------------------------------------------------------------------------| ListResourceRecordSets |+----------------------------------------------------------------------+--------+| name | type |+----------------------------------------------------------------------+--------+| cleanup.im-your-huckleberry.com. | NS || cleanup.im-your-huckleberry.com. | SOA || _e68596c15f8e1f4b0ed1c5bb6a327cdf.cleanup.im-your-huckleberry.com. | CNAME |
Destroy HCP
- Now destroy: HCP → queue destroy plan → Confirm.
- Remove the NLB before
terraform destroy. - An orphaned NLB keeps costing money and blocks the VPC from being deleted.
Afterwards…
========aws elbv2 describe-load-balancers --region us-east-1 --query 'length(LoadBalancers)' --output text # → 0========aws ec2 describe-volumes --region us-east-1 --filters Name=status,Values=available \ Name=tag:kubernetes.io/created-for/pvc/namespace,Values=monitoring --query 'Volumes[].VolumeId' --output text========