From 748868548912eee8434425fab13a2027c74cdccf Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Mon, 13 Nov 2023 10:55:21 +0200 Subject: [PATCH 01/12] updtae ingress templates --- helm-chart/Chart.yaml | 2 +- helm-chart/cvat.values.yaml | 47 +------------ helm-chart/templates/analytics/ingress.yaml | 36 ++++------ helm-chart/templates/ingress.yaml | 59 ++++++++-------- helm-chart/values.yaml | 75 ++++++--------------- 5 files changed, 63 insertions(+), 156 deletions(-) diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index cd0db7ba9071..fc4021aef79e 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.10.3 +version: 0.11.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm-chart/cvat.values.yaml b/helm-chart/cvat.values.yaml index 9765325f3cc1..9cb5b0d3ff1a 100644 --- a/helm-chart/cvat.values.yaml +++ b/helm-chart/cvat.values.yaml @@ -3,51 +3,6 @@ analytics: ingress: enabled: true - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web - kubernetes.io/ingress.class: traefik - hosts: - - host: cvat.local - paths: - - path: /api - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /admin - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /static - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /django-rq - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /git - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /opencv - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path: /profiler - pathType: "Prefix" - service: - name: backend-service - port: 8080 - - path : / - pathType: "Prefix" - service: - name: frontend-service - port: 80 + traefik: enabled: true diff --git a/helm-chart/templates/analytics/ingress.yaml b/helm-chart/templates/analytics/ingress.yaml index 396bc2cfb6d5..480371eb5f97 100644 --- a/helm-chart/templates/analytics/ingress.yaml +++ b/helm-chart/templates/analytics/ingress.yaml @@ -1,13 +1,7 @@ {{- $version := .Capabilities.KubeVersion.GitVersion -}} {{- if and .Values.ingress.enabled .Values.analytics.enabled -}} {{- $fullName := include "cvat.fullname" . -}} -{{- if semverCompare ">=1.19-0" $version -}} apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" $version -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} kind: Ingress metadata: name: {{ $fullName }}-analytics @@ -15,34 +9,30 @@ metadata: labels: {{- include "cvat.labels" . | nindent 4 }} annotations: + {{- if .Values.traefik.enabled }} traefik.ingress.kubernetes.io/router.middlewares: {{ $.Release.Namespace }}-stripprefix@kubernetescrd, {{ $.Release.Namespace }}-forwardauth@kubernetescrd - {{- with .Values.analytics.ingress.annotations }} + {{- end }} + {{- with .Values.ingress.annotations }} {{- toYaml . | nindent 4 }} {{- end }} spec: -{{- if semverCompare ">=1.19-0" $version }} - ingressClassName: {{ .Values.ingress.className }} +{{- if .Values.ingress.ingressClassName }} + ingressClassName: {{ .Values.ingress.ingressClassName | quote }} {{- end }} rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} + {{- if .Values.ingress.hostname }} + - host: {{ .Values.ingress.hostname }} http: paths: - - path: {{ $.Values.analytics.ingress.path }} - {{- if $.Values.analytics.ingress.pathType }} - pathType: {{ $.Values.analytics.ingress.pathType }} + - path: /analytics + {{- if $.Values.ingress.pathType }} + pathType: {{ $.Values.ingress.pathType }} {{- end }} - {{- if semverCompare ">=1.19-0" $version }} backend: service: - name: {{ $.Release.Name }}-{{ $.Values.analytics.ingress.service.name }} + name: {{ $.Release.Name }}-grafana port: - number: {{ $.Values.analytics.ingress.service.port }} - {{- else }} - backend: - serviceName: {{ $.Release.Name }}-{{ $.Values.analytics.ingress.service.name }} - servicePort: {{ $.Values.analytics.ingress.service.port }} - {{- end }} - {{- end }} + number: 80 + {{- end}} {{- end }} diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml index 6e512ce51f16..3d4a3624d6fe 100644 --- a/helm-chart/templates/ingress.yaml +++ b/helm-chart/templates/ingress.yaml @@ -1,26 +1,20 @@ {{- $version := .Capabilities.KubeVersion.GitVersion -}} {{- if .Values.ingress.enabled -}} {{- $fullName := include "cvat.fullname" . -}} -{{- if semverCompare ">=1.19-0" $version -}} apiVersion: networking.k8s.io/v1 -{{- else if semverCompare ">=1.14-0" $version -}} -apiVersion: networking.k8s.io/v1beta1 -{{- else -}} -apiVersion: extensions/v1beta1 -{{- end }} kind: Ingress metadata: name: {{ $fullName }} namespace: {{ .Release.Namespace }} labels: {{- include "cvat.labels" . | nindent 4 }} - {{- with .Values.ingress.annotations }} annotations: - {{- toYaml . | nindent 4 }} - {{- end }} + {{- with .Values.ingress.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: -{{- if semverCompare ">=1.19-0" $version }} - ingressClassName: {{ .Values.ingress.className }} +{{- if .Values.ingress.ingressClassName }} + ingressClassName: {{ .Values.ingress.ingressClassName | quote }} {{- end }} {{- if .Values.ingress.tls }} tls: @@ -33,26 +27,29 @@ spec: {{- end }} {{- end }} rules: - {{- range .Values.ingress.hosts }} - - host: {{ .host | quote }} - http: - paths: - {{- range .paths }} - - path: {{ .path }} - {{- if .pathType }} - pathType: {{ .pathType }} - {{- end }} - {{- if semverCompare ">=1.19-0" $version }} - backend: - service: - name: {{ $.Release.Name }}-{{ .service.name }} - port: - number: {{ .service.port }} - {{- else }} - backend: - serviceName: {{ .service.name }} - servicePort: {{ .service.port }} - {{- end }} + {{- if .Values.ingress.hostname }} + - host: {{ .Values.ingress.hostname }} + http: + paths: + {{- range tuple "api" "admin" "static" "django-rq" "profiler" }} + - path: {{ print "/" . }} + {{- if $.Values.ingress.pathType }} + pathType: {{ $.Values.ingress.pathType }} + {{- end }} + backend: + service: + name: {{ $.Release.Name }}-backend-service + port: + number: 8080 + {{- end }} + - path: / + {{- if .Values.ingress.pathType }} + pathType: {{ .Values.ingress.pathType }} {{- end }} + backend: + service: + name: {{ .Release.Name }}-frontend-service + port: + number: 80 {{- end }} {{- end }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index c0d35955ef0f..4e3ff635dce3 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -273,15 +273,6 @@ analytics: clickhousePassword: user clickhouseHost: "{{ .Release.Name }}-clickhouse" - ingress: - path: /analytics - pathType: "Prefix" - annotations: - kubernetes.io/ingress.class: traefik - service: - name: grafana - port: 80 - vector: envFrom: - secretRef: @@ -364,56 +355,30 @@ grafana: enabled: false ingress: + ## @param ingress.enabled Enable ingress record generation for CVAT + ## enabled: false - -# In case you need an ingress, write them manually in your my.values.eml, see example below: -# enabled: true -# annotations: -# traefik.ingress.kubernetes.io/router.entrypoints: web -# kubernetes.io/ingress.class: traefik -# hosts: -# - host: cvat.local -# paths: -# - path: /api -# pathType: "Prefix" -# service: -# name: backend-service -# port: 8080 -# - path: /admin -# pathType: "Prefix" -# service: -# name: backend-service -# port: 8080 -# - path: /static -# pathType: "Prefix" -# service: -# name: backend-service -# port: 8080 -# - path: /django-rq -# pathType: "Prefix" -# service: -# name: backend-service -# port: 8080 -# - path: /profiler -# pathType: "Prefix" -# service: -# name: backend-service -# port: 8080 -# - path : / -# pathType: "Prefix" -# service: -# name: frontend-service -# port: 80 -# tls: -# - hosts: -# - -# secretName: ingress-tls-cvat + ## @param ingress.pathType Ingress path type + ## + pathType: Prefix + ## @param ingress.hostname Default host for the ingress record + ## + hostname: cvat.local + ## @param ingress.annotations Additional annotations for the Ingress resource. + ## + ## e.g: + ## annotations: + ## kubernetes.io/ingress.class: nginx + ## + annotations: {} + ## @param ingress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) + ## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster . + ## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ + ## + ingressClassName: "" traefik: enabled: false - service: - externalIPs: - # - "192.168.49.2" smokescreen: opts: '' From 2c373d6d36439a32bbd139168cbc97878483abec Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 15 Nov 2023 11:31:05 +0200 Subject: [PATCH 02/12] apply comments --- .../20231115_110934_andrey_update_helm.md | 7 +++++ helm-chart/Chart.yaml | 1 + helm-chart/templates/analytics/ingress.yaml | 11 +++----- helm-chart/templates/ingress.yaml | 27 ++++--------------- helm-chart/values.yaml | 9 +++---- 5 files changed, 19 insertions(+), 36 deletions(-) create mode 100644 changelog.d/20231115_110934_andrey_update_helm.md diff --git a/changelog.d/20231115_110934_andrey_update_helm.md b/changelog.d/20231115_110934_andrey_update_helm.md new file mode 100644 index 000000000000..4762138e7e68 --- /dev/null +++ b/changelog.d/20231115_110934_andrey_update_helm.md @@ -0,0 +1,7 @@ +### Changed + +- [Helm] Minimum compatible Kubernetes version is 1.19.0. + () + +- [Helm] The CVAT hostname can be configured with `ingress.hostname` option. + () diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index fc4021aef79e..82937bc3e867 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -1,5 +1,6 @@ apiVersion: v2 name: cvat +kubeVersion: ">= 1.19.0" description: A Helm chart for Kubernetes # A chart can be either an 'application' or a 'library' chart. diff --git a/helm-chart/templates/analytics/ingress.yaml b/helm-chart/templates/analytics/ingress.yaml index 480371eb5f97..c5df2fa52e84 100644 --- a/helm-chart/templates/analytics/ingress.yaml +++ b/helm-chart/templates/analytics/ingress.yaml @@ -1,4 +1,3 @@ -{{- $version := .Capabilities.KubeVersion.GitVersion -}} {{- if and .Values.ingress.enabled .Values.analytics.enabled -}} {{- $fullName := include "cvat.fullname" . -}} apiVersion: networking.k8s.io/v1 @@ -17,22 +16,18 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: -{{- if .Values.ingress.ingressClassName }} - ingressClassName: {{ .Values.ingress.ingressClassName | quote }} +{{- if .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className | quote }} {{- end }} rules: - {{- if .Values.ingress.hostname }} - host: {{ .Values.ingress.hostname }} http: paths: - path: /analytics - {{- if $.Values.ingress.pathType }} - pathType: {{ $.Values.ingress.pathType }} - {{- end }} + pathType: Prefix backend: service: name: {{ $.Release.Name }}-grafana port: number: 80 - {{- end}} {{- end }} diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml index 3d4a3624d6fe..6002f6a9db45 100644 --- a/helm-chart/templates/ingress.yaml +++ b/helm-chart/templates/ingress.yaml @@ -1,4 +1,3 @@ -{{- $version := .Capabilities.KubeVersion.GitVersion -}} {{- if .Values.ingress.enabled -}} {{- $fullName := include "cvat.fullname" . -}} apiVersion: networking.k8s.io/v1 @@ -13,29 +12,16 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: -{{- if .Values.ingress.ingressClassName }} - ingressClassName: {{ .Values.ingress.ingressClassName | quote }} -{{- end }} -{{- if .Values.ingress.tls }} - tls: - {{- range .Values.ingress.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} +{{- if .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className | quote }} {{- end }} rules: - {{- if .Values.ingress.hostname }} - host: {{ .Values.ingress.hostname }} http: paths: {{- range tuple "api" "admin" "static" "django-rq" "profiler" }} - - path: {{ print "/" . }} - {{- if $.Values.ingress.pathType }} - pathType: {{ $.Values.ingress.pathType }} - {{- end }} + - path: "/{{ . }}" + pathType: Prefix backend: service: name: {{ $.Release.Name }}-backend-service @@ -43,13 +29,10 @@ spec: number: 8080 {{- end }} - path: / - {{- if .Values.ingress.pathType }} - pathType: {{ .Values.ingress.pathType }} - {{- end }} + pathType: Prefix backend: service: name: {{ .Release.Name }}-frontend-service port: number: 80 - {{- end }} {{- end }} diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 4e3ff635dce3..e28da2ffbe79 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -355,12 +355,9 @@ grafana: enabled: false ingress: - ## @param ingress.enabled Enable ingress record generation for CVAT + ## @param ingress.enabled Enable ingress resource generation for CVAT ## enabled: false - ## @param ingress.pathType Ingress path type - ## - pathType: Prefix ## @param ingress.hostname Default host for the ingress record ## hostname: cvat.local @@ -371,11 +368,11 @@ ingress: ## kubernetes.io/ingress.class: nginx ## annotations: {} - ## @param ingress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) + ## @param ingress.className IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) ## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster . ## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ ## - ingressClassName: "" + className: "" traefik: enabled: false From 14ffb2d14a67d79e839230d6781c1c02b5cdf306 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 15 Nov 2023 12:02:10 +0200 Subject: [PATCH 03/12] Fix linter --- changelog.d/20231115_110934_andrey_update_helm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changelog.d/20231115_110934_andrey_update_helm.md b/changelog.d/20231115_110934_andrey_update_helm.md index 4762138e7e68..af7dbd12d2c0 100644 --- a/changelog.d/20231115_110934_andrey_update_helm.md +++ b/changelog.d/20231115_110934_andrey_update_helm.md @@ -1,7 +1,7 @@ ### Changed -- [Helm] Minimum compatible Kubernetes version is 1.19.0. +- \[Helm\] Minimum compatible Kubernetes version is 1.19.0. () -- [Helm] The CVAT hostname can be configured with `ingress.hostname` option. +- \[Helm\] The CVAT hostname can be configured with `ingress.hostname` option. () From 2a52846029b52a9e2158af3ae3c1ebf4ff7bdc50 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 15 Nov 2023 12:52:21 +0200 Subject: [PATCH 04/12] apply comments --- helm-chart/templates/ingress.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml index 6002f6a9db45..6fb76df4b286 100644 --- a/helm-chart/templates/ingress.yaml +++ b/helm-chart/templates/ingress.yaml @@ -7,10 +7,10 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "cvat.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} annotations: - {{- with .Values.ingress.annotations }} - {{- toYaml . | nindent 4 }} - {{- end }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className | quote }} From 403adf684e43e959a65fe22edbb6dbc5b3d887f5 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 15 Nov 2023 15:10:27 +0200 Subject: [PATCH 05/12] Update helm-chart/values.yaml Co-authored-by: Roman Donchenko --- helm-chart/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index e28da2ffbe79..44b96a5ca377 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -358,7 +358,7 @@ ingress: ## @param ingress.enabled Enable ingress resource generation for CVAT ## enabled: false - ## @param ingress.hostname Default host for the ingress record + ## @param ingress.hostname Host for the ingress resource ## hostname: cvat.local ## @param ingress.annotations Additional annotations for the Ingress resource. From 259f181cb64bf53a19431beb7503228aa93a6880 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 15 Nov 2023 15:10:37 +0200 Subject: [PATCH 06/12] Update helm-chart/templates/ingress.yaml Co-authored-by: Roman Donchenko --- helm-chart/templates/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml index 6fb76df4b286..c5ae604fb45d 100644 --- a/helm-chart/templates/ingress.yaml +++ b/helm-chart/templates/ingress.yaml @@ -13,7 +13,7 @@ metadata: {{- end }} spec: {{- if .Values.ingress.className }} - ingressClassName: {{ .Values.ingress.className | quote }} + ingressClassName: {{ .Values.ingress.className | toYaml }} {{- end }} rules: - host: {{ .Values.ingress.hostname }} From 7d12e7fd0610a8eb839c8f20dcaee59a441a7405 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 15 Nov 2023 15:10:43 +0200 Subject: [PATCH 07/12] Update helm-chart/templates/analytics/ingress.yaml Co-authored-by: Roman Donchenko --- helm-chart/templates/analytics/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/templates/analytics/ingress.yaml b/helm-chart/templates/analytics/ingress.yaml index c5df2fa52e84..0d987f956354 100644 --- a/helm-chart/templates/analytics/ingress.yaml +++ b/helm-chart/templates/analytics/ingress.yaml @@ -17,7 +17,7 @@ metadata: {{- end }} spec: {{- if .Values.ingress.className }} - ingressClassName: {{ .Values.ingress.className | quote }} + ingressClassName: {{ .Values.ingress.className | toYaml }} {{- end }} rules: - host: {{ .Values.ingress.hostname }} From e143bdf487e8c30d3ac7bdaa5676a0853b4b9a76 Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 15 Nov 2023 15:27:19 +0200 Subject: [PATCH 08/12] update changelog --- changelog.d/20231115_110934_andrey_update_helm.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/changelog.d/20231115_110934_andrey_update_helm.md b/changelog.d/20231115_110934_andrey_update_helm.md index af7dbd12d2c0..a7da3bb3e0f7 100644 --- a/changelog.d/20231115_110934_andrey_update_helm.md +++ b/changelog.d/20231115_110934_andrey_update_helm.md @@ -5,3 +5,11 @@ - \[Helm\] The CVAT hostname can be configured with `ingress.hostname` option. () + +### Removed + \[Helm\] `ingress.hosts` has been removed, use `ingress.hostname` instead. + () + + \[Helm\] removed unsupported `ingress.tls` option. + () + From fb7a7378523591348f785cb2c751fd41b8f7d6ff Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Wed, 15 Nov 2023 16:10:15 +0200 Subject: [PATCH 09/12] tls --- changelog.d/20231115_110934_andrey_update_helm.md | 7 +++---- helm-chart/templates/analytics/ingress.yaml | 6 ++++++ helm-chart/templates/ingress.yaml | 6 ++++++ helm-chart/values.yaml | 9 ++++++++- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/changelog.d/20231115_110934_andrey_update_helm.md b/changelog.d/20231115_110934_andrey_update_helm.md index a7da3bb3e0f7..5b09c6e61498 100644 --- a/changelog.d/20231115_110934_andrey_update_helm.md +++ b/changelog.d/20231115_110934_andrey_update_helm.md @@ -6,10 +6,9 @@ - \[Helm\] The CVAT hostname can be configured with `ingress.hostname` option. () -### Removed - \[Helm\] `ingress.hosts` has been removed, use `ingress.hostname` instead. +- \[Helm\] `ingress.tls` configuration has been reworked. () - \[Helm\] removed unsupported `ingress.tls` option. +### Removed + \[Helm\] `ingress.hosts` has been removed, use `ingress.hostname` instead. () - diff --git a/helm-chart/templates/analytics/ingress.yaml b/helm-chart/templates/analytics/ingress.yaml index 0d987f956354..32e93194eb42 100644 --- a/helm-chart/templates/analytics/ingress.yaml +++ b/helm-chart/templates/analytics/ingress.yaml @@ -19,6 +19,12 @@ spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className | toYaml }} {{- end }} + {{- if .Values.ingress.tls }} + tls: + - hosts: + - {{ .Values.ingress.hostname }} + secretName: {{ .Values.ingress.tlsSecretName }} + {{- end }} rules: - host: {{ .Values.ingress.hostname }} http: diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml index c5ae604fb45d..e9f18fdee197 100644 --- a/helm-chart/templates/ingress.yaml +++ b/helm-chart/templates/ingress.yaml @@ -15,6 +15,12 @@ spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className | toYaml }} {{- end }} + {{- if .Values.ingress.tls }} + tls: + - hosts: + - {{ .Values.ingress.hostname }} + secretName: {{ .Values.ingress.tlsSecretName }} + {{- end }} rules: - host: {{ .Values.ingress.hostname }} http: diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 44b96a5ca377..c9d2775fd5b3 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -369,10 +369,17 @@ ingress: ## annotations: {} ## @param ingress.className IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) - ## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster . + ## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster ## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/ ## className: "" + ## @param ingress.tls Enable TLS configuration for the host defined at `ingress.hostname` parameter + ## TLS certificates will be retrieved from a TLS secret defined in tlsSecretName parameter + ## + tls: false + ## @param ingress.tlsSecretName Ыpecifies the name of the secret containing TLS certificates. Ignored if ingress.tls is false + ## + tlsSecretName: ingress-tls-cvat traefik: enabled: false From b0714bc2ddc55064ae646b86403941defb2d4a3d Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Thu, 16 Nov 2023 12:59:59 +0200 Subject: [PATCH 10/12] Update helm-chart/values.yaml Co-authored-by: Roman Donchenko --- helm-chart/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index c9d2775fd5b3..503e706e422f 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -377,7 +377,7 @@ ingress: ## TLS certificates will be retrieved from a TLS secret defined in tlsSecretName parameter ## tls: false - ## @param ingress.tlsSecretName Ыpecifies the name of the secret containing TLS certificates. Ignored if ingress.tls is false + ## @param ingress.tlsSecretName Specifies the name of the secret containing TLS certificates. Ignored if ingress.tls is false ## tlsSecretName: ingress-tls-cvat From 021aee4b63d9d0ff1b83a715e01c882898ccc1ba Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Thu, 16 Nov 2023 13:37:45 +0200 Subject: [PATCH 11/12] set ingressClassName to 'traefik' if ingress.className is not set and traefik.enabled is set to true --- helm-chart/templates/analytics/ingress.yaml | 22 +++++++++++---------- helm-chart/templates/ingress.yaml | 2 ++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/helm-chart/templates/analytics/ingress.yaml b/helm-chart/templates/analytics/ingress.yaml index 32e93194eb42..9ae521364d0a 100644 --- a/helm-chart/templates/analytics/ingress.yaml +++ b/helm-chart/templates/analytics/ingress.yaml @@ -18,6 +18,8 @@ metadata: spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className | toYaml }} +{{- else if .Values.traefik.enabled }} + ingressClassName: traefik {{- end }} {{- if .Values.ingress.tls }} tls: @@ -26,14 +28,14 @@ spec: secretName: {{ .Values.ingress.tlsSecretName }} {{- end }} rules: - - host: {{ .Values.ingress.hostname }} - http: - paths: - - path: /analytics - pathType: Prefix - backend: - service: - name: {{ $.Release.Name }}-grafana - port: - number: 80 + - host: {{ .Values.ingress.hostname }} + http: + paths: + - path: /analytics + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }}-grafana + port: + number: 80 {{- end }} diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml index e9f18fdee197..b9f24c4d0659 100644 --- a/helm-chart/templates/ingress.yaml +++ b/helm-chart/templates/ingress.yaml @@ -14,6 +14,8 @@ metadata: spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className | toYaml }} +{{- else if .Values.traefik.enabled }} + ingressClassName: traefik {{- end }} {{- if .Values.ingress.tls }} tls: From 75e4346acac8e387539f9b8db5b364c31fa7178d Mon Sep 17 00:00:00 2001 From: Andrey Zhavoronkov Date: Thu, 16 Nov 2023 15:05:20 +0200 Subject: [PATCH 12/12] fixed ingressClassName and updated traefik --- changelog.d/20231115_110934_andrey_update_helm.md | 3 +++ helm-chart/Chart.yaml | 2 +- helm-chart/templates/analytics/ingress.yaml | 4 ++-- helm-chart/templates/ingress.yaml | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/changelog.d/20231115_110934_andrey_update_helm.md b/changelog.d/20231115_110934_andrey_update_helm.md index 5b09c6e61498..1fa31275fdd8 100644 --- a/changelog.d/20231115_110934_andrey_update_helm.md +++ b/changelog.d/20231115_110934_andrey_update_helm.md @@ -9,6 +9,9 @@ - \[Helm\] `ingress.tls` configuration has been reworked. () +- \[Helm\] Traefik subchart updated to 25.0.0 (appVersion v2.10.5) + () + ### Removed \[Helm\] `ingress.hosts` has been removed, use `ingress.hostname` instead. () diff --git a/helm-chart/Chart.yaml b/helm-chart/Chart.yaml index 82937bc3e867..833dfbcd7f66 100644 --- a/helm-chart/Chart.yaml +++ b/helm-chart/Chart.yaml @@ -52,7 +52,7 @@ dependencies: condition: analytics.enabled - name: traefik - version: 10.24.0 + version: 25.0.0 repository: https://helm.traefik.io/traefik condition: traefik.enabled diff --git a/helm-chart/templates/analytics/ingress.yaml b/helm-chart/templates/analytics/ingress.yaml index 9ae521364d0a..98dad20391d5 100644 --- a/helm-chart/templates/analytics/ingress.yaml +++ b/helm-chart/templates/analytics/ingress.yaml @@ -18,8 +18,8 @@ metadata: spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className | toYaml }} -{{- else if .Values.traefik.enabled }} - ingressClassName: traefik +{{- else if and .Values.traefik.enabled .Values.traefik.ingressClass.enabled }} + ingressClassName: {{ .Values.traefik.ingressClass.name | default (include "traefik.fullname" .Subcharts.traefik) }} {{- end }} {{- if .Values.ingress.tls }} tls: diff --git a/helm-chart/templates/ingress.yaml b/helm-chart/templates/ingress.yaml index b9f24c4d0659..8eddd964da9e 100644 --- a/helm-chart/templates/ingress.yaml +++ b/helm-chart/templates/ingress.yaml @@ -14,8 +14,8 @@ metadata: spec: {{- if .Values.ingress.className }} ingressClassName: {{ .Values.ingress.className | toYaml }} -{{- else if .Values.traefik.enabled }} - ingressClassName: traefik +{{- else if and .Values.traefik.enabled .Values.traefik.ingressClass.enabled }} + ingressClassName: {{ .Values.traefik.ingressClass.name | default (include "traefik.fullname" .Subcharts.traefik) }} {{- end }} {{- if .Values.ingress.tls }} tls: