Skip to content

Latest commit

 

History

History
107 lines (84 loc) · 4.01 KB

File metadata and controls

107 lines (84 loc) · 4.01 KB

Run on Kubernetes Example

Prerequisites

Install prometheus

$ kubectl create ns monitoring
$ helm -n monitoring install prometheus kube-prometheus-stack --repo https://prometheus-community.github.io/helm-charts

See kube-prometheus-stack for details.

Create several Nebula Clusters

$ export STORAGE_CLASS_NAME=gp2             # the storage class for the nebula cluster

$ kubectl create namespace example1
$ helm install nebula1 nebula-cluster --repo https://vesoft-inc.github.io/nebula-operator/charts \
    --namespace=example1 \
    --set nameOverride=nebula1 \
    --set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
    --set nebula.graphd.replicas=1 \
    --set nebula.metad.replicas=1 \
    --set nebula.storaged.replicas=3
$ helm install nebula2 nebula-cluster --repo https://vesoft-inc.github.io/nebula-operator/charts \
    --namespace=example1 \
    --set nameOverride=nebula2 \
    --set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
    --set nebula.graphd.replicas=1 \
    --set nebula.metad.replicas=3 \
    --set nebula.storaged.replicas=3

$ kubectl create namespace example2
$ helm install nebula3 nebula-cluster --repo https://vesoft-inc.github.io/nebula-operator/charts \
    --namespace=example2 \
    --set nameOverride=nebula3 \
    --set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
    --set nebula.graphd.replicas=2 \
    --set nebula.metad.replicas=3 \
    --set nebula.storaged.replicas=3

$ helm install nebula4 nebula-cluster --repo https://vesoft-inc.github.io/nebula-operator/charts \
    --namespace=example2 \
    --set nameOverride=nebula4 \
    --set nebula.storageClassName="${STORAGE_CLASS_NAME}" \
    --set nebula.graphd.replicas=2 \
    --set nebula.metad.replicas=3 \
    --set nebula.storaged.replicas=5

See Install Nebula Cluster with helm for details.

Install Nebula Exporter

$ helm install nebula-exporter nebula-exporter --repo https://vesoft-inc.github.io/nebula-stats-exporter/charts \
    --namespace=example1 --version=v3.3.0 \
    --set serviceMonitor.enabled=true \
    --set serviceMonitor.prometheusServiceMatchLabels.release=prometheus

$ helm install nebula-exporter nebula-exporter --repo https://vesoft-inc.github.io/nebula-stats-exporter/charts \
    --namespace=example2 --version=v3.3.0 \
    --set serviceMonitor.enabled=true \
    --set serviceMonitor.prometheusServiceMatchLabels.release=prometheus

Import and view grafana

Forward the grafana service:

$ kubectl -n monitoring port-forward svc/prometheus-grafana 3000:80

The default user/password of grafana is admin/prom-operator, and the http host is http://127.0.0.1:3000.

Please import nebula-grafana.json into grafana.

Wait a while, then you can see the charts in grafana.

Clean the example

$ helm uninstall nebula-exporter --namespace=example1
$ helm uninstall nebula-exporter --namespace=example2
$ helm uninstall nebula1 --namespace=example1
$ helm uninstall nebula2 --namespace=example1
$ helm uninstall nebula3 --namespace=example2
$ helm uninstall nebula4 --namespace=example2
$ helm -n monitoring uninstall prometheus
$ kubectl delete crd alertmanagerconfigs.monitoring.coreos.com
$ kubectl delete crd alertmanagers.monitoring.coreos.com
$ kubectl delete crd podmonitors.monitoring.coreos.com
$ kubectl delete crd probes.monitoring.coreos.com
$ kubectl delete crd prometheuses.monitoring.coreos.com
$ kubectl delete crd prometheusrules.monitoring.coreos.com
$ kubectl delete crd servicemonitors.monitoring.coreos.com
$ kubectl delete crd thanosrulers.monitoring.coreos.com
$ kubectl delete ns monitoring example1 example1