Skip to content

The Unified and Autonomous Development Platform

feat(chart): add settings to support using custom cluster-manager issuers instead of the default one from the chart

Nex Zhu5d540ba097c4
diff --git a/server-product/helm/build.sh b/server-product/helm/build.sh
index 1b317a46d3..5ed416fac9 100755
--- a/server-product/helm/build.sh
+++ b/server-product/helm/build.sh
@@ -19,5 +19,3 @@ fi
cd helm-chart
tar zcvf onedev-${buildVersion}.tgz onedev
-
-
diff --git a/server-product/helm/templates/ingress.yaml b/server-product/helm/templates/ingress.yaml
index 3ad847b4fd..804c3256ff 100644
--- a/server-product/helm/templates/ingress.yaml
+++ b/server-product/helm/templates/ingress.yaml
@@ -3,9 +3,12 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "onedev.fullname" . }}
- {{- if .Values.letsencrypt.email }}
+ {{- with .Values.ingress.annotations }}
annotations:
+ {{- if and $.Values.ingress.enableDefaultIssuer $.Values.letsencrypt.email }}
cert-manager.io/issuer: "{{ include "onedev.fullname" . }}"
+ {{- end }}
+ {{- toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.class }}
@@ -24,6 +27,6 @@ spec:
backend:
service:
name: {{ include "onedev.fullname" . }}
- port:
+ port:
number: 80
{{- end }}
diff --git a/server-product/helm/templates/issuer.yaml b/server-product/helm/templates/issuer.yaml
index 56b431a651..f674d62b76 100644
--- a/server-product/helm/templates/issuer.yaml
+++ b/server-product/helm/templates/issuer.yaml
@@ -1,4 +1,4 @@
-{{- if .Values.letsencrypt.email -}}
+{{- if and .Values.ingress.enableDefaultIssuer .Values.letsencrypt.email -}}
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
diff --git a/server-product/helm/values.yaml b/server-product/helm/values.yaml
index 5e12d4d7f0..dd058577fb 100644
--- a/server-product/helm/values.yaml
+++ b/server-product/helm/values.yaml
@@ -17,6 +17,13 @@ ingress:
tls: false
## Will be used as ingressClassName of ingress spec to match controller
class: nginx
+ ## Set to false to disable the default certificate issuer from this chart if you want to use a custom one
+ enableDefaultIssuer: true
+ ## Custom annotations for the ingress
+ annotations: {}
+ # kubernetes.io/tls-acme: "true"
+ # cert-manager.io/issuer: ""
+ # cert-manager.io/cluster-issuer: ""
letsencrypt:
## Specify an email here to enable LetsEncrypt.