目录
目录README.md

opengauss-operator

opengauss-operator

1. 架构

支持集群模式和的单机模式。单机模式下只会启动一个Pod。集群模式下将启动指定集群大小数量的Master节点和对应的Slaver节点。

image-20211009224248457

2. 部署

  1. 部署opengauss-operator

    进入项目目录。运行make deploy 命令。即可在当前K8s集群部署operator。该命令会部署CRD、创建一个opengauss-operator-system的命名空间并在该命名空间内创建operator的相关资源

  2. 部署Opengauss

    在项目config/sample目录下存在示例资源yaml配置,该资源清单配置一个大小为1的Opengauss集群:

    pv.yaml:

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: opengauss-sample-slaver-0
    spec:
      capacity:
        storage: 10Gi
      accessModes:
        - ReadWriteOnce
      nfs:
        path: /mnt/md0/mnt1/pv/slaver-0
        server: 10.21.57.118
    ---
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: opengauss-sample-master-0
    spec:
      capacity:
        storage: 10Gi
      accessModes:
        - ReadWriteOnce
      nfs:
        path: /mnt/md0/mnt1/pv/master-0
        server: 10.21.57.118

    sample.yaml:

    apiVersion: opengauss.huawei.com.my.domain/v1alpha1
    kind: OpenGauss
    metadata:
      name: opengauss-sample
      namespace: opengauss-operator-system
    spec:
      #集群模式:standalone 或者 cluster
      mode: standalone
      #当模式为cluster时有效。表示集群大小。集群会为每个主节点分配一个从节点。一个Size为3的OpenGauss集群包含3个Master节点和对应的三个Slaver节点
      size: 1
      commonConfig:
        #指定镜像,当镜像版本修改时,自动触发滚动更新
        image: modernoom/opengauss:latest
        imagePullPolicy: IfNotPresent
        #密码必须为包含大小写字母、数字、特殊租房,长度大于等于8
      gsPassword:  Enmo@233
      #持久化配置。可以配置为StorageClass或者提前创建相应数量的PV卷
      volumeClaimTemplate:
        spec:
          accessModes: ["ReadWriteOnce"]
          resources:
            requests:
              storage: 5Gi
      #亲和度字段,可选,可用于进行Pod迁移。根据亲和度配置重新进行Pod的调度。
      #affinity:

    部署:

    kubectl apply -f config/sample/pv.yaml

    kubectl apply -f config/sample/sample.yaml

    检查集群状态:

    image-20211017220332968

    检查主从状态:

    image-20211017220301048

3.特性支持

  • 持久化支持

    为保证数据不会丢失,要求必须进行持久化。Opengauss的持久化字段必须被配置。部署Opengauss集群前必须提前制作相应数量的PV卷或者配置StorageClass动态卷。

  • 单机模式部署

    支持单机模式部署

  • 集群模式部署

    支持集群模式部署

  • Pod迁移

    支持基于亲和性的pod迁移。当需要进行迁移时,通过为Opengauss资源配置affinity字段实现Pod调度到指定节点并通过控制循环恢复集群状态。

  • 滚动升级

支持在线滚动升级。

image-20211016134736108

关于

openGauss-operator

99.5 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号