From c051da93eb39caf84d9434e735d8a64b1efb7e27 Mon Sep 17 00:00:00 2001 From: Marcin Antas Date: Wed, 8 Nov 2023 15:17:24 +0100 Subject: [PATCH] Add option to enable / disable gRPC support --- .cicd/test.sh | 2 ++ weaviate/templates/weaviateServiceGRPC.yaml | 2 ++ weaviate/templates/weaviateStatefulset.yaml | 2 ++ weaviate/values.yaml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/.cicd/test.sh b/.cicd/test.sh index e765a43..1e6303b 100755 --- a/.cicd/test.sh +++ b/.cicd/test.sh @@ -150,6 +150,8 @@ function check_creates_template() { check_string_existence "--set modules.qna-openai.enabled=true --set modules.qna-openai.azureApiKey=azureApiKey" "name: AZURE_APIKEY" check_string_existence "--set modules.generative-openai.enabled=true --set modules.generative-openai.azureApiKey=azureApiKey" "name: AZURE_APIKEY" check_string_existence "--set modules.text2vec-jinaai.enabled=true --set modules.text2vec-jinaai.apiKey=jinaaiApiKey" "name: JINAAI_APIKEY" + check_string_existence "--set grpcService.enabled=true" "containerPort: 50051" + check_string_existence "--set grpcService.enabled=true --set grpcService.name=weaviate-grpc-service-custom-name" "name: weaviate-grpc-service-custom-name" _settingPassageQueryOn="--set modules.text2vec-contextionary.enabled=false --set modules.text2vec-transformers.passageQueryServices.passage.enabled=true --set modules.text2vec-transformers.passageQueryServices.query.enabled=true" check_setting_has_value "$_settingPassageQueryOn" "name: TRANSFORMERS_PASSAGE_INFERENCE_API" "value: http://transformers-inference-passage.default.svc.cluster.local:8080" diff --git a/weaviate/templates/weaviateServiceGRPC.yaml b/weaviate/templates/weaviateServiceGRPC.yaml index d14c9e8..a9a4cd5 100644 --- a/weaviate/templates/weaviateServiceGRPC.yaml +++ b/weaviate/templates/weaviateServiceGRPC.yaml @@ -1,3 +1,4 @@ +{{ if .Values.grpcService.enabled }} apiVersion: v1 kind: Service metadata: @@ -30,3 +31,4 @@ spec: {{ end -}} {{- end -}} {{- end }} +{{ end }} diff --git a/weaviate/templates/weaviateStatefulset.yaml b/weaviate/templates/weaviateStatefulset.yaml index c4747b6..c529aab 100644 --- a/weaviate/templates/weaviateStatefulset.yaml +++ b/weaviate/templates/weaviateStatefulset.yaml @@ -322,9 +322,11 @@ spec: containerPort: 2112 protocol: TCP {{- end }} + {{ if .Values.grpcService.enabled }} - name: grpc containerPort: 50051 protocol: TCP + {{- end }} volumeMounts: - name: weaviate-config mountPath: /weaviate-config diff --git a/weaviate/values.yaml b/weaviate/values.yaml index 18f067e..113d511 100644 --- a/weaviate/values.yaml +++ b/weaviate/values.yaml @@ -110,6 +110,8 @@ service: # If you don't want a public load balancer, you can also choose 'ClusterIP' to make # weaviate gRPC port be only accessible within your cluster. grpcService: + # Set this to true in order to deploy Weaviate gRPC service + enabled: false name: weaviate-grpc ports: - name: grpc