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

jibin pushed a commit to branch main
in repository 
https://gitbox.apache.org/repos/asf/incubator-devlake-helm-chart.git


The following commit(s) were added to refs/heads/main by this push:
     new 75ac8a5  feat: enable selection of default Nginx ingress vs generic 
one. (#104)
75ac8a5 is described below

commit 75ac8a5bdebae65548d3037f69240f9df991b22d
Author: Jorge GarcĂ­a <[email protected]>
AuthorDate: Mon Apr 3 03:42:18 2023 +0200

    feat: enable selection of default Nginx ingress vs generic one. (#104)
---
 charts/devlake/templates/ingresses.yaml | 14 ++++++++++++--
 charts/devlake/values.yaml              |  6 ++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/charts/devlake/templates/ingresses.yaml 
b/charts/devlake/templates/ingresses.yaml
index 8406ab4..dafde05 100644
--- a/charts/devlake/templates/ingresses.yaml
+++ b/charts/devlake/templates/ingresses.yaml
@@ -36,7 +36,9 @@ metadata:
   labels:
     {{- include "devlake.labels" . | nindent 4 }}
   annotations:
+  {{- if .Values.ingress.useDefaultNginx }}
     nginx.ingress.kubernetes.io/rewrite-target: /$2
+  {{- end}}
   {{- with .Values.ingress.annotations }}
     {{- toYaml . | nindent 4 }}
   {{- end }}
@@ -55,7 +57,11 @@ spec:
       http:
         paths:
           {{- if not .Values.grafana.useExternal }}
+          {{- if .Values.ingress.useDefaultNginx }}
           - path: /{{ include "devlake.grafanaEndpointPrefix" . }}(/|$)(.*)
+          {{- else }}
+          - path: /{{ include "devlake.grafanaEndpointPrefix" . }}
+          {{- end }}
             {{- if semverCompare ">=1.18-0" 
$.Capabilities.KubeVersion.GitVersion }}
             pathType: Prefix
             {{- end }}
@@ -69,8 +75,12 @@ spec:
               serviceName: {{ include "devlake.fullname" . }}-grafana
               servicePort: 3000
               {{- end }}
-            {{- end }}
+          {{- end }}
+          {{- if .Values.ingress.useDefaultNginx }}
           - path: /{{ include "devlake.uiEndpointPrefix" . }}(/?|$)(.*)
+          {{- else }}
+          - path: /{{ include "devlake.uiEndpointPrefix" . }}
+          {{- end}}
             {{- if semverCompare ">=1.18-0" 
$.Capabilities.KubeVersion.GitVersion }}
             pathType: Prefix
             {{- end }}
@@ -85,7 +95,7 @@ spec:
               servicePort: 4000
               {{- end }}
 
-{{- if .Values.grafana.useExternal }}
+{{- if and .Values.ingress.useDefaultNginx .Values.grafana.useExternal }}
 ---
 {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
 apiVersion: networking.k8s.io/v1
diff --git a/charts/devlake/values.yaml b/charts/devlake/values.yaml
index c621e8b..a669646 100644
--- a/charts/devlake/values.yaml
+++ b/charts/devlake/values.yaml
@@ -116,6 +116,9 @@ grafana:
     repository: apache/devlake-dashboard
     pullPolicy: Always
 
+  # If true, the default Nginx configuration will support a permanent redirect
+  # in the tool's menu. Should you use a different ingress controller, you'll 
need
+  # to add the ingress with the permanent redirect.
   useExternal: false
 
   externalUrl: ''
@@ -196,6 +199,9 @@ ingress:
   enabled: false
   enableHttps: false
   className: ""
+  # Set to false if you want to use a different ingress controller
+  useDefaultNginx: true
+  # Add annotations required for your ingress controller. Uncomment for Nginx.
   annotations: {}
     # kubernetes.io/ingress.class: nginx
     # kubernetes.io/tls-acme: "true"

Reply via email to