[stable/seq] Feature apiVersion compatibility switch (#18140)

* Add apiVersion compatibility switch for deployment and ingress

Signed-off-by: Markus Schlotbohm <markus_schlotbohm@as-gmbh.de>

* Bump seq chart version

Signed-off-by: Markus Schlotbohm <markus_schlotbohm@as-gmbh.de>
This commit is contained in:
Markus Schlotbohm
2019-11-06 14:03:51 -08:00
committed by Kubernetes Prow Robot
parent 2c9b6dd416
commit c3e446ff96
4 changed files with 26 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: seq
version: 1.0.2
version: 1.0.3
appVersion: 5
description: Seq is the easiest way for development teams to capture, search and visualize structured log events! This page will walk you through the very quick setup process.
keywords:
+23
View File
@@ -30,3 +30,26 @@ Create chart name and version as used by the chart label.
{{- define "seq.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for deployment.
*/}}
{{- define "deployment.apiVersion" -}}
{{- if semverCompare ">=1.9-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "apps/v1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "ingress.apiVersion" -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
+1 -1
View File
@@ -1,4 +1,4 @@
apiVersion: apps/v1
apiVersion: {{ template "deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "seq.fullname" . }}
+1 -1
View File
@@ -2,7 +2,7 @@
{{- $fullName := include "seq.fullname" . -}}
{{- $servicePort := .Values.service.port -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
apiVersion: {{ template "ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ $fullName }}