Skip to content

feat(helm): render Twingate CRs instead of annotating the Gateway Service#332

Open
minhtule wants to merge 8 commits into
masterfrom
feat/mt/operator-cr-rendering
Open

feat(helm): render Twingate CRs instead of annotating the Gateway Service#332
minhtule wants to merge 8 commits into
masterfrom
feat/mt/operator-cr-rendering

Conversation

@minhtule

@minhtule minhtule commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Related Tickets & Documents

Changes

Conditionally render Twingate Custom Resources to integrate with Twingate k8s operator

Notes

⚠️ Do not release this before Twingate operator with Twingate/kubernetes-operator#1041 is released

minhtule added 3 commits June 11, 2026 15:26
Render TwingateGateway, TwingateCertificateAuthority, and an optional
in-cluster Kubernetes TwingateResource, gated behind
twingateOperator.gateway.enabled. The chart is the source of truth; the
operator reconciles the CRs to the Twingate backend.
The operator now reconciles the Twingate CRs the chart renders directly,
so the gateway.twingate.com Service annotations and the twingate.resource
values are removed. The in-cluster resource alias (TLS cert SAN) and the
data-plane kubernetes upstream block are now sourced from
twingateOperator.kubernetesResource instead.

BREAKING CHANGE: twingate.resource.* is removed; use
twingateOperator.gateway.enabled and twingateOperator.kubernetesResource.*.
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.18%. Comparing base (bdcbe83) to head (800eeaa).
⚠️ Report is 27 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #332      +/-   ##
==========================================
+ Coverage   86.07%   86.18%   +0.10%     
==========================================
  Files          40       40              
  Lines        2830     2830              
==========================================
+ Hits         2436     2439       +3     
+ Misses        269      265       -4     
- Partials      125      126       +1     
Flag Coverage Δ
integration 54.96% <ø> (+0.10%) ⬆️
unit 78.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 updates the Helm chart’s integration with the Twingate Kubernetes Operator by rendering Twingate Custom Resources (CRs) instead of annotating the Gateway Service, enabling a cleaner source-of-truth model and supporting operator-managed reconciliation.

Changes:

  • Introduces twingateOperator.gateway.enabled and twingateOperator.kubernetesResource.enabled flags and values docs/schema to gate CR rendering.
  • Adds a new twingate-cr.yaml template to render TwingateCertificateAuthority, TwingateGateway, and optional TwingateResource (Kubernetes API server).
  • Removes Service annotation-based resource integration and makes Service port configurable via service.port.

Reviewed changes

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

Show a summary per file
File Description
deploy/gateway/values.yaml Adds twingateOperator.* values and introduces service.port default.
deploy/gateway/values.schema.json Adds schema for twingateOperator.* values (operator/CR integration).
deploy/gateway/tests/twingate-cr_test.yaml New unit tests validating CR rendering and gating behavior.
deploy/gateway/tests/tls-secret_test.yaml Updates TLS regeneration test inputs to use twingateOperator.kubernetesResource.alias.
deploy/gateway/tests/service_test.yaml Removes tests for deprecated Service annotation-based integration.
deploy/gateway/tests/gateway-configmap_test.yaml Updates configmap tests to use twingateOperator.kubernetesResource.enabled.
deploy/gateway/tests/cert-manager_test.yaml Updates cert-manager SAN test inputs to use twingateOperator.kubernetesResource.alias.
deploy/gateway/templates/twingate-cr.yaml New template rendering Twingate CRs (CA, Gateway, optional Kubernetes Resource).
deploy/gateway/templates/service.yaml Removes Twingate resource annotations and uses service.port.
deploy/gateway/templates/gateway-configmap.yaml Switches “resource enabled” detection to twingateOperator.kubernetesResource.enabled.
deploy/gateway/templates/_helpers.tpl Updates resource alias helper to read from twingateOperator.kubernetesResource.alias.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deploy/gateway/tests/tls-secret_test.yaml
Comment thread deploy/gateway/tests/cert-manager_test.yaml
Comment thread deploy/gateway/tests/gateway-configmap_test.yaml
Comment thread deploy/gateway/tests/gateway-configmap_test.yaml
@minhtule minhtule marked this pull request as ready for review June 11, 2026 10:59
@minhtule minhtule requested review from clement0010 and ekampf June 11, 2026 11:00
Comment thread deploy/gateway/templates/twingate-cr.yaml

@clement0010 clement0010 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.

Fix & merge!

Comment thread deploy/gateway/templates/twingate-cr.yaml
Comment thread deploy/gateway/templates/twingate-cr.yaml
Comment thread deploy/gateway/templates/twingate-cr.yaml
Comment thread deploy/gateway/values.yaml
Comment thread deploy/gateway/values.yaml Outdated
# resource.twingate.com/alias: "myk8s.int"
# Any TwingateResource spec field passes straight through; the chart owns
# type/address/gatewayRef and defaults `name` to "<fullname> Kubernetes
# cluster". `alias` is also added to the auto-generated TLS cert SANs.

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.

If provided, alias is also added to the auto ...

Signed-off-by: Eran Kampf <205185+ekampf@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

This pull request is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the wontfix This will not be worked on label Jun 26, 2026
@minhtule minhtule removed the wontfix This will not be worked on label Jun 26, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

This pull request is stale because it has been open 5 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions Bot added the wontfix This will not be worked on label Jul 7, 2026
@minhtule minhtule removed the wontfix This will not be worked on label Jul 7, 2026
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.

4 participants