Skip to content

Commit 1c749c3

Browse files
author
Harry Waye
authored
Revert "Revert "fix(ingress): ensure only capture and decide go to events" (#660)
* Revert "Revert "fix(ingress): ensure only capture and decide go to events (#659)" This reverts commit a95f96f. * bump version
1 parent 11de44d commit 1c749c3

File tree

3 files changed

+77
-2
lines changed

3 files changed

+77
-2
lines changed

charts/posthog/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type: application
1111

1212
# This is the chart version. This version number should be incremented each time you make changes
1313
# to the chart and its templates, including the app version.
14-
version: 30.2.6
14+
version: 30.2.7
1515

1616
# This is the version number of the application being deployed. This version number should be
1717
# incremented each time you make changes to the application.

charts/posthog/templates/ingress.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,57 @@ spec:
7878
port:
7979
number: {{ .Values.service.externalPort }}
8080
{{- if (ne (include "ingress.type" .) "clb") }}
81+
# Match any url with a prefix ending with a forward-slash. Previously
82+
# we would match without the forward-slash. To ensure that we pick up
83+
# with the forward-slash omitted we also match Exact. Note that we
84+
# could use e.g. [ingress-nginx regex support](https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/#regular-expression-support)
85+
# but to keep this agnostic we use a combination of Prefix and Exact.
86+
#
87+
# NOTE: we still use a Prefix match on paths with a forward-slash,
88+
# just in case there are cases that we have subpaths for these
89+
# endpoints that still need to be passed to the `posthog-events` pods.
8190
- pathType: Prefix
91+
path: "/capture/"
92+
backend: *INGESTION
93+
- pathType: Exact
8294
path: "/capture"
8395
backend: *INGESTION
96+
8497
- pathType: Prefix
98+
path: "/decide/"
99+
backend: *INGESTION
100+
- pathType: Exact
85101
path: "/decide"
86102
backend: *INGESTION
103+
87104
- pathType: Prefix
105+
path: "/e/"
106+
backend: *INGESTION
107+
- pathType: Exact
88108
path: "/e"
89109
backend: *INGESTION
110+
90111
- pathType: Prefix
112+
path: "/engage/"
113+
backend: *INGESTION
114+
- pathType: Exact
91115
path: "/engage"
92116
backend: *INGESTION
117+
93118
- pathType: Prefix
119+
path: "/track/"
120+
backend: *INGESTION
121+
- pathType: Exact
94122
path: "/track"
95123
backend: *INGESTION
124+
96125
- pathType: Prefix
126+
path: "/s/"
127+
backend: *INGESTION
128+
- pathType: Exact
97129
path: "/s"
98130
backend: *INGESTION
131+
99132
{{- else }}
100133
- pathType: ImplementationSpecific
101134
path: "/capture/*"

charts/posthog/tests/__snapshot__/ingress.yaml.snap

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,87 @@ the "spec" path should match the snapshot when using default values:
1717
number: 8000
1818
path: /batch
1919
pathType: Prefix
20+
- backend:
21+
service:
22+
name: RELEASE-NAME-posthog-events
23+
port:
24+
number: 8000
25+
path: /capture/
26+
pathType: Prefix
2027
- backend:
2128
service:
2229
name: RELEASE-NAME-posthog-events
2330
port:
2431
number: 8000
2532
path: /capture
33+
pathType: Exact
34+
- backend:
35+
service:
36+
name: RELEASE-NAME-posthog-events
37+
port:
38+
number: 8000
39+
path: /decide/
2640
pathType: Prefix
2741
- backend:
2842
service:
2943
name: RELEASE-NAME-posthog-events
3044
port:
3145
number: 8000
3246
path: /decide
47+
pathType: Exact
48+
- backend:
49+
service:
50+
name: RELEASE-NAME-posthog-events
51+
port:
52+
number: 8000
53+
path: /e/
3354
pathType: Prefix
3455
- backend:
3556
service:
3657
name: RELEASE-NAME-posthog-events
3758
port:
3859
number: 8000
3960
path: /e
61+
pathType: Exact
62+
- backend:
63+
service:
64+
name: RELEASE-NAME-posthog-events
65+
port:
66+
number: 8000
67+
path: /engage/
4068
pathType: Prefix
4169
- backend:
4270
service:
4371
name: RELEASE-NAME-posthog-events
4472
port:
4573
number: 8000
4674
path: /engage
75+
pathType: Exact
76+
- backend:
77+
service:
78+
name: RELEASE-NAME-posthog-events
79+
port:
80+
number: 8000
81+
path: /track/
4782
pathType: Prefix
4883
- backend:
4984
service:
5085
name: RELEASE-NAME-posthog-events
5186
port:
5287
number: 8000
5388
path: /track
89+
pathType: Exact
90+
- backend:
91+
service:
92+
name: RELEASE-NAME-posthog-events
93+
port:
94+
number: 8000
95+
path: /s/
5496
pathType: Prefix
5597
- backend:
5698
service:
5799
name: RELEASE-NAME-posthog-events
58100
port:
59101
number: 8000
60102
path: /s
61-
pathType: Prefix
103+
pathType: Exact

0 commit comments

Comments
 (0)