Skip to content

Commit

Permalink
Add canary service to web (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankh authored Jan 25, 2024
1 parent 5d38eb0 commit 3bbe02f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
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.44.0
version: 30.45.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
2 changes: 2 additions & 0 deletions charts/posthog/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ spec:
maxUnavailable: {{ .Values.web.rollout.maxUnavailable }}
{{- else if eq .Values.web.deployment.strategy "canary" }}
canary:
canaryService: {{ template "posthog.fullname" . }}-web-canary
stableService: {{ template "posthog.fullname" . }}-web
trafficRouting:
plugins:
argoproj-labs/contour:
Expand Down
33 changes: 33 additions & 0 deletions charts/posthog/templates/web-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,37 @@ spec:
loadBalancerSourceRanges:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if eq .Values.web.deployment.strategy "canary" }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "posthog.fullname" . }}-web-canary
labels: {{- include "_snippet-metadata-labels-common" . | nindent 4 }}
annotations: {{- include "_snippet-metadata-annotations-common" . | nindent 4 }}
{{- if .Values.service.annotations }}
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.externalPort }}
targetPort: {{ .Values.service.internalPort }}
protocol: TCP
name: {{ .Values.service.name }}
{{- if and (.Values.service.nodePort) (eq .Values.service.type "NodePort") }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
{{- if .Values.service.externalIPs }}
externalIPs:
{{ toYaml .Values.service.externalIPs | indent 4 }}
{{- end }}
selector:
app: {{ template "posthog.fullname" . }}
role: web
{{- with .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 3bbe02f

Please sign in to comment.