Skip to content

Wait for the Envoy proxy Deployment in the Gateway WAF tutorial - #2936

Merged
ctauchen merged 1 commit into
tigera:mainfrom
electricjesus:seth/gateway-waf-tutorial-wait-condition
Aug 21, 2026
Merged

Wait for the Envoy proxy Deployment in the Gateway WAF tutorial#2936
ctauchen merged 1 commit into
tigera:mainfrom
electricjesus:seth/gateway-waf-tutorial-wait-condition

Conversation

@electricjesus

Copy link
Copy Markdown
Member

Product Version(s):
Calico Enterprise 3.24 (both next and version-3.24-1; the two files were byte-identical, so the change is the same in each)

Issue:
None. Found while running the tutorial end to end on a fresh 3.24 cluster.

Link to docs preview:
To be added once the Netlify deploy preview builds. The page is calico-enterprise/threat/gateway-waf/tutorial.

SME review:

  • An SME has approved this change.

DOCS review:

  • A member of the docs team has approved this change.

Additional information:

Step 2 of the tutorial waits on the Gateway's Accepted condition, then step 3 immediately sends a request through the gateway. Accepted only means the Gateway passed validation. Envoy Gateway still has to create the Envoy proxy Deployment, and Envoy still has to finish starting, so that first request can fail with a connection error.

I hit this following the tutorial verbatim on a fresh cluster. The first request failed at 39 seconds of gateway pod age and returned 200 on a retry once Envoy had settled.

Timings I measured, with the Gateway applied at a known time and an in-cluster poller requesting the gateway service every 2 seconds:

signal time after the Gateway is applied
Gateway Accepted=True 2 s
Gateway listeners[0] Programmed=True 2 s
Gateway top-level Programmed never True on this cluster, stays False (AddressNotAssigned) with no load balancer provider
Envoy proxy Deployment Available=True 20.2 s
first successful request 21 s

So both Gateway conditions fire about 19 seconds too early to be useful as a readiness gate, and the Deployment's Available condition lands one second before traffic starts flowing.

The added command waits on the Deployment rather than the pod on purpose. kubectl wait resolves a label selector once and then watches only the objects it matched at that moment. A pod wait can latch onto a pod that is shutting down from an earlier attempt and then time out while the new pod is already serving. I reproduced that: a pod wait timed out after its full 180 seconds while the gateway was returning 200.

There is no race in the added command. Envoy Gateway creates the Deployment within 1 second of the Gateway apply, so the selector always matches something.

Tested on Calico Enterprise v3.24.0-3.0-calient-0.dev-1305-g13d6dbddb5fd, operator v1.45.0-0.dev-13-g5615c1ab5e8e, kubectl v1.35.2, on a GCP kubeadm cluster with no load balancer provider.

scripts/vale-lint.sh --no-exit --minAlertLevel=warning reports 0 errors, 0 warnings and 0 suggestions on both files.

Merge checklist:

  • Deploy preview inspected wherever changes were made
  • Build completed successfully
  • Test have passed

The tutorial sent its first request right after waiting on the Gateway's
Accepted condition. Accepted only means the Gateway passed validation, so
the request can land before Envoy is serving and fail with a connection
error.

Measured on a 3.24 cluster: Accepted goes True about 2 seconds after the
Gateway is applied, while the first successful request needs about 21
seconds. Waiting on the Envoy proxy Deployment's Available condition
returns at 20.2 seconds, one second before traffic starts flowing.
@electricjesus
electricjesus requested a review from a team as a code owner August 20, 2026 11:39
Copilot AI lite review requested due to automatic review settings August 20, 2026 11:39
@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview for calico-docs-preview-next ready!

Name Link
🔨 Latest commit 2a3e584
🔍 Latest deploy log https://app.netlify.com/projects/calico-docs-preview-next/deploys/6a86e7686728000008426175
😎 Deploy Preview https://deploy-preview-2936--calico-docs-preview-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 20, 2026

Copy link
Copy Markdown

Deploy Preview succeeded!

Name Link
🔨 Latest commit 2a3e584
🔍 Latest deploy log https://app.netlify.com/projects/tigera/deploys/6a870835413986050b27e791
😎 Deploy Preview https://deploy-preview-2936--tigera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 68 (🔴 down 26 from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Calico Enterprise Gateway WAF tutorial reliability by adding an explicit readiness gate for the Envoy proxy Deployment, reducing the chance that the first request test fails due to the proxy not being fully started yet.

Changes:

  • Add a kubectl wait --for=condition=Available step that waits for the Envoy proxy Deployment created for the Gateway.
  • Apply the same change to both the next (unversioned) and version-3.24-1 tutorial copies.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
calico-enterprise/threat/gateway-waf/tutorial.mdx Adds a wait step for the Envoy proxy Deployment to be Available before sending test traffic.
calico-enterprise_versioned_docs/version-3.24-1/threat/gateway-waf/tutorial.mdx Mirrors the same Deployment readiness wait step for the 3.24-1 versioned docs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +117 to +118
At this point `Accepted` only means Gateway passed validation. Let's now wait for the Envoy proxy
Deployment that Ingress Gateway creates:
Comment on lines +117 to +118
At this point `Accepted` only means Gateway passed validation. Let's now wait for the Envoy proxy
Deployment that Ingress Gateway creates:
@ctauchen

Copy link
Copy Markdown
Collaborator

LGTM, pending clean build. Are you ready to merge?

@ctauchen
ctauchen merged commit 0e2ab2e into tigera:main Aug 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants