Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 31 additions & 12 deletions charts/skypilot/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,35 @@ spec:
{{- if $useNewIngressClass }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}

rules:
- host: {{ .Values.ingress.host }}
http:
paths:
{{- /* TODO(aylei): check whether this works for ingress-controllers other than nginx */}}
- pathType: {{ if eq .Values.ingress.path "/" }}Prefix{{ else }}ImplementationSpecific{{ end }}
path: {{ .Values.ingress.path }}{{ if ne .Values.ingress.path "/" }}(/|$)(.*){{ end }}
backend:
service:
name: {{ .Release.Name }}-api-service
port:
number: 80
{{- end }}
{{- if .Values.ingress.hosts }}
{{- /* --- Multi-host mode --- */}}
{{- range .Values.ingress.hosts }}
- host: {{ .host | default "null" }}
http:
paths:
{{- range .paths }}
- pathType: {{ if eq .path "/" }}Prefix{{ else }}ImplementationSpecific{{ end }}
path: {{ .path }}
backend:
service:
name: {{ printf "%s-%s" $.Release.Namespace .serviceName }}
port:
number: {{ .servicePort }}
{{- end }}
{{- end }}
{{- else }}
{{- /* --- Backward compatibility (single-host mode) --- */}}
- host: {{ .Values.ingress.host | default "null" }}
http:
paths:
- pathType: {{ if eq .Values.ingress.path "/" }}Prefix{{ else }}ImplementationSpecific{{ end }}
path: {{ .Values.ingress.path | default "/" }}{{ if and .Values.ingress.path (ne .Values.ingress.path "/") }}(/|$)(.*){{ end }}
backend:
service:
name: {{ .Release.Name }}-api-service
port:
number: 80
{{- end }}
{{- end }}
30 changes: 30 additions & 0 deletions charts/skypilot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,36 @@ ingress:
# Host to exclusively accept traffic from (optional) - will respond to all host requests if not set
# @schema type: [string, null]
host: null
## -----------------------------------------------------------------------------
## Adding support for multiple hosts and backend services
##
## This replaces the legacy single 'ingress.host' key.
## Each item in the list defines:
## - a hostname (DNS name)
## - one or more backend services (paths)
##
## Example:
## hosts:
## - host: null
## paths:
## - path: /
## serviceName: skypilot-api-service
## servicePort: 80
## - path: /grafana
## serviceName: skypilot-grafana
## servicePort: 80
## - host: mlflow.company.com
## paths:
## - path: /
## serviceName: mlflow-tracking
## servicePort: 5000
##
## Notes:
## - All hosts will share the same TLS certificate (see annotations below).
## - Paths are defined per host; each path routes to a Kubernetes Service.
## - You can mix multiple paths per host (e.g. /grafana β†’ grafana service).
## - To keep backward compatibility, you can still define a single host.
## -----------------------------------------------------------------------------
# The base path of API server, you may use different path to expose multiple API server through a unified ingress-controller
path: '/'
# Ingress class name (for newer Kubernetes versions)
Expand Down
Loading