Skip to content

Support provisioning of Gateway(s) in helm chart #3399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 27, 2025
Merged

Conversation

bjee19
Copy link
Contributor

@bjee19 bjee19 commented May 22, 2025

Proposed changes

Support provisioning of Gateway(s) in helm chart.

Problem: Users would like to provision a Gateway through the helm chart.

Solution: Support provisioning of Gateway(s) in helm chart.

Testing: Manually tested templating and installation of an example values.yaml file.

Closes #1533

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

Support provisioning Gateway resources through helm chart. 

@bjee19 bjee19 requested a review from a team as a code owner May 22, 2025 17:54
@github-actions github-actions bot added documentation Improvements or additions to documentation helm-chart Relates to helm chart labels May 22, 2025
Copy link

codecov bot commented May 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.77%. Comparing base (807ff92) to head (6ce4773).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3399      +/-   ##
==========================================
+ Coverage   86.74%   86.77%   +0.02%     
==========================================
  Files         129      129              
  Lines       14928    14928              
  Branches       62       62              
==========================================
+ Hits        12950    12954       +4     
+ Misses       1827     1823       -4     
  Partials      151      151              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bjee19
Copy link
Contributor Author

bjee19 commented May 22, 2025

With this example values.yaml file:

gateways:
  - name: "nginx-gateway"
    namespace: "default"
    labels:
      "key": "value"
      "keytwo": "valuetwo"
    annotations:
      "keyannotations": "valueannotations"
    spec:
      gatewayClassName: "nginx"
      infrastructure:
        annotations:
          service.annotations.networking.gke.io/load-balancer-type: Internal
      listeners:
        - name: "http"
          port: 80
          protocol: "HTTP"
        - name: "https"
          port: 443
          protocol: "HTTPS"
          tls:
            mode: Terminate
            certificateRefs:
              - kind: Secret
                name: cafe-secret
                namespace: certificate
          allowedRoutes:
            namespaces:
              from: Same
  - name: "nginx-gateway2"
    spec:
      gatewayClassName: "nginx"
      listeners:
        - name: "http1"
          port: 801
          protocol: "HTTP"

I get the following Gateway resources when printed out through helm template:

---
# Source: nginx-gateway-fabric/templates/gateway.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: nginx-gateway
  namespace: default
  labels:
    key: value
    keytwo: valuetwo
  annotations:
    keyannotations: valueannotations
spec:
  gatewayClassName: nginx
  infrastructure:
    annotations:
      service.annotations.networking.gke.io/load-balancer-type: Internal
  listeners:
    - name: http
      port: 80
      protocol: HTTP
    - name: https
      port: 443
      protocol: HTTPS
      allowedRoutes:
        namespaces:
          from: Same
      tls:
        certificateRefs:
        - kind: Secret
          name: cafe-secret
          namespace: certificate
        mode: Terminate
---
# Source: nginx-gateway-fabric/templates/gateway.yaml
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: nginx-gateway2
spec:
  gatewayClassName: nginx
  listeners:
    - name: http1
      port: 801
      protocol: HTTP
---

Also confirmed no gateways included in values.yaml, correctly does not produce a gateway object when deploying through helm.

Copy link
Collaborator

@sjberman sjberman left a comment

Choose a reason for hiding this comment

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

Nice work!

Copy link
Contributor

@salonichf5 salonichf5 left a comment

Choose a reason for hiding this comment

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

nice work !

@bjee19 bjee19 force-pushed the helm/provision-gateway branch from bffaeed to 6ce4773 Compare May 27, 2025 19:45
@bjee19 bjee19 merged commit f9fa98c into main May 27, 2025
76 of 77 checks passed
@bjee19 bjee19 deleted the helm/provision-gateway branch May 27, 2025 20:37
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in NGINX Gateway Fabric May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation helm-chart Relates to helm chart
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

helm: provisioning "gateway" support for nginx-gateway-fabric helm chart
5 participants