Skip to content

Commit

Permalink
Helm improvements (#14)
Browse files Browse the repository at this point in the history
- Both services got registered with the LB, which does not work. Use a
specific selector to only select the API.
- Use a different port (by default 80) on the LB.
- use LB by default which exposes the service to the outside world

Tested in GKE and works as expected.
  • Loading branch information
mkysel authored Dec 9, 2024
1 parent ec636ca commit eddcd65
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions helm/xmtpd/templates/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ spec:
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
app.kubernetes.io/role: api

spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -44,16 +46,16 @@ spec:
{{- include "helpers.list-env-variables" . | indent 12 }}
ports:
- name: grpc
containerPort: {{ .Values.service.port }}
containerPort: {{ .Values.service.targetPort }}
protocol: TCP
startupProbe:
grpc:
port: {{ .Values.service.port }}
port: {{ .Values.service.targetPort }}
failureThreshold: 3
periodSeconds: 10
livenessProbe:
grpc:
port: {{ .Values.service.port }}
port: {{ .Values.service.targetPort }}
failureThreshold: 3
periodSeconds: 10
resources:
Expand Down
3 changes: 2 additions & 1 deletion helm/xmtpd/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
protocol: TCP
selector:
{{- include "xmtpd.selectorLabels" . | nindent 4 }}
app.kubernetes.io/role: api
1 change: 1 addition & 0 deletions helm/xmtpd/templates/sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
app.kubernetes.io/role: sync
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down
5 changes: 3 additions & 2 deletions helm/xmtpd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ securityContext: {}
# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
service:
# This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
type: ClusterIP
type: LoadBalancer
# This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
port: 5050
port: 80
targetPort: 5050

resources: {}
# limits:
Expand Down

0 comments on commit eddcd65

Please sign in to comment.