Skip to content

Commit 3bbe02f

Browse files
authored
Add canary service to web (#791)
1 parent 5d38eb0 commit 3bbe02f

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
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.44.0
14+
version: 30.45.0
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/web-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ spec:
2323
maxUnavailable: {{ .Values.web.rollout.maxUnavailable }}
2424
{{- else if eq .Values.web.deployment.strategy "canary" }}
2525
canary:
26+
canaryService: {{ template "posthog.fullname" . }}-web-canary
27+
stableService: {{ template "posthog.fullname" . }}-web
2628
trafficRouting:
2729
plugins:
2830
argoproj-labs/contour:

charts/posthog/templates/web-service.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,37 @@ spec:
2929
loadBalancerSourceRanges:
3030
{{- toYaml . | nindent 4 }}
3131
{{- end }}
32+
{{- if eq .Values.web.deployment.strategy "canary" }}
33+
---
34+
apiVersion: v1
35+
kind: Service
36+
metadata:
37+
name: {{ template "posthog.fullname" . }}-web-canary
38+
labels: {{- include "_snippet-metadata-labels-common" . | nindent 4 }}
39+
annotations: {{- include "_snippet-metadata-annotations-common" . | nindent 4 }}
40+
{{- if .Values.service.annotations }}
41+
{{ toYaml .Values.service.annotations | indent 4 }}
42+
{{- end }}
43+
spec:
44+
type: {{ .Values.service.type }}
45+
ports:
46+
- port: {{ .Values.service.externalPort }}
47+
targetPort: {{ .Values.service.internalPort }}
48+
protocol: TCP
49+
name: {{ .Values.service.name }}
50+
{{- if and (.Values.service.nodePort) (eq .Values.service.type "NodePort") }}
51+
nodePort: {{ .Values.service.nodePort }}
52+
{{- end }}
53+
{{- if .Values.service.externalIPs }}
54+
externalIPs:
55+
{{ toYaml .Values.service.externalIPs | indent 4 }}
56+
{{- end }}
57+
selector:
58+
app: {{ template "posthog.fullname" . }}
59+
role: web
60+
{{- with .Values.service.loadBalancerSourceRanges }}
61+
loadBalancerSourceRanges:
62+
{{- toYaml . | nindent 4 }}
63+
{{- end }}
64+
{{- end }}
3265
{{- end }}

0 commit comments

Comments
 (0)