Skip to content

Commit

Permalink
Merge pull request #12 from stackhpc/feat/ingress
Browse files Browse the repository at this point in the history
Add basic ingress support
  • Loading branch information
sd109 authored Apr 4, 2024
2 parents a86498c + 927556b commit 8547109
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ui:

***Warning*** - Exposing the services in this way provides no authentication mechanism and anyone with access to the load balancer IPs will be able to query the language model. It is up to you to secure the running service in your own way. In contrast, when deploying via Azimuth, authentication is provided via the standard Azimuth Identity Provider mechanisms and the authenticated services are exposed via [Zenith](https://github.com/stackhpc/zenith).

The UI can also optionally be exposed using a Kubernetes Ingress resource. See the `ui.ingress` section in `values.yml` for available config options.

## Tested Models

Expand Down
27 changes: 27 additions & 0 deletions chart/templates/ui/service.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.ui.enabled -}}
---
apiVersion: v1
kind: Service
metadata:
Expand All @@ -14,4 +15,30 @@ spec:
type: {{ .Values.ui.service.type }}
selector:
{{- include "azimuth-llm.ui-selectorLabels" . | nindent 4 }}
---
{{- if .Values.ui.ingress.host -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
{{- .Values.ui.ingress.annotations | toYaml | nindent 4 }}
name: {{ .Values.ui.ingress.name | default .Release.Name }}
spec:
ingressClassName: nginx
rules:
- host: {{ .Values.ui.ingress.host | quote }}
http:
paths:
- backend:
service:
name: {{ .Values.ui.service.name }}
port:
number: 80 # Must match Service resource
path: /
pathType: Prefix
tls:
- hosts:
- {{ .Values.ui.ingress.host | quote }}
secretName: {{ .Release.Name }}-tls
{{- end -}}
{{- end -}}
10 changes: 10 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@

},
"required": ["hf_model_name", "hf_model_instruction"]
},
"ingress": {
"type": "object",
"properties": {
"host": {
"type": ["string", "null"],
"title": "Ingress Host",
"description": "An optional custom domain name to expose the UI on (requires an Ingress controller-equipped cluster)"
}
}
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,22 @@ ui:
iconUrl: https://raw.githubusercontent.com/gradio-app/gradio/5524e590577769b0444a5332b8d444aafb0c5c12/js/app/public/static/img/logo.svg
description: |
A web-based user inferface for interacting with the deployed LLM.
# Optional config for an ingress resource to expose the UI
ingress:
# The name of the ingress resource to create (default: Release.Name)
name:
# Any annotations to apply to the ingress resource
# (e.g. for cert-manager TLS integration)
annotations: {}
# The domain name to use for the ingress resource.
# If host is not set then ingress support will be disabled and
# no ingress resource will be created.
# NOTE: If ingress is enabled, an ingress controller must be installed
# on the target cluster before installing this chart.
# For example, see https://kubernetes.github.io/ingress-nginx/deploy/
# TODO: Check what happens if ingress is enabled without a controller deployed
# (probably nothing, just an unused ingress resource will be created)
host:
# The update strategy to use for the deployment
updateStrategy:
rollingUpdate:
Expand Down

0 comments on commit 8547109

Please sign in to comment.