From 6fd58bbede9355902833fd7386476a02dc5f0b18 Mon Sep 17 00:00:00 2001 From: alizademhdi Date: Fri, 7 Jun 2024 02:29:45 +0330 Subject: [PATCH 1/4] Add schedulerName to helm chart values. Signed-off-by: alizademhdi --- charts/telepresence/templates/deployment.yaml | 3 +++ charts/telepresence/templates/pre-delete-hook.yaml | 3 +++ charts/telepresence/values.yaml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/charts/telepresence/templates/deployment.yaml b/charts/telepresence/templates/deployment.yaml index 2f1e9fef78..c2cd9d3966 100644 --- a/charts/telepresence/templates/deployment.yaml +++ b/charts/telepresence/templates/deployment.yaml @@ -286,6 +286,9 @@ spec: {{- template "traffic-manager-mounts" . }} {{- end }} {{- end }} + {{- with .schedulerName }} + schedulerName: {{ .schedulerName }} + {{- end }} {{- with .nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/telepresence/templates/pre-delete-hook.yaml b/charts/telepresence/templates/pre-delete-hook.yaml index 80d8ea9622..9f4c7e45c8 100644 --- a/charts/telepresence/templates/pre-delete-hook.yaml +++ b/charts/telepresence/templates/pre-delete-hook.yaml @@ -58,6 +58,9 @@ spec: - name: secret-volume secret: secretName: {{ .Values.agentInjector.secret.name }} + {{- with .Values.schedulerName }} + schedulerName: {{ .Values.schedulerName }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/telepresence/values.yaml b/charts/telepresence/values.yaml index 95d9a9f328..baf0047494 100644 --- a/charts/telepresence/values.yaml +++ b/charts/telepresence/values.yaml @@ -66,6 +66,8 @@ tolerations: [] affinity: {} +schedulerName: ~ + ## @param priorityClassName Name of the existing priority class to be used ## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ ## From 4693a4d27887055c4f2b8bd80f4a695a6bc93604 Mon Sep 17 00:00:00 2001 From: alizademhdi Date: Fri, 7 Jun 2024 02:43:10 +0330 Subject: [PATCH 2/4] Update Changelog.yml and add some docs for helm values. Signed-off-by: alizademhdi --- CHANGELOG.yml | 5 +++++ charts/telepresence/README.md | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.yml b/CHANGELOG.yml index 635723cb06..a217d08612 100644 --- a/CHANGELOG.yml +++ b/CHANGELOG.yml @@ -33,6 +33,11 @@ items: - version: 2.19.0 date: (TBD) notes: + - type: feature + title: Add scheduler name to PODs templates. + body: >- + A new Helm chart value schedulerName has been added. With this feature, we are + able to define some particular schedulers from Kubernetes to apply some different strategies to allocate resources. - type: bugfix title: Kubeconfig exec authentication failure when connecting with --docker from a WSL linux host body: >- diff --git a/charts/telepresence/README.md b/charts/telepresence/README.md index 5a834fa741..75bdb43a8c 100644 --- a/charts/telepresence/README.md +++ b/charts/telepresence/README.md @@ -34,6 +34,7 @@ The following tables lists the configurable parameters of the Telepresence chart | podCIDRStrategy | Define the strategy that the traffic-manager uses to discover what CIDRs the cluster uses for pods | `auto` | | podSecurityContext | The Kubernetes SecurityContext for the `Pod` | `{}` | | securityContext | The Kubernetes SecurityContext for the `Deployment` | `{"readOnlyRootFilesystem": true, "runAsNonRoot": true, "runAsUser": 1000}` | +| schedulerName | Specify a scheduler for the pod. | | nodeSelector | Define which `Node`s you want to the Traffic Manager to be deployed to. | `{}` | | tolerations | Define tolerations for the Traffic Manager to ignore `Node` taints. | `[]` | | affinity | Define the `Node` Affinity and Anti-Affinity for the Traffic Manager. | `{}` | From 3c780168a1ce2402288f2e40924597e5aa2ded77 Mon Sep 17 00:00:00 2001 From: alizademhdi Date: Mon, 10 Jun 2024 11:51:50 +0330 Subject: [PATCH 3/4] Fix values reference for schedulerName Signed-off-by: alizademhdi --- charts/telepresence/templates/deployment.yaml | 2 +- charts/telepresence/templates/pre-delete-hook.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/telepresence/templates/deployment.yaml b/charts/telepresence/templates/deployment.yaml index c2cd9d3966..630df84dc1 100644 --- a/charts/telepresence/templates/deployment.yaml +++ b/charts/telepresence/templates/deployment.yaml @@ -287,7 +287,7 @@ spec: {{- end }} {{- end }} {{- with .schedulerName }} - schedulerName: {{ .schedulerName }} + schedulerName: {{ . }} {{- end }} {{- with .nodeSelector }} nodeSelector: diff --git a/charts/telepresence/templates/pre-delete-hook.yaml b/charts/telepresence/templates/pre-delete-hook.yaml index 9f4c7e45c8..9ed82ac942 100644 --- a/charts/telepresence/templates/pre-delete-hook.yaml +++ b/charts/telepresence/templates/pre-delete-hook.yaml @@ -59,7 +59,7 @@ spec: secret: secretName: {{ .Values.agentInjector.secret.name }} {{- with .Values.schedulerName }} - schedulerName: {{ .Values.schedulerName }} + schedulerName: {{ . }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: From 3ca613ad1a01a0721cfdcd583901d1308a57c002 Mon Sep 17 00:00:00 2001 From: alizademhdi Date: Mon, 10 Jun 2024 12:18:33 +0330 Subject: [PATCH 4/4] Fix README and CHANGELOG for schedulerName value in helm chart Signed-off-by: alizademhdi --- CHANGELOG.yml | 3 ++- charts/telepresence/README.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.yml b/CHANGELOG.yml index a217d08612..d28c7ef8e5 100644 --- a/CHANGELOG.yml +++ b/CHANGELOG.yml @@ -37,7 +37,8 @@ items: title: Add scheduler name to PODs templates. body: >- A new Helm chart value schedulerName has been added. With this feature, we are - able to define some particular schedulers from Kubernetes to apply some different strategies to allocate resources. + able to define some particular schedulers from Kubernetes to apply some different strategies to allocate telepresence resources, + including the Traffic Manager and hooks pods. - type: bugfix title: Kubeconfig exec authentication failure when connecting with --docker from a WSL linux host body: >- diff --git a/charts/telepresence/README.md b/charts/telepresence/README.md index 75bdb43a8c..9fa7b9e1ad 100644 --- a/charts/telepresence/README.md +++ b/charts/telepresence/README.md @@ -34,7 +34,7 @@ The following tables lists the configurable parameters of the Telepresence chart | podCIDRStrategy | Define the strategy that the traffic-manager uses to discover what CIDRs the cluster uses for pods | `auto` | | podSecurityContext | The Kubernetes SecurityContext for the `Pod` | `{}` | | securityContext | The Kubernetes SecurityContext for the `Deployment` | `{"readOnlyRootFilesystem": true, "runAsNonRoot": true, "runAsUser": 1000}` | -| schedulerName | Specify a scheduler for the pod. | +| schedulerName | Specify a scheduler for Traffic Manager `Pod` and hooks `Pod`. | | nodeSelector | Define which `Node`s you want to the Traffic Manager to be deployed to. | `{}` | | tolerations | Define tolerations for the Traffic Manager to ignore `Node` taints. | `[]` | | affinity | Define the `Node` Affinity and Anti-Affinity for the Traffic Manager. | `{}` |