Skip to content

Commit

Permalink
Don't wait for migrations for capture pods (#775)
Browse files Browse the repository at this point in the history
These pods don't care about migrations and waiting for them slows down
scaling and deployments
  • Loading branch information
frankh authored Oct 20, 2023
1 parent a346dbb commit b165911
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/posthog/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 30.31.0
version: 30.32.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
Expand Down
3 changes: 2 additions & 1 deletion charts/posthog/templates/events-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ spec:
value: '1'
- name: IS_BEHIND_PROXY
value: '1'
- name: POSTHOG_SKIP_MIGRATION_CHECKS
value: 'true'
{{- if eq .Values.web.secureCookies false }}
- name: SECURE_COOKIES
value: '0'
Expand Down Expand Up @@ -174,5 +176,4 @@ spec:
{{- end }}
initContainers:
{{- include "_snippet-initContainers-wait-for-service-dependencies" . | indent 8 }}
{{- include "_snippet-initContainers-wait-for-migrations" . | indent 8 }}
{{- end }}
3 changes: 2 additions & 1 deletion charts/posthog/templates/recordings-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ spec:
value: '1'
- name: IS_BEHIND_PROXY
value: '1'
- name: POSTHOG_SKIP_MIGRATION_CHECKS
value: 'true'
{{- if eq .Values.web.secureCookies false }}
- name: SECURE_COOKIES
value: '0'
Expand Down Expand Up @@ -174,5 +176,4 @@ spec:
{{- end }}
initContainers:
{{- include "_snippet-initContainers-wait-for-service-dependencies" . | indent 8 }}
{{- include "_snippet-initContainers-wait-for-migrations" . | indent 8 }}
{{- end }}
2 changes: 0 additions & 2 deletions charts/posthog/tests/_initContainers-wait-for-migrations.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
suite: _initContainers-wait-for-migrations
templates:
- templates/events-deployment.yaml
- templates/plugins-deployment.yaml
- templates/web-deployment.yaml
- templates/worker-deployment.yaml
Expand All @@ -10,7 +9,6 @@ templates:
tests:
- it: spec.template.spec.initContainers[1].env override via 'env' should work
templates: # TODO: remove once secrets.yaml will be fixed/removed
- templates/events-deployment.yaml
- templates/plugins-deployment.yaml
- templates/web-deployment.yaml
- templates/worker-deployment.yaml
Expand Down
11 changes: 6 additions & 5 deletions ci/kubetest/helpers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,12 @@ def wait_for_pods_to_be_ready(kube, labels=None, expected_count=None, namespace=
job_pods = [pod for pod in pods.values() if "job-name" in pod.obj.metadata.labels]

for job_pod in job_pods:
print("job logs")
try:
print([c.get_logs() for c in job_pod.get_containers()])
except Exception:
pass
if job_pod.status().phase == "Failed":
try:
print("Job failure logs:")
print("\n".join([c.get_logs() for c in job_pod.get_containers()]))
except Exception:
pass
print("job logs2")
assert job_pod.status().phase != "Failed", f"Detected failed job {job_pod.obj.metadata.name}"

Expand Down

0 comments on commit b165911

Please sign in to comment.