From 8e6a70eb435f7b565c7ee062f5d3d99260b9a865 Mon Sep 17 00:00:00 2001 From: Igor Zibarev Date: Sun, 9 Aug 2020 16:58:52 +0300 Subject: [PATCH] Use new Ingress API (#1659) `extensions/v1beta1` API for Ingress is deprecated since Kuberentes 1.14. Ref: https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.14.md#deprecations This commit adds a check using Helm Capabilities to deploy Ingress with newer API. --- charts/athens-proxy/Chart.yaml | 2 +- charts/athens-proxy/templates/ingress.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/athens-proxy/Chart.yaml b/charts/athens-proxy/Chart.yaml index 48d54593..0bf01121 100644 --- a/charts/athens-proxy/Chart.yaml +++ b/charts/athens-proxy/Chart.yaml @@ -1,5 +1,5 @@ name: athens-proxy -version: 0.4.12 +version: 0.4.13 appVersion: 0.9.0 description: The proxy server for Go modules icon: https://raw.githubusercontent.com/gomods/athens/main/docs/static/banner.png diff --git a/charts/athens-proxy/templates/ingress.yaml b/charts/athens-proxy/templates/ingress.yaml index e6e899c2..07ddc9d2 100644 --- a/charts/athens-proxy/templates/ingress.yaml +++ b/charts/athens-proxy/templates/ingress.yaml @@ -1,7 +1,11 @@ {{- if .Values.ingress.enabled -}} {{- $serviceName := include "fullname" . -}} {{- $servicePort := .Values.service.servicePort -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} apiVersion: extensions/v1beta1 +{{- end }} kind: Ingress metadata: name: {{ template "fullname" . }}