Introduction:The complete definition of the PolarDBXCluster can be found here 。
First, prepare a yaml file that describes the PolarDBXCluster:
apiVersion: polardbx.aliyun.com/v1 # API Group / Version
kind: PolarDBXCluster # API Name
metadata: # Object metadata
name: polardbx-test # Object name
namespace: default # Namespace
labels: # Object label collection
kind: test
spec: # Spec
topology: # Topology definition
nodes: # Node specifications and quantities
cn:
replicas: 2
template:
image: polardbx/polardbx-sql:v2.4.0_5.4.19
resources:
limits:
cpu: 4
memory: 16Gi
dn:
replicas: 2
template:
image: polardbx/polardbx-engine:v2.4.0_8.4.19
resources:
limits:
cpu: 4
memory: 16Gi
cdc:
replicas: 2
template:
image: polardbx/polardbx-cdc:v2.4.0_5.4.19
resources:
limits:
cpu: 4
memory: 16Gi
Create the PolarDBXCluster object using the following command:
kubectl create -f polardbx-test.yaml
Observe the status of the PolarDBXCluster object using the following command:
kubectl get pxc polardbx-test
NAME GMS CN DN CDC PHASE DISK AGE
polardbx-test 0/1 0/2 0/2 0/2 Creating 5s
When the PHASE
in the status is Running
, the PolarDB-X cluster has been successfully created.
kubectl get pxc polardbx-test
NAME GMS CN DN CDC PHASE DISK AGE
polardbx-test 1/1 2/2 2/2 2/2 Running 6.2Gi 63s