mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-24 16:09:08 +00:00
Merge pull request #68 from k8s-at-home/bug/media-common
[media-common] fix nested kube check and update for kube version 1.19 check
This commit is contained in:
commit
d90ddd9e2b
@ -2,7 +2,7 @@ apiVersion: v2
|
||||
name: media-common
|
||||
description: Common dependancy chart for media ecosystem containers
|
||||
type: application
|
||||
version: 1.2.0
|
||||
version: 1.3.0
|
||||
keywords:
|
||||
- media-common
|
||||
home: https://github.com/k8s-at-home/charts/tree/master/charts/media-common
|
||||
|
@ -1,7 +1,10 @@
|
||||
{{- if .Values.ingress.enabled -}}
|
||||
{{- $kubeVersion := .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- $fullName := include "media-common.fullname" . -}}
|
||||
{{- $svcPort := .Values.service.port -}}
|
||||
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- if semverCompare ">= 1.19-0" $kubeVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">= 1.14-0 < 1.19-0" $kubeVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
@ -32,15 +35,27 @@ spec:
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ . }}
|
||||
- path: {{ .path }}
|
||||
{{- if semverCompare ">= 1.14-0" $kubeVersion}}
|
||||
pathType: {{ .pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">= 1.19-0" $kubeVersion}}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
name: http
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $index, $ingress := .Values.ingress.extraIngresses }}
|
||||
---
|
||||
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||
{{- if semverCompare ">= 1.19-0" $kubeVersion -}}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
{{- else if semverCompare ">= 1.14-0 < 1.19-0" $kubeVersion -}}
|
||||
apiVersion: networking.k8s.io/v1beta1
|
||||
{{- else -}}
|
||||
apiVersion: extensions/v1beta1
|
||||
@ -71,11 +86,21 @@ spec:
|
||||
http:
|
||||
paths:
|
||||
{{- range .paths }}
|
||||
- path: {{ . }}
|
||||
- path: {{ .path }}
|
||||
{{- if semverCompare ">= 1.14-0" $kubeVersion}}
|
||||
pathType: {{ .pathType }}
|
||||
{{- end }}
|
||||
backend:
|
||||
{{- if semverCompare ">= 1.19-0" $kubeVersion}}
|
||||
service:
|
||||
name: {{ $fullName }}
|
||||
port:
|
||||
name: http
|
||||
{{- else }}
|
||||
serviceName: {{ $fullName }}
|
||||
servicePort: {{ $svcPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
@ -50,7 +50,9 @@ ingress:
|
||||
hosts:
|
||||
- host: chart-example.local
|
||||
paths:
|
||||
- /
|
||||
- path: /
|
||||
# Ignored if not kubeVersion >= 1.14-0
|
||||
pathType: Prefix
|
||||
tls: []
|
||||
# - secretName: chart-example-tls
|
||||
# hosts:
|
||||
@ -65,7 +67,9 @@ ingress:
|
||||
# hosts:
|
||||
# - host: chart-example.local
|
||||
# paths:
|
||||
# - /api
|
||||
# - path: /api
|
||||
# # Ignored if not kubeVersion >= 1.14-0
|
||||
# pathType: Prefix
|
||||
# tls: []
|
||||
# # - secretName: chart-example-tls
|
||||
# # hosts:
|
||||
|
Loading…
Reference in New Issue
Block a user