Skip to content

Commit

Permalink
Update helm template
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasasx committed Jul 19, 2022
1 parent f2ebb05 commit e90293a
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.1
0.3.2
2 changes: 1 addition & 1 deletion charts/envrouter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: envrouter
description: Envrouter Helm chart for Kubernetes
type: application
version: "0.3.1"
version: "0.3.2"
appVersion: "v0.3.0"
maintainers:
- name: jonasasx
Expand Down
24 changes: 22 additions & 2 deletions charts/envrouter/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "envrouter.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- 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 -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
Expand All @@ -16,6 +23,9 @@ metadata:
{{- 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 @@ -33,9 +43,19 @@ 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 }}
10 changes: 5 additions & 5 deletions charts/envrouter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ingress:
# -- Additional ingress annotations
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
# kubernetes.io/tls-acme: "true"

# -- List of ingress hosts
## Envrouter Ingress.
Expand All @@ -60,10 +60,10 @@ ingress:
hosts:
- host: envrouter.local
paths:
- path: /
backend:
serviceName: envrouter.local
servicePort: 80
- path: /
backend:
serviceName: envrouter.local
servicePort: 80
# -- Ingress TLS configuration
tls: []
# - secretName: chart-example-tls
Expand Down
Empty file modified scripts/bump-version.sh
100755 → 100644
Empty file.
Empty file modified scripts/helm-docs.sh
100755 → 100644
Empty file.

0 comments on commit e90293a

Please sign in to comment.