Skip to content

Commit 17c7e7e

Browse files
committed
fix(helm): preserve Gateway name defaults
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent fb2f340 commit 17c7e7e

8 files changed

Lines changed: 36 additions & 29 deletions

File tree

‎.agents/skills/helm-dev-environment/SKILL.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ cd ../../..
236236
KUBECONFIG=kubeconfig mise run helm:gateway:apply
237237
```
238238

239-
`values-gateway.yaml` creates the `openshell-ingress` `Gateway` (listener on
240-
port 80, class `eg`) and an `openshell` `GRPCRoute` in the `openshell`
241-
namespace. The `high-availability` profile
239+
`values-gateway.yaml` creates the `openshell` `Gateway` (listener on port 80,
240+
class `eg`) and an `openshell` `GRPCRoute` in the `openshell` namespace. The
241+
`high-availability` profile
242242
installs the Envoy Gateway Helm chart and layers both
243243
`values-high-availability.yaml` and `values-gateway.yaml` onto the OpenShell
244244
release.
@@ -258,7 +258,7 @@ as a real reverse proxy while gateway pods rotate behind it:
258258

259259
```bash
260260
KUBECONFIG=kubeconfig kubectl get svc -A \
261-
-l gateway.envoyproxy.io/owning-gateway-name=openshell-ingress
261+
-l gateway.envoyproxy.io/owning-gateway-name=openshell
262262
KUBECONFIG=kubeconfig kubectl -n <envoy-service-namespace> port-forward \
263263
svc/<envoy-service-name> 8080:80
264264
openshell gateway add http://127.0.0.1:8080 --name openshell --local

‎deploy/helm/openshell/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ discovery endpoint or its TLS CA.
372372
| grpcRoute.gateway.listener.port | int | `80` | Listener port for the generated Gateway resource. Use 443 with protocol HTTPS. |
373373
| grpcRoute.gateway.listener.protocol | string | `"HTTP"` | Listener protocol for the generated Gateway resource: HTTP or HTTPS. HTTPS terminates TLS at the Gateway listener; pair it with server.disableTls=true so the proxy forwards plaintext to the gateway pod, and use OIDC for client identity (the gateway never sees the client certificate). |
374374
| grpcRoute.gateway.listener.tls.certificateRefs | list | `[]` | certificateRefs for the HTTPS listener. Required when protocol is HTTPS. Each entry needs a `name` pointing at a kubernetes.io/tls Secret in the Gateway's namespace. May reference a cert-manager-issued Secret or the existing openshell-server-tls Secret (its SANs must include the external hostname). |
375-
| grpcRoute.gateway.name | string | `""` | Name of the Gateway resource. Defaults to `<fullname>-ingress`, which stays distinct from the OpenShell Service name. When gateway.create is false, set this to the name of the existing Gateway. |
375+
| grpcRoute.gateway.name | string | `""` | Name of the Gateway resource. Defaults to `<fullname>`. Set a distinct name when the selected controller creates a proxy Service with the Gateway name. When gateway.create is false, set this to the name of the existing Gateway. |
376376
| grpcRoute.gateway.namespace | string | `""` | Namespace of the Gateway referenced by the GRPCRoute parentRef. Defaults to the release namespace. A chart-created Gateway always resides in the release namespace. |
377377
| grpcRoute.gateway.sectionName | string | `""` | Listener name on an existing Gateway. Leave empty to let Gateway API listener matching select compatible listeners. |
378378
| grpcRoute.hostnames | list | `[]` | Hostnames the GRPCRoute matches on. Leave empty to match all hosts. |

‎deploy/helm/openshell/ci/values-gateway.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# Service (named envoy-<namespace>-<gateway-name>-*) in the openshell namespace.
1212
#
1313
# To reach the gateway from outside a k3d cluster, port-forward to that service:
14-
# kubectl -n openshell get svc -l gateway.envoyproxy.io/owning-gateway-name=openshell-ingress
14+
# kubectl -n openshell get svc -l gateway.envoyproxy.io/owning-gateway-name=openshell
1515
# kubectl -n openshell port-forward svc/<envoy-service> 8080:80
1616
# # then: grpcurl -plaintext localhost:8080 ...
1717

‎deploy/helm/openshell/templates/_helpers.tpl‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,11 @@ Create a default fully qualified app name.
2525
{{- end }}
2626

2727
{{/*
28-
Name of the Gateway API Gateway referenced by the GRPCRoute. Keep the default
29-
distinct from the OpenShell Service because some Gateway implementations name
30-
their generated proxy Service after the Gateway.
28+
Name of the Gateway API Gateway referenced by the GRPCRoute. Preserve explicit
29+
names unchanged because Gateway names may be longer than label values.
3130
*/}}
3231
{{- define "openshell.grpcRouteGatewayName" -}}
33-
{{- $fullname := include "openshell.fullname" . | trunc 55 | trimSuffix "-" -}}
34-
{{- default (printf "%s-ingress" $fullname) .Values.grpcRoute.gateway.name | trunc 63 | trimSuffix "-" -}}
32+
{{- default (include "openshell.fullname" .) .Values.grpcRoute.gateway.name -}}
3533
{{- end }}
3634

3735
{{/*

‎deploy/helm/openshell/tests/gateway_api_test.yaml‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ release:
1010
namespace: openshell
1111

1212
tests:
13-
- it: gives a chart-created Gateway a non-conflicting default name
13+
- it: preserves the chart fullname as the default Gateway name
1414
template: templates/gateway.yaml
1515
set:
1616
grpcRoute.enabled: true
1717
grpcRoute.gateway.create: true
1818
asserts:
1919
- equal:
2020
path: metadata.name
21-
value: openshell-ingress
21+
value: openshell
2222
- equal:
2323
path: spec.gatewayClassName
2424
value: eg
@@ -31,7 +31,7 @@ tests:
3131
asserts:
3232
- equal:
3333
path: spec.parentRefs[0].name
34-
value: openshell-ingress
34+
value: openshell
3535
- equal:
3636
path: spec.parentRefs[0].namespace
3737
value: openshell
@@ -64,16 +64,27 @@ tests:
6464
path: spec.gatewayClassName
6565
value: custom-class
6666

67-
- it: preserves the ingress suffix for a long chart fullname
67+
- it: preserves an explicit Gateway name longer than 63 characters
6868
template: templates/gateway.yaml
6969
set:
70-
fullnameOverride: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk
7170
grpcRoute.enabled: true
7271
grpcRoute.gateway.create: true
72+
grpcRoute.gateway.name: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
7373
asserts:
7474
- equal:
7575
path: metadata.name
76-
value: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabc-ingress
76+
value: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
77+
78+
- it: references an explicit Gateway name longer than 63 characters unchanged
79+
template: templates/grpcroute.yaml
80+
set:
81+
grpcRoute.enabled: true
82+
grpcRoute.gateway.create: true
83+
grpcRoute.gateway.name: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
84+
asserts:
85+
- equal:
86+
path: spec.parentRefs[0].name
87+
value: abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqr
7788

7889
- it: attaches to a listener on an existing Gateway
7990
template: templates/grpcroute.yaml

‎deploy/helm/openshell/values.yaml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,9 +693,10 @@ grpcRoute:
693693
# by your Gateway API implementation. Envoy Gateway uses "eg" in the
694694
# OpenShell examples. Ignored when gateway.create is false.
695695
className: "eg"
696-
# -- Name of the Gateway resource. Defaults to `<fullname>-ingress`, which
697-
# stays distinct from the OpenShell Service name. When gateway.create is
698-
# false, set this to the name of the existing Gateway.
696+
# -- Name of the Gateway resource. Defaults to `<fullname>`. Set a distinct
697+
# name when the selected controller creates a proxy Service with the
698+
# Gateway name. When gateway.create is false, set this to the name of the
699+
# existing Gateway.
699700
name: ""
700701
# -- Namespace of the Gateway referenced by the GRPCRoute parentRef.
701702
# Defaults to the release namespace. A chart-created Gateway always resides

‎docs/kubernetes/ingress.mdx‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ helm upgrade --install openshell \
6262
--set grpcRoute.gateway.className=eg
6363
```
6464

65-
The generated Gateway defaults to `<fullname>-ingress`, while the OpenShell Service keeps the `<fullname>` name. Keeping these names distinct avoids collisions with Gateway implementations that name their proxy Service after the Gateway.
66-
67-
<Note>
68-
Existing releases that created a Gateway under the previous `<fullname>` default can retain that resource name by setting `grpcRoute.gateway.name=<fullname>` before upgrading.
69-
</Note>
65+
The generated Gateway defaults to the chart fullname.
7066

7167
### Use another GatewayClass
7268

@@ -79,10 +75,11 @@ helm upgrade --install openshell \
7975
--namespace openshell \
8076
--set grpcRoute.enabled=true \
8177
--set grpcRoute.gateway.create=true \
82-
--set grpcRoute.gateway.className=<gateway-class>
78+
--set grpcRoute.gateway.className=<gateway-class> \
79+
--set grpcRoute.gateway.name=openshell-ingress
8380
```
8481

85-
For ingress, the OpenShell chart creates only the Gateway and GRPCRoute. Install and manage the selected controller, GatewayClass, and Gateway API CRDs separately.
82+
Some Gateway API implementations name their proxy Service after the Gateway. Set a distinct Gateway name, such as `openshell-ingress`, when the default would conflict with the OpenShell Service. For ingress, the OpenShell chart creates only the Gateway and GRPCRoute. Install and manage the selected controller, GatewayClass, and Gateway API CRDs separately.
8683

8784
### Use an existing Gateway
8885

@@ -107,7 +104,7 @@ The existing Gateway listener must allow routes from the OpenShell release names
107104
With the Envoy Gateway example above, the controller creates a LoadBalancer service in the `openshell` namespace. Wait for it to get an external address:
108105

109106
```shell
110-
kubectl -n openshell get svc -l gateway.envoyproxy.io/owning-gateway-name=openshell-ingress
107+
kubectl -n openshell get svc -l gateway.envoyproxy.io/owning-gateway-name=openshell
111108
```
112109

113110
For another Gateway API implementation or an existing Gateway, follow that implementation's instructions to find the external address.

‎skills/debug-openshell-cluster/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ credential failures.
10371037
| Sandbox remains `Stopping` or `Starting` | Driver stop/start failed, retained resource is missing, or a fresh supervisor has not connected | Gateway and driver logs; `docker inspect`, `podman inspect`, Agent Sandbox status/PVC, or VM state marker and launcher process |
10381038
| Image pull failure | Gateway or sandbox image cannot be pulled | Runtime events and image pull credentials |
10391039
| Gateway API resources fail with `the server could not find the requested resource` | Optional Gateway API resources were applied without Gateway API CRDs | Install the standard Gateway API CRDs and selected controller, then enable `grpcRoute` before applying the optional ingress resources |
1040-
| A custom GatewayClass does not program the chart-created Gateway, or its proxy Service conflicts with the OpenShell Service | The selected controller is unavailable, or an explicit `grpcRoute.gateway.name` reuses the OpenShell Service name | Check `kubectl get gatewayclass,gateway,grpcroute -A`; leave the Gateway name empty to use `<fullname>-ingress`, or set a distinct name. For an existing Gateway, set `gateway.create=false` plus `gateway.name`, `gateway.namespace`, and optional `gateway.sectionName` |
1040+
| A custom GatewayClass does not program the chart-created Gateway, or its proxy Service conflicts with the OpenShell Service | The selected controller is unavailable, or the default `grpcRoute.gateway.name` reuses the OpenShell Service name | Check `kubectl get gatewayclass,gateway,grpcroute -A`; set a distinct Gateway name such as `<fullname>-ingress`. For an existing Gateway, set `gateway.create=false` plus `gateway.name`, `gateway.namespace`, and optional `gateway.sectionName` |
10411041
| HTTPS ingress (`grpcRoute.gateway.listener.protocol=HTTPS`) connection resets or TLS handshake hangs | Envoy terminates TLS but the gateway pod still expects TLS, so the plaintext backend hop fails | Set `server.disableTls=true` so Envoy forwards plaintext to the pod; verify the listener `certificateRefs` Secret exists in the release namespace and `openshell status` over `https://<host>` |
10421042
| With `grpcRoute.replicaRouting.enabled=true`, sandbox SSH, forward, or exec still relay through a peer replica | A `<release>-replica-<i>` Service has no endpoint, so Envoy returns `Unavailable` and the CLI retries unrouted | `kubectl -n openshell get endpoints <release>-replica-0 <release>-replica-1`; confirm `workload.kind=statefulset` and the GRPCRoute status is `Accepted`/`ResolvedRefs` |
10431043
| HTTPS ingress returns `Unauthenticated` after connecting | TLS terminates at Envoy, so the gateway never sees a client cert; no OIDC issuer is configured for identity | Configure `server.oidc.issuer` and register with `openshell gateway add https://<host> --oidc-issuer <url>`, or set `server.auth.allowUnauthenticatedUsers=true` for a trusted-proxy/dev cluster |

0 commit comments

Comments
 (0)