From f43e0522026f35ac428cc9d0c01c1f556441d92b Mon Sep 17 00:00:00 2001 From: greg pereira Date: Tue, 6 May 2025 16:18:28 -0700 Subject: [PATCH 1/2] stub OCP ingress controller into opinionated install Signed-off-by: greg pereira --- charts/llm-d/Chart.yaml | 2 +- charts/llm-d/README.md | 2 +- .../llm-d/templates/sample-application/ingress.yaml | 13 ++++++++----- quickstart/llmd-installer.sh | 5 ++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/charts/llm-d/Chart.yaml b/charts/llm-d/Chart.yaml index 02e493e..5ca90cc 100644 --- a/charts/llm-d/Chart.yaml +++ b/charts/llm-d/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: llm-d type: application -version: 0.5.1 +version: 0.5.2 appVersion: "0.0.1" icon: data:null description: A Helm chart for llm-d diff --git a/charts/llm-d/README.md b/charts/llm-d/README.md index 0bfc457..083c27a 100644 --- a/charts/llm-d/README.md +++ b/charts/llm-d/README.md @@ -1,7 +1,7 @@ # llm-d Helm Chart for OpenShift -![Version: 0.5.1](https://img.shields.io/badge/Version-0.5.1-informational?style=flat-square) +![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) A Helm chart for llm-d diff --git a/charts/llm-d/templates/sample-application/ingress.yaml b/charts/llm-d/templates/sample-application/ingress.yaml index d4babfc..4b6117e 100644 --- a/charts/llm-d/templates/sample-application/ingress.yaml +++ b/charts/llm-d/templates/sample-application/ingress.yaml @@ -1,10 +1,12 @@ +{{- $gatewayFullname := include "gateway.fullname" . }} +{{- $host := include "common.tplvalues.render" ( dict "value" .Values.ingress.host "context" $ ) | default "localhost" }} {{- if and .Values.gateway.enabled .Values.ingress.enabled (eq .Values.gateway.serviceType "NodePort") }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: - name: {{ include "gateway.fullname" . }} + name: {{ $gatewayFullname }} labels: {{ include "common.labels.standard" $ | nindent 4 }} - app.kubernetes.io/gateway: {{ include "gateway.fullname" . }} + app.kubernetes.io/gateway: {{ $gatewayFullname }} app.kubernetes.io/component: sample-application {{- if $.Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} @@ -24,7 +26,7 @@ spec: tls: {{- if .Values.ingress.tls.enabled }} - hosts: - - {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.host "context" $ ) }} + - {{ $gatewayFullname }}.{{ $host }} secretName: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.tls.secretName "context" $ ) }} {{- end }} {{- if .Values.ingress.extraTls }} @@ -32,9 +34,10 @@ spec: {{- end }} {{- end }} rules: + {{- range .Values.gateway.listeners }} - {{ if $.Values.ingress.host -}} - host: {{ include "common.tplvalues.render" ( dict "value" $.Values.ingress.host "context" $ ) }} + host: {{ $gatewayFullname }}.{{ $host }} {{ end -}} http: paths: @@ -42,7 +45,7 @@ spec: pathType: Prefix backend: service: - name: {{ include "gateway.fullname" $ }} + name: {{ $gatewayFullname }} port: number: {{ .port }} {{- end }} diff --git a/quickstart/llmd-installer.sh b/quickstart/llmd-installer.sh index a42cfc2..2b804a0 100755 --- a/quickstart/llmd-installer.sh +++ b/quickstart/llmd-installer.sh @@ -246,12 +246,15 @@ install() { helm dependency build . log_success "✅ Dependencies built" + BASE_OCP_DOMAIN=$(kubectl get ingresscontroller default -n openshift-ingress-operator -o jsonpath='{.status.domain}') + log_info "🚚 Deploying llm-d chart with ${VALUES_PATH}..." helm upgrade -i llm-d . \ ${DEBUG} \ --namespace "${NAMESPACE}" \ --values "${VALUES_PATH}" \ - --set gateway.parameters.proxyUID="${PROXY_UID}" + --set gateway.parameters.proxyUID="${PROXY_UID}" \ + --set ingress.host="${BASE_OCP_DOMAIN}" log_success "✅ llm-d deployed" log_info "🔄 Patching all ServiceAccounts with pull-secret..." From 2d1aa562e155f7586f475eab44287620fd05d3c8 Mon Sep 17 00:00:00 2001 From: greg pereira Date: Wed, 7 May 2025 20:59:55 -0700 Subject: [PATCH 2/2] remove backstage references and respect passing host Signed-off-by: greg pereira --- charts/llm-d/README.md | 8 ++++---- .../llm-d/templates/sample-application/_helpers.tpl | 9 +++++++++ .../llm-d/templates/sample-application/ingress.yaml | 11 ++++------- charts/llm-d/values.yaml | 10 +++++----- quickstart/llmd-installer.sh | 2 +- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/charts/llm-d/README.md b/charts/llm-d/README.md index 083c27a..2768fc5 100644 --- a/charts/llm-d/README.md +++ b/charts/llm-d/README.md @@ -159,11 +159,11 @@ Kubernetes: `>= 1.25.0-0` | ingress | Ingress configuration | object | `{"annotations":{},"enabled":true,"extraHosts":[],"extraTls":[],"host":"","ingressClassName":"","path":"/","tls":{"enabled":false,"secretName":""}}` | | ingress.annotations | Additional annotations for the Ingress resource | object | `{}` | | ingress.enabled | Deploy Ingress | bool | `true` | -| ingress.extraHosts | List of additional hostnames to be covered with this ingress record (e.g. a CNAME) | list | `[]` | -| ingress.extraTls | The TLS configuration for additional hostnames to be covered with this ingress record.
Ref: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls | list | `[]` | -| ingress.host | Hostname to be used to expose the route to access the backstage application (e.g: backstage.IP.nip.io) | string | `""` | +| ingress.extraHosts | List of additional hostnames to be covered with this ingress record (e.g. a CNAME) | list | `[]` | +| ingress.extraTls | The TLS configuration for additional hostnames to be covered with this ingress record.
Ref: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls | list | `[]` | +| ingress.host | Hostname to be used to expose the NodePort service to the inferencing gateway | string | `""` | | ingress.ingressClassName | Name of the IngressClass cluster resource which defines which controller will implement the resource (e.g nginx) | string | `""` | -| ingress.path | Path to be used to expose the full route to access the backstage application (e.g: IP.nip.io/backstage) | string | `"/"` | +| ingress.path | Path to be used to expose the full route to access the inferencing gateway | string | `"/"` | | ingress.tls | Ingress TLS parameters | object | `{"enabled":false,"secretName":""}` | | ingress.tls.enabled | Enable TLS configuration for the host defined at `ingress.host` parameter | bool | `false` | | ingress.tls.secretName | The name to which the TLS Secret will be called | string | `""` | diff --git a/charts/llm-d/templates/sample-application/_helpers.tpl b/charts/llm-d/templates/sample-application/_helpers.tpl index dbe4179..175722d 100644 --- a/charts/llm-d/templates/sample-application/_helpers.tpl +++ b/charts/llm-d/templates/sample-application/_helpers.tpl @@ -14,3 +14,12 @@ Sanitize the model name into a valid k8s label. {{- $name -}} {{- end }} + + +{{- define "sampleApplication.ingressHost" -}} + {{- if .Values.ingress.host -}} + {{- include "common.tplvalues.render" ( dict "value" .Values.ingress.host "context" $ ) }} + {{- else }} + {{- include "gateway.fullname" . }}.{{ default "localhost" .Values.ingress.clusterRouterBase }} + {{- end}} +{{- end }} diff --git a/charts/llm-d/templates/sample-application/ingress.yaml b/charts/llm-d/templates/sample-application/ingress.yaml index 4b6117e..d8676e4 100644 --- a/charts/llm-d/templates/sample-application/ingress.yaml +++ b/charts/llm-d/templates/sample-application/ingress.yaml @@ -1,6 +1,6 @@ -{{- $gatewayFullname := include "gateway.fullname" . }} -{{- $host := include "common.tplvalues.render" ( dict "value" .Values.ingress.host "context" $ ) | default "localhost" }} {{- if and .Values.gateway.enabled .Values.ingress.enabled (eq .Values.gateway.serviceType "NodePort") }} +{{- $gatewayFullname := include "gateway.fullname" . }} +{{- $host := include "sampleApplication.ingressHost" . }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -26,7 +26,7 @@ spec: tls: {{- if .Values.ingress.tls.enabled }} - hosts: - - {{ $gatewayFullname }}.{{ $host }} + - {{ $host }} secretName: {{ include "common.tplvalues.render" ( dict "value" .Values.ingress.tls.secretName "context" $ ) }} {{- end }} {{- if .Values.ingress.extraTls }} @@ -34,11 +34,8 @@ spec: {{- end }} {{- end }} rules: - {{- range .Values.gateway.listeners }} - - {{ if $.Values.ingress.host -}} - host: {{ $gatewayFullname }}.{{ $host }} - {{ end -}} + - host: {{ $host }} http: paths: - path: {{ .path }} diff --git a/charts/llm-d/values.yaml b/charts/llm-d/values.yaml index 0772d3b..6a0da6d 100644 --- a/charts/llm-d/values.yaml +++ b/charts/llm-d/values.yaml @@ -121,19 +121,19 @@ ingress: # -- Additional annotations for the Ingress resource annotations: {} - # -- Hostname to be used to expose the route to access the backstage application (e.g: backstage.IP.nip.io) + # -- Hostname to be used to expose the NodePort service to the inferencing gateway host: "" # -- List of additional hostnames to be covered with this ingress record (e.g. a CNAME) # extraHosts: [] - # -- Path to be used to expose the full route to access the backstage application (e.g: IP.nip.io/backstage) + # -- Path to be used to expose the full route to access the inferencing gateway path: "/" # -- Ingress TLS parameters @@ -150,8 +150,8 @@ ingress: # + # - llm-d.env.example.com + # secretName: llm-d-env --> extraTls: [] auth: diff --git a/quickstart/llmd-installer.sh b/quickstart/llmd-installer.sh index 2b804a0..23c3af4 100755 --- a/quickstart/llmd-installer.sh +++ b/quickstart/llmd-installer.sh @@ -254,7 +254,7 @@ install() { --namespace "${NAMESPACE}" \ --values "${VALUES_PATH}" \ --set gateway.parameters.proxyUID="${PROXY_UID}" \ - --set ingress.host="${BASE_OCP_DOMAIN}" + --set ingress.clusterRouterBase="${BASE_OCP_DOMAIN}" log_success "✅ llm-d deployed" log_info "🔄 Patching all ServiceAccounts with pull-secret..."