diff --git a/helm/nebari-chat/Chart.lock b/helm/nebari-chat/Chart.lock index 6f67648..de0dea6 100644 --- a/helm/nebari-chat/Chart.lock +++ b/helm/nebari-chat/Chart.lock @@ -2,5 +2,8 @@ dependencies: - name: ravnar repository: oci://quay.io/nebari/charts version: 0.0.11 -digest: sha256:cf6d4495e3c0e0c7e88cbbdf2564d5c61eff190b5601e18934432e41013bcca5 -generated: "2026-07-16T13:38:43.259976-05:00" +- name: nebari-app + repository: oci://quay.io/reiemp/charts + version: 0.1.3 +digest: sha256:4c9732b7205a3f5077047412c6c388d4aa66d4552ee4836d92cb7ff407ded73d +generated: "2026-08-31T17:04:25.070075068+02:00" diff --git a/helm/nebari-chat/Chart.yaml b/helm/nebari-chat/Chart.yaml index f37ee3a..f1a322d 100644 --- a/helm/nebari-chat/Chart.yaml +++ b/helm/nebari-chat/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: nebari-chat type: application description: chat pack for nebari -version: "set-by-cd" -appVersion: "set-by-cd" +version: "0.0.0" +appVersion: "0.0.0" keywords: - nebari home: https://github.com/nebari-dev/nebari-chat-pack @@ -17,3 +17,6 @@ dependencies: - name: ravnar repository: oci://quay.io/nebari/charts version: "0.0.11" + - name: nebari-app + repository: oci://quay.io/reiemp/charts + version: "0.1.3" diff --git a/helm/nebari-chat/templates/_helpers.tpl b/helm/nebari-chat/templates/_helpers.tpl index bb1ec10..538adf7 100644 --- a/helm/nebari-chat/templates/_helpers.tpl +++ b/helm/nebari-chat/templates/_helpers.tpl @@ -1,122 +1,3 @@ -{{/* -NebariApp helper template. -Expects a dict with keys: top, component, service, nebariapp -*/}} -{{- define "nebari-chat.nebariapp" -}} -{{- $top := .top -}} -{{- $component := .component -}} -{{- $service := .service -}} -{{- $nebariapp := .nebariapp -}} -apiVersion: reconcilers.nebari.dev/v1 -kind: NebariApp -metadata: - name: {{ include "ravnar.component-name" (dict "top" $top "component" $component) }} - namespace: {{ $top.Release.Namespace }} - labels: - {{- include "ravnar.labels" (dict "top" $top "component" $component) | nindent 4 }} -spec: - hostname: {{ required (printf "%s.nebariapp.hostname is required" $component) $nebariapp.hostname }} - service: - name: {{ $service.name }} - port: {{ $service.port }} - {{- with $service.namespace }} - namespace: {{ . }} - {{- end }} - {{- with $nebariapp.serviceAccountName }} - serviceAccountName: {{ . }} - {{- end }} - {{- with $nebariapp.routing }} - routing: - {{- toYaml . | nindent 4 }} - {{- end }} - {{- with $nebariapp.auth }} - auth: - enabled: {{ .enabled }} - provider: {{ .provider }} - provisionClient: {{ .provisionClient }} - enforceAtGateway: {{ .enforceAtGateway }} - redirectURI: {{ .redirectURI }} - {{- with .clientSecretRef }} - clientSecretRef: {{ . }} - {{- end }} - {{- with .scopes }} - scopes: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- with .groups }} - groups: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- with .forwardAccessToken }} - forwardAccessToken: {{ . }} - {{- end }} - {{- with .denyRedirect }} - denyRedirect: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- with .issuerURL }} - issuerURL: {{ . }} - {{- end }} - {{- with .spaClient }} - spaClient: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- with .deviceFlowClient }} - deviceFlowClient: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- with .keycloakConfig }} - keycloakConfig: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- with .tokenExchange }} - tokenExchange: - {{- toYaml . | nindent 6 }} - {{- end }} - {{- end }} - {{- with $nebariapp.gateway }} - gateway: {{ . }} - {{- end }} - {{- with .nebariapp.landingPage }} - landingPage: - enabled: {{ .enabled | default false }} - {{- with .displayName }} - displayName: {{ . | quote }} - {{- end }} - {{- with .description }} - description: {{ . | quote }} - {{- end }} - {{- with .icon }} - icon: {{ . | quote }} - {{- end }} - {{- with .category }} - category: {{ . | quote }} - {{- end }} - {{- if kindIs "float64" .priority }} - priority: {{ .priority }} - {{- end }} - {{- with .externalUrl }} - externalUrl: {{ . | quote }} - {{- end }} - {{- with .healthCheck }} - healthCheck: - enabled: {{ .enabled | default false }} - {{- with .path }} - path: {{ . | quote }} - {{- end }} - {{- if .intervalSeconds }} - intervalSeconds: {{ .intervalSeconds }} - {{- end }} - {{- if .timeoutSeconds }} - timeoutSeconds: {{ .timeoutSeconds }} - {{- end }} - {{- if .port }} - port: {{ .port }} - {{- end }} - {{- end }} - {{- end }} -{{- end -}} - {{/* Construct a JSON representation of the ravnar subchart context. Useful for evaluating ravnar templates that depend on subchart scope. diff --git a/helm/nebari-chat/templates/nebariapp-backend.yaml b/helm/nebari-chat/templates/nebariapp-backend.yaml deleted file mode 100644 index 5e86a34..0000000 --- a/helm/nebari-chat/templates/nebariapp-backend.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- $component := "backend" }} -{{- with include "nebari-chat.ravnarContextJson" . | fromJson }} -{{- include "nebari-chat.nebariapp" (dict - "top" $ - "component" $component - "service" (dict - "name" (include "ravnar.fullname" .) - "port" .Values.service.port - ) - "nebariapp" $.Values.backend.nebariapp -) }} -{{- end }} diff --git a/helm/nebari-chat/templates/nebariapp-frontend.yaml b/helm/nebari-chat/templates/nebariapp-frontend.yaml deleted file mode 100644 index 12e6ae0..0000000 --- a/helm/nebari-chat/templates/nebariapp-frontend.yaml +++ /dev/null @@ -1,12 +0,0 @@ -{{- if .Values.frontend.enabled }} -{{- $component := "frontend" }} -{{- include "nebari-chat.nebariapp" (dict - "top" . - "component" $component - "service" (dict - "name" (include "ravnar.component-name" (dict "top" . "component" $component)) - "port" .Values.frontend.service.port - ) - "nebariapp" .Values.frontend.nebariapp -) }} -{{- end }} diff --git a/helm/nebari-chat/templates/nebariapp-namespace.yaml b/helm/nebari-chat/templates/nebariapp-namespace.yaml deleted file mode 100644 index e6090cf..0000000 --- a/helm/nebari-chat/templates/nebariapp-namespace.yaml +++ /dev/null @@ -1,8 +0,0 @@ -{{- $component := "nebariapp" }} -apiVersion: v1 -kind: Namespace -metadata: - name: {{ .Release.Namespace }} - labels: - nebari.dev/managed: "true" - {{- include "ravnar.labels" (dict "top" . "component" $component) | nindent 4 }} diff --git a/helm/nebari-chat/templates/nebariapp.yaml b/helm/nebari-chat/templates/nebariapp.yaml new file mode 100644 index 0000000..78ce1a2 --- /dev/null +++ b/helm/nebari-chat/templates/nebariapp.yaml @@ -0,0 +1,35 @@ +{{- define "nebari-chat.nebariapp" -}} +{{- $top := .top -}} +{{- $component := .component -}} +{{- $spec := .spec -}} +{{- include "nebari-app.nebariApp" (dict + "metadata" (dict + "name" (include "ravnar.component-name" (dict "top" $top "component" $component)) + "namespace" $top.Release.Namespace + "labels" (include "ravnar.labels" (dict "top" $top "component" $component) | fromYaml) + ) + "spec" $spec + "tplCtx" $top +) -}} +{{- end -}} +apiVersion: v1 +kind: Namespace +metadata: + name: {{ .Release.Namespace }} + labels: + nebari.dev/managed: "true" + {{- include "ravnar.labels" (dict "top" . "component" "nebariapp") | nindent 4 }} +--- +{{ include "nebari-chat.nebariapp" (dict + "top" . + "component" "backend" + "spec" .Values.backend.nebariapp +) }} +--- +{{ if .Values.frontend.enabled }} +{{- include "nebari-chat.nebariapp" (dict + "top" . + "component" "frontend" + "spec" .Values.frontend.nebariapp +) }} +{{- end }} diff --git a/helm/nebari-chat/values.schema.json b/helm/nebari-chat/values.schema.json index f2b3fcb..1869ee0 100644 --- a/helm/nebari-chat/values.schema.json +++ b/helm/nebari-chat/values.schema.json @@ -228,271 +228,7 @@ }, "nebariapp": { "type": "object", - "properties": { - "hostname": { - "type": "string", - "anyOf": [ - { "maxLength": 0 }, - { "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$" } - ] - }, - "serviceAccountName": { - "type": "string", - "minLength": 1 - }, - "routing": { - "type": "object", - "properties": { - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/routeMatch" - } - }, - "publicRoutes": { - "type": "array", - "items": { - "$ref": "#/definitions/routeMatch" - } - }, - "tls": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - } - } - }, - "annotations": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "auth": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "provider": { - "type": "string", - "enum": ["keycloak", "generic-oidc"] - }, - "redirectURI": { - "type": "string" - }, - "clientSecretRef": { - "type": "string" - }, - "scopes": { - "type": "array", - "items": { - "type": "string" - } - }, - "groups": { - "type": "array", - "items": { - "type": "string" - } - }, - "provisionClient": { - "type": "boolean" - }, - "enforceAtGateway": { - "type": "boolean" - }, - "forwardAccessToken": { - "type": "boolean" - }, - "denyRedirect": { - "type": "array", - "items": { - "$ref": "#/definitions/denyRedirectHeader" - } - }, - "issuerURL": { - "type": "string" - }, - "spaClient": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "clientId": { - "type": "string" - } - } - }, - "deviceFlowClient": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - } - } - }, - "keycloakConfig": { - "type": "object", - "properties": { - "groups": { - "type": "array", - "items": { - "$ref": "#/definitions/keycloakGroup" - } - }, - "protocolMappers": { - "type": "array", - "items": { - "$ref": "#/definitions/keycloakProtocolMapperConfig" - } - } - } - }, - "tokenExchange": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - } - } - } - } - }, - "gateway": { - "type": "string", - "enum": ["public", "internal"] - }, - "landingPage": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "displayName": { - "type": "string", - "maxLength": 64 - }, - "description": { - "type": "string", - "maxLength": 256 - }, - "icon": { - "type": "string" - }, - "category": { - "type": "string" - }, - "priority": { - "type": "integer", - "minimum": 0, - "maximum": 1000 - }, - "externalUrl": { - "type": "string" - }, - "healthCheck": { - "type": "object", - "properties": { - "enabled": { - "type": "boolean" - }, - "path": { - "type": "string" - }, - "port": { - "type": "integer", - "minimum": 1, - "maximum": 65535 - }, - "intervalSeconds": { - "type": "integer", - "minimum": 10, - "maximum": 300 - }, - "timeoutSeconds": { - "type": "integer", - "minimum": 1, - "maximum": 30 - } - } - } - } - } - }, - "required": ["hostname"] - }, - "routeMatch": { - "type": "object", - "properties": { - "pathPrefix": { - "type": "string", - "pattern": "^/.*" - }, - "pathType": { - "type": "string", - "enum": ["PathPrefix", "Exact"] - } - }, - "required": ["pathPrefix"] - }, - "denyRedirectHeader": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1 - }, - "type": { - "type": "string", - "enum": ["Exact", "Prefix", "Suffix", "RegularExpression"] - }, - "value": { - "type": "string", - "minLength": 1 - } - }, - "required": ["name", "value"] - }, - "keycloakGroup": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1 - }, - "members": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "required": ["name"] - }, - "keycloakProtocolMapperConfig": { - "type": "object", - "properties": { - "name": { - "type": "string", - "minLength": 1 - }, - "protocolMapper": { - "type": "string", - "minLength": 1 - }, - "config": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - }, - "required": ["name", "protocolMapper"] + "additionalProperties": true } } } diff --git a/helm/nebari-chat/values.yaml b/helm/nebari-chat/values.yaml index 1e9d3da..5616cf0 100644 --- a/helm/nebari-chat/values.yaml +++ b/helm/nebari-chat/values.yaml @@ -31,9 +31,13 @@ ravnar: backend: nebariapp: - # -- The hostname for the backend NebariApp - hostname: "" - # -- Routing configuration for the backend NebariApp + # -- The hostname for the backend nebariapp + hostname: '{{ fail "backend.nebariapp.hostname is required" }}' + # -- The service for the backend nebariapp + service: + name: '{{ include "ravnar.fullname" (include "nebari-chat.ravnarContextJson" . | fromJson) | toJson }}' + port: '{{ .Values.ravnar.service.port }}' + # -- Routing configuration for the backend nebariapp routing: routes: - pathPrefix: / @@ -133,11 +137,15 @@ frontend: dark: {} nebariapp: - # -- The hostname for the frontend NebariApp - hostname: "" - # -- Authentication configuration for the frontend NebariApp + # -- The hostname for the frontend nebariapp + hostname: '{{ fail "if frontend.enabled, frontend.nebariapp.hostname is required" }}' + # -- The service for the frontend nebariapp + service: + name: '{{ include "ravnar.component-name" (dict "top" . "component" "frontend") | toJson }}' + port: '{{ .Values.frontend.service.port }}' + # -- Authentication configuration for the frontend nebariapp auth: - # -- Whether authentication is enabled for the frontend NebariApp + # -- Whether authentication is enabled for the frontend nebariapp enabled: true # -- The OIDC authentication provider provider: keycloak @@ -156,12 +164,12 @@ frontend: spaClient: # -- Whether to provision a public OIDC client for SPA use enabled: true - # -- Routing configuration for the frontend NebariApp + # -- Routing configuration for the frontend nebariapp routing: routes: - pathPrefix: / pathType: PathPrefix - # -- Landing page configuration for the frontend NebariApp + # -- Landing page configuration for the frontend nebariapp landingPage: # -- Whether to show the service on the landing page enabled: true