Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Ingress configuration values and schema #40

Merged
merged 2 commits into from
Dec 6, 2024
Merged
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
22 changes: 2 additions & 20 deletions charts/perses/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "perses.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.ingressClassName (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
nicolastakashi marked this conversation as resolved.
Show resolved Hide resolved
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.ingressClassName}}
{{- end }}
{{- end }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
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 }}
Expand All @@ -23,7 +12,7 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and .Values.ingress.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
nicolastakashi marked this conversation as resolved.
Show resolved Hide resolved
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
{{- if .Values.ingress.tls }}
Expand All @@ -43,19 +32,12 @@ spec:
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 }}
port:
number: {{ $svcPort }}
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
49 changes: 34 additions & 15 deletions charts/perses/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,39 @@
"hosts": {
"type": "array",
"items": {
"type": "string"
"type": "object",
"properties": {
"host": {
"type": "string"
},
"paths": {
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"pathType": {
"type": "string",
"enum": [
"Exact",
"Prefix",
"ImplementationSpecific"
]
}
},
"required": [
"path",
"pathType"
]
}
}
},
"required": [
"host",
"paths"
]
}
},
"ingressClassName": {
Expand All @@ -699,17 +731,6 @@
"annotations": {
"type": "object"
},
"path": {
"type": "string"
},
"pathType": {
"type": "string",
"enum": [
"Exact",
"Prefix",
"ImplementationSpecific"
]
},
"tls": {
"type": "array",
"items": {
Expand All @@ -734,9 +755,7 @@
}
},
"required": [
"hosts",
"path",
"pathType"
"hosts"
]
},
"serviceAccount": {
Expand Down
11 changes: 4 additions & 7 deletions charts/perses/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ ingress:

# -- Default host for the ingress resource
hosts:
- perses.local
- host: perses.local
paths:
- path: /
pathType: Prefix

# -- IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+)
# This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster .
Expand All @@ -204,12 +207,6 @@ ingress:
# ref: https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md
annotations: {}

# -- Ingress path
path: /

# -- Ingress path type
pathType: Prefix

# -- Ingress TLS configuration
tls: []
# - secretName: ingress-cert
Expand Down
Loading