当前位置: 首页 > 工具软件 > Stolon > 使用案例 >

helm部署Stolon(HA PostgreSQL 集群)

龙博
2023-12-01

Github地址:Stolon Helm Chart | helm_stolon

stolon 1.7.2 · iomed/stolon

1、准备

helm repo add iomedstolon https://iomedhealth.github.io/helm_stolon/
helm pull iomedstolon/stolon
tar -zxvf stolon-1.7.2.tgz
cd stolon

2、设置

根据实际情况修改values.yaml文件

vim values.yaml

3、存储信息

  storageClassName: "nfs"
  accessModes:
    - ReadWriteOnce
  size: 10Gi

4、认证信息

superuserUsername: "stolon"
## password for the superuser (REQUIRED if superuserSecret and superuserPasswordFile are not set)
superuserPassword: "xxxxx"

replicationPasswordFile:

replicationUsername: "repluser"
## password for the replication user (REQUIRED if replicationSecret and replicationPasswordFile are not set)
replicationPassword: "xxxxxx"

5、最大连接数

pgParameters:
  max_connections: "1000"

6、service信息

proxy:
  replicaCount: 2
  annotations: {}
  resources: {}
  priorityClassName: ""
  service:
    type: NodePort
#    loadBalancerIP: ""
    annotations: {}
    ports:
      proxy:
        port: 5432
        targetPort: 5432
        nodePort: 30032
        protocol: TCP
  nodeSelector: {}
  affinity: {}

7、创建集群

kubectl create namespace stolon
helm install stolon . -n stolon

8、查看

[root@k8s-master01 stolon]# kubectl get pod -n stolon
NAME                               READY   STATUS      RESTARTS   AGE
stolon-create-cluster-rh2qf        0/1     Completed   0          10d
stolon-keeper-0                    1/1     Running     0          10d
stolon-keeper-1                    1/1     Running     0          10d
stolon-proxy-7bb79964d5-bc6w9      1/1     Running     0          10d
stolon-proxy-7bb79964d5-gfc2h      1/1     Running     0          10d
stolon-sentinel-69f9d776cf-v52qg   1/1     Running     0          10d
stolon-sentinel-69f9d776cf-vvdnm   1/1     Running     0          10d

 类似资料: