2. Create a local cluster
Create a local cluster
Create a YugabyteDB cluster in Minikube using the commands below. Note that for Helm, you have to first create a namespace.
$ kubectl create namespace yb-demo
$ helm install yb-demo yugabytedb/yugabyte \
--version 2.13.1 \
--set resource.master.requests.cpu=0.5,resource.master.requests.memory=0.5Gi,\
resource.tserver.requests.cpu=0.5,resource.tserver.requests.memory=0.5Gi,\
replicas.master=1,replicas.tserver=1 --namespace yb-demo
Note that in Minikube, the LoadBalancers for yb-master-ui
and yb-tserver-service
will remain in pending state since load balancers are not available in a Minikube environment. If you would like to turn off these services then pass the enableLoadBalancer=False
flag as shown below.
$ helm install yb-demo yugabytedb/yugabyte \
--version 2.13.1 \
--set resource.master.requests.cpu=0.5,resource.master.requests.memory=0.5Gi,\
resource.tserver.requests.cpu=0.5,resource.tserver.requests.memory=0.5Gi,\
replicas.master=1,replicas.tserver=1,enableLoadBalancer=False --namespace yb-demo
Check cluster status with kubectl
Run the following command to see that you now have two services with one pod each — 1 yb-master pod (yb-master-0
) and 1 yb-tserver pod (yb-tserver-0
) running. For details on the roles of these pods in a YugabyteDB cluster (aka Universe), see Universe in the Concepts section.
$ kubectl --namespace yb-demo get pods
NAME READY STATUS RESTARTS AGE
yb-master-0 0/2 ContainerCreating 0 5s
yb-tserver-0 0/2 ContainerCreating 0 4s
Eventually, all the pods will have the Running
state.
NAME READY STATUS RESTARTS AGE
yb-master-0 2/2 Running 0 13s
yb-tserver-0 2/2 Running 0 12s
To see the status of the three services, run the following command.
$ kubectl --namespace yb-demo get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
yb-master-ui LoadBalancer 10.98.66.255 <pending> 7000:31825/TCP 119s
yb-masters ClusterIP None <none> 7100/TCP,7000/TCP 119s
yb-tserver-service LoadBalancer 10.106.5.69 <pending> 6379:31320/TCP,9042:30391/TCP,5433:30537/TCP 119s
yb-tservers ClusterIP None <none> 7100/TCP,9000/TCP,6379/TCP,9042/TCP,5433/TCP 119s
Check cluster status with Admin UI
Under the hood, the cluster you have just created consists of two processes: YB-Master which keeps track of various metadata (list of tables, users, roles, permissions, and so on), and YB-TServer which is responsible for the actual end user requests for data updates and queries.
Each of the processes exposes its own Admin UI that can be used to check the status of the corresponding process, and perform certain administrative operations.
To get access to the Admin UI, you first need to set up port forwarding for port 7000:
$ kubectl --namespace yb-demo port-forward svc/yb-master-ui 7000:7000
Now, you can view the yb-master-0 Admin UI at http://localhost:7000.
Overview and YB-Master status
The YB-Master home page shows that you have a cluster (or universe) with a replication factor of 1, a single node, and no tables. The YugabyteDB version is also displayed.
The Masters section highlights the 1 YB-Master along with its corresponding cloud, region, and zone placement.
YB-TServer status
Click See all nodes to go to the Tablet Servers page, which lists the YB-TServer along with the time since it last connected to the YB-Master using regular heartbeats.