Skip to content

Commit

Permalink
Make ingress definition more flexible (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
guilload authored Feb 13, 2025
1 parent 9a01d48 commit 1911317
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 52 deletions.
4 changes: 2 additions & 2 deletions charts/quickwit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: quickwit
description: Sub-second search & analytics engine on cloud storage.
type: application
version: 0.7.14
appVersion: "v0.8.2"
version: 0.7.15
appVersion: v0.8.2
keywords:
- quickwit
- search
Expand Down
22 changes: 0 additions & 22 deletions charts/quickwit/templates/NOTES.txt

This file was deleted.

55 changes: 30 additions & 25 deletions charts/quickwit/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,17 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "quickwit.fullname" . -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
{{- $fullname := include "quickwit.fullname" . }}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
name: {{ $fullname }}
labels:
{{- include "quickwit.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
Expand All @@ -36,25 +23,43 @@ spec:
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
{{- if and .Values.ingress.hosts (eq (first .Values.ingress.hosts).host "*") }}
{{- $host := first .Values.ingress.hosts }}
- http:
paths:
{{- range $host.paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ $fullname }}-{{ .service | default "searcher" }}
{{- $port := .port | default "rest" }}
port:
{{- if kindIs "string" $port }}
name: {{ $port }}
{{- else }}
number: {{ $port }}
{{- end }}
{{- end }}
{{- else }}
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ $fullName }}-searcher
name: {{ $fullname }}-{{ .service | default "searcher" }}
{{- $port := .port | default "rest" }}
port:
name: rest
{{- else }}
serviceName: {{ $fullName }}-searcher
serviceport: rest
{{- end }}
{{- if kindIs "string" $port }}
name: {{ $port }}
{{- else }}
number: {{ $port }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
27 changes: 24 additions & 3 deletions charts/quickwit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ image:
repository: quickwit/quickwit
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
# tag: v0.8.1
# tag: v0.8.2

imagePullSecrets: []
nameOverride: ""
Expand Down Expand Up @@ -625,12 +625,33 @@ ingress:
className: nginx
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 10m
nginx.ingress.kubernetes.io/use-regex: "true"
hosts:
# hostname required here.
- host: chart-example.local
- host: "*"
paths:
# Ingest and ES bulk endpoints to quickwit-indexer
- path: /api/v1/.*/ingest
pathType: ImplementationSpecific
service: indexer
port: rest
- path: /api/v1/_elastic/bulk
pathType: ImplementationSpecific
service: indexer
port: rest
- path: /api/v1/_elastic/.*/_bulk
pathType: ImplementationSpecific
service: indexer
port: rest
# Indexes API endpoints to quickwit-metastore
- path: /api/v1/indexes
pathType: Prefix
service: metastore
port: rest
# Everything else to quickwit-searcher
- path: /
pathType: ImplementationSpecific
service: searcher
port: rest
tls: []
# - secretName: chart-example-tls
# hosts:
Expand Down

0 comments on commit 1911317

Please sign in to comment.