-
Notifications
You must be signed in to change notification settings - Fork 37
Add GatewayAPI support & docs #395
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
mjudeikis
merged 2 commits into
kbind-dev:main
from
mjudeikis:mjudeikis/helm.prod.setup
Nov 27, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| {{- if .Values.gatewayApi.enabled }} | ||
| {{- if .Values.certManager.enabled }} | ||
| apiVersion: cert-manager.io/v1 | ||
| kind: Certificate | ||
| metadata: | ||
| name: {{ include "kube-bind.fullname" . }}-tls | ||
| labels: | ||
| {{- include "kube-bind.labels" . | nindent 4 }} | ||
| spec: | ||
| secretName: {{ include "kube-bind.fullname" . }}-tls | ||
| issuerRef: | ||
| name: {{ .Values.certManager.clusterIssuer }} | ||
| kind: ClusterIssuer | ||
| {{- if .Values.gatewayApi.route.hostnames }} | ||
| dnsNames: | ||
| {{- range .Values.gatewayApi.route.hostnames }} | ||
| - {{ . }} | ||
| {{- end }} | ||
| {{- end }} | ||
| --- | ||
| {{- end }} | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: Gateway | ||
| metadata: | ||
| name: {{ include "kube-bind.fullname" . }}-gateway | ||
| labels: | ||
| {{- include "kube-bind.labels" . | nindent 4 }} | ||
| {{- with .Values.gatewayApi.gateway.annotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| gatewayClassName: {{ .Values.gatewayApi.gateway.className }} | ||
| listeners: | ||
| - name: https | ||
| protocol: HTTPS | ||
| port: {{ .Values.gatewayApi.gateway.httpsPort | default 443 }} | ||
| tls: | ||
| mode: Terminate | ||
| certificateRefs: | ||
| {{- if .Values.certManager.enabled }} | ||
| - name: {{ include "kube-bind.fullname" . }}-tls | ||
| {{- else if .Values.gatewayApi.gateway.tls.certificateRefs }} | ||
| {{- range .Values.gatewayApi.gateway.tls.certificateRefs }} | ||
| - name: {{ .name }} | ||
| {{- if .namespace }} | ||
| namespace: {{ .namespace }} | ||
| {{- end }} | ||
| {{- if .group }} | ||
| group: {{ .group }} | ||
| {{- end }} | ||
| {{- if .kind }} | ||
| kind: {{ .kind }} | ||
| {{- end }} | ||
| {{- end }} | ||
| {{- end }} | ||
| - name: http | ||
| protocol: HTTP | ||
| port: {{ .Values.gatewayApi.gateway.httpPort | default 80 }} | ||
| --- | ||
| apiVersion: gateway.networking.k8s.io/v1 | ||
| kind: HTTPRoute | ||
| metadata: | ||
| name: {{ include "kube-bind.fullname" . }}-route | ||
| labels: | ||
| {{- include "kube-bind.labels" . | nindent 4 }} | ||
| {{- with .Values.gatewayApi.route.annotations }} | ||
| annotations: | ||
| {{- toYaml . | nindent 4 }} | ||
| {{- end }} | ||
| spec: | ||
| parentRefs: | ||
| - name: {{ include "kube-bind.fullname" . }}-gateway | ||
| {{- if .Values.gatewayApi.route.hostnames }} | ||
| hostnames: | ||
| {{- range .Values.gatewayApi.route.hostnames }} | ||
| - {{ . | quote }} | ||
| {{- end }} | ||
| {{- end }} | ||
| rules: | ||
| - matches: | ||
| - path: | ||
| type: {{ .Values.gatewayApi.route.pathType | default "PathPrefix" }} | ||
| value: {{ .Values.gatewayApi.route.path | default "/" }} | ||
| backendRefs: | ||
| - name: {{ include "kube-bind.fullname" . }} | ||
| port: {{ .Values.service.port }} | ||
| {{- end }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| --- | ||
| description: > | ||
| How to test changes made to kube-bind in your development environment. | ||
| weight: 30 | ||
| title: Testing Changes | ||
| --- | ||
|
|
||
| # Testing code changes | ||
|
|
||
| When making changes to kube-bind, it's important to test them in a realistic multi-cluster environment. | ||
|
|
||
| Follow [development setup instructions](../developers/development-setup/) to set up your development environment using kcp. | ||
| kcp allows you to simulate multiple clusters using logical clusters. | ||
|
|
||
|
|
||
| # Testing helm chart changes | ||
|
|
||
| By default, in helm chart, the backend component does not have TLS enabled, and the embedded OIDC server is not used. | ||
| To test changes related to TLS or OIDC, you need to enable them explicitly by setting the appropriate Helm values. | ||
|
|
||
| To test basic Helm-install flow you will need GatewayAPI enabled kubernetes cluster with cert-manager installed. | ||
| By default it will use TLS termination at the Gateway level. | ||
|
|
||
|
|
||
| ```bash | ||
| # Use a specific development version: | ||
| # VERSION=0.0.0-9fd9281e661c0d9a426a941111d3d8b08019ebc1 | ||
| ``` | ||
|
|
||
| And run full helm install command with additional parameters: | ||
| ```bash | ||
| helm upgrade \ | ||
| --install \ | ||
| --namespace kube-bind \ | ||
| --create-namespace \ | ||
| --set certManager.enabled=true \ | ||
| --set certManager.clusterIssuer=letsencrypt-prod \ | ||
| --set backend.oidc.issuerUrl=https://auth.genericcontrolplane.io \ | ||
| --set backend.oidc.clientId=platform-mesh \ | ||
| --set backend.oidc.clientSecret=Z2Fyc2lha2FsYmlzdmFuZGVuekWplCg== \ | ||
| --set backend.oidc.callbackUrl=https://kube-bind.genericcontrolplane.io/api/callback \ | ||
| --set gatewayApi.enabled=true \ | ||
| --set gatewayApi.gateway.className=nginx \ | ||
| --set gatewayApi.gateway.httpPort=80 \ | ||
| --set gatewayApi.gateway.httpsPort=443 \ | ||
| --set 'gatewayApi.gateway.tls.certificateRefs[0].name=backend-tls-cert' \ | ||
| --set 'gatewayApi.route.hostnames[0]=kube-bind.genericcontrolplane.io' \ | ||
| --set gatewayApi.route.path=/ \ | ||
| --set gatewayApi.route.pathType=PathPrefix \ | ||
| --set image.tag=${VERSION} \ | ||
| kube-bind \ | ||
| ./deploy/charts/backend | ||
| ``` | ||
|
|
||
| After the deployment at minimum url should be accessible: | ||
|
|
||
| ```bash | ||
| curl https://kube-bind.genericcontrolplane.io | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Kube Bind</title> | ||
| <script type="module" crossorigin src="./assets/index.41dda553.js"></script> | ||
| <link rel="stylesheet" href="./assets/index.952308d6.css"> | ||
| </head> | ||
| <body> | ||
| <div id="app"></div> | ||
|
|
||
| </body> | ||
| </html>% | ||
| ``` | ||
|
|
||
|
|
||
| # Local dev environment testing | ||
|
|
||
| If you changed helm charts and neet to test them in local development environment you can do the following: | ||
|
|
||
| ```bash | ||
| ./bin/kubectl-bind dev create --chart-path ./deploy/charts/backend | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.