kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/<release_version>/cert-manager.yamlhelm repo add nebula-operator https://vesoft-inc.github.io/nebula-operator/charts
helm repo update
helm install nebula-operator nebula-operator/nebula-operator --namespace=<namespace_name> --version=1.1.0Choose between the Enterprise and Community configuration files base on your license. Create a StorageClass or use an existing one in the k8s cluster. Edit the config with the proper storageClassName and run the command below:
kubectl create -f enterprise_edition.yaml
or
kubectl create -f community_edition.yamlOnce you've set up a NebulaGraph cluster using Nebula Operator on Kubernetes, you can connect to NebulaGraph databases both from inside the cluster and from external sources.
Run the following command to check the IP of the Service:
$ kubectl get service -l app.kubernetes.io/cluster=<nebula> #<nebula> is a variable value. Replace it with the desired name.
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nebula-graphd-svc ClusterIP 10.98.213.34 <none> 9669/TCP,19669/TCP,19670/TCP 23h
nebula-metad-headless ClusterIP None <none> 9559/TCP,19559/TCP,19560/TCP 23h
nebula-storaged-headless ClusterIP None <none> 9779/TCP,19779/TCP,19780/TCP,9778/TCPRun the following commands to get the cluster ip and service port of the service:
cluster_ip=$(kubectl get service | grep nebula-graphd-svc | awk '/nebula-graphd-svc/ {print $3}')
service_port=$(kubectl get service | grep nebula-graphd-svc | awk '{print $5}' | cut -d',' -f1 | cut -d'/' -f1)Run the following command to connect to the NebulaGraph database using the cluster ip and service port the -graphd-svc service above:
kubectl run -ti --image vesoft/nebula-console --restart=Never -- <nebula_console_name> -addr <cluster_ip> -port <service_port> -u <username> -p <password>For example:
kubectl run -ti --image vesoft/nebula-console --restart=Never -- nebula-console -addr 10.98.213.34 -port 9669 -u root -p vesoft
A successful connection to the database is indicated if the following is returned:
If you don't see a command prompt, try pressing enter.
(root@nebula) [(none)]>
Refer to the NebulaGraph Database Manual for more information.