Skip to content

Commit

Permalink
Add support for gRPC endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
antas-marcin committed Nov 3, 2023
1 parent 3539d0f commit 8b04650
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
32 changes: 32 additions & 0 deletions weaviate/templates/weaviateServiceGRPC.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.grpcService.name }}
labels:
app.kubernetes.io/name: weaviate
app.kubernetes.io/managed-by: helm
{{- with .Values.grpcService.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.grpcService.type }}
selector:
app: weaviate
ports:
{{- range .Values.grpcService.ports }}
- {{ toYaml . | indent 6 | trim }}
targetPort: 50051
{{- end }}
{{ if eq .Values.grpcService.type "ClusterIP" -}}
{{ if .Values.grpcService.clusterIP }}
clusterIP: {{ .Values.grpcService.clusterIP }}
{{ end }}
{{ end }}
{{ if eq .Values.grpcService.type "LoadBalancer" -}}
{{- if gt (len .Values.grpcService.loadBalancerSourceRanges) 0 }}
loadBalancerSourceRanges:
{{- range $_, $sourceRange := .Values.grpcService.loadBalancerSourceRanges }}
- {{ $sourceRange }}
{{ end -}}
{{- end -}}
{{- end }}
3 changes: 3 additions & 0 deletions weaviate/templates/weaviateStatefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ spec:
containerPort: 2112
protocol: TCP
{{- end }}
- name: grpc
containerPort: 50051
protocol: TCP
volumeMounts:
- name: weaviate-config
mountPath: /weaviate-config
Expand Down
18 changes: 17 additions & 1 deletion weaviate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ image:
# of weaviate. In accordance with Infra-as-code, you should pin this value
# down and only change it if you explicitly want to upgrade the Weaviate
# version.
tag: 1.21.2
tag: 1.22.2
repo: semitechnologies/weaviate
# Image pull policy: https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy
pullPolicy: IfNotPresent
Expand Down Expand Up @@ -106,6 +106,22 @@ service:
clusterIP:
annotations: {}

# The service controls how weaviate gRPC endpoint is exposed to the outside world.
# 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:
name: weaviate-grpc
ports:
- name: http
protocol: TCP
port: 80
# Target port is going to be the same for every port
type: LoadBalancer
loadBalancerSourceRanges: []
# optionally set cluster IP if you want to set a static IP
clusterIP:
annotations: {}

# The service monitor defines prometheus monitoring for a set of services
# https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.ServiceMonitor
serviceMonitor:
Expand Down

0 comments on commit 8b04650

Please sign in to comment.