You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ha...@apache.org on 2021/03/25 06:18:29 UTC

[skywalking-kubernetes] branch master updated: improve ingress compatibility (#68)

This is an automated email from the ASF dual-hosted git repository.

hanahmily pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new ad8bf88  improve ingress compatibility (#68)
ad8bf88 is described below

commit ad8bf882f26d07f2093b44a7b9613365be7c34b1
Author: Shiwen Cheng <ch...@gmail.com>
AuthorDate: Thu Mar 25 14:18:24 2021 +0800

    improve ingress compatibility (#68)
---
 chart/skywalking/templates/ui-ingress.yaml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/chart/skywalking/templates/ui-ingress.yaml b/chart/skywalking/templates/ui-ingress.yaml
index b12f3bc..dac773f 100644
--- a/chart/skywalking/templates/ui-ingress.yaml
+++ b/chart/skywalking/templates/ui-ingress.yaml
@@ -16,7 +16,13 @@
 {{- if .Values.ui.ingress.enabled }}
 {{- $serviceName := include "skywalking.ui.fullname" . }}
 {{- $servicePort := .Values.ui.service.externalPort }}
+{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
+apiVersion: networking.k8s.io/v1
+{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" }}
+apiVersion: networking.k8s.io/v1beta1
+{{- else }}
 apiVersion: extensions/v1beta1
+{{- end }}
 kind: Ingress
 metadata:
   labels:
@@ -39,8 +45,18 @@ spec:
         paths:
           - path: /{{ rest $url | join "/" }}
             backend:
+              {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
+              service:
+                name: {{ $serviceName }}
+                port:
+                  number: {{ $servicePort }}
+              {{- else }}
               serviceName: {{ $serviceName }}
               servicePort: {{ $servicePort }}
+              {{- end }}
+            {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }}
+            pathType: Prefix
+            {{- end }}
     {{- end -}}
   {{- if .Values.ui.ingress.tls }}
   tls: