diff --git a/charts/posthog/ALL_VALUES.md b/charts/posthog/ALL_VALUES.md index 420284239..64e3ba216 100644 --- a/charts/posthog/ALL_VALUES.md +++ b/charts/posthog/ALL_VALUES.md @@ -329,6 +329,8 @@ The following table lists the configurable parameters of the PostHog chart and t | cloudwatch.region | string | `nil` | AWS region | | cloudwatch.clusterName | string | `nil` | AWS EKS cluster name | | cloudwatch.fluentBit | object | `{"port":2020,"readHead":"On","readTail":"Off","server":"On"}` | fluentBit configuration | +| hooks.nodeSelector | object | `{}` | Node labels for hooks | +| hooks.tolerations | list | `[]` | Toleration labels for hooks | | hooks.affinity | object | `{}` | Affinity settings for hooks | | hooks.migrate.env | list | `[]` | Env variables for migate hooks | | hooks.migrate.resources | object | `{}` | Hook job resource limits/requests | diff --git a/charts/posthog/templates/migrate.job.yaml b/charts/posthog/templates/migrate.job.yaml index 897f4932b..6e78d41b8 100644 --- a/charts/posthog/templates/migrate.job.yaml +++ b/charts/posthog/templates/migrate.job.yaml @@ -23,6 +23,14 @@ spec: spec: {{- with .Values.hooks.affinity }} affinity: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.hooks.nodeSelector }} + nodeSelector: +{{ toYaml . | indent 8 }} + {{- end }} + {{- with .Values.hooks.tolerations }} + tolerations: {{ toYaml . | indent 8 }} {{- end }} restartPolicy: Never diff --git a/charts/posthog/tests/migrate-job.yaml b/charts/posthog/tests/migrate-job.yaml index 34fe67bff..0a1efe8ab 100644 --- a/charts/posthog/tests/migrate-job.yaml +++ b/charts/posthog/tests/migrate-job.yaml @@ -44,3 +44,19 @@ tests: content: name: SENTRY_DSN value: sentry.endpoint + + - it: nodeSelector override via 'hooks.nodeSelector' works + template: templates/migrate.job.yaml # TODO: remove once secrets.yaml will be fixed/removed + set: + cloud: local # TODO: remove once secrets.yaml will be fixed/removed + hooks.nodeSelector: + diskType: ssd + nodeType: fast + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.template.spec.nodeSelector + value: + diskType: ssd + nodeType: fast diff --git a/charts/posthog/values.yaml b/charts/posthog/values.yaml index 1b1dc99e2..c52d42429 100644 --- a/charts/posthog/values.yaml +++ b/charts/posthog/values.yaml @@ -1085,7 +1085,11 @@ cloudwatch: # Provide affinity for hooks if needed hooks: - # -- Affinity settings for hooks + # -- Node labels for hooks. + nodeSelector: {} + # -- Toleration labels for hooks. + tolerations: [] + # -- Affinity settings for hooks. affinity: {} migrate: # -- Env variables for migate hooks