Skip to content

Latest commit

 

History

History
144 lines (96 loc) · 3.44 KB

getting_started.md

File metadata and controls

144 lines (96 loc) · 3.44 KB

Get Started with Matrixone Operator in Kubernetes

Prerequisites

Create a sample Kubernetes cluster

This section describes two ways to create a simple Kubernetes cluster. After creating a Kubernetes cluster, you can use it to test Matrixone cluster managed by Matrixone Operator. Choose whichever best matches your environment.

  • Use kind to deploy a Kubernetes cluster in Docker. It is a common and recommended way.
  • Use minikube to deploy a Kubernetes cluster running locally in a VM.

How to create Kubernetes cluster can see document

MacOS Kind Example

# install kind
brew install kind

# start a kind cluster
kind create cluster --name mo

Deploy Matrixone Operator

Matrixone Operator helm repository

Using helm charts

  • Install cluster scope operator into the matrixone-operator namespace
# Create namespace
kubectl create ns matrixone-operator

# Add helm repository
helm repo add matrixone https://matrixorigin.github.io/matrixone-operator

# Update repo
helm repo update

# Show helm values about Matrixone Operator
helm show values matrixone/matrixone-operator

# Deploy matrixone operator into matrixone-operator namespace
helm install mo-operator matrixone/matrixone-operator -n matrixone-operator
  • Check Operator Status
kubectl get po -n matrixone-operator

Matrixone Operator is ready:

NAME                                              READY   STATUS    RESTARTS   AGE
mo-operator-matrixone-operator-5dd548755f-b7p64   1/1     Running   0          55sx

Deploy a sample Matrixone cluster

  • An example spec to deploy a tiny matrixone cluster is included. Install cluster into matrixone namespace
# Create namespace
kubectl create ns matrixone

# Deploy a sample cluster
kubectl apply -f https://raw.githubusercontent.com/matrixorigin/matrixone-operator/main/examples/tiny-cluster.yaml -n matrixone
  • Check Matrixone cluster status
kubectl get po -n matrixone

Matrixone cluster is ready:

NAME   READY   STATUS    RESTARTS   AGE
mo-0   1/1     Running   0          26s

Connect to a Matrixone cluster

  • Connect cluster by port-forward
# Port-forward 6001 -> 6001
kubectl port-forward service/mo 6001:6001 -n matrixone

# connect to cluster
mysql -h 127.0.0.1 -P 6001 -udump -p111
  • Connect cluster by tools

Uninstall Matrixone resources

  • Uninstall Matrixone cluster
kubectl delete -f https://raw.githubusercontent.com/matrixorigin/matrixone-operator/main/examples/tiny-cluster.yaml -n matrixone

The Matrixone cluster should display the state when the cluster is deleted:

kubectl get po -n matrixone
> No resources found in matrixone namespace.

Then delete namespace:

# Delete the namespace after all matrixone pods are deleted
kubectl delete ns matrixone
  • Uninstall Matrixone Operator
helm uninstall mo-operator -n matrixone-operator

The Matrixone Operator should display the state when the cluster is deleted:

kubectl get po -n matrixone-operator
> No resources found in matrixone-operator namespace.

Then delete namespace:

# Delete the namespace after matrixone operator pod are deleted
kubectl delete ns matrixone-operator