Skip to content

Commit

Permalink
Merge pull request #27 from thesse1/grpc
Browse files Browse the repository at this point in the history
Add support for gRPC port (for HAFT)
  • Loading branch information
MarcFriedhoff authored Jan 19, 2024
2 parents 60f5102 + b184b0d commit 7b75020
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
5 changes: 5 additions & 0 deletions apigateway/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ spec:
- containerPort: {{ int .Values.apigw.runtimeExternalPort }}
name: external-http
protocol: TCP
{{- if .Values.grpcService.enabled }}
- containerPort: {{ int .Values.apigw.grpcPort }}
name: grpc-http
protocol: TCP
{{- end }}
{{- if .Values.extraPorts }}
{{- toYaml .Values.extraPorts | nindent 10 }}
{{- end }}
Expand Down
6 changes: 3 additions & 3 deletions apigateway/helm/templates/nginx-svc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ metadata:
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.serviceType }}
type: {{ .Values.service.type }}
ports:
- port: {{ int .Values.apigw.runtimePort }}
protocol: TCP
targetPort: {{ int .Values.apigw.runtimePort }}
name: rtport
{{- if (eq .Values.serviceType "ClusterIP") }}
{{- if (eq .Values.service.type "ClusterIP") }}
nodePort: null
{{- end }}
- port: {{ int .Values.apigw.uiPort }}
protocol: TCP
targetPort: {{ int .Values.apigw.uiPort }}
name: uiport
{{- if (eq .Values.serviceType "ClusterIP") }}
{{- if (eq .Values.service.type "ClusterIP") }}
nodePort: null
{{- end }}
selector:
Expand Down
42 changes: 35 additions & 7 deletions apigateway/helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ metadata:
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.serviceType }}
type: {{ .Values.service.type }}
ports:
- port: {{ int .Values.apigw.runtimePort }}
protocol: TCP
targetPort: {{ int .Values.apigw.runtimePort }}
name: rtport
{{- if (eq .Values.serviceType "ClusterIP") }}
{{- if (eq .Values.service.type "ClusterIP") }}
nodePort: null
{{- end }}
selector:
Expand All @@ -49,13 +49,13 @@ metadata:
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.serviceType }}
type: {{ .Values.service.type }}
ports:
- port: {{ int .Values.apigw.adminPort }}
protocol: TCP
targetPort: {{ int .Values.apigw.adminPort }}
name: adminport
{{- if (eq .Values.serviceType "ClusterIP") }}
{{- if (eq .Values.service.type "ClusterIP") }}
nodePort: null
{{- end }}
selector:
Expand All @@ -71,7 +71,7 @@ metadata:
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.serviceType }}
type: {{ .Values.service.type }}
sessionAffinity: ClientIP
sessionAffinityConfig:
clientIP:
Expand All @@ -81,8 +81,36 @@ spec:
protocol: TCP
targetPort: {{ int .Values.apigw.uiPort }}
name: uiport
{{- if (eq .Values.serviceType "ClusterIP") }}
{{- if (eq .Values.service.type "ClusterIP") }}
nodePort: null
{{- end }}
selector:
{{- include "common.labels.matchLabels" . | nindent 4}}
{{- include "common.labels.matchLabels" . | nindent 4}}
{{- if .Values.grpcService.enabled }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.names.fullname" . }}-grpc
{{- if .Values.grpcService.azureInternalLoadBalancer }}
annotations:
service.beta.kubernetes.io/azure-load-balancer-internal: "true"
{{- end }}
labels:
{{- include "common.labels.standard" . | nindent 4 }}
{{- with .Values.extraLabels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.grpcService.type }}
ports:
- port: {{ int .Values.apigw.grpcPort }}
protocol: TCP
targetPort: {{ int .Values.apigw.grpcPort }}
name: grpcport
{{- if (eq .Values.grpcService.type "ClusterIP") }}
nodePort: null
{{- end }}
selector:
{{- include "common.labels.matchLabels" . | nindent 4}}
{{- end }}
7 changes: 7 additions & 0 deletions apigateway/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ service:
type: ClusterIP
port: 80

grpcService:
enabled: false
type: LoadBalancer
azureInternalLoadBalancer: false

# multiple ingresses for ui, admin, ext and rt
ingresses:
ui:
Expand Down Expand Up @@ -281,6 +286,8 @@ apigw:
adminPort: 5555
# -- External Runtime Port for Reverse Invoke Setups. This port must be manually setup after API Gateway was initizalized.
runtimeExternalPort: 6555
# -- gRPC port for High Availability and Fault Tolerance (HAFT) solution. This port must be manually setup after API Gateway was initizalized.
grpcPort: 4440
readinessProbe:
# -- The readinessprobe scheme (https or http).
scheme: "HTTP"
Expand Down

0 comments on commit 7b75020

Please sign in to comment.