Skip to content

Commit

Permalink
Merge pull request #100 from consideRatio/pr/update-ingress
Browse files Browse the repository at this point in the history
Update ingress config to align with zj2h config format
  • Loading branch information
GeorgianaElena authored May 22, 2024
2 parents 8e1762c + 263a589 commit de22387
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 29 deletions.
34 changes: 14 additions & 20 deletions binderhub-service/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,26 @@ metadata:
{{- . | toYaml | nindent 4 }}
{{- end }}
spec:
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
{{- with .Values.ingress.tls }}
tls:
{{- range . }}
- hosts:
{{- .hosts | toYaml | nindent 8 }}
secretName: {{ .secretName }}
{{- end }}
{{- with .Values.ingress.ingressClassName }}
ingressClassName: "{{ . }}"
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
{{- range $host := .Values.ingress.hosts | default (list "") }}
- http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- with .pathType }}
pathType: {{ . }}
{{- end }}
- path: {{ $.Values.config.BinderHub.base_url | trimSuffix "/" }}/{{ $.Values.ingress.pathSuffix }}
pathType: {{ $.Values.ingress.pathType }}
backend:
service:
name: {{ include "binderhub-service.fullname" $ }}
port:
number: {{ $.Values.service.port }}
{{- end }}
name: http
{{- if $host }}
host: {{ $host | quote }}
{{- end }}
{{- end }}
{{- with .Values.ingress.tls }}
tls:
{{- . | toYaml | nindent 4 }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions binderhub-service/values.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ properties:
properties:
enabled:
type: boolean
className:
annotations: *labels-and-annotations
ingressClassName:
type: [string, "null"]
hosts:
type: array
Expand All @@ -188,7 +189,6 @@ properties:
enum: [Prefix, Exact, ImplementationSpecific]
tls:
type: array
annotations: *labels-and-annotations

# DaemonSet resource - docker-api
# ---------------------------------------------------------------------------
Expand Down
10 changes: 4 additions & 6 deletions binderhub-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,11 @@ service:
#
ingress:
enabled: false
className: ""
annotations: {}
hosts:
- host: chart-example.local
paths:
- path: /
pathType: ImplementationSpecific
ingressClassName:
hosts: []
pathSuffix:
pathType: Prefix
tls: []

# DaemonSet resource - docker-api
Expand Down
13 changes: 12 additions & 1 deletion tools/templates/lint-and-validate-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,18 @@ service:
# -----------------------------------------------------------------------------
#
ingress:
enabled: false
enabled: true
ingressClassName: mock-ingress-class-name
hosts:
- mocked1.domain.name
- mocked2.domain.name
pathSuffix: dummy-pathSuffix
pathType: ImplementationSpecific
tls:
- secretName: tls
hosts:
- mocked1.domain.name
- mocked2.domain.name

# DaemonSet resource - docker-api
# -----------------------------------------------------------------------------
Expand Down

0 comments on commit de22387

Please sign in to comment.