diff --git a/incubator/vault/Chart.yaml b/incubator/vault/Chart.yaml index 11c75c78d0..e7c5fac5f1 100644 --- a/incubator/vault/Chart.yaml +++ b/incubator/vault/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: A Helm chart for Vault, a tool for managing secrets name: vault -version: 0.22.2 +version: 0.23.0 appVersion: 1.2.3 home: https://www.vaultproject.io/ icon: https://www.vaultproject.io/assets/images/mega-nav/logo-vault-0f83e3d2.svg diff --git a/incubator/vault/templates/_helpers.tpl b/incubator/vault/templates/_helpers.tpl index 3f3a52633c..37f1386980 100644 --- a/incubator/vault/templates/_helpers.tpl +++ b/incubator/vault/templates/_helpers.tpl @@ -41,3 +41,36 @@ Create chart name and version as used by the chart label. {{- define "vault.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the apiVersion of deployment. +*/}} +{{- define "deployment.apiVersion" -}} +{{- if .Capabilities.APIVersions.Has "apps/v1" -}} + {{- print "apps/v1" -}} +{{- else -}} + {{- print "extensions/v1beta1" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the apiVersion of ingress. +*/}} +{{- define "ingress.apiVersion" -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}} + {{- print "networking.k8s.io/v1beta1" -}} +{{- else -}} + {{- print "extensions/v1beta1" -}} +{{- end -}} +{{- end -}} + +{{/* +Return the apiVersion of networkPolicy. +*/}} +{{- define "networkPolicy.apiVersion" -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}} + {{- print "networking.k8s.io/v1" -}} +{{- else -}} + {{- print "extensions/v1beta1" -}} +{{- end -}} +{{- end -}} diff --git a/incubator/vault/templates/deployment.yaml b/incubator/vault/templates/deployment.yaml index 44b607c9bf..5ae75e77a4 100644 --- a/incubator/vault/templates/deployment.yaml +++ b/incubator/vault/templates/deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: {{ template "deployment.apiVersion" . }} kind: Deployment metadata: name: {{ template "vault.fullname" . }} diff --git a/incubator/vault/templates/ingress.yaml b/incubator/vault/templates/ingress.yaml index 6ab1192a8a..8073a117f5 100644 --- a/incubator/vault/templates/ingress.yaml +++ b/incubator/vault/templates/ingress.yaml @@ -1,7 +1,7 @@ {{- if .Values.ingress.enabled -}} {{- $serviceName := include "vault.fullname" . -}} {{- $servicePort := .Values.service.externalPort -}} -apiVersion: networking.k8s.io/v1beta1 +apiVersion: {{ template "ingress.apiVersion" . }} kind: Ingress metadata: name: {{ template "vault.fullname" . }}