feat: ingress.path now is an object intead string (#10)
This commit is contained in:
@ -14,4 +14,4 @@ type: library
|
|||||||
|
|
||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
version: 0.5.2
|
version: 1.0.0
|
||||||
|
10
README.md
10
README.md
@ -337,7 +337,8 @@ ingress:
|
|||||||
hosts:
|
hosts:
|
||||||
- host: chart-example.local
|
- host: chart-example.local
|
||||||
paths:
|
paths:
|
||||||
- /path/to/somewhere
|
- path: /path/to/somewhere
|
||||||
|
pathType: ImplementationSpecific
|
||||||
tls:
|
tls:
|
||||||
- secretName: chart-example-tls
|
- secretName: chart-example-tls
|
||||||
hosts:
|
hosts:
|
||||||
@ -380,9 +381,12 @@ spec:
|
|||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
- backend:
|
- backend:
|
||||||
serviceName: release-name-mychart
|
service:
|
||||||
servicePort: 80
|
name: release-name-mychart
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
path: /path/to/somewhere
|
path: /path/to/somewhere
|
||||||
|
pathType: ImplementationSpecific
|
||||||
tls:
|
tls:
|
||||||
- hosts:
|
- hosts:
|
||||||
- "chart-example.local"
|
- "chart-example.local"
|
||||||
|
@ -10,9 +10,9 @@ spec:
|
|||||||
{{- $cronJob := index . 1 }}
|
{{- $cronJob := index . 1 }}
|
||||||
{{- $pod := index . 2 }}
|
{{- $pod := index . 2 }}
|
||||||
{{- $serviceAccount := index . 3 }}
|
{{- $serviceAccount := index . 3 }}
|
||||||
{{- if semverCompare ">=1.21.0" $top.Capabilities.KubeVersion.Version }}
|
{{- if semverCompare ">=1.21-0" $top.Capabilities.KubeVersion.GitVersion -}}
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
{{- else }}
|
{{- else -}}
|
||||||
apiVersion: batch/v1beta1
|
apiVersion: batch/v1beta1
|
||||||
{{- end }}
|
{{- end }}
|
||||||
kind: CronJob
|
kind: CronJob
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
{{- define "common.hpa.tpl" -}}
|
{{- define "common.hpa.tpl" -}}
|
||||||
{{- $top := first . }}
|
{{- $top := first . }}
|
||||||
{{- $autoscaling := index . 1 }}
|
{{- $autoscaling := index . 1 }}
|
||||||
{{- if semverCompare ">=1.23.0" $top.Capabilities.KubeVersion.Version }}
|
{{- if semverCompare ">=1.23-0" $top.Capabilities.KubeVersion.GitVersion -}}
|
||||||
apiVersion: autoscaling/v2
|
apiVersion: autoscaling/v2
|
||||||
{{- else }}
|
{{- else -}}
|
||||||
apiVersion: autoscaling/v2beta2
|
apiVersion: autoscaling/v2beta2
|
||||||
{{- end }}
|
{{- end }}
|
||||||
kind: HorizontalPodAutoscaler
|
kind: HorizontalPodAutoscaler
|
||||||
|
@ -14,11 +14,11 @@ annotations:
|
|||||||
{{- $service := index . 2 }}
|
{{- $service := index . 2 }}
|
||||||
{{- $fullName := include "common.fullname" $top }}
|
{{- $fullName := include "common.fullname" $top }}
|
||||||
{{- $svcPort := $service.port }}
|
{{- $svcPort := $service.port }}
|
||||||
{{- if semverCompare ">=1.19.0" $top.Capabilities.KubeVersion.Version }}
|
{{- if semverCompare ">=1.19-0" $top.Capabilities.KubeVersion.GitVersion -}}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
{{- else if semverCompare ">=1.14.0" $top.Capabilities.KubeVersion.Version }}
|
{{- else if semverCompare ">=1.14-0" $top.Capabilities.KubeVersion.GitVersion -}}
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
{{- else }}
|
{{- else -}}
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: extensions/v1beta1
|
||||||
{{- end }}
|
{{- end }}
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
@ -41,12 +41,22 @@ spec:
|
|||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
{{- range .paths }}
|
{{- range .paths }}
|
||||||
- path: {{ . }}
|
- path: {{ .path }}
|
||||||
|
{{- if and .pathType (semverCompare ">=1.18-0" $top.Capabilities.KubeVersion.GitVersion) }}
|
||||||
|
pathType: {{ .pathType }}
|
||||||
|
{{- end }}
|
||||||
backend:
|
backend:
|
||||||
|
{{- if semverCompare ">=1.19-0" $top.Capabilities.KubeVersion.GitVersion }}
|
||||||
|
service:
|
||||||
|
name: {{ $fullName }}
|
||||||
|
port:
|
||||||
|
number: {{ $svcPort }}
|
||||||
|
{{- else }}
|
||||||
serviceName: {{ $fullName }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: {{ $svcPort }}
|
servicePort: {{ $svcPort }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- define "common.ingress" -}}
|
{{- define "common.ingress" -}}
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
{{- define "common.pdb.tpl" -}}
|
{{- define "common.pdb.tpl" -}}
|
||||||
{{- $top := first . }}
|
{{- $top := first . }}
|
||||||
{{- $pdb := index . 1 }}
|
{{- $pdb := index . 1 }}
|
||||||
{{- if semverCompare ">=1.21.0" $top.Capabilities.KubeVersion.Version }}
|
{{- if semverCompare ">=1.21-0" $top.Capabilities.KubeVersion.GitVersion -}}
|
||||||
apiVersion: policy/v1
|
apiVersion: policy/v1
|
||||||
{{- else }}
|
{{- else -}}
|
||||||
apiVersion: policy/v1beta1
|
apiVersion: policy/v1beta1
|
||||||
{{- end }}
|
{{- end }}
|
||||||
kind: PodDisruptionBudget
|
kind: PodDisruptionBudget
|
||||||
|
Reference in New Issue
Block a user