dgraph icon indicating copy to clipboard operation
dgraph copied to clipboard

Kubernetes Configuration Update - cluster + missing dgraph-ratel

Open alexmilowski opened this issue 8 years ago • 4 comments

The current documented cluster configuration for Kubernetes didn't quite work for me. Various things seem to have changed and dgraph-ratel was also missing.

I was able to get dgraph working on a 1.8.4 cluster and added dgraph-ratel via the attached configuration.

dgraph-multi-github.yaml.txt

alexmilowski avatar Jan 11 '18 23:01 alexmilowski

I have updated the config https://docs.dgraph.io/master/deploy/#cluster-setup and it works with Kubernetes v1.8.4. Can you give this a try? I didn't get the error about the volume storage class that you were talking about. @alexmilowski how do you deploy to your kubernetes cluster?

Also, dgraph-ratel doesn't need to be a stateful set as it doesn't have any state.

pawanrawal avatar Jan 15 '18 05:01 pawanrawal

The service configuration will still route inconsistently. Because all the pods share the same label, some requests will get routed to the wrong place (e.g., a server request on 8080 can route to dgraph-zero pod).

I still had to separate the services and change the service labels. See the example below:

# This is the service that should be used by the clients of Dgraph to talk to the server.
# It exposes a ClusterIP that will automatically load balance connections the the different Dgraph
# Servers.
apiVersion: v1
kind: Service
metadata:
  name: dgraph-public-server
  labels:
    app: dgraph
spec:
  type: LoadBalancer
  ports:
  - port: 8080
    targetPort: 8080
    name: server-http
  - port: 9080
    targetPort: 9080
    name: server-grpc
  selector:
    app: dgraph-server
---
# This is the service that should be used by the clients of Dgraph to talk to the server.
# It exposes a ClusterIP that will automatically load balance connections the the different Dgraph
# Servers.
apiVersion: v1
kind: Service
metadata:
  name: dgraph-public-zero
  labels:
    app: dgraph
spec:
  type: LoadBalancer
  ports:
  - port: 5080
    targetPort: 5080
    name: zero-grpc
  - port: 6080
    targetPort: 6080
    name: zero-http
  selector:
    app: dgraph-zero
---
# This is the service that should be used by the clients of Dgraph to talk to the server.
# It exposes a ClusterIP that will automatically load balance connections the the different Dgraph
# Servers.
apiVersion: v1
kind: Service
metadata:
  name: dgraph-public-ui
  labels:
    app: dgraph
spec:
  type: LoadBalancer
  ports:
  - port: 8081
    targetPort: 8081
    name: ratel-http
  selector:
    app: dgraph-ui

alexmilowski avatar Jan 18 '18 22:01 alexmilowski

With that change, It worked.

alexmilowski avatar Jan 18 '18 22:01 alexmilowski

Updated k8s manifest files on the master.

sboorlagadda avatar Feb 09 '18 01:02 sboorlagadda