From f601bfb657d211a312e95515e42eae16a4d67690 Mon Sep 17 00:00:00 2001 From: "Thomas Hesse (THES) [EXT]" Date: Tue, 16 Jan 2024 15:50:22 +0100 Subject: [PATCH 1/4] Fix service type --- apigateway/helm/templates/nginx-svc.yaml | 6 +++--- apigateway/helm/templates/service.yaml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apigateway/helm/templates/nginx-svc.yaml b/apigateway/helm/templates/nginx-svc.yaml index f1d9289..47036af 100644 --- a/apigateway/helm/templates/nginx-svc.yaml +++ b/apigateway/helm/templates/nginx-svc.yaml @@ -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: diff --git a/apigateway/helm/templates/service.yaml b/apigateway/helm/templates/service.yaml index 3387b84..0eb2def 100644 --- a/apigateway/helm/templates/service.yaml +++ b/apigateway/helm/templates/service.yaml @@ -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: @@ -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: @@ -71,7 +71,7 @@ metadata: {{ toYaml . | nindent 4 }} {{- end }} spec: - type: {{ .Values.serviceType }} + type: {{ .Values.service.type }} sessionAffinity: ClientIP sessionAffinityConfig: clientIP: @@ -81,7 +81,7 @@ 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: From e5fcc18e4f6bdac5409f244a6f7e4bd274195249 Mon Sep 17 00:00:00 2001 From: "Thomas Hesse (THES) [EXT]" Date: Tue, 16 Jan 2024 16:07:10 +0100 Subject: [PATCH 2/4] Add support for gRPC port (for HAFT) --- apigateway/helm/templates/deployment.yaml | 5 +++++ apigateway/helm/templates/service.yaml | 26 ++++++++++++++++++++++- apigateway/helm/values.yaml | 6 ++++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/apigateway/helm/templates/deployment.yaml b/apigateway/helm/templates/deployment.yaml index 3f56b79..21f6613 100644 --- a/apigateway/helm/templates/deployment.yaml +++ b/apigateway/helm/templates/deployment.yaml @@ -167,6 +167,11 @@ spec: - containerPort: {{ int .Values.apigw.runtimeExternalPort }} name: external-http protocol: TCP +{{- if .Values.global.grpcEnabled }} + - containerPort: {{ int .Values.apigw.grpcPort }} + name: grpc-http + protocol: TCP +{{- end }} {{- if .Values.extraPorts }} {{- toYaml .Values.extraPorts | nindent 10 }} {{- end }} diff --git a/apigateway/helm/templates/service.yaml b/apigateway/helm/templates/service.yaml index 0eb2def..6522dcd 100644 --- a/apigateway/helm/templates/service.yaml +++ b/apigateway/helm/templates/service.yaml @@ -85,4 +85,28 @@ spec: nodePort: null {{- end }} selector: - {{- include "common.labels.matchLabels" . | nindent 4}} \ No newline at end of file + {{- include "common.labels.matchLabels" . | nindent 4}} +{{- if .Values.grpcService.enabled }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "common.names.fullname" . }}-grpc + 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 }} \ No newline at end of file diff --git a/apigateway/helm/values.yaml b/apigateway/helm/values.yaml index 432202f..9d8d02a 100644 --- a/apigateway/helm/values.yaml +++ b/apigateway/helm/values.yaml @@ -96,6 +96,10 @@ service: type: ClusterIP port: 80 +grpcService: + enabled: false + type: LoadBalancer + # multiple ingresses for ui, admin, ext and rt ingresses: ui: @@ -281,6 +285,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" From 437f92422bd9ef60c89a312ccd560ea31b0c98cb Mon Sep 17 00:00:00 2001 From: "Thomas Hesse (THES) [EXT]" Date: Wed, 17 Jan 2024 18:26:28 +0100 Subject: [PATCH 3/4] Add option to configure Azure internal loadbalancer --- apigateway/helm/templates/service.yaml | 4 ++++ apigateway/helm/values.yaml | 1 + 2 files changed, 5 insertions(+) diff --git a/apigateway/helm/templates/service.yaml b/apigateway/helm/templates/service.yaml index 6522dcd..832ffc2 100644 --- a/apigateway/helm/templates/service.yaml +++ b/apigateway/helm/templates/service.yaml @@ -92,6 +92,10 @@ 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 -}} diff --git a/apigateway/helm/values.yaml b/apigateway/helm/values.yaml index 9d8d02a..2127756 100644 --- a/apigateway/helm/values.yaml +++ b/apigateway/helm/values.yaml @@ -99,6 +99,7 @@ service: grpcService: enabled: false type: LoadBalancer + azureInternalLoadBalancer: false # multiple ingresses for ui, admin, ext and rt ingresses: From b184b0d6f7c92bf4d4023c8042e1741c93e7bc27 Mon Sep 17 00:00:00 2001 From: Marc Friedhoff Date: Fri, 19 Jan 2024 09:54:53 +0100 Subject: [PATCH 4/4] Fixed grpcService --- apigateway/helm/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apigateway/helm/templates/deployment.yaml b/apigateway/helm/templates/deployment.yaml index 21f6613..0bfca54 100644 --- a/apigateway/helm/templates/deployment.yaml +++ b/apigateway/helm/templates/deployment.yaml @@ -167,11 +167,11 @@ spec: - containerPort: {{ int .Values.apigw.runtimeExternalPort }} name: external-http protocol: TCP -{{- if .Values.global.grpcEnabled }} + {{- if .Values.grpcService.enabled }} - containerPort: {{ int .Values.apigw.grpcPort }} name: grpc-http protocol: TCP -{{- end }} + {{- end }} {{- if .Values.extraPorts }} {{- toYaml .Values.extraPorts | nindent 10 }} {{- end }}