diff --git a/charts/kueue/README.md b/charts/kueue/README.md index 7a1adcd6ea9..7f51ace043f 100644 --- a/charts/kueue/README.md +++ b/charts/kueue/README.md @@ -131,6 +131,7 @@ The following table lists the configurable parameters of the kueue chart and the | kueueViz.backend.image.tag | string | `"main"` | KueueViz dashboard backend image tag | | kueueViz.backend.imagePullSecrets | list | `[]` | Sets ImagePullSecrets for KueueViz dashboard backend deployments. This is useful when the images are in a private registry. | | kueueViz.backend.ingress.annotations | object | `{"nginx.ingress.kubernetes.io/rewrite-target":"/","nginx.ingress.kubernetes.io/ssl-redirect":"true"}` | KueueViz dashboard backend ingress annotations | +| kueueViz.backend.ingress.enabled | bool | `true` | Enable KueueViz dashboard backend ingress | | kueueViz.backend.ingress.host | string | `"backend.kueueviz.local"` | KueueViz dashboard backend ingress host | | kueueViz.backend.ingress.ingressClassName | string | `nil` | KueueViz dashboard backend ingress class name | | kueueViz.backend.ingress.tlsSecretName | string | `"kueueviz-backend-tls"` | KueueViz dashboard backend ingress tls secret name | @@ -144,6 +145,7 @@ The following table lists the configurable parameters of the kueue chart and the | kueueViz.frontend.image.tag | string | `"main"` | KueueViz dashboard frontend image tag | | kueueViz.frontend.imagePullSecrets | list | `[]` | Sets ImagePullSecrets for KueueViz dashboard frontend deployments. This is useful when the images are in a private registry. | | kueueViz.frontend.ingress.annotations | object | `{"nginx.ingress.kubernetes.io/rewrite-target":"/","nginx.ingress.kubernetes.io/ssl-redirect":"true"}` | KueueViz dashboard frontend ingress annotations | +| kueueViz.frontend.ingress.enabled | bool | `true` | Enable KueueViz dashboard frontend ingress | | kueueViz.frontend.ingress.host | string | `"frontend.kueueviz.local"` | KueueViz dashboard frontend ingress host | | kueueViz.frontend.ingress.ingressClassName | string | `nil` | KueueViz dashboard frontend ingress class name | | kueueViz.frontend.ingress.tlsSecretName | string | `"kueueviz-frontend-tls"` | KueueViz dashboard frontend ingress tls secret name | diff --git a/charts/kueue/templates/kueueviz/backend-ingress.yaml b/charts/kueue/templates/kueueviz/backend-ingress.yaml index 9af249ed8a0..3a7c0f021a4 100644 --- a/charts/kueue/templates/kueueviz/backend-ingress.yaml +++ b/charts/kueue/templates/kueueviz/backend-ingress.yaml @@ -16,7 +16,7 @@ limitations under the License. {{/* Code generated by yaml-processor. DO NOT EDIT. */}} -{{- if .Values.enableKueueViz }} +{{- if and .Values.enableKueueViz .Values.kueueViz.backend.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/kueue/templates/kueueviz/frontend-ingress.yaml b/charts/kueue/templates/kueueviz/frontend-ingress.yaml index 0b0a1ccc5b7..a4a62a224f5 100644 --- a/charts/kueue/templates/kueueviz/frontend-ingress.yaml +++ b/charts/kueue/templates/kueueviz/frontend-ingress.yaml @@ -16,7 +16,7 @@ limitations under the License. {{/* Code generated by yaml-processor. DO NOT EDIT. */}} -{{- if .Values.enableKueueViz }} +{{- if and .Values.enableKueueViz .Values.kueueViz.frontend.ingress.enabled }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/charts/kueue/tests/kueue_test.yaml b/charts/kueue/tests/kueue_test.yaml index d60dd262d19..26069221aab 100644 --- a/charts/kueue/tests/kueue_test.yaml +++ b/charts/kueue/tests/kueue_test.yaml @@ -252,3 +252,43 @@ tests: asserts: - notExists: path: spec.template.spec.containers[0].env[0] + - it: should not render backend ingress when backend ingress is disabled + template: kueueviz/backend-ingress.yaml + set: + enableKueueViz: true + kueueViz: + backend: + ingress: + enabled: false + asserts: + - hasDocuments: + count: 0 + - it: should not render frontend ingress when frontend ingress is disabled + template: kueueviz/frontend-ingress.yaml + set: + enableKueueViz: true + kueueViz: + frontend: + ingress: + enabled: false + asserts: + - hasDocuments: + count: 0 + - it: should render backend ingress when backend ingress is enabled (default) + template: kueueviz/backend-ingress.yaml + set: + enableKueueViz: true + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Ingress + - it: should render frontend ingress when frontend ingress is enabled (default) + template: kueueviz/frontend-ingress.yaml + set: + enableKueueViz: true + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Ingress diff --git a/charts/kueue/values.yaml b/charts/kueue/values.yaml index f4025effefc..04681014cb3 100644 --- a/charts/kueue/values.yaml +++ b/charts/kueue/values.yaml @@ -234,6 +234,8 @@ kueueViz: - name: KUEUEVIZ_ALLOWED_ORIGINS value: "https://frontend.kueueviz.local" ingress: + # -- Enable KueueViz dashboard backend ingress + enabled: true # -- KueueViz dashboard backend ingress annotations annotations: nginx.ingress.kubernetes.io/rewrite-target: "/" @@ -275,6 +277,8 @@ kueueViz: - name: REACT_APP_WEBSOCKET_URL value: "wss://backend.kueueviz.local" ingress: + # -- Enable KueueViz dashboard frontend ingress + enabled: true # -- KueueViz dashboard frontend ingress annotations annotations: nginx.ingress.kubernetes.io/rewrite-target: "/" diff --git a/hack/processing-plan.yaml b/hack/processing-plan.yaml index 3abd53aaaa4..31e694dbca8 100644 --- a/hack/processing-plan.yaml +++ b/hack/processing-plan.yaml @@ -799,10 +799,32 @@ files: position: START value: | {{- if .Values.enableKueueViz }} + onFileCondition: '.kind != "Ingress"' - type: INSERT_TEXT position: END value: | {{- end }} + onFileCondition: '.kind != "Ingress"' + - type: INSERT_TEXT + position: START + value: | + {{- if and .Values.enableKueueViz .Values.kueueViz.backend.ingress.enabled }} + onFileCondition: '.kind == "Ingress" and .metadata.name | contains("backend")' + - type: INSERT_TEXT + position: END + value: | + {{- end }} + onFileCondition: '.kind == "Ingress" and .metadata.name | contains("backend")' + - type: INSERT_TEXT + position: START + value: | + {{- if and .Values.enableKueueViz .Values.kueueViz.frontend.ingress.enabled }} + onFileCondition: '.kind == "Ingress" and .metadata.name | contains("frontend")' + - type: INSERT_TEXT + position: END + value: | + {{- end }} + onFileCondition: '.kind == "Ingress" and .metadata.name | contains("frontend")' - path: ./config/components/internalcert/*.yaml outputDir: ./charts/kueue/templates/internalcert removeComments: true