From 569c6462bef515164ef11d18a6b4c9800de5bc99 Mon Sep 17 00:00:00 2001 From: Nathan Eudeline Date: Mon, 30 Mar 2026 14:52:05 +0200 Subject: [PATCH] feat: add Gateway API HTTPRoute support to parent service charts Add HTTPRoute templates to library-chart and parent charts for Gateway API integration with Onyxia. This allows services to be exposed via Kubernetes Gateway API in addition to Ingress and OpenShift Route. Changes: - Add _httproute.tpl template in library-chart with httproute, httprouteUser, and httprouteSpark helpers - Update _common.tpl to support HTTPRoute in URL resolution - Add httproute.yaml and httproute-user.yaml templates to parent charts - Add httproute-sparkui.yaml templates to spark-capable charts - Add httproute section to values.yaml and values.schema.json - Add unittest for httproute template Children charts will be auto-generated from parent charts on release. --- .../templates/httproute-sparkui.yaml | 1 + .../templates/httproute-user.yaml | 1 + .../jupyter-pyspark/templates/httproute.yaml | 1 + charts/jupyter-pyspark/values.schema.json | 85 ++++++++++- charts/jupyter-pyspark/values.yaml | 12 ++ .../templates/httproute-user.yaml | 1 + .../jupyter-python/templates/httproute.yaml | 1 + charts/jupyter-python/values.schema.json | 79 +++++++++++ charts/jupyter-python/values.yaml | 12 ++ charts/library-chart/templates/_common.tpl | 6 + charts/library-chart/templates/_httproute.tpl | 132 ++++++++++++++++++ .../templates/httproute-sparkui.yaml | 1 + .../templates/httproute-user.yaml | 1 + .../rstudio-sparkr/templates/httproute.yaml | 1 + charts/rstudio-sparkr/values.schema.json | 87 +++++++++++- charts/rstudio-sparkr/values.yaml | 12 ++ charts/rstudio/templates/httproute-user.yaml | 1 + charts/rstudio/templates/httproute.yaml | 1 + charts/rstudio/values.schema.json | 87 +++++++++++- charts/rstudio/values.yaml | 12 ++ .../templates/httproute-sparkui.yaml | 1 + .../templates/httproute-user.yaml | 1 + .../vscode-pyspark/templates/httproute.yaml | 1 + charts/vscode-pyspark/values.schema.json | 99 +++++++++++-- charts/vscode-pyspark/values.yaml | 12 ++ .../templates/httproute-user.yaml | 1 + charts/vscode-python/templates/httproute.yaml | 1 + charts/vscode-python/values.schema.json | 97 +++++++++++-- charts/vscode-python/values.yaml | 12 ++ tests/httproute_test.yaml | 13 ++ 30 files changed, 742 insertions(+), 30 deletions(-) create mode 100644 charts/jupyter-pyspark/templates/httproute-sparkui.yaml create mode 100644 charts/jupyter-pyspark/templates/httproute-user.yaml create mode 100644 charts/jupyter-pyspark/templates/httproute.yaml create mode 100644 charts/jupyter-python/templates/httproute-user.yaml create mode 100644 charts/jupyter-python/templates/httproute.yaml create mode 100644 charts/library-chart/templates/_httproute.tpl create mode 100644 charts/rstudio-sparkr/templates/httproute-sparkui.yaml create mode 100644 charts/rstudio-sparkr/templates/httproute-user.yaml create mode 100644 charts/rstudio-sparkr/templates/httproute.yaml create mode 100644 charts/rstudio/templates/httproute-user.yaml create mode 100644 charts/rstudio/templates/httproute.yaml create mode 100644 charts/vscode-pyspark/templates/httproute-sparkui.yaml create mode 100644 charts/vscode-pyspark/templates/httproute-user.yaml create mode 100644 charts/vscode-pyspark/templates/httproute.yaml create mode 100644 charts/vscode-python/templates/httproute-user.yaml create mode 100644 charts/vscode-python/templates/httproute.yaml create mode 100644 tests/httproute_test.yaml diff --git a/charts/jupyter-pyspark/templates/httproute-sparkui.yaml b/charts/jupyter-pyspark/templates/httproute-sparkui.yaml new file mode 100644 index 000000000..09fc2056a --- /dev/null +++ b/charts/jupyter-pyspark/templates/httproute-sparkui.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteSpark" . }} diff --git a/charts/jupyter-pyspark/templates/httproute-user.yaml b/charts/jupyter-pyspark/templates/httproute-user.yaml new file mode 100644 index 000000000..070bea371 --- /dev/null +++ b/charts/jupyter-pyspark/templates/httproute-user.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteUser" . }} diff --git a/charts/jupyter-pyspark/templates/httproute.yaml b/charts/jupyter-pyspark/templates/httproute.yaml new file mode 100644 index 000000000..4400e92f4 --- /dev/null +++ b/charts/jupyter-pyspark/templates/httproute.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httproute" . }} diff --git a/charts/jupyter-pyspark/values.schema.json b/charts/jupyter-pyspark/values.schema.json index 75432dab4..5fb56d36a 100644 --- a/charts/jupyter-pyspark/values.schema.json +++ b/charts/jupyter-pyspark/values.schema.json @@ -876,6 +876,85 @@ } } }, + "httproute": { + "title": "HTTPRoute Details", + "type": "object", + "form": true, + "x-onyxia": { + "overwriteSchemaWith": "ide/httproute.json" + }, + "properties": { + "enabled": { + "description": "Enable HTTPRoute", + "type": "boolean", + "default": false, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.enabled" + } + }, + "hostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" + } + }, + "userHostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" + } + }, + "path": { + "type": "string", + "form": true, + "title": "Path", + "default": "/" + }, + "userPath": { + "type": "string", + "form": true, + "title": "User Path", + "default": "/" + }, + "parentRefs": { + "description": "Gateway parent references", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.parentRefs" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Gateway name" + }, + "namespace": { + "type": "string", + "title": "Gateway namespace" + }, + "sectionName": { + "type": "string", + "title": "Listener name" + }, + "port": { + "type": "integer", + "title": "Listener port" + } + } + } + } + } + }, "userPreferences": { "description": "User Preferences", "type": "object", @@ -1148,7 +1227,7 @@ "properties": { "fr": { "type": "string", - "description": "message à ajouter dans les notes", + "description": "message \u00e0 ajouter dans les notes", "default": "" }, "en": { @@ -1158,7 +1237,7 @@ } } }, - "runtimeClassName" : { + "runtimeClassName": { "type": "string", "description": "Runtime Class Name", "default": "", @@ -1168,4 +1247,4 @@ } } } -} +} \ No newline at end of file diff --git a/charts/jupyter-pyspark/values.yaml b/charts/jupyter-pyspark/values.yaml index e9edd4ed1..a0eb80124 100644 --- a/charts/jupyter-pyspark/values.yaml +++ b/charts/jupyter-pyspark/values.yaml @@ -224,6 +224,18 @@ route: # destinationCACertificate: wildcardPolicy: None +httproute: + enabled: false + annotations: [] + hostname: chart-example.local + userHostname: chart-example-user.local + path: / + userPath: / + parentRefs: [] + # - name: my-gateway + # namespace: gateway-system + # sectionName: http + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little diff --git a/charts/jupyter-python/templates/httproute-user.yaml b/charts/jupyter-python/templates/httproute-user.yaml new file mode 100644 index 000000000..87d0392b1 --- /dev/null +++ b/charts/jupyter-python/templates/httproute-user.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteUser" . }} \ No newline at end of file diff --git a/charts/jupyter-python/templates/httproute.yaml b/charts/jupyter-python/templates/httproute.yaml new file mode 100644 index 000000000..c54742424 --- /dev/null +++ b/charts/jupyter-python/templates/httproute.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httproute" . }} \ No newline at end of file diff --git a/charts/jupyter-python/values.schema.json b/charts/jupyter-python/values.schema.json index 49dcbe783..a84320431 100644 --- a/charts/jupyter-python/values.schema.json +++ b/charts/jupyter-python/values.schema.json @@ -818,6 +818,85 @@ } } }, + "httproute": { + "title": "HTTPRoute Details", + "type": "object", + "form": true, + "x-onyxia": { + "overwriteSchemaWith": "ide/httproute.json" + }, + "properties": { + "enabled": { + "description": "Enable HTTPRoute", + "type": "boolean", + "default": false, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.enabled" + } + }, + "hostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" + } + }, + "userHostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" + } + }, + "path": { + "type": "string", + "form": true, + "title": "Path", + "default": "/" + }, + "userPath": { + "type": "string", + "form": true, + "title": "User Path", + "default": "/" + }, + "parentRefs": { + "description": "Gateway parent references", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.parentRefs" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Gateway name" + }, + "namespace": { + "type": "string", + "title": "Gateway namespace" + }, + "sectionName": { + "type": "string", + "title": "Listener name" + }, + "port": { + "type": "integer", + "title": "Listener port" + } + } + } + } + } + }, "repository": { "description": "python repositories for pip and conda", "type": "object", diff --git a/charts/jupyter-python/values.yaml b/charts/jupyter-python/values.yaml index fc0d60d0f..ee91c2f04 100644 --- a/charts/jupyter-python/values.yaml +++ b/charts/jupyter-python/values.yaml @@ -191,6 +191,18 @@ route: # destinationCACertificate: wildcardPolicy: None +httproute: + enabled: false + annotations: [] + hostname: chart-example.local + userHostname: chart-example-user.local + path: / + userPath: / + parentRefs: [] + # - name: my-gateway + # namespace: gateway-system + # sectionName: http + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little diff --git a/charts/library-chart/templates/_common.tpl b/charts/library-chart/templates/_common.tpl index caad31a9c..04e7e9c71 100644 --- a/charts/library-chart/templates/_common.tpl +++ b/charts/library-chart/templates/_common.tpl @@ -11,6 +11,8 @@ {{- define "library-chart.service-url" -}} {{- if (.Values.ingress).enabled -}} {{- printf "%s://%s" (.Values.ingress.tls | ternary "https" "http") .Values.ingress.hostname -}} +{{- else if (.Values.httproute).enabled -}} +{{- printf "https://%s" .Values.httproute.hostname -}} {{- else if (.Values.route).enabled -}} {{- printf "https://%s" .Values.route.hostname -}} {{- end -}} @@ -23,6 +25,8 @@ {{- if (.Values.spark).ui -}} {{- if (.Values.ingress).enabled -}} {{- printf "%s://%s" (.Values.ingress.tls | ternary "https" "http") .Values.spark.hostname -}} + {{- else if (.Values.httproute).enabled -}} + {{- printf "https://%s" .Values.spark.hostname -}} {{- else if (.Values.route).enabled -}} {{- printf "https://%s" .Values.spark.hostname -}} {{- end -}} @@ -35,6 +39,8 @@ {{- define "library-chart.user-url" -}} {{- if (.Values.ingress).enabled -}} {{- printf "%s://%s" (.Values.ingress.tls | ternary "https" "http") .Values.ingress.userHostname -}} + {{- else if (.Values.httproute).enabled -}} + {{- printf "https://%s" .Values.httproute.userHostname -}} {{- else if (.Values.route).enabled -}} {{- printf "https://%s" .Values.route.userHostname -}} {{- end -}} diff --git a/charts/library-chart/templates/_httproute.tpl b/charts/library-chart/templates/_httproute.tpl new file mode 100644 index 000000000..fd17f832a --- /dev/null +++ b/charts/library-chart/templates/_httproute.tpl @@ -0,0 +1,132 @@ +{{/* vim: set filetype=mustache: */}} + +{{/* HTTPRoute annotations */}} +{{- define "library-chart.httproute.annotations" -}} +{{- with (.Values.httproute).annotations }} +{{- toYaml . }} +{{- end }} +{{- if ((.Values.security).allowlist).enabled }} +gateway.networking.k8s.io/client-ip-masking: "true" +{{- end }} +{{- end }} + +{{/* HTTPRoute hostname */}} +{{- define "library-chart.httproute.hostname" -}} +{{- if (.Values.httproute).generate }} +{{- .Values.httproute.userHostname }} +{{- else }} +{{- .Values.httproute.hostname }} +{{- end }} +{{- end }} + +{{/* Template to generate a standard HTTPRoute */}} +{{- define "library-chart.httproute" -}} +{{- if (.Values.httproute).enabled -}} +{{- if or (.Values.autoscaling).enabled (not (.Values.global).suspend) }} +{{- $fullName := include "library-chart.fullname" . -}} +{{- $svcPort := .Values.networking.service.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }}-ui + labels: + {{- include "library-chart.labels" . | nindent 4 }} + annotations: + {{- include "library-chart.httproute.annotations" . | nindent 4 }} +spec: + parentRefs: + {{- toYaml .Values.httproute.parentRefs | nindent 4 }} + hostnames: + - {{ .Values.httproute.hostname | quote }} + rules: + - backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + {{- if .Values.httproute.path }} + matches: + - path: + type: PathPrefix + value: {{ .Values.httproute.path }} + {{- end }} +{{- end }} +{{- end }} +{{- end }} + +{{/* Template to generate a custom HTTPRoute */}} +{{- define "library-chart.httprouteUser" -}} +{{- if (.Values.httproute).enabled -}} +{{- if or (.Values.autoscaling).enabled (not (.Values.global).suspend) }} +{{- if ((.Values.networking).user).enabled -}} +{{- $userPorts := list -}} +{{- if or .Values.networking.user.ports .Values.networking.user.port -}} +{{- $userPorts = .Values.networking.user.ports | default (list .Values.networking.user.port) -}} +{{- end -}} +{{- if $userPorts -}} +{{- $fullName := include "library-chart.fullname" . -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }}-user + labels: + {{- include "library-chart.labels" . | nindent 4 }} + annotations: + {{- include "library-chart.httproute.annotations" . | nindent 4 }} +spec: + parentRefs: + {{- toYaml .Values.httproute.parentRefs | nindent 4 }} + hostnames: + {{- range $userPort := $userPorts }} + {{- if eq (len $userPorts) 1 }} + - {{ $.Values.httproute.userHostname | quote }} + {{- else }} + - {{ regexReplaceAll "([^\\.]+)\\.(.*)" $.Values.httproute.userHostname (printf "${1}-%d.${2}" (int $userPort)) | quote }} + {{- end }} + {{- end }} + rules: + {{- range $userPort := $userPorts }} + - backendRefs: + - name: {{ $fullName }} + port: {{ $userPort }} + {{- if $.Values.httproute.userPath }} + matches: + - path: + type: PathPrefix + value: {{ $.Values.httproute.userPath }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} +{{- end }} +{{- end }} +{{- end }} + +{{/* Template to generate an HTTPRoute for the Spark UI */}} +{{- define "library-chart.httprouteSpark" -}} +{{- if and (.Values.httproute).enabled (.Values.spark).ui -}} +{{- $fullName := include "library-chart.fullname" . -}} +{{- $svcPort := .Values.networking.sparkui.port -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $fullName }}-sparkui + labels: + {{- include "library-chart.labels" . | nindent 4 }} + annotations: + {{- include "library-chart.httproute.annotations" . | nindent 4 }} +spec: + parentRefs: + {{- toYaml .Values.httproute.parentRefs | nindent 4 }} + hostnames: + - {{ .Values.spark.hostname | quote }} + rules: + - backendRefs: + - name: {{ $fullName }} + port: {{ $svcPort }} + {{- if .Values.spark.path }} + matches: + - path: + type: PathPrefix + value: {{ .Values.spark.path }} + {{- end }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/rstudio-sparkr/templates/httproute-sparkui.yaml b/charts/rstudio-sparkr/templates/httproute-sparkui.yaml new file mode 100644 index 000000000..09fc2056a --- /dev/null +++ b/charts/rstudio-sparkr/templates/httproute-sparkui.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteSpark" . }} diff --git a/charts/rstudio-sparkr/templates/httproute-user.yaml b/charts/rstudio-sparkr/templates/httproute-user.yaml new file mode 100644 index 000000000..070bea371 --- /dev/null +++ b/charts/rstudio-sparkr/templates/httproute-user.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteUser" . }} diff --git a/charts/rstudio-sparkr/templates/httproute.yaml b/charts/rstudio-sparkr/templates/httproute.yaml new file mode 100644 index 000000000..4400e92f4 --- /dev/null +++ b/charts/rstudio-sparkr/templates/httproute.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httproute" . }} diff --git a/charts/rstudio-sparkr/values.schema.json b/charts/rstudio-sparkr/values.schema.json index a2a82c9f6..b53f86f48 100644 --- a/charts/rstudio-sparkr/values.schema.json +++ b/charts/rstudio-sparkr/values.schema.json @@ -791,7 +791,7 @@ "hidden": true } }, - "tlsSecretName":{ + "tlsSecretName": { "type": "string", "default": "", "x-onyxia": { @@ -843,6 +843,85 @@ } } }, + "httproute": { + "title": "HTTPRoute Details", + "type": "object", + "form": true, + "x-onyxia": { + "overwriteSchemaWith": "ide/httproute.json" + }, + "properties": { + "enabled": { + "description": "Enable HTTPRoute", + "type": "boolean", + "default": false, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.enabled" + } + }, + "hostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" + } + }, + "userHostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" + } + }, + "path": { + "type": "string", + "form": true, + "title": "Path", + "default": "/" + }, + "userPath": { + "type": "string", + "form": true, + "title": "User Path", + "default": "/" + }, + "parentRefs": { + "description": "Gateway parent references", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.parentRefs" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Gateway name" + }, + "namespace": { + "type": "string", + "title": "Gateway namespace" + }, + "sectionName": { + "type": "string", + "title": "Listener name" + }, + "port": { + "type": "integer", + "title": "Listener port" + } + } + } + } + } + }, "repository": { "description": "r repository (eg : cran mirrors or proxy caches)", "type": "object", @@ -1043,7 +1122,7 @@ "properties": { "fr": { "type": "string", - "description": "message à ajouter dans les notes", + "description": "message \u00e0 ajouter dans les notes", "default": "" }, "en": { @@ -1053,7 +1132,7 @@ } } }, - "runtimeClassName" : { + "runtimeClassName": { "type": "string", "description": "Runtime Class Name", "default": "", @@ -1063,4 +1142,4 @@ } } } -} +} \ No newline at end of file diff --git a/charts/rstudio-sparkr/values.yaml b/charts/rstudio-sparkr/values.yaml index 85707bd82..095333ace 100644 --- a/charts/rstudio-sparkr/values.yaml +++ b/charts/rstudio-sparkr/values.yaml @@ -201,6 +201,18 @@ route: # destinationCACertificate: wildcardPolicy: None +httproute: + enabled: false + annotations: [] + hostname: chart-example.local + userHostname: chart-example-user.local + path: / + userPath: / + parentRefs: [] + # - name: my-gateway + # namespace: gateway-system + # sectionName: http + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little diff --git a/charts/rstudio/templates/httproute-user.yaml b/charts/rstudio/templates/httproute-user.yaml new file mode 100644 index 000000000..070bea371 --- /dev/null +++ b/charts/rstudio/templates/httproute-user.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteUser" . }} diff --git a/charts/rstudio/templates/httproute.yaml b/charts/rstudio/templates/httproute.yaml new file mode 100644 index 000000000..4400e92f4 --- /dev/null +++ b/charts/rstudio/templates/httproute.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httproute" . }} diff --git a/charts/rstudio/values.schema.json b/charts/rstudio/values.schema.json index dee763006..b1888301e 100644 --- a/charts/rstudio/values.schema.json +++ b/charts/rstudio/values.schema.json @@ -750,7 +750,7 @@ "hidden": true } }, - "tlsSecretName":{ + "tlsSecretName": { "type": "string", "default": "", "x-onyxia": { @@ -793,6 +793,85 @@ } } }, + "httproute": { + "title": "HTTPRoute Details", + "type": "object", + "form": true, + "x-onyxia": { + "overwriteSchemaWith": "ide/httproute.json" + }, + "properties": { + "enabled": { + "description": "Enable HTTPRoute", + "type": "boolean", + "default": false, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.enabled" + } + }, + "hostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" + } + }, + "userHostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" + } + }, + "path": { + "type": "string", + "form": true, + "title": "Path", + "default": "/" + }, + "userPath": { + "type": "string", + "form": true, + "title": "User Path", + "default": "/" + }, + "parentRefs": { + "description": "Gateway parent references", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.parentRefs" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Gateway name" + }, + "namespace": { + "type": "string", + "title": "Gateway namespace" + }, + "sectionName": { + "type": "string", + "title": "Listener name" + }, + "port": { + "type": "integer", + "title": "Listener port" + } + } + } + } + } + }, "repository": { "description": "r repository (eg : cran mirrors or proxy caches)", "type": "object", @@ -961,7 +1040,7 @@ "properties": { "fr": { "type": "string", - "description": "message à ajouter dans les notes", + "description": "message \u00e0 ajouter dans les notes", "default": "" }, "en": { @@ -971,7 +1050,7 @@ } } }, - "runtimeClassName" : { + "runtimeClassName": { "type": "string", "description": "Runtime Class Name", "default": "", @@ -981,4 +1060,4 @@ } } } -} +} \ No newline at end of file diff --git a/charts/rstudio/values.yaml b/charts/rstudio/values.yaml index 8296e33d8..b607d6868 100644 --- a/charts/rstudio/values.yaml +++ b/charts/rstudio/values.yaml @@ -165,6 +165,18 @@ route: # destinationCACertificate: wildcardPolicy: None +httproute: + enabled: false + annotations: [] + hostname: chart-example.local + userHostname: chart-example-user.local + path: / + userPath: / + parentRefs: [] + # - name: my-gateway + # namespace: gateway-system + # sectionName: http + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little diff --git a/charts/vscode-pyspark/templates/httproute-sparkui.yaml b/charts/vscode-pyspark/templates/httproute-sparkui.yaml new file mode 100644 index 000000000..09fc2056a --- /dev/null +++ b/charts/vscode-pyspark/templates/httproute-sparkui.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteSpark" . }} diff --git a/charts/vscode-pyspark/templates/httproute-user.yaml b/charts/vscode-pyspark/templates/httproute-user.yaml new file mode 100644 index 000000000..070bea371 --- /dev/null +++ b/charts/vscode-pyspark/templates/httproute-user.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteUser" . }} diff --git a/charts/vscode-pyspark/templates/httproute.yaml b/charts/vscode-pyspark/templates/httproute.yaml new file mode 100644 index 000000000..4400e92f4 --- /dev/null +++ b/charts/vscode-pyspark/templates/httproute.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httproute" . }} diff --git a/charts/vscode-pyspark/values.schema.json b/charts/vscode-pyspark/values.schema.json index fb9f5ffb6..6a0b93946 100644 --- a/charts/vscode-pyspark/values.schema.json +++ b/charts/vscode-pyspark/values.schema.json @@ -26,7 +26,7 @@ "listEnum": [ "inseefrlab/onyxia-vscode-pyspark:py3.13.12-spark4.1.1", "inseefrlab/onyxia-vscode-pyspark:py3.12.13-spark4.1.1", - "inseefrlab/onyxia-vscode-pyspark:py3.13.8-spark3.5.7", + "inseefrlab/onyxia-vscode-pyspark:py3.13.8-spark3.5.7", "inseefrlab/onyxia-vscode-pyspark:py3.12.13-spark3.5.7" ], "render": "list", @@ -826,7 +826,7 @@ "hidden": true } }, - "tlsSecretName":{ + "tlsSecretName": { "type": "string", "default": "", "x-onyxia": { @@ -869,6 +869,85 @@ } } }, + "httproute": { + "title": "HTTPRoute Details", + "type": "object", + "form": true, + "x-onyxia": { + "overwriteSchemaWith": "ide/httproute.json" + }, + "properties": { + "enabled": { + "description": "Enable HTTPRoute", + "type": "boolean", + "default": false, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.enabled" + } + }, + "hostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" + } + }, + "userHostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" + } + }, + "path": { + "type": "string", + "form": true, + "title": "Path", + "default": "/" + }, + "userPath": { + "type": "string", + "form": true, + "title": "User Path", + "default": "/" + }, + "parentRefs": { + "description": "Gateway parent references", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.parentRefs" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Gateway name" + }, + "namespace": { + "type": "string", + "title": "Gateway namespace" + }, + "sectionName": { + "type": "string", + "title": "Listener name" + }, + "port": { + "type": "integer", + "title": "Listener port" + } + } + } + } + } + }, "repository": { "description": "python repositories for pip and conda", "type": "object", @@ -1011,7 +1090,7 @@ "overwriteDefaultWith": "user.lang" } }, - "aiAssistant":{ + "aiAssistant": { "title": "AI Assistant", "type": "object", "description": "Configure Continue, an extension to use custom AI code assistants", @@ -1029,7 +1108,7 @@ }, "model": { "type": "string", - "default":"", + "default": "", "hidden": { "value": false, "path": "enabled", @@ -1051,7 +1130,7 @@ "overwriteDefaultWith": "user.profile.aiAssistant.provider" } }, - "apiBase":{ + "apiBase": { "type": "string", "default": "", "hidden": { @@ -1063,7 +1142,7 @@ "overwriteDefaultWith": "user.profile.aiAssistant.apiBase" } }, - "apiKey":{ + "apiKey": { "type": "string", "default": "", "hidden": { @@ -1075,7 +1154,7 @@ "overwriteDefaultWith": "user.profile.aiAssistant.apiKey" } }, - "useLegacyCompletionsEndpoint":{ + "useLegacyCompletionsEndpoint": { "title": "use legacy completions endpoint", "type": "boolean", "default": true, @@ -1142,7 +1221,7 @@ "properties": { "fr": { "type": "string", - "description": "message à ajouter dans les notes", + "description": "message \u00e0 ajouter dans les notes", "default": "" }, "en": { @@ -1152,7 +1231,7 @@ } } }, - "runtimeClassName" : { + "runtimeClassName": { "type": "string", "description": "Runtime Class Name", "default": "", @@ -1162,4 +1241,4 @@ } } } -} +} \ No newline at end of file diff --git a/charts/vscode-pyspark/values.yaml b/charts/vscode-pyspark/values.yaml index 73fca9cec..c992dfd3c 100644 --- a/charts/vscode-pyspark/values.yaml +++ b/charts/vscode-pyspark/values.yaml @@ -225,6 +225,18 @@ route: # destinationCACertificate: wildcardPolicy: None +httproute: + enabled: false + annotations: [] + hostname: chart-example.local + userHostname: chart-example-user.local + path: / + userPath: / + parentRefs: [] + # - name: my-gateway + # namespace: gateway-system + # sectionName: http + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little diff --git a/charts/vscode-python/templates/httproute-user.yaml b/charts/vscode-python/templates/httproute-user.yaml new file mode 100644 index 000000000..070bea371 --- /dev/null +++ b/charts/vscode-python/templates/httproute-user.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httprouteUser" . }} diff --git a/charts/vscode-python/templates/httproute.yaml b/charts/vscode-python/templates/httproute.yaml new file mode 100644 index 000000000..4400e92f4 --- /dev/null +++ b/charts/vscode-python/templates/httproute.yaml @@ -0,0 +1 @@ +{{ include "library-chart.httproute" . }} diff --git a/charts/vscode-python/values.schema.json b/charts/vscode-python/values.schema.json index 00c77bbda..b9f0ade34 100644 --- a/charts/vscode-python/values.schema.json +++ b/charts/vscode-python/values.schema.json @@ -794,7 +794,7 @@ "hidden": true } }, - "tlsSecretName":{ + "tlsSecretName": { "type": "string", "default": "", "x-onyxia": { @@ -837,6 +837,85 @@ } } }, + "httproute": { + "title": "HTTPRoute Details", + "type": "object", + "form": true, + "x-onyxia": { + "overwriteSchemaWith": "ide/httproute.json" + }, + "properties": { + "enabled": { + "description": "Enable HTTPRoute", + "type": "boolean", + "default": false, + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.enabled" + } + }, + "hostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-0.{{k8s.domain}}" + } + }, + "userHostname": { + "type": "string", + "form": true, + "title": "Hostname", + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "{{project.id}}-{{k8s.randomSubdomain}}-user.{{k8s.domain}}" + } + }, + "path": { + "type": "string", + "form": true, + "title": "Path", + "default": "/" + }, + "userPath": { + "type": "string", + "form": true, + "title": "User Path", + "default": "/" + }, + "parentRefs": { + "description": "Gateway parent references", + "type": "array", + "default": [], + "x-onyxia": { + "hidden": true, + "overwriteDefaultWith": "k8s.httpRoute.parentRefs" + }, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Gateway name" + }, + "namespace": { + "type": "string", + "title": "Gateway namespace" + }, + "sectionName": { + "type": "string", + "title": "Listener name" + }, + "port": { + "type": "integer", + "title": "Listener port" + } + } + } + } + } + }, "repository": { "description": "python repositories for pip and conda", "type": "object", @@ -938,7 +1017,7 @@ "overwriteDefaultWith": "user.lang" } }, - "aiAssistant":{ + "aiAssistant": { "title": "AI Assistant", "type": "object", "description": "Configure Continue, an extension to use custom AI code assistants", @@ -956,7 +1035,7 @@ }, "model": { "type": "string", - "default":"", + "default": "", "hidden": { "value": false, "path": "enabled", @@ -978,7 +1057,7 @@ "overwriteDefaultWith": "user.profile.aiAssistant.provider" } }, - "apiBase":{ + "apiBase": { "type": "string", "default": "", "hidden": { @@ -990,7 +1069,7 @@ "overwriteDefaultWith": "user.profile.aiAssistant.apiBase" } }, - "apiKey":{ + "apiKey": { "type": "string", "default": "", "hidden": { @@ -1002,7 +1081,7 @@ "overwriteDefaultWith": "user.profile.aiAssistant.apiKey" } }, - "useLegacyCompletionsEndpoint":{ + "useLegacyCompletionsEndpoint": { "title": "use legacy completions endpoint", "type": "boolean", "default": true, @@ -1110,7 +1189,7 @@ "properties": { "fr": { "type": "string", - "description": "message à ajouter dans les notes", + "description": "message \u00e0 ajouter dans les notes", "default": "" }, "en": { @@ -1120,7 +1199,7 @@ } } }, - "runtimeClassName" : { + "runtimeClassName": { "type": "string", "description": "Runtime Class Name", "default": "", @@ -1130,4 +1209,4 @@ } } } -} +} \ No newline at end of file diff --git a/charts/vscode-python/values.yaml b/charts/vscode-python/values.yaml index 33010588b..d520dec06 100644 --- a/charts/vscode-python/values.yaml +++ b/charts/vscode-python/values.yaml @@ -193,6 +193,18 @@ route: # destinationCACertificate: wildcardPolicy: None +httproute: + enabled: false + annotations: [] + hostname: chart-example.local + userHostname: chart-example-user.local + path: / + userPath: / + parentRefs: [] + # - name: my-gateway + # namespace: gateway-system + # sectionName: http + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious diff --git a/tests/httproute_test.yaml b/tests/httproute_test.yaml new file mode 100644 index 000000000..c476674b5 --- /dev/null +++ b/tests/httproute_test.yaml @@ -0,0 +1,13 @@ +suite: httproute test +templates: + - httproute.yaml +tests: + - it: should render an httproute + set: + httproute.enabled: true + httproute.parentRefs: + - name: my-gateway + namespace: gateway-system + asserts: + - isKind: + of: HTTPRoute \ No newline at end of file