Skip to content

Commit

Permalink
Merge remote-tracking branch 'eclipse/master' into feature/use_hawkbi…
Browse files Browse the repository at this point in the history
…t_0.5.0
  • Loading branch information
lharzenetter committed Oct 7, 2024
2 parents cde5ab4 + 8806852 commit e257aca
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
11 changes: 11 additions & 0 deletions charts/hawkbit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,14 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "hawkbit.ingressAPIVersion" -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" -}}
{{- print "networking.k8s.io/v1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- end -}}
{{- end -}}
15 changes: 14 additions & 1 deletion charts/hawkbit/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $apiVersion := include "hawkbit.ingressAPIVersion" . -}}
{{- $fullName := include "hawkbit.fullname" . -}}
apiVersion: networking.k8s.io/v1beta1
apiVersion: {{ $apiVersion }}
kind: Ingress
metadata:
name: {{ $fullName }}
Expand All @@ -21,16 +22,28 @@ spec:
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- if eq $apiVersion "networking.k8s.io/v1" }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
{{- if eq $apiVersion "networking.k8s.io/v1" }}
pathType: Prefix
backend:
service:
name: {{ $fullName }}
port:
name: http
{{- else }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/hawkbit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ readinessProbe:

ingress:
enabled: false
ingressClassName:
annotations: {}
# ingress.kubernetes.io/ssl-redirect: "true"
# kubernetes.io/tls-acme: "true"
Expand Down

0 comments on commit e257aca

Please sign in to comment.