Kubernetes部署PostgreSQL集群

马哥Linux运维

共 1399字,需浏览 3分钟

 ·

2024-05-18 19:23

 一、基本架构图

环境:CentOS 7.9

二、安装helm

  • 下载helm

https://github.com/helm/helm/releases
centos7 环境选择Linux amd64版本

 解压:

tar -xzvf helm-v3.14.4-linux-amd64.tar.gz
将helm移动至/bin目录
mv  linux-amd64/helm  /usr/local/bin/helm
查看版本号:
helm version

 三、部署OpenEBS控制平面

  • 更新

helm repo add openebs https://openebs.github.io/chartshelm repo update
  • 安装

helm install --namespace openebs openebs openebs/openebs
 

 三、部署

  • 给PostgreSQL数据库创建独立的命名空间。

kubectl create namespace database
  • 查看命名空间

kubectl get namespaces

  • 创建存储池和存储类:创建一个名为disk-pool的存储池,并定义一个OpenEBS存储类openebs-standard。 

cat > postgres-configmap.yaml << EOFapiVersion: v1kind: ConfigMapmetadata:  name: postgres-config  labels:    app: postgres  namespace: databasedata:  POSTGRES_DB: postgresdb  POSTGRES_USER: postgresadmin  POSTGRES_PASSWORD: admin12345EOFkubectl create -f postgres-configmap.yaml
  • 查看configMap

kubectl get configmaps -n database

  
  •  持久化卷 Persistent Storage Volume

链接:https://www.cnblogs.com/zhongqifeng/p/18131443

(版权归原作者所有,侵删)

浏览 80
点赞
评论
收藏
分享

手机扫一扫分享

举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

举报