From 57f0c99199efdb0d70c3d6f10025bc346aa42b88 Mon Sep 17 00:00:00 2001 From: Tzu-Hua Lan Date: Fri, 7 Jun 2024 23:37:24 +0800 Subject: [PATCH 1/3] [YUNIKORN-2626] Add flag to helm chart to disable web container --- helm-charts/yunikorn/README.md | 1 + helm-charts/yunikorn/templates/deployment.yaml | 2 ++ helm-charts/yunikorn/templates/service.yaml | 2 ++ helm-charts/yunikorn/values.yaml | 4 ++++ 4 files changed, 9 insertions(+) diff --git a/helm-charts/yunikorn/README.md b/helm-charts/yunikorn/README.md index 82b76c9..45df1b4 100644 --- a/helm-charts/yunikorn/README.md +++ b/helm-charts/yunikorn/README.md @@ -106,6 +106,7 @@ The following table lists the configurable parameters of the YuniKorn chart and | `web.resources.limits.memory` | Web app memory resource limit | `500Mi` | | `embedAdmissionController` | Flag for enabling/disabling the admission controller | `true` | | `enableSchedulerPlugin` | Flag for enabling/disabling scheduler plugin mode | `false` | +| `enableWebService` | Flag for enabling/disabling web service | `true` | | `nodeSelector` | Scheduler deployment nodeSelector(s) | `{}` | | `tolerations` | Scheduler deployment tolerations | `[]` | | `affinity` | Scheduler deployment affinity | `{}` | diff --git a/helm-charts/yunikorn/templates/deployment.yaml b/helm-charts/yunikorn/templates/deployment.yaml index 399ba12..2fbfe40 100644 --- a/helm-charts/yunikorn/templates/deployment.yaml +++ b/helm-charts/yunikorn/templates/deployment.yaml @@ -95,6 +95,7 @@ spec: fieldPath: metadata.namespace resources: {{- toYaml .Values.resources | nindent 12 }} + {{- if .Values.enableWebService }} - name: yunikorn-scheduler-web image: "{{ .Values.web.image.repository }}:{{ .Values.web.image.tag }}" imagePullPolicy: {{ .Values.web.image.pullPolicy }} @@ -104,3 +105,4 @@ spec: protocol: TCP resources: {{- toYaml .Values.web.resources | nindent 12 }} + {{- end }} diff --git a/helm-charts/yunikorn/templates/service.yaml b/helm-charts/yunikorn/templates/service.yaml index 89ecb14..42e91c9 100644 --- a/helm-charts/yunikorn/templates/service.yaml +++ b/helm-charts/yunikorn/templates/service.yaml @@ -30,10 +30,12 @@ spec: targetPort: http1 protocol: TCP name: yunikorn-core + {{- if .Values.enableWebService }} - port: {{ .Values.service.portWeb }} targetPort: http2 protocol: TCP name: yunikorn-service + {{- end }} selector: app: yunikorn component: yunikorn-scheduler diff --git a/helm-charts/yunikorn/values.yaml b/helm-charts/yunikorn/values.yaml index 3b6f149..19a5127 100644 --- a/helm-charts/yunikorn/values.yaml +++ b/helm-charts/yunikorn/values.yaml @@ -122,5 +122,9 @@ embedAdmissionController: true # When this flag is false, the scheduler will be deployed as a standalone scheduler. enableSchedulerPlugin: false +# When this flag is true, the web service will be deployed. +# When this flag is false, the web service will not be deployed. +enableWebService: true + podLabels: {} podAnnotations: {} From 3d3d3c510ffd33366df55e5bf20e5637539c09ab Mon Sep 17 00:00:00 2001 From: Tzu-Hua Lan Date: Sun, 9 Jun 2024 21:16:10 +0800 Subject: [PATCH 2/3] disable ingress when `enableWebService` is `false` --- helm-charts/yunikorn/templates/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm-charts/yunikorn/templates/ingress.yaml b/helm-charts/yunikorn/templates/ingress.yaml index 5e053ec..8663a0d 100644 --- a/helm-charts/yunikorn/templates/ingress.yaml +++ b/helm-charts/yunikorn/templates/ingress.yaml @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -{{- if .Values.ingress.enabled }} +{{- if and .Values.ingress.enabled .Values.enableWebService }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: From 6e36f2c801948b42737649ac30beb2e1a180f01c Mon Sep 17 00:00:00 2001 From: Tzu-Hua Lan Date: Sun, 9 Jun 2024 21:22:26 +0800 Subject: [PATCH 3/3] format table --- helm-charts/yunikorn/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helm-charts/yunikorn/README.md b/helm-charts/yunikorn/README.md index 45df1b4..b288456 100644 --- a/helm-charts/yunikorn/README.md +++ b/helm-charts/yunikorn/README.md @@ -60,7 +60,7 @@ helm install yunikorn yunikorn/yunikorn The following table lists the configurable parameters of the YuniKorn chart and their default values: | Parameter | Description | Default | -|-------------------------------------------------|-------------------------------------------------------------|---------------------------------| +| ----------------------------------------------- | ----------------------------------------------------------- | ------------------------------- | | `imagePullSecrets` | Docker repository secrets | `[]` | | `serviceAccount` | Service account name | `yunikorn-admin` | | `hostNetwork` | Whether scheduler should run in the host network | `false` | @@ -106,7 +106,7 @@ The following table lists the configurable parameters of the YuniKorn chart and | `web.resources.limits.memory` | Web app memory resource limit | `500Mi` | | `embedAdmissionController` | Flag for enabling/disabling the admission controller | `true` | | `enableSchedulerPlugin` | Flag for enabling/disabling scheduler plugin mode | `false` | -| `enableWebService` | Flag for enabling/disabling web service | `true` | +| `enableWebService` | Flag for enabling/disabling web service | `true` | | `nodeSelector` | Scheduler deployment nodeSelector(s) | `{}` | | `tolerations` | Scheduler deployment tolerations | `[]` | | `affinity` | Scheduler deployment affinity | `{}` |