Deploy LM¶
Before deploying NebulaGraph Enterprise 3.5.0 or later using Operator, you first need to deploy License Manager (LM) and configure the NebulaGraph Enterprise License in LM. LM is a standalone service used to manage the NebulaGraph license. LM checks the validity of the license when NebulaGraph Enterprise database starts. If the License is invalid, the database will not be able to start.
Deployment instructions¶
Operator does not currently support the deployment of LM. You need to deploy LM themselves.
As LM needs to store data and is a stateful service. You can deploy LM through the StatefulSet resource type or outside the Kubernetes cluster.
Deploy LM outside K8s cluster¶
For information on how to deploy LM on a machine outside the K8s cluster, see License Manager.
Caution
If LM is deployed outside the K8s cluster, make sure that the port of the LM service (default is 9119
) can be accessed by all nodes in the K8s cluster.
Deploy LM in K8s using StatefulSet¶
Prerequisites¶
- Prepare the LM image.
- A StorageClass has been created to store LM data. For more information, see Storage Class.
Steps¶
-
Create a namespace.
# Create the nebula-license-manager namespace. kubectl create namespace nebula-license-manager
-
Create a Secret for pulling the LM image from a private repository.
kubectl -n nebula-license-manager create secret docker-registry <image-pull-secret> \ --docker-server=DOCKER_REGISTRY_SERVER \ --docker-username=DOCKER_USER \ --docker-password=DOCKER_PASSWORD
<image-pull-secret>
: Specify the name of the Secret.- DOCKER_REGISTRY_SERVER: Specify the address of the private repository server from which the image is pulled, for example,
reg.example-inc.com
. - DOCKER_USER: Image repository username.
- DOCKER_PASSWORD: Image repository password.
-
Create a StatefulSet resource configuration file for LM. Here is an example:
apiVersion: v1 kind: Service metadata: name: nebula-license-manager namespace: nebula-license-manager labels: app: nebula-license-manager spec: ports: - port: 9119 selector: app: nebula-license-manager --- apiVersion: apps/v1 kind: StatefulSet metadata: name: nebula-license-manager namespace: nebula-license-manager spec: replicas: 1 selector: matchLabels: app: nebula-license-manager serviceName: nebula-license-manager template: metadata: labels: app: nebula-license-manager spec: containers: - name: nebula-license-manager image: # Fill in the corresponding LM image address. ports: - containerPort: 9119 volumeMounts: - name: data mountPath: /usr/local/nebula-license-manager/data livenessProbe: httpGet: path: /health port: 9119 readinessProbe: httpGet: path: /health port: 9119 # Used to specify one or more Secret names for pulling private images. imagePullSecrets: - name: image-pull-secret # The name of the Secret. volumeClaimTemplates: - metadata: name: data spec: accessModes: - ReadWriteOnce storageClassName: "local-path" # Storage Class name. resources: requests: storage: 2Gi
-
Create LM.
kubectl apply -f nebula-license-manager.yaml
-
Verify that LM has been successfully deployed.
kubectl -n nebula-license-manager get pods
Access LM¶
You can access the License Manager (LM) through the created Service using the following command to get the IP and port of the LM Service:
kubectl -n nebula-license-manager get svc nebula-license-manager
Output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
nebula-license-manager ClusterIP 10.108.xxx.219 <none> 9119/TCP 37m
To access the LM within the cluster, you can use the ClusterIP
type Service IP and port 9119
. For example, 10.108.xxx.219:9119
.
Alternatively, you can access the LM using the domain name <service-name>.<namespace>.svc.cluster.local
and port 9119
. For example, nebula-license-manager.nebula-license-manager.svc.cluster.local:9119
.
Monitor LM¶
You can use monitoring tools, such as Dashboard Enterprise or Prometheus, to monitor the running status and metrics of LM. For more information, see Monitor LM.
Use LM to manage the license¶
- For commands related to using LM deployed outside the K8s cluster to manage License, see License Manager.
-
Commands for managing the license using LM deployed within the K8s cluster are as follows:
# View license information. kubectl -n nebula-license-manager exec -it nebula-license-manager-0 -- \ /usr/local/nebula-license-manager/nebula-license-manager-cli info # Load the License Key. # You must load the License Key before starting the NebulaGraph database. kubectl -n nebula-license-manager exec -it nebula-license-manager-0 -- \ /usr/local/nebula-license-manager/nebula-license-manager-cli load --key XXXXX-XXXXX-... # View license quota usage. kubectl -n nebula-license-manager exec -it nebula-license-manager-0 -- \ /usr/local/nebula-license-manager/nebula-license-manager-cli usage
What's next¶
After deploying LM and loading the License Key, you need to configure the address and port of LM in the NebulaGraph Enterprise cluster through the licenseManagerURL
parameter. For more information, see Create a cluster.