Preparations

Before getting started, please ensure that the following prerequisites are met:

  • Have a running Kubernetes cluster and ensure that:
    • The cluster version >= 1.18.0
    • There are at least 2 CPUs available
    • There is at least 4GB of available memory
    • There is at least 30GB of available disk space
  • Have installed kubectl to access the Kubernetes cluster
  • Have installed Helm 3 first

create a namespace called polardbx-operator-system,

$ kubectl create namespace polardbx-operator-system

Execute the following command to install PolarDB-X Operator.

$ helm install --namespace polardbx-operator-system --create-namespace polardbx-operator https://github.com/polardb/polardbx-operator/releases/download/v1.6.0/polardbx-operator-1.6.0.tgz

You can also install through the PolarDB-X Helm Chart repository:

helm repo add polardbx https://polardbx-charts.oss-cn-beijing.aliyuncs.com
helm install --namespace polardbx-operator-system --create-namespace polardbx-operator polardbx/polardbx-operator

Expect to see the following output:

NAME: polardbx-operator
LAST DEPLOYED: Sun Oct 17 15:17:29 2021
NAMESPACE: polardbx-operator-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
polardbx-operator is installed. Please check the status of components:

    kubectl get pods --namespace polardbx-operator-system

Now have fun with your first PolarDB-X cluster.

Here's the manifest for quick start:

```yaml
apiVersion: polardbx.aliyun.com/v1
kind: PolarDBXCluster
metadata:
  name: quick-start
  annotations:
    polardbx/topology-mode-guide: quick-start

Installation Options

Helm installation typically allows specifying values for some configuration options to override default installation options. Here are a few common options and installation modes:

All installation options can be obtained using the following command:

helm show values --namespace polardbx-operator-system  https://github.com/polardb/polardbx-operator/releases/download/v1.6.0/polardbx-operator-1.6.0.tgz

System Check

Runtime Status

Use the following command to view the runtime status of system components:

kubectl -n polardbx-operator-system get pods

You will typically see the following Pods:

NAME                                          READY   STATUS    RESTARTS   AGE
NAME                                           READY   STATUS    RESTARTS   AGE
polardbx-controller-manager-6c858fc5b9-zrhx9   1/1     Running   0          66s
polardbx-hpfs-d44zd                            1/1     Running   0          66s
polardbx-tools-updater-459lc                   1/1     Running   0          66s

Where:

  • polardbx-controller-manager is the Pod where the operator and webhook are located, created by a Deployment controller
  • polardbx-hpfs is the Pod where the host remote file service is located, created by a DaemonSet controller, so there will be one on each node
  • polardbx-tools-updater is the update program for some common tools scripts on the host machine, also created by a DaemonSet controller

Dynamic Configuration

The Operator/Webhook loads a set of dynamic configurations at runtime, which are stored in a ConfigMap in Kubernetes.

Use the following command to view the contents of the configuration:

kubectl -n polardbx-operator-system get configmap polardbx-controller-manager-config -o yaml

You will typically see content like this:

apiVersion: v1
data:
  config.yaml: |-
    images:
      repo: polardbx
      common:
        prober: probe-proxy:v1.2.0
        exporter: polardbx-exporter:v1.2.0
      compute:
        init: polardbx-init:v1.2.0
        engine: registry.cn-zhangjiakou.aliyuncs.com/drds_pre/polardbx-sql:20220330-2
      cdc:
        engine: registry.cn-zhangjiakou.aliyuncs.com/drds_pre/polardbx-cdc:20220408
      store:
        galaxy:
          engine: polardbx-engine@sha256:a1cf4aabf3e0230d6a63dd9afa125e58baa2a925462a59968ac3b918422bf521
          exporter: prom/mysqld-exporter:master
    scheduler:
      enable_master: true
    cluster:
      enable_exporters: true
      enable_aliyun_ack_resource_controller: true
      enable_debug_mode_for_compute_nodes: false
      enable_privileged_container: false
    store:
      enable_privileged_container: false
      host_paths:
        tools: /data/cache/tools/xstore
        volume_data: /data/xstore
      hpfs_endpoint: polardbx-hpfs:6543
  webhook.yaml: |-
    validator:

    default:
      protocol_version: 8
      storage_engine: galaxy
      service_type: ClusterIP
      upgrade_strategy: RollingUpgrade
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: polardbx-operator
    meta.helm.sh/release-namespace: polardbx-operator-system
  creationTimestamp: "2022-04-01T08:09:55Z"
  labels:
    app.kubernetes.io/managed-by: Helm
  name: polardbx-controller-manager-config
  namespace: polardbx-operator-system
  resourceVersion: "2475601453"
  uid: 585844ea-4b87-4407-98f2-520d02d8cffd

results matching ""

    No results matching ""