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/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 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/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/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..e4a0b750 100644 --- a/charts/operator-wandb/charts/otel/values.yaml +++ b/charts/operator-wandb/charts/otel/values.yaml @@ -29,6 +29,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/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/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..4281cd4e 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 @@ -334,6 +354,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