diff --git a/helm/cosmo/templates/ingress.yaml b/helm/cosmo/templates/ingress.yaml index abf3bf9541..913be1417f 100644 --- a/helm/cosmo/templates/ingress.yaml +++ b/helm/cosmo/templates/ingress.yaml @@ -35,6 +35,19 @@ spec: secretName: {{ .secretName }} {{- end }} {{- end }} + {{- if .Values.ingress.defaultBackend }} + {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }} + defaultBackend: + service: + name: {{ .Values.ingress.defaultBackend.name }} + port: + number: {{ .Values.ingress.defaultBackend.port }} + {{- else }} + backend: + serviceName: {{ .Values.ingress.defaultBackend.name }} + servicePort: {{ .Values.ingress.defaultBackend.port }} + {{- end }} + {{- end }} rules: {{- if .Values.global.controlplane.enabled }} - host: {{ (urlParse .Values.global.controlplane.webUrl).host | quote }} diff --git a/helm/cosmo/values.yaml b/helm/cosmo/values.yaml index e823d46a38..45460528d4 100644 --- a/helm/cosmo/values.yaml +++ b/helm/cosmo/values.yaml @@ -111,6 +111,9 @@ ingress: # - secretName: chart-example-tls # hosts: # - chart-example.local + # defaultBackend: + # name: chart-example-service + # port: 1234 # Cosmo CDN. For more options, please refer to the README.md cdn: