This repository was archived by the owner on Jan 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Support running additional routers #157
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
10034c2
Handle namespace consistently
NickCao e25bd70
Add additionalRouters field to value schema
NickCao 6f99f24
Fix reloading controller on config change
NickCao fb3a007
Pass router information to controller cm
NickCao 72731d5
Add deployment for additional routers
NickCao e83df05
Add addtional router ingress and route
NickCao 3c2e36d
Add additional router service
NickCao 8b238e2
Update deploy/helm/jumpstarter/charts/jumpstarter-controller/template…
NickCao 995cefd
Update deploy/helm/jumpstarter/charts/jumpstarter-controller/template…
NickCao f31e82c
Update deploy/helm/jumpstarter/charts/jumpstarter-controller/template…
NickCao 3556b41
Fixup additional router ingress
NickCao 0c75561
Merge branch 'main' into router-new
mangelajo 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
Some comments aren't visible on the classic Files Changed page.
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
111 changes: 111 additions & 0 deletions
111
...elm/jumpstarter/charts/jumpstarter-controller/templates/additional-router-deployment.yaml
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,111 @@ | ||
| {{ range $k, $v := .Values.grpc.additionalRouters }} | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: jumpstarter-router-{{ $k }} | ||
| namespace: {{ default $.Release.Namespace $.Values.namespace }} | ||
| labels: | ||
| control-plane: controller-router-{{ $k }} | ||
| app.kubernetes.io/name: jumpstarter-controller | ||
| {{ if $.Values.global.timestamp }} | ||
| deployment.timestamp: {{ $.Values.global.timestamp | quote }} | ||
| {{ end }} | ||
| annotations: | ||
| argocd.argoproj.io/sync-wave: "1" | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| control-plane: controller-router-{{ $k }} | ||
| replicas: 1 | ||
| template: | ||
| metadata: | ||
| annotations: | ||
| kubectl.kubernetes.io/default-container: router | ||
| configmap-sha256: {{ include (print $.Template.BasePath "/cms/controller-cm.yaml") $ | sha256sum }} | ||
| labels: | ||
| control-plane: controller-router-{{ $k }} | ||
| {{ if $.Values.global.timestamp }} | ||
| deployment.timestamp: {{ $.Values.global.timestamp | quote }} | ||
| {{ end }} | ||
| spec: | ||
| # TODO(user): Uncomment the following code to configure the nodeAffinity expression | ||
| # according to the platforms which are supported by your solution. | ||
| # It is considered best practice to support multiple architectures. You can | ||
| # build your manager image using the makefile target docker-buildx. | ||
| # affinity: | ||
| # nodeAffinity: | ||
| # requiredDuringSchedulingIgnoredDuringExecution: | ||
| # nodeSelectorTerms: | ||
| # - matchExpressions: | ||
| # - key: kubernetes.io/arch | ||
| # operator: In | ||
| # values: | ||
| # - amd64 | ||
| # - arm64 | ||
| # - ppc64le | ||
| # - s390x | ||
| # - key: kubernetes.io/os | ||
| # operator: In | ||
| # values: | ||
| # - linux | ||
| {{ if $v.nodeSelector }} | ||
| nodeSelector: | ||
| {{ $v.nodeSelector | toYaml | indent 1 }} | ||
| {{ end }} | ||
| securityContext: | ||
| runAsNonRoot: true | ||
| seccompProfile: | ||
| type: RuntimeDefault | ||
| containers: | ||
| - command: | ||
| - /router | ||
| env: | ||
| - name: GRPC_ROUTER_ENDPOINT | ||
| {{ if $v.endpoint }} | ||
| value: {{ $v.endpoint }} | ||
| {{ else if $v.hostname }} | ||
| value: {{ $v.hostname }}:{{ default 443 $.Values.grpc.tls.port }} | ||
| {{ else }} | ||
| value: router-{{ $k }}.{{ $.Values.global.baseDomain | required "set .global.baseDomain, or provide grpc.additionalRouters[...].endpoint/hostname" }}:{{ default 443 $.Values.grpc.tls.port }} | ||
| {{ end }} | ||
| - name: ROUTER_KEY | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: jumpstarter-router-secret | ||
| key: key | ||
| - name: NAMESPACE | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.namespace | ||
|
|
||
| image: {{ $.Values.image }}:{{ default $.Chart.AppVersion $.Values.tag }} | ||
| imagePullPolicy: {{ $.Values.imagePullPolicy }} | ||
| name: router | ||
| securityContext: | ||
| allowPrivilegeEscalation: false | ||
| capabilities: | ||
| drop: | ||
| - "ALL" | ||
| # livenessProbe: | ||
| # httpGet: | ||
| # path: /healthz | ||
| # port: 8081 | ||
| # initialDelaySeconds: 15 | ||
| # periodSeconds: 20 | ||
| # readinessProbe: | ||
| # httpGet: | ||
| # path: /readyz | ||
| # port: 8081 | ||
| # initialDelaySeconds: 5 | ||
| # periodSeconds: 10 | ||
| resources: | ||
| limits: | ||
| cpu: 2000m | ||
| memory: 1024Mi | ||
| requests: | ||
| cpu: 1000m | ||
| memory: 256Mi | ||
| serviceAccountName: controller-manager | ||
| terminationGracePeriodSeconds: 10 | ||
| {{ end }} | ||
47 changes: 47 additions & 0 deletions
47
...y/helm/jumpstarter/charts/jumpstarter-controller/templates/additional-router-ingress.yaml
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,47 @@ | ||
| {{ if eq .Values.grpc.mode "ingress" }} | ||
| {{ range $k, $v := .Values.grpc.additionalRouters }} | ||
| --- | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: Ingress | ||
| metadata: | ||
| annotations: | ||
| nginx.ingress.kubernetes.io/ssl-redirect: "true" | ||
| nginx.ingress.kubernetes.io/backend-protocol: "GRPC" | ||
| nginx.ingress.kubernetes.io/proxy-read-timeout: "300" | ||
| nginx.ingress.kubernetes.io/proxy-send-timeout: "300" | ||
| {{ if eq $.Values.grpc.tls.mode "passthrough" }} | ||
| nginx.ingress.kubernetes.io/ssl-passthrough: "true" | ||
| {{ end }} | ||
|
Comment on lines
+12
to
+14
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Don't set a TLS secret when ssl-passthrough is enabled. With NGINX ssl-passthrough, a secret must not be provided; doing so breaks TLS handshake at the ingress. - tls:
+ tls:
- hosts:
{{ if $v.hostname }}
- {{ $v.hostname }}
{{ else }}
- router-{{ $k }}.{{ $.Values.global.baseDomain | required "a global.baseDomain or a grpc.routerHostname must be provided"}}
{{ end }}
- {{ if $.Values.grpc.tls.routerCertSecret }}
- secretName: {{ $.Values.grpc.tls.routerCertSecret }}
- {{ end }}
+ {{ if and $.Values.grpc.tls.routerCertSecret (ne $.Values.grpc.tls.mode "passthrough") }}
+ secretName: {{ $.Values.grpc.tls.routerCertSecret }}
+ {{ end }}Also applies to: 36-45 🤖 Prompt for AI Agents |
||
| name: jumpstarter-router-ingress-{{ $k }} | ||
| namespace: {{ default $.Release.Namespace $.Values.namespace }} | ||
| spec: | ||
| {{ if $.Values.grpc.ingress.class }} | ||
| ingressClassName: {{ $.Values.grpc.ingress.class }} | ||
| {{ end }} | ||
| rules: | ||
| {{ if $v.hostname }} | ||
| - host: {{ $v.hostname }} | ||
| {{ else }} | ||
| - host: router-{{ $k }}.{{ $.Values.global.baseDomain | required "a global.baseDomain or a grpc.routerHostname must be provided"}} | ||
| {{ end }} | ||
| http: | ||
| paths: | ||
| - path: / | ||
| pathType: Prefix | ||
| backend: | ||
| service: | ||
| name: jumpstarter-router-grpc-{{ $k }} | ||
| port: | ||
| number: 8083 | ||
| tls: | ||
| - hosts: | ||
| {{ if $v.hostname }} | ||
| - {{ $v.hostname }} | ||
| {{ else }} | ||
| - router-{{ $k }}.{{ $.Values.global.baseDomain | required "a global.baseDomain or a grpc.routerHostname must be provided"}} | ||
| {{ end }} | ||
| {{ if $.Values.grpc.tls.routerCertSecret }} | ||
| secretName: {{ $.Values.grpc.tls.routerCertSecret }} | ||
| {{ end }} | ||
| {{ end }} | ||
| {{ end }} | ||
42 changes: 42 additions & 0 deletions
42
deploy/helm/jumpstarter/charts/jumpstarter-controller/templates/additional-router-route.yaml
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,42 @@ | ||
| {{ if eq .Values.grpc.mode "route" }} | ||
| {{ range $k, $v := .Values.grpc.additionalRouters }} | ||
| --- | ||
| apiVersion: route.openshift.io/v1 | ||
| kind: Route | ||
| metadata: | ||
| labels: | ||
| external-exposed: "true" | ||
| shard: external | ||
| annotations: | ||
| haproxy.router.openshift.io/timeout: 2d | ||
| haproxy.router.openshift.io/timeout-tunnel: 2d | ||
| name: jumpstarter-router-route-{{ $k }} | ||
| namespace: {{ default $.Release.Namespace $.Values.namespace }} | ||
| spec: | ||
| {{ if $v.hostname }} | ||
| host: {{ $v.hostname }} | ||
| {{ else }} | ||
| host: router-{{ $k }}.{{ $.Values.global.baseDomain | required "a global.baseDomain or a grpc.routerHostname must be provided"}} | ||
| {{ end }} | ||
| port: | ||
| targetPort: 8083 | ||
| tls: | ||
| {{ if eq $.Values.grpc.tls.mode "passthrough" }} | ||
| termination: passthrough | ||
| {{ end }} | ||
| {{ if eq $.Values.grpc.tls.mode "reencrypt" }} | ||
| termination: reencrypt | ||
| {{ end }} | ||
| insecureEdgeTerminationPolicy: None | ||
| {{ if $.Values.grpc.tls.routerCertSecret }} | ||
| externalCertificate: | ||
| name: {{ $.Values.grpc.tls.routerCertSecret }} | ||
| {{ end }} | ||
|
NickCao marked this conversation as resolved.
|
||
|
|
||
| to: | ||
| kind: Service | ||
| name: jumpstarter-router-grpc-{{ $k }} | ||
| weight: 100 | ||
| wildcardPolicy: None | ||
| {{ end }} | ||
| {{ end }} | ||
27 changes: 27 additions & 0 deletions
27
...y/helm/jumpstarter/charts/jumpstarter-controller/templates/additional-router-service.yaml
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,27 @@ | ||
| {{ range $k, $v := .Values.grpc.additionalRouters }} | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| labels: | ||
| control-plane: controller-router-{{ $k }} | ||
| app.kubernetes.io/name: jumpstarter-controller | ||
| name: jumpstarter-router-grpc-{{ $k }} | ||
| namespace: {{ default $.Release.Namespace $.Values.namespace }} | ||
| spec: | ||
| {{ if .Values.grpc.nodeport.enabled }} | ||
| type: NodePort | ||
| {{ end }} | ||
|
|
||
| ports: | ||
| - name: grpc | ||
| port: 8083 | ||
| protocol: TCP | ||
| targetPort: 8083 | ||
| appProtocol: h2c # HTTP/2 over cleartext for gRPC (fixes edge termination in ingress/router) | ||
| {{ if .Values.grpc.nodeport.enabled }} | ||
| nodePort: {{ .Values.grpc.nodeport.routerPort }} | ||
| {{ end }} | ||
| selector: | ||
| control-plane: controller-router-{{ $k }} | ||
| {{ 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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must find the way to make this configurable at some point, the routers actually need very little. But seems like an ok default.