From 83067b9385825333a77ccfc69daa9263dfa28582 Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Tue, 3 Dec 2024 17:51:14 +0530 Subject: [PATCH 1/4] add support for topologyspreadconstraints --- charts/operator-wandb/charts/app/values.yaml | 3 +++ charts/operator-wandb/templates/_pods.tpl | 24 +++++++++++++++++ charts/operator-wandb/values.yaml | 27 ++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/charts/operator-wandb/charts/app/values.yaml b/charts/operator-wandb/charts/app/values.yaml index de8e1817..469edc25 100644 --- a/charts/operator-wandb/charts/app/values.yaml +++ b/charts/operator-wandb/charts/app/values.yaml @@ -51,6 +51,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + common: labels: {} diff --git a/charts/operator-wandb/templates/_pods.tpl b/charts/operator-wandb/templates/_pods.tpl index 76d256f9..24f72f45 100644 --- a/charts/operator-wandb/templates/_pods.tpl +++ b/charts/operator-wandb/templates/_pods.tpl @@ -88,3 +88,27 @@ securityContext: {{- end }} {{- end }} +{{/* +Return a simplified topologySpreadConstraints definition with dynamic labelSelector and matchLabels passed as a map. +*/}} +{{- define "wandb.topologySpreadConstraints" -}} +{{- $matchLabels := .matchLabels -}} +topologySpreadConstraints: + - maxSkew: 1 + topologyKey: kubernetes.io/hostname + whenUnsatisfiable: ScheduleAnyway + labelSelector: + matchLabels: + {{- range $key, $value := $matchLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + - maxSkew: 1 + topologyKey: topology.kubernetes.io/zone + whenUnsatisfiable: ScheduleAnyway + labelSelector: + matchLabels: + {{- range $key, $value := $matchLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} +{{- end }} + diff --git a/charts/operator-wandb/values.yaml b/charts/operator-wandb/values.yaml index e82e09e6..9e95a4d3 100644 --- a/charts/operator-wandb/values.yaml +++ b/charts/operator-wandb/values.yaml @@ -208,6 +208,8 @@ parquet: tag: latest envFrom: "{{ .Release.Name }}-bucket-configmap": "configMapRef" + topologySpreadConstraints: + enabled: false app: install: true @@ -216,6 +218,8 @@ app: tag: latest envFrom: "{{ .Release.Name }}-bucket-configmap": "configMapRef" + topologySpreadConstraints: + enabled: false nginx: install: false @@ -225,6 +229,8 @@ weave: image: repository: wandb/local tag: latest + topologySpreadConstraints: + enabled: false weave-trace: install: false @@ -233,12 +239,16 @@ weave-trace: tag: latest datadog: enabled: false + topologySpreadConstraints: + enabled: false console: install: true image: repository: wandb/console tag: latest + topologySpreadConstraints: + enabled: false flat-run-fields-updater: install: false @@ -249,6 +259,8 @@ flat-run-fields-updater: subscription: "" envFrom: "{{ .Release.Name }}-bucket-configmap": "configMapRef" + topologySpreadConstraints: + enabled: false filestream: install: false @@ -259,6 +271,8 @@ filestream: subscription: "" envFrom: "{{ .Release.Name }}-bucket-configmap": "configMapRef" + topologySpreadConstraints: + enabled: false executor: install: false @@ -267,12 +281,16 @@ executor: tag: latest envFrom: "{{ .Release.Name }}-bucket-configmap": "configMapRef" + topologySpreadConstraints: + enabled: false mysql: install: false persistence: size: 20Gi storageClass: "" + topologySpreadConstraints: + enabled: false yace: install: false @@ -283,6 +301,8 @@ yace: prometheus.io/port: "5000" prometheus.io/path: "/metrics" prometheus.io/scheme: http + topologySpreadConstraints: + enabled: false redis: install: true @@ -310,6 +330,9 @@ prometheus: mysql-exporter: install: true + topologySpreadConstraints: + enabled: false + stackdriver: install: false pod: @@ -318,9 +341,13 @@ stackdriver: prometheus.io/port: "9255" prometheus.io/path: "/metrics" prometheus.io/scheme: http + topologySpreadConstraints: + enabled: false otel: install: true + topologySpreadConstraints: + enabled: false # Consider deploying with a deployment rather than a daemonset to avoid # redundant metrics. In setups where both are scraping the same endpoints, From 979af3d6c2d4617a3d1b38e32b1915a39cef97d4 Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Wed, 4 Dec 2024 19:16:13 +0530 Subject: [PATCH 2/4] add support for topologyspreadconstraints in all subcharts --- .../charts/console/templates/deployment.yaml | 3 +++ charts/operator-wandb/charts/console/values.yaml | 3 +++ .../charts/executor/templates/deployment.yaml | 3 +++ .../operator-wandb/charts/executor/values.yaml | 3 +++ .../charts/filestream/templates/deployment.yaml | 3 +++ .../operator-wandb/charts/filestream/values.yaml | 3 +++ .../templates/deployment.yaml | 3 +++ .../charts/flat-run-fields-updater/values.yaml | 3 +++ .../charts/mysql/templates/statefulset.yaml | 5 ++++- charts/operator-wandb/charts/mysql/values.yaml | 3 +++ .../otel/charts/agent/templates/deamonset.yaml | 3 +++ .../otel/charts/agent/templates/deployment.yaml | 3 +++ .../charts/otel/charts/agent/values.yaml | 3 +++ charts/operator-wandb/charts/otel/values.yaml | 4 ++++ .../charts/parquet/templates/cron.yaml | 3 +++ .../charts/parquet/templates/deployment.yaml | 3 +++ charts/operator-wandb/charts/parquet/values.yaml | 3 +++ .../mysql-exporter/templates/deployment.yaml | 3 +++ .../prometheus/charts/mysql-exporter/values.yaml | 3 +++ .../redis-exporter/templates/deployment.yaml | 3 +++ .../prometheus/charts/redis-exporter/values.yaml | 3 +++ .../charts/stackdriver/templates/deployment.yaml | 3 +++ .../charts/stackdriver/values.yaml | 3 +++ .../charts/weave-trace/templates/deployment.yaml | 3 +++ .../charts/weave-trace/values.yaml | 3 +++ .../charts/weave/templates/deployment.yaml | 3 +++ charts/operator-wandb/charts/weave/values.yaml | 3 +++ .../charts/yace/templates/deployment.yaml | 3 +++ charts/operator-wandb/charts/yace/values.yaml | 3 +++ charts/operator-wandb/values.yaml | 16 +++++++++------- 30 files changed, 98 insertions(+), 8 deletions(-) diff --git a/charts/operator-wandb/charts/console/templates/deployment.yaml b/charts/operator-wandb/charts/console/templates/deployment.yaml index 5771d410..ab0c1280 100644 --- a/charts/operator-wandb/charts/console/templates/deployment.yaml +++ b/charts/operator-wandb/charts/console/templates/deployment.yaml @@ -42,6 +42,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "console.labels" .))) | nindent 6 }} + {{- end }} # Extend the pods shutdown grace period from the default of 30s to 60s. # This goes in the pod template spec. terminationGracePeriodSeconds: 60 diff --git a/charts/operator-wandb/charts/console/values.yaml b/charts/operator-wandb/charts/console/values.yaml index e7250e5a..c040c837 100644 --- a/charts/operator-wandb/charts/console/values.yaml +++ b/charts/operator-wandb/charts/console/values.yaml @@ -49,6 +49,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + service: type: ClusterIP annotations: {} diff --git a/charts/operator-wandb/charts/executor/templates/deployment.yaml b/charts/operator-wandb/charts/executor/templates/deployment.yaml index 268a2235..fb31367b 100644 --- a/charts/operator-wandb/charts/executor/templates/deployment.yaml +++ b/charts/operator-wandb/charts/executor/templates/deployment.yaml @@ -45,6 +45,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "executor.labels" .))) | nindent 6 }} + {{- end }} # needed to ensure ensure Kafka consumers handle pod termination gracefully and avoid data loss terminationGracePeriodSeconds: 60 containers: diff --git a/charts/operator-wandb/charts/executor/values.yaml b/charts/operator-wandb/charts/executor/values.yaml index ab55e3bc..b3890e6f 100644 --- a/charts/operator-wandb/charts/executor/values.yaml +++ b/charts/operator-wandb/charts/executor/values.yaml @@ -54,6 +54,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + common: labels: {} diff --git a/charts/operator-wandb/charts/filestream/templates/deployment.yaml b/charts/operator-wandb/charts/filestream/templates/deployment.yaml index 8634f7b1..f2d03bb6 100644 --- a/charts/operator-wandb/charts/filestream/templates/deployment.yaml +++ b/charts/operator-wandb/charts/filestream/templates/deployment.yaml @@ -45,6 +45,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "filestream.labels" .))) | nindent 6 }} + {{- end }} # needed to ensure ensure Kafka consumers handle pod termination gracefully and avoid data loss terminationGracePeriodSeconds: 60 containers: diff --git a/charts/operator-wandb/charts/filestream/values.yaml b/charts/operator-wandb/charts/filestream/values.yaml index 193739e3..9ada8ca4 100644 --- a/charts/operator-wandb/charts/filestream/values.yaml +++ b/charts/operator-wandb/charts/filestream/values.yaml @@ -58,6 +58,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + common: labels: {} diff --git a/charts/operator-wandb/charts/flat-run-fields-updater/templates/deployment.yaml b/charts/operator-wandb/charts/flat-run-fields-updater/templates/deployment.yaml index 5e8d2022..351fa2e9 100644 --- a/charts/operator-wandb/charts/flat-run-fields-updater/templates/deployment.yaml +++ b/charts/operator-wandb/charts/flat-run-fields-updater/templates/deployment.yaml @@ -45,6 +45,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "flat-run-fields-updater.labels" .))) | nindent 6 }} + {{- end }} # needed to ensure ensure Kafka consumers handle pod termination gracefully and avoid data loss terminationGracePeriodSeconds: 60 containers: diff --git a/charts/operator-wandb/charts/flat-run-fields-updater/values.yaml b/charts/operator-wandb/charts/flat-run-fields-updater/values.yaml index 8c07c405..bbae5782 100644 --- a/charts/operator-wandb/charts/flat-run-fields-updater/values.yaml +++ b/charts/operator-wandb/charts/flat-run-fields-updater/values.yaml @@ -54,6 +54,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + common: labels: {} diff --git a/charts/operator-wandb/charts/mysql/templates/statefulset.yaml b/charts/operator-wandb/charts/mysql/templates/statefulset.yaml index 438e0931..507bace0 100644 --- a/charts/operator-wandb/charts/mysql/templates/statefulset.yaml +++ b/charts/operator-wandb/charts/mysql/templates/statefulset.yaml @@ -29,10 +29,13 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "mysql.labels" .))) | nindent 6 }} + {{- end }} containers: - name: mysql image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - {{- include "wandb.podSecurityContext" .Values.container.securityContext | nindent 10 }} + {{- include "wandb.containerSecurityContext" .Values.container.securityContext | nindent 10 }} ports: - name: mysql containerPort: 3306 diff --git a/charts/operator-wandb/charts/mysql/values.yaml b/charts/operator-wandb/charts/mysql/values.yaml index b779d139..c2690481 100644 --- a/charts/operator-wandb/charts/mysql/values.yaml +++ b/charts/operator-wandb/charts/mysql/values.yaml @@ -45,6 +45,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + resources: requests: cpu: 500m diff --git a/charts/operator-wandb/charts/otel/charts/agent/templates/deamonset.yaml b/charts/operator-wandb/charts/otel/charts/agent/templates/deamonset.yaml index d84fd1d1..221d3eb1 100644 --- a/charts/operator-wandb/charts/otel/charts/agent/templates/deamonset.yaml +++ b/charts/operator-wandb/charts/otel/charts/agent/templates/deamonset.yaml @@ -43,6 +43,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "otelAgent.labels" .))) | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/otel/charts/agent/templates/deployment.yaml b/charts/operator-wandb/charts/otel/charts/agent/templates/deployment.yaml index 7fbc8b97..047281d2 100644 --- a/charts/operator-wandb/charts/otel/charts/agent/templates/deployment.yaml +++ b/charts/operator-wandb/charts/otel/charts/agent/templates/deployment.yaml @@ -43,6 +43,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "otelAgent.labels" .))) | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/otel/charts/agent/values.yaml b/charts/operator-wandb/charts/otel/charts/agent/values.yaml index 573c9cd9..6d812860 100644 --- a/charts/operator-wandb/charts/otel/charts/agent/values.yaml +++ b/charts/operator-wandb/charts/otel/charts/agent/values.yaml @@ -51,6 +51,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + clusterRole: annotations: {} labels: {} diff --git a/charts/operator-wandb/charts/otel/values.yaml b/charts/operator-wandb/charts/otel/values.yaml index 980a638a..5bee7d58 100644 --- a/charts/operator-wandb/charts/otel/values.yaml +++ b/charts/operator-wandb/charts/otel/values.yaml @@ -1,6 +1,8 @@ daemonset: install: true mode: "daemonset" + topologySpreadConstraints: + enabled: false presets: receivers: hostMetrics: true @@ -29,6 +31,8 @@ daemonset: deployment: install: true mode: "deployment" + topologySpreadConstraints: + enabled: false presets: receivers: statsd: true diff --git a/charts/operator-wandb/charts/parquet/templates/cron.yaml b/charts/operator-wandb/charts/parquet/templates/cron.yaml index 1ea5c87d..85e9e20e 100644 --- a/charts/operator-wandb/charts/parquet/templates/cron.yaml +++ b/charts/operator-wandb/charts/parquet/templates/cron.yaml @@ -42,6 +42,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 10 }} {{- include "wandb.priorityClassName" . | nindent 10 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 10 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "parquet.labels" .))) | nindent 10 }} + {{- end }} containers: - name: backfill-job image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/parquet/templates/deployment.yaml b/charts/operator-wandb/charts/parquet/templates/deployment.yaml index 9938010f..4286cfcc 100644 --- a/charts/operator-wandb/charts/parquet/templates/deployment.yaml +++ b/charts/operator-wandb/charts/parquet/templates/deployment.yaml @@ -43,6 +43,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "parquet.labels" .))) | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/parquet/values.yaml b/charts/operator-wandb/charts/parquet/values.yaml index 81bd7495..40c13768 100644 --- a/charts/operator-wandb/charts/parquet/values.yaml +++ b/charts/operator-wandb/charts/parquet/values.yaml @@ -55,6 +55,9 @@ container: allowPrivilegeEscalation: false readOnlyRootFilesystem: false +topologySpreadConstraints: + enabled: false + resources: # We usually recommend not to specify default resources and to leave this as a # conscious choice for the user. This also increases chances charts run on diff --git a/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/templates/deployment.yaml b/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/templates/deployment.yaml index 34839bcb..1a639e78 100644 --- a/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/templates/deployment.yaml +++ b/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/templates/deployment.yaml @@ -41,6 +41,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "mysql-exporter.labels" .))) | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/values.yaml b/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/values.yaml index 4c3b1742..afa6e69f 100644 --- a/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/values.yaml +++ b/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/values.yaml @@ -19,6 +19,9 @@ pod: labels: {} annotations: {} +topologySpreadConstraints: + enabled: false + common: labels: {} diff --git a/charts/operator-wandb/charts/prometheus/charts/redis-exporter/templates/deployment.yaml b/charts/operator-wandb/charts/prometheus/charts/redis-exporter/templates/deployment.yaml index 34ed6d19..ccca0b6f 100644 --- a/charts/operator-wandb/charts/prometheus/charts/redis-exporter/templates/deployment.yaml +++ b/charts/operator-wandb/charts/prometheus/charts/redis-exporter/templates/deployment.yaml @@ -41,6 +41,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "redis-exporter.labels" .))) | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/prometheus/charts/redis-exporter/values.yaml b/charts/operator-wandb/charts/prometheus/charts/redis-exporter/values.yaml index 53bc6e64..8e2bccfc 100644 --- a/charts/operator-wandb/charts/prometheus/charts/redis-exporter/values.yaml +++ b/charts/operator-wandb/charts/prometheus/charts/redis-exporter/values.yaml @@ -19,6 +19,9 @@ pod: labels: {} annotations: {} +topologySpreadConstraints: + enabled: false + common: labels: {} diff --git a/charts/operator-wandb/charts/stackdriver/templates/deployment.yaml b/charts/operator-wandb/charts/stackdriver/templates/deployment.yaml index b3003fe6..ac6fe8a2 100644 --- a/charts/operator-wandb/charts/stackdriver/templates/deployment.yaml +++ b/charts/operator-wandb/charts/stackdriver/templates/deployment.yaml @@ -35,6 +35,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "stackdriver.labels" .))) | nindent 6 }} + {{- end }} spec: containers: - name: {{ .Chart.Name }} diff --git a/charts/operator-wandb/charts/stackdriver/values.yaml b/charts/operator-wandb/charts/stackdriver/values.yaml index 51ed7b65..76631977 100644 --- a/charts/operator-wandb/charts/stackdriver/values.yaml +++ b/charts/operator-wandb/charts/stackdriver/values.yaml @@ -101,6 +101,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + deployment: {} serviceAccount: diff --git a/charts/operator-wandb/charts/weave-trace/templates/deployment.yaml b/charts/operator-wandb/charts/weave-trace/templates/deployment.yaml index 3bb3f854..0b26466c 100644 --- a/charts/operator-wandb/charts/weave-trace/templates/deployment.yaml +++ b/charts/operator-wandb/charts/weave-trace/templates/deployment.yaml @@ -40,6 +40,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "weaveTrace.labels" .))) | nindent 6 }} + {{- end }} {{- if not .Values.migration.useHook }} initContainers: - name: {{ include "weaveTraceMigrate.fullname" . }} diff --git a/charts/operator-wandb/charts/weave-trace/values.yaml b/charts/operator-wandb/charts/weave-trace/values.yaml index 25f4f352..a77238c1 100644 --- a/charts/operator-wandb/charts/weave-trace/values.yaml +++ b/charts/operator-wandb/charts/weave-trace/values.yaml @@ -46,6 +46,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + resources: requests: cpu: 500m diff --git a/charts/operator-wandb/charts/weave/templates/deployment.yaml b/charts/operator-wandb/charts/weave/templates/deployment.yaml index 8abb7aee..bf8402b3 100644 --- a/charts/operator-wandb/charts/weave/templates/deployment.yaml +++ b/charts/operator-wandb/charts/weave/templates/deployment.yaml @@ -43,6 +43,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "weave.labels" .))) | nindent 6 }} + {{- end }} containers: - name: {{ include "weave.fullname" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/weave/values.yaml b/charts/operator-wandb/charts/weave/values.yaml index ed51e533..6e2aa890 100644 --- a/charts/operator-wandb/charts/weave/values.yaml +++ b/charts/operator-wandb/charts/weave/values.yaml @@ -55,6 +55,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + resources: # We usually recommend not to specify default resources and to leave this as a # conscious choice for the user. This also increases chances charts run on diff --git a/charts/operator-wandb/charts/yace/templates/deployment.yaml b/charts/operator-wandb/charts/yace/templates/deployment.yaml index 988fe210..1a50b73d 100644 --- a/charts/operator-wandb/charts/yace/templates/deployment.yaml +++ b/charts/operator-wandb/charts/yace/templates/deployment.yaml @@ -42,6 +42,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "yace.labels" .))) | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/yace/values.yaml b/charts/operator-wandb/charts/yace/values.yaml index a2f45071..275e271f 100644 --- a/charts/operator-wandb/charts/yace/values.yaml +++ b/charts/operator-wandb/charts/yace/values.yaml @@ -113,6 +113,9 @@ container: readOnlyRootFilesystem: false privileged: false +topologySpreadConstraints: + enabled: false + deployment: {} serviceAccount: diff --git a/charts/operator-wandb/values.yaml b/charts/operator-wandb/values.yaml index 9e95a4d3..75ad4555 100644 --- a/charts/operator-wandb/values.yaml +++ b/charts/operator-wandb/values.yaml @@ -326,12 +326,13 @@ prometheus: redis-exporter: install: true + topologySpreadConstraints: + enabled: false mysql-exporter: install: true - - topologySpreadConstraints: - enabled: false + topologySpreadConstraints: + enabled: false stackdriver: install: false @@ -346,14 +347,13 @@ stackdriver: otel: install: true - topologySpreadConstraints: - enabled: false - # Consider deploying with a deployment rather than a daemonset to avoid # redundant metrics. In setups where both are scraping the same endpoints, # this redundancy occurs as both scrape the same points. daemonset: - install: true + install: false + topologySpreadConstraints: + enabled: false # By default, we use only the daemonset which, along with the Prometheus # receiver, gathers most necessary metrics. @@ -361,6 +361,8 @@ otel: # promethus endpoint which causes duplicated metrics that get repoted. deployment: install: false + topologySpreadConstraints: + enabled: false # # cannot use install because schema validation will fail. # enabled: true From db5c8d6aa8450526ccd0fb8aaed3f8ea7577e003 Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Thu, 5 Dec 2024 11:17:34 +0530 Subject: [PATCH 3/4] resolve conflicts --- charts/operator-wandb/charts/app/templates/deployment.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/operator-wandb/charts/app/templates/deployment.yaml b/charts/operator-wandb/charts/app/templates/deployment.yaml index bcc074b1..218ea6c8 100644 --- a/charts/operator-wandb/charts/app/templates/deployment.yaml +++ b/charts/operator-wandb/charts/app/templates/deployment.yaml @@ -43,6 +43,9 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} + {{- if .Values.topologySpreadConstraints.enabled }} + {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "app.labels" .))) | nindent 6 }} + {{- end }} # Extend the pods shutdown grace period from the default of 30s to 60s. # This goes in the pod template spec. terminationGracePeriodSeconds: 60 From 10a0c216069a0db7d1fd4090d815f5c9dbe14e5c Mon Sep 17 00:00:00 2001 From: velotioaastha Date: Wed, 18 Dec 2024 18:29:56 +0530 Subject: [PATCH 4/4] resolve comments to remove topology from prometheus, stackdriver & daemonset --- charts/operator-wandb/Chart.lock | 6 +++--- charts/operator-wandb/Chart.yaml | 2 +- .../charts/otel/charts/agent/templates/deamonset.yaml | 3 --- charts/operator-wandb/charts/otel/values.yaml | 2 -- .../charts/mysql-exporter/templates/deployment.yaml | 3 --- .../prometheus/charts/mysql-exporter/values.yaml | 3 --- .../charts/redis-exporter/templates/deployment.yaml | 3 --- .../prometheus/charts/redis-exporter/values.yaml | 3 --- .../charts/stackdriver/templates/deployment.yaml | 3 --- charts/operator-wandb/charts/stackdriver/values.yaml | 3 --- charts/operator-wandb/values.yaml | 11 ++--------- 11 files changed, 6 insertions(+), 36 deletions(-) diff --git a/charts/operator-wandb/Chart.lock b/charts/operator-wandb/Chart.lock index def9b848..709a2e3d 100644 --- a/charts/operator-wandb/Chart.lock +++ b/charts/operator-wandb/Chart.lock @@ -31,7 +31,7 @@ dependencies: version: 25.3.5 - name: etcd repository: oci://registry-1.docker.io/bitnamicharts - version: 10.6.1 + version: 10.7.1 - name: bufstream repository: file://charts/bufstream version: 0.3.1 @@ -56,5 +56,5 @@ dependencies: - name: wandb-base repository: file://../wandb-base version: 0.1.1 -digest: sha256:1eb284a2d6588f3e3d90293abb99f0e25b02fd62a87758f023d809879a82e31d -generated: "2024-12-06T11:08:12.69179-08:00" +digest: sha256:3c02029e1921428d7f45866291a8c42b79894505ee47864c54f34fcd847b2793 +generated: "2024-12-18T18:29:20.054295+05:30" diff --git a/charts/operator-wandb/Chart.yaml b/charts/operator-wandb/Chart.yaml index 13006d9e..48a0dcc0 100644 --- a/charts/operator-wandb/Chart.yaml +++ b/charts/operator-wandb/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: operator-wandb description: A Helm chart for deploying W&B to Kubernetes type: application -version: 0.21.8 +version: 0.21.9 appVersion: 1.0.0 icon: https://wandb.ai/logo.svg diff --git a/charts/operator-wandb/charts/otel/charts/agent/templates/deamonset.yaml b/charts/operator-wandb/charts/otel/charts/agent/templates/deamonset.yaml index 221d3eb1..d84fd1d1 100644 --- a/charts/operator-wandb/charts/otel/charts/agent/templates/deamonset.yaml +++ b/charts/operator-wandb/charts/otel/charts/agent/templates/deamonset.yaml @@ -43,9 +43,6 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} - {{- if .Values.topologySpreadConstraints.enabled }} - {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "otelAgent.labels" .))) | nindent 6 }} - {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/otel/values.yaml b/charts/operator-wandb/charts/otel/values.yaml index 5bee7d58..e4a0b750 100644 --- a/charts/operator-wandb/charts/otel/values.yaml +++ b/charts/operator-wandb/charts/otel/values.yaml @@ -1,8 +1,6 @@ daemonset: install: true mode: "daemonset" - topologySpreadConstraints: - enabled: false presets: receivers: hostMetrics: true diff --git a/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/templates/deployment.yaml b/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/templates/deployment.yaml index 1a639e78..34839bcb 100644 --- a/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/templates/deployment.yaml +++ b/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/templates/deployment.yaml @@ -41,9 +41,6 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} - {{- if .Values.topologySpreadConstraints.enabled }} - {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "mysql-exporter.labels" .))) | nindent 6 }} - {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/values.yaml b/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/values.yaml index afa6e69f..4c3b1742 100644 --- a/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/values.yaml +++ b/charts/operator-wandb/charts/prometheus/charts/mysql-exporter/values.yaml @@ -19,9 +19,6 @@ pod: labels: {} annotations: {} -topologySpreadConstraints: - enabled: false - common: labels: {} diff --git a/charts/operator-wandb/charts/prometheus/charts/redis-exporter/templates/deployment.yaml b/charts/operator-wandb/charts/prometheus/charts/redis-exporter/templates/deployment.yaml index ccca0b6f..34ed6d19 100644 --- a/charts/operator-wandb/charts/prometheus/charts/redis-exporter/templates/deployment.yaml +++ b/charts/operator-wandb/charts/prometheus/charts/redis-exporter/templates/deployment.yaml @@ -41,9 +41,6 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} - {{- if .Values.topologySpreadConstraints.enabled }} - {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "redis-exporter.labels" .))) | nindent 6 }} - {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/operator-wandb/charts/prometheus/charts/redis-exporter/values.yaml b/charts/operator-wandb/charts/prometheus/charts/redis-exporter/values.yaml index 8e2bccfc..53bc6e64 100644 --- a/charts/operator-wandb/charts/prometheus/charts/redis-exporter/values.yaml +++ b/charts/operator-wandb/charts/prometheus/charts/redis-exporter/values.yaml @@ -19,9 +19,6 @@ pod: labels: {} annotations: {} -topologySpreadConstraints: - enabled: false - common: labels: {} diff --git a/charts/operator-wandb/charts/stackdriver/templates/deployment.yaml b/charts/operator-wandb/charts/stackdriver/templates/deployment.yaml index ac6fe8a2..b3003fe6 100644 --- a/charts/operator-wandb/charts/stackdriver/templates/deployment.yaml +++ b/charts/operator-wandb/charts/stackdriver/templates/deployment.yaml @@ -35,9 +35,6 @@ spec: {{- include "wandb.nodeSelector" . | nindent 6 }} {{- include "wandb.priorityClassName" . | nindent 6 }} {{- include "wandb.podSecurityContext" .Values.pod.securityContext | nindent 6 }} - {{- if .Values.topologySpreadConstraints.enabled }} - {{- include "wandb.topologySpreadConstraints" (dict "matchLabels" (fromYaml (include "stackdriver.labels" .))) | nindent 6 }} - {{- end }} spec: containers: - name: {{ .Chart.Name }} diff --git a/charts/operator-wandb/charts/stackdriver/values.yaml b/charts/operator-wandb/charts/stackdriver/values.yaml index 76631977..51ed7b65 100644 --- a/charts/operator-wandb/charts/stackdriver/values.yaml +++ b/charts/operator-wandb/charts/stackdriver/values.yaml @@ -101,9 +101,6 @@ container: readOnlyRootFilesystem: false privileged: false -topologySpreadConstraints: - enabled: false - deployment: {} serviceAccount: diff --git a/charts/operator-wandb/values.yaml b/charts/operator-wandb/values.yaml index 75ad4555..4281cd4e 100644 --- a/charts/operator-wandb/values.yaml +++ b/charts/operator-wandb/values.yaml @@ -326,13 +326,9 @@ prometheus: redis-exporter: install: true - topologySpreadConstraints: - enabled: false mysql-exporter: install: true - topologySpreadConstraints: - enabled: false stackdriver: install: false @@ -342,18 +338,15 @@ stackdriver: prometheus.io/port: "9255" prometheus.io/path: "/metrics" prometheus.io/scheme: http - topologySpreadConstraints: - enabled: false otel: install: true + # Consider deploying with a deployment rather than a daemonset to avoid # redundant metrics. In setups where both are scraping the same endpoints, # this redundancy occurs as both scrape the same points. daemonset: - install: false - topologySpreadConstraints: - enabled: false + install: true # By default, we use only the daemonset which, along with the Prometheus # receiver, gathers most necessary metrics.