diff --git a/charts/posthog/ALL_VALUES.md b/charts/posthog/ALL_VALUES.md index 3c4c03722..83629d7dd 100644 --- a/charts/posthog/ALL_VALUES.md +++ b/charts/posthog/ALL_VALUES.md @@ -23,6 +23,9 @@ The following table lists the configurable parameters of the PostHog chart and t | posthogSecretKey.existingSecret | string | `nil` | Specify that the key should be pulled from an existing secret key. By default the chart will generate a secret and create a Kubernetes Secret containing it. | | posthogSecretKey.existingSecretKey | string | `"posthog-secret"` | Specify the key within the secret from which SECRET_KEY should be taken. | | env | list | `[]` | Environment variables to inject into every PostHog deployment. | +| nodeSelector | object | `{}` | Global Node labels for all deployment. | +| tolerations | list | `[]` | Global Toleration labels for all deployment. | +| affinity | object | `{}` | Global Affinity settings for all deployment. | | migrate.enabled | bool | `true` | Whether to install the PostHog migrate job or not. | | events.enabled | bool | `true` | Whether to install the PostHog events stack or not. | | events.replicacount | int | `1` | Count of events pods to run. This setting is ignored if `events.hpa.enabled` is set to `true`. | diff --git a/charts/posthog/Chart.lock b/charts/posthog/Chart.lock index 6b3d8db6b..dcda37014 100644 --- a/charts/posthog/Chart.lock +++ b/charts/posthog/Chart.lock @@ -19,7 +19,7 @@ dependencies: version: 16.8.9 - name: zookeeper repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami - version: 7.0.5 + version: 7.4.11 - name: grafana repository: https://grafana.github.io/helm-charts version: 6.40.0 @@ -44,5 +44,5 @@ dependencies: - name: prometheus-statsd-exporter repository: https://prometheus-community.github.io/helm-charts version: 0.3.1 -digest: sha256:5ac223659ced28c44ff2c89963e0268427f848b5d4db98df9b8f1010f22f8207 -generated: "2022-12-20T11:35:36.888806538Z" +digest: sha256:5615fc5fda7592b7c87d352789702c33db0ec6c6ff8625aee1ef20465aaa442f +generated: "2023-02-17T16:38:29.581158+05:00" diff --git a/charts/posthog/Chart.yaml b/charts/posthog/Chart.yaml index 8026850ab..63a1d72fc 100644 --- a/charts/posthog/Chart.yaml +++ b/charts/posthog/Chart.yaml @@ -49,7 +49,7 @@ dependencies: condition: redis.enabled - name: zookeeper - version: 7.0.5 + version: 7.4.11 repository: https://raw.githubusercontent.com/bitnami/charts/pre-2022/bitnami condition: zookeeper.enabled diff --git a/charts/posthog/charts/zookeeper-7.0.5.tgz b/charts/posthog/charts/zookeeper-7.0.5.tgz deleted file mode 100644 index be0d85940..000000000 Binary files a/charts/posthog/charts/zookeeper-7.0.5.tgz and /dev/null differ diff --git a/charts/posthog/charts/zookeeper-7.4.11.tgz b/charts/posthog/charts/zookeeper-7.4.11.tgz new file mode 100644 index 000000000..0149d9933 Binary files /dev/null and b/charts/posthog/charts/zookeeper-7.4.11.tgz differ diff --git a/charts/posthog/templates/_kafka.tpl b/charts/posthog/templates/_kafka.tpl index cb6562aff..2cff3f780 100644 --- a/charts/posthog/templates/_kafka.tpl +++ b/charts/posthog/templates/_kafka.tpl @@ -14,7 +14,7 @@ {{/* Return the Kafka hosts (brokers) */}} {{- define "posthog.kafka.brokers"}} {{- if .Values.kafka.enabled -}} - {{- printf "%s:%d" (include "posthog.kafka.fullname" .) (.Values.kafka.service.port | int) }} + {{- printf "%s:%d" (include "posthog.kafka.fullname" .) (.Values.kafka.service.ports.client | int) }} {{- else -}} {{- printf "%s" .Values.externalKafka.brokers }} {{- end }} diff --git a/charts/posthog/templates/_snippet-plugins-deployment.tpl b/charts/posthog/templates/_snippet-plugins-deployment.tpl index 0ff3cbdef..59bdf0d8d 100644 --- a/charts/posthog/templates/_snippet-plugins-deployment.tpl +++ b/charts/posthog/templates/_snippet-plugins-deployment.tpl @@ -44,22 +44,9 @@ spec: {{- end }} spec: serviceAccountName: {{ template "posthog.serviceAccountName" .root }} - - {{- if .params.affinity }} - affinity: - {{- toYaml .params.affinity | nindent 8 }} - {{- end }} - - {{- if .params.nodeSelector }} - nodeSelector: - {{- toYaml .params.nodeSelector | nindent 8 }} - {{- end }} - - {{- if .params.tolerations }} - tolerations: - {{- toYaml .params.tolerations | nindent 8 }} - {{- end }} - + affinity: {{ toYaml (merge .params.affinity .root.Values.affinity) | nindent 8 }} + nodeSelector: {{ toYaml (merge .params.nodeSelector .root.Values.nodeSelector) | nindent 8 }} + tolerations: {{ toYaml (coalesce .params.tolerations .root.Values.tolerations) | nindent 8 }} {{- if .params.schedulerName }} schedulerName: "{{ .params.schedulerName }}" {{- end }} @@ -145,6 +132,16 @@ spec: periodSeconds: {{ .params.readinessProbe.periodSeconds }} successThreshold: {{ .params.readinessProbe.successThreshold }} timeoutSeconds: {{ .params.readinessProbe.timeoutSeconds }} + startupProbe: + failureThreshold: {{ .params.startupProbe.failureThreshold }} + httpGet: + path: /_health + port: 6738 + scheme: HTTP + initialDelaySeconds: {{ .params.startupProbe.initialDelaySeconds }} + periodSeconds: {{ .params.startupProbe.periodSeconds }} + successThreshold: {{ .params.startupProbe.successThreshold }} + timeoutSeconds: {{ .params.startupProbe.timeoutSeconds }} resources: {{- toYaml .params.resources | nindent 12 }} {{- if .params.securityContext.enabled }} @@ -158,7 +155,7 @@ spec: --- {{ if .params.hpa.enabled }} -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ template "posthog.fullname" .root }}-{{ .name }} diff --git a/charts/posthog/templates/clickhouse-backup-cronjob.yaml b/charts/posthog/templates/clickhouse-backup-cronjob.yaml index 95f74edce..1602bbb77 100644 --- a/charts/posthog/templates/clickhouse-backup-cronjob.yaml +++ b/charts/posthog/templates/clickhouse-backup-cronjob.yaml @@ -29,6 +29,9 @@ spec: {{- end }} {{- end }} {{- end }} + affinity: {{ toYaml (merge .Values.clickhouse.affinity .Values.affinity) | nindent 12 }} + nodeSelector: {{ toYaml (merge .Values.clickhouse.nodeSelector .Values.nodeSelector) | nindent 12 }} + tolerations: {{ toYaml (coalesce .Values.clickhouse.tolerations .Values.tolerations) | nindent 12 }} initContainers: # diff --git a/charts/posthog/templates/clickhouse_instance.yaml b/charts/posthog/templates/clickhouse_instance.yaml index f39529ac4..4af83ce72 100644 --- a/charts/posthog/templates/clickhouse_instance.yaml +++ b/charts/posthog/templates/clickhouse_instance.yaml @@ -71,16 +71,9 @@ spec: podDistribution: {{ toYaml .Values.clickhouse.podDistribution | nindent 12 }} {{- end}} spec: - {{- if .Values.clickhouse.affinity }} - affinity: {{ toYaml .Values.clickhouse.affinity | nindent 12 }} - {{- end }} - {{- if .Values.clickhouse.tolerations }} - tolerations: {{ toYaml .Values.clickhouse.tolerations | nindent 12 }} - {{- end }} - {{- if .Values.clickhouse.nodeSelector }} - nodeSelector: {{ toYaml .Values.clickhouse.nodeSelector | nindent 12 }} - {{- end }} - + affinity: {{ toYaml (merge .Values.clickhouse.affinity .Values.affinity) | nindent 12 }} + nodeSelector: {{ toYaml (merge .Values.clickhouse.nodeSelector .Values.nodeSelector) | nindent 12 }} + tolerations: {{ toYaml (coalesce .Values.clickhouse.tolerations .Values.tolerations) | nindent 12 }} {{- if .Values.clickhouse.persistence.enabled }} volumes: {{- if .Values.clickhouse.persistence.existingClaim }} diff --git a/charts/posthog/templates/events-deployment.yaml b/charts/posthog/templates/events-deployment.yaml index dd40f9815..91a66ed9a 100644 --- a/charts/posthog/templates/events-deployment.yaml +++ b/charts/posthog/templates/events-deployment.yaml @@ -25,8 +25,8 @@ spec: metadata: annotations: checksum/secrets.yaml: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }} - {{- if .Values.web.podAnnotations }} -{{ toYaml .Values.web.podAnnotations | indent 8 }} + {{- if .Values.events.podAnnotations }} +{{ toYaml .Values.events.podAnnotations | indent 8 }} {{- end }} labels: app: {{ template "posthog.fullname" . }} @@ -41,22 +41,9 @@ spec: spec: terminationGracePeriodSeconds: {{ include "snippet.web-deployments.terminationGracePeriodSeconds" . }} serviceAccountName: {{ template "posthog.serviceAccountName" . }} - - {{- if .Values.web.affinity }} - affinity: -{{ toYaml .Values.web.affinity | indent 8 }} - {{- end }} - - {{- if .Values.web.nodeSelector }} - nodeSelector: -{{ toYaml .Values.web.nodeSelector | indent 8 }} - {{- end }} - - {{- if .Values.web.tolerations }} - tolerations: -{{ toYaml .Values.web.tolerations | indent 8 }} - {{- end }} - + affinity: {{ toYaml (merge .Values.events.affinity .Values.affinity) | nindent 8 }} + nodeSelector: {{ toYaml (merge .Values.events.nodeSelector .Values.nodeSelector) | nindent 8 }} + tolerations: {{ toYaml (coalesce .Values.events.tolerations .Values.tolerations) | nindent 8 }} {{- if .Values.web.schedulerName }} schedulerName: "{{ .Values.web.schedulerName }}" {{- end }} diff --git a/charts/posthog/templates/events-hpa.yaml b/charts/posthog/templates/events-hpa.yaml index 20613ff06..de4f7b467 100644 --- a/charts/posthog/templates/events-hpa.yaml +++ b/charts/posthog/templates/events-hpa.yaml @@ -1,5 +1,5 @@ {{- if and .Values.events.enabled .Values.events.hpa.enabled -}} -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ template "posthog.fullname" . }}-events diff --git a/charts/posthog/templates/migrate.job.yaml b/charts/posthog/templates/migrate.job.yaml index 918f65021..9f0fb8087 100644 --- a/charts/posthog/templates/migrate.job.yaml +++ b/charts/posthog/templates/migrate.job.yaml @@ -21,28 +21,16 @@ spec: {{ toYaml .Values.worker.podLabels | indent 8 }} {{- end }} 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 }} - + affinity: {{ toYaml (merge .Values.hooks.affinity .Values.affinity) | nindent 8 }} + nodeSelector: {{ toYaml (merge .Values.hooks.nodeSelector .Values.nodeSelector) | nindent 8 }} + tolerations: {{ toYaml (coalesce .Values.hooks.tolerations .Values.tolerations) | nindent 8 }} restartPolicy: Never {{- if .Values.image.imagePullSecrets }} imagePullSecrets: {{ toYaml .Values.image.imagePullSecrets | indent 8 }} {{- end }} - + # I do not know for sure if the old one has been used anywhere, so do both :( {{- if .Values.image.pullSecrets }} imagePullSecrets: diff --git a/charts/posthog/templates/pgbouncer-deployment.yaml b/charts/posthog/templates/pgbouncer-deployment.yaml index c59abaa14..fb2e41638 100644 --- a/charts/posthog/templates/pgbouncer-deployment.yaml +++ b/charts/posthog/templates/pgbouncer-deployment.yaml @@ -40,21 +40,10 @@ spec: # shuts down and exits before the terminationGracePeriod is done, we # moves to the next step immediately. terminationGracePeriodSeconds: 65 - serviceAccountName: {{ template "posthog.serviceAccountName" . }} - - {{- if .Values.pgbouncer.affinity }} - affinity: {{ toYaml .Values.pgbouncer.affinity | nindent 8 }} - {{- end }} - - {{- if .Values.pgbouncer.nodeSelector }} - nodeSelector: {{ toYaml .Values.pgbouncer.nodeSelector | nindent 8 }} - {{- end }} - - {{- if .Values.pgbouncer.tolerations }} - tolerations: {{ toYaml .Values.pgbouncer.tolerations | nindent 8 }} - {{- end }} - + affinity: {{ toYaml (merge .Values.pgbouncer.affinity .Values.affinity) | nindent 8 }} + nodeSelector: {{ toYaml (merge .Values.pgbouncer.nodeSelector .Values.nodeSelector) | nindent 8 }} + tolerations: {{ toYaml (coalesce .Values.pgbouncer.tolerations .Values.tolerations) | nindent 8 }} {{- if .Values.pgbouncer.schedulerName }} schedulerName: "{{ .Values.pgbouncer.schedulerName }}" {{- end }} diff --git a/charts/posthog/templates/pgbouncer-hpa.yaml b/charts/posthog/templates/pgbouncer-hpa.yaml index 024949130..efdaf795e 100644 --- a/charts/posthog/templates/pgbouncer-hpa.yaml +++ b/charts/posthog/templates/pgbouncer-hpa.yaml @@ -1,5 +1,5 @@ {{- if and .Values.pgbouncer.enabled .Values.pgbouncer.hpa.enabled -}} -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ template "posthog.fullname" . }}-pgbouncer diff --git a/charts/posthog/templates/web-deployment.yaml b/charts/posthog/templates/web-deployment.yaml index 335417222..5e7cd0247 100644 --- a/charts/posthog/templates/web-deployment.yaml +++ b/charts/posthog/templates/web-deployment.yaml @@ -41,22 +41,9 @@ spec: spec: terminationGracePeriodSeconds: {{ include "snippet.web-deployments.terminationGracePeriodSeconds" . }} serviceAccountName: {{ template "posthog.serviceAccountName" . }} - - {{- if .Values.web.affinity }} - affinity: -{{ toYaml .Values.web.affinity | indent 8 }} - {{- end }} - - {{- if .Values.web.nodeSelector }} - nodeSelector: -{{ toYaml .Values.web.nodeSelector | indent 8 }} - {{- end }} - - {{- if .Values.web.tolerations }} - tolerations: -{{ toYaml .Values.web.tolerations | indent 8 }} - {{- end }} - + affinity: {{ toYaml (merge .Values.web.affinity .Values.affinity) | nindent 8 }} + nodeSelector: {{ toYaml (merge .Values.web.nodeSelector .Values.nodeSelector) | nindent 8 }} + tolerations: {{ toYaml (coalesce .Values.web.tolerations .Values.tolerations) | nindent 8 }} {{- if .Values.web.schedulerName }} schedulerName: "{{ .Values.web.schedulerName }}" {{- end }} diff --git a/charts/posthog/templates/web-hpa.yaml b/charts/posthog/templates/web-hpa.yaml index fa550df51..06e6e6a53 100644 --- a/charts/posthog/templates/web-hpa.yaml +++ b/charts/posthog/templates/web-hpa.yaml @@ -1,5 +1,5 @@ {{- if and .Values.web.enabled .Values.web.hpa.enabled -}} -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ template "posthog.fullname" . }}-web diff --git a/charts/posthog/templates/worker-deployment.yaml b/charts/posthog/templates/worker-deployment.yaml index b9d07c008..508a4045e 100644 --- a/charts/posthog/templates/worker-deployment.yaml +++ b/charts/posthog/templates/worker-deployment.yaml @@ -40,22 +40,9 @@ spec: {{- end }} spec: serviceAccountName: {{ template "posthog.serviceAccountName" . }} - - {{- if .Values.worker.affinity }} - affinity: -{{ toYaml .Values.worker.affinity | indent 8 }} - {{- end }} - - {{- if .Values.worker.nodeSelector }} - nodeSelector: -{{ toYaml .Values.worker.nodeSelector | indent 8 }} - {{- end }} - - {{- if .Values.worker.tolerations }} - tolerations: -{{ toYaml .Values.worker.tolerations | indent 8 }} - {{- end }} - + affinity: {{ toYaml (merge .Values.worker.affinity .Values.affinity) | nindent 8 }} + nodeSelector: {{ toYaml (merge .Values.worker.nodeSelector .Values.nodeSelector) | nindent 8 }} + tolerations: {{ toYaml (coalesce .Values.worker.tolerations .Values.tolerations) | nindent 8 }} {{- if .Values.worker.schedulerName }} schedulerName: "{{ .Values.worker.schedulerName }}" {{- end }} diff --git a/charts/posthog/templates/worker-hpa.yaml b/charts/posthog/templates/worker-hpa.yaml index 86bc55f38..daabf4643 100644 --- a/charts/posthog/templates/worker-hpa.yaml +++ b/charts/posthog/templates/worker-hpa.yaml @@ -1,5 +1,5 @@ {{- if and .Values.worker.enabled .Values.worker.hpa.enabled -}} -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ template "posthog.fullname" . }}-worker diff --git a/charts/posthog/tests/__snapshot__/clickhouse-backup-cronjob.yaml.snap b/charts/posthog/tests/__snapshot__/clickhouse-backup-cronjob.yaml.snap index a1857d7e2..5e1d89fa5 100644 --- a/charts/posthog/tests/__snapshot__/clickhouse-backup-cronjob.yaml.snap +++ b/charts/posthog/tests/__snapshot__/clickhouse-backup-cronjob.yaml.snap @@ -16,6 +16,7 @@ should match the snapshot when backup is true: labels: job: clickhouse-backup spec: + affinity: {} containers: - command: - /bin/sh @@ -67,7 +68,9 @@ should match the snapshot when backup is true: image: busybox:1.34 imagePullPolicy: IfNotPresent name: wait-for-service-dependencies + nodeSelector: {} restartPolicy: Never + tolerations: null volumes: - configMap: defaultMode: 511 diff --git a/charts/posthog/tests/__snapshot__/clickhouse-instance.yaml.snap b/charts/posthog/tests/__snapshot__/clickhouse-instance.yaml.snap index 8449d52a7..abe083e29 100644 --- a/charts/posthog/tests/__snapshot__/clickhouse-instance.yaml.snap +++ b/charts/posthog/tests/__snapshot__/clickhouse-instance.yaml.snap @@ -70,6 +70,7 @@ the manifest should match the snapshot when using default values: podTemplates: - name: pod-template spec: + affinity: {} containers: - command: - /bin/bash @@ -87,10 +88,12 @@ the manifest should match the snapshot when using default values: volumeMounts: - mountPath: /var/lib/clickhouse name: data-volumeclaim-template + nodeSelector: {} securityContext: fsGroup: 101 runAsGroup: 101 runAsUser: 101 + tolerations: null volumes: - name: data-volumeclaim-template persistentVolumeClaim: diff --git a/charts/posthog/tests/__snapshot__/pgbouncer-deployment.yaml.snap b/charts/posthog/tests/__snapshot__/pgbouncer-deployment.yaml.snap index 4e82d25de..7c33adfbd 100644 --- a/charts/posthog/tests/__snapshot__/pgbouncer-deployment.yaml.snap +++ b/charts/posthog/tests/__snapshot__/pgbouncer-deployment.yaml.snap @@ -1,5 +1,6 @@ should match snapshot data: 1: | + affinity: {} containers: - env: - name: POSTGRESQL_USERNAME @@ -54,5 +55,7 @@ should match snapshot data: tcpSocket: port: 6543 timeoutSeconds: 2 + nodeSelector: {} serviceAccountName: RELEASE-NAME-posthog terminationGracePeriodSeconds: 65 + tolerations: null diff --git a/charts/posthog/tests/clickhouse-instance.yaml b/charts/posthog/tests/clickhouse-instance.yaml index 72f76ea8b..411f1bad7 100644 --- a/charts/posthog/tests/clickhouse-instance.yaml +++ b/charts/posthog/tests/clickhouse-instance.yaml @@ -146,11 +146,84 @@ tests: - mountPath: /var/lib/clickhouse name: existing-volumeclaim - - it: nodeSelector override via 'clickhouse.nodeSelector' works + - it: nodeSelector, affinity and tolerations via '.Values.' works set: + nodeSelector: + diskType: hdd + nodeType: slow + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-group + operator: In + values: + - test + tolerations: + - key: dedicated + operator: Equal + value: test + effect: NoExecute + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.templates.podTemplates[0].spec.nodeSelector + value: + diskType: hdd + nodeType: slow + - equal: + path: spec.templates.podTemplates[0].spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0] + value: + key: node-group + operator: In + values: + - test + - equal: + path: spec.templates.podTemplates[0].spec.tolerations[0] + value: + key: dedicated + operator: Equal + value: test + effect: NoExecute + + - it: nodeSelector, affinity and tolerations override via '.Values.clickhouse.' works + set: + nodeSelector: + diskType: hdd + nodeType: slow + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-group + operator: In + values: + - test + tolerations: + - key: dedicated + operator: Equal + value: test + effect: NoExecute clickhouse.nodeSelector: diskType: ssd nodeType: fast + clickhouse.affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-group + operator: In + values: + - test-override + clickhouse.tolerations: + - key: dedicated + operator: Equal + value: test-override + effect: NoExecute asserts: - hasDocuments: count: 1 @@ -159,6 +232,20 @@ tests: value: diskType: ssd nodeType: fast + - equal: + path: spec.templates.podTemplates[0].spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0] + value: + key: node-group + operator: In + values: + - test-override + - equal: + path: spec.templates.podTemplates[0].spec.tolerations[0] + value: + key: dedicated + operator: Equal + value: test-override + effect: NoExecute - it: volumeClaimTemplates shouldn't exit if clickhouse.persistence.enabled is false set: diff --git a/charts/posthog/tests/events-hpa.yaml b/charts/posthog/tests/events-hpa.yaml index 3e39fc4e5..d6117a1f7 100644 --- a/charts/posthog/tests/events-hpa.yaml +++ b/charts/posthog/tests/events-hpa.yaml @@ -35,7 +35,7 @@ tests: - hasDocuments: count: 1 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 - it: should be the correct kind set: diff --git a/charts/posthog/tests/migrate-job.yaml b/charts/posthog/tests/migrate-job.yaml index ecc3cff15..ba7af4fc5 100644 --- a/charts/posthog/tests/migrate-job.yaml +++ b/charts/posthog/tests/migrate-job.yaml @@ -45,13 +45,88 @@ tests: name: SENTRY_DSN value: sentry.endpoint + - it: nodeSelector via '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 + nodeSelector: + diskType: hdd + nodeType: slow + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-group + operator: In + values: + - test + tolerations: + - key: dedicated + operator: Equal + value: test + effect: NoExecute + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.template.spec.nodeSelector + value: + diskType: hdd + nodeType: slow + - equal: + path: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0] + value: + key: node-group + operator: In + values: + - test + - equal: + path: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0] + value: + key: node-group + operator: In + values: + - test + - 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 + nodeSelector: + diskType: hdd + nodeType: slow + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-group + operator: In + values: + - test + tolerations: + - key: dedicated + operator: Equal + value: test + effect: NoExecute hooks.nodeSelector: diskType: ssd nodeType: fast + hooks.affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-group + operator: In + values: + - test-override + hooks.tolerations: + - key: dedicated + operator: Equal + value: test-override + effect: NoExecute asserts: - hasDocuments: count: 1 @@ -60,6 +135,20 @@ tests: value: diskType: ssd nodeType: fast + - equal: + path: spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms[0].matchExpressions[0] + value: + key: node-group + operator: In + values: + - test-override + - equal: + path: spec.template.spec.tolerations[0] + value: + key: dedicated + operator: Equal + value: test-override + effect: NoExecute - it: allows setting imagePullSecrets template: templates/migrate.job.yaml # TODO: remove once secrets.yaml will be fixed/removed diff --git a/charts/posthog/tests/pgbouncer-hpa.yaml b/charts/posthog/tests/pgbouncer-hpa.yaml index 29dc10dcc..ea3215ae0 100644 --- a/charts/posthog/tests/pgbouncer-hpa.yaml +++ b/charts/posthog/tests/pgbouncer-hpa.yaml @@ -35,7 +35,7 @@ tests: - hasDocuments: count: 1 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 - it: should be the correct kind set: diff --git a/charts/posthog/tests/plugins-async-hpa.yaml b/charts/posthog/tests/plugins-async-hpa.yaml index d5df41f7b..442fe2669 100644 --- a/charts/posthog/tests/plugins-async-hpa.yaml +++ b/charts/posthog/tests/plugins-async-hpa.yaml @@ -48,7 +48,7 @@ tests: - hasDocuments: count: 2 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 documentIndex: 1 - it: should be the correct kind diff --git a/charts/posthog/tests/plugins-exports-hpa.yaml b/charts/posthog/tests/plugins-exports-hpa.yaml index f2ad80173..88f00c292 100644 --- a/charts/posthog/tests/plugins-exports-hpa.yaml +++ b/charts/posthog/tests/plugins-exports-hpa.yaml @@ -48,7 +48,7 @@ tests: - hasDocuments: count: 2 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 documentIndex: 1 - it: should be the correct kind diff --git a/charts/posthog/tests/plugins-hpa.yaml b/charts/posthog/tests/plugins-hpa.yaml index 4ad5d803e..5092c6655 100644 --- a/charts/posthog/tests/plugins-hpa.yaml +++ b/charts/posthog/tests/plugins-hpa.yaml @@ -48,7 +48,7 @@ tests: - hasDocuments: count: 2 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 documentIndex: 1 - it: should be the correct kind diff --git a/charts/posthog/tests/plugins-ingestion-hpa.yaml b/charts/posthog/tests/plugins-ingestion-hpa.yaml index 45ad37de1..7193d53a1 100644 --- a/charts/posthog/tests/plugins-ingestion-hpa.yaml +++ b/charts/posthog/tests/plugins-ingestion-hpa.yaml @@ -48,7 +48,7 @@ tests: - hasDocuments: count: 2 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 documentIndex: 1 - it: should be the correct kind diff --git a/charts/posthog/tests/plugins-jobs-hpa.yaml b/charts/posthog/tests/plugins-jobs-hpa.yaml index 9fdf3de70..427ef8433 100644 --- a/charts/posthog/tests/plugins-jobs-hpa.yaml +++ b/charts/posthog/tests/plugins-jobs-hpa.yaml @@ -48,7 +48,7 @@ tests: - hasDocuments: count: 2 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 documentIndex: 1 - it: should be the correct kind diff --git a/charts/posthog/tests/plugins-scheduler-hpa.yaml b/charts/posthog/tests/plugins-scheduler-hpa.yaml index 83f439c56..56f16a362 100644 --- a/charts/posthog/tests/plugins-scheduler-hpa.yaml +++ b/charts/posthog/tests/plugins-scheduler-hpa.yaml @@ -48,7 +48,7 @@ tests: - hasDocuments: count: 2 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 documentIndex: 1 - it: should be the correct kind diff --git a/charts/posthog/tests/web-hpa.yaml b/charts/posthog/tests/web-hpa.yaml index 9fd9fcf40..42e447329 100644 --- a/charts/posthog/tests/web-hpa.yaml +++ b/charts/posthog/tests/web-hpa.yaml @@ -35,7 +35,7 @@ tests: - hasDocuments: count: 1 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 - it: should be the correct kind set: diff --git a/charts/posthog/tests/worker-hpa.yaml b/charts/posthog/tests/worker-hpa.yaml index 48db29da8..3b5cedd3f 100644 --- a/charts/posthog/tests/worker-hpa.yaml +++ b/charts/posthog/tests/worker-hpa.yaml @@ -35,7 +35,7 @@ tests: - hasDocuments: count: 1 - isAPIVersion: - of: autoscaling/v2beta2 + of: autoscaling/v2 - it: should be the correct kind set: diff --git a/charts/posthog/values.yaml b/charts/posthog/values.yaml index cb65b19dd..b9fd0ee99 100644 --- a/charts/posthog/values.yaml +++ b/charts/posthog/values.yaml @@ -47,16 +47,27 @@ env: [] # - name: FOO # value: bar +# -- Global Node labels for all deployment. +nodeSelector: {} +# -- Global Toleration labels for all deployment. +tolerations: [] +# -- Global Affinity settings for all deployment. +affinity: {} migrate: # -- Whether to install the PostHog migrate job or not. enabled: true - events: # -- Whether to install the PostHog events stack or not. enabled: true + podAnnotations: + # Uncomment these lines if you want Prometheus server to scrape metrics. + # prometheus.io/scrape: "true" + # prometheus.io/path: /metrics + # prometheus.io/port: "8001" + # -- Count of events pods to run. This setting is ignored if `events.hpa.enabled` is set to `true`. replicacount: 1 @@ -83,6 +94,17 @@ events: # -- Additional env variables to inject into the events stack, uses `web.env` if empty. env: [] + # -- Resource limits for events service. + resources: + {} + + # -- Node labels for events stack deployment. + nodeSelector: {} + # -- Toleration labels for events stack deployment. + tolerations: [] + # -- Affinity settings for events stack deployment. + affinity: {} + # -- Container security context for the events stack HorizontalPodAutoscaler. securityContext: enabled: false @@ -319,6 +341,18 @@ plugins: # -- The readiness probe timeout seconds timeoutSeconds: 5 + startupProbe: + # -- The startup probe failure threshold + failureThreshold: 30 + # -- The startup probe initial delay seconds + initialDelaySeconds: 0 + # -- The startup probe period seconds + periodSeconds: 10 + # -- The startup probe success threshold + successThreshold: 1 + # -- The startup probe timeout seconds + timeoutSeconds: 5 + # -- Sentry endpoint to send errors to. Falls back to global sentryDSN sentryDSN: @@ -397,6 +431,18 @@ pluginsAsync: # -- The readiness probe timeout seconds timeoutSeconds: 5 + startupProbe: + # -- The startup probe failure threshold + failureThreshold: 30 + # -- The startup probe initial delay seconds + initialDelaySeconds: 0 + # -- The startup probe period seconds + periodSeconds: 10 + # -- The startup probe success threshold + successThreshold: 1 + # -- The startup probe timeout seconds + timeoutSeconds: 5 + # -- Sentry endpoint to send errors to. Falls back to global sentryDSN sentryDSN: @@ -480,6 +526,18 @@ pluginsIngestion: # -- The readiness probe timeout seconds timeoutSeconds: 5 + startupProbe: + # -- The startup probe failure threshold + failureThreshold: 30 + # -- The startup probe initial delay seconds + initialDelaySeconds: 0 + # -- The startup probe period seconds + periodSeconds: 10 + # -- The startup probe success threshold + successThreshold: 1 + # -- The startup probe timeout seconds + timeoutSeconds: 5 + # -- Sentry endpoint to send errors to. Falls back to global sentryDSN sentryDSN: @@ -557,6 +615,18 @@ pluginsExports: # -- The readiness probe timeout seconds timeoutSeconds: 5 + startupProbe: + # -- The startup probe failure threshold + failureThreshold: 30 + # -- The startup probe initial delay seconds + initialDelaySeconds: 0 + # -- The startup probe period seconds + periodSeconds: 10 + # -- The startup probe success threshold + successThreshold: 1 + # -- The startup probe timeout seconds + timeoutSeconds: 5 + # -- Sentry endpoint to send errors to. Falls back to global sentryDSN sentryDSN: @@ -634,6 +704,18 @@ pluginsJobs: # -- The readiness probe timeout seconds timeoutSeconds: 5 + startupProbe: + # -- The startup probe failure threshold + failureThreshold: 30 + # -- The startup probe initial delay seconds + initialDelaySeconds: 0 + # -- The startup probe period seconds + periodSeconds: 10 + # -- The startup probe success threshold + successThreshold: 1 + # -- The startup probe timeout seconds + timeoutSeconds: 5 + # -- Sentry endpoint to send errors to. Falls back to global sentryDSN sentryDSN: @@ -710,6 +792,18 @@ pluginsScheduler: # -- The readiness probe timeout seconds timeoutSeconds: 5 + startupProbe: + # -- The startup probe failure threshold + failureThreshold: 30 + # -- The startup probe initial delay seconds + initialDelaySeconds: 0 + # -- The startup probe period seconds + periodSeconds: 10 + # -- The startup probe success threshold + successThreshold: 1 + # -- The startup probe timeout seconds + timeoutSeconds: 5 + # -- Sentry endpoint to send errors to. Falls back to global sentryDSN sentryDSN: @@ -1286,6 +1380,8 @@ clickhouse: ## pullSecrets: [] + # -- Node labels for clickhouse pod assignment + nodeSelector: {} # -- Toleration labels for clickhouse pod assignment tolerations: [] # -- Affinity settings for clickhouse pod