Kubernetes部署PostgreSQL集群
一、基本架构图
环境:CentOS 7.9
二、安装helm
- 下载helm
https://github.com/helm/helm/releases
centos7 环境选择Linux amd64版本
解压:
tar-xzvfhelm-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/charts
helm 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 << EOF
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres-config
labels:
app: postgres
namespace: database
data:
POSTGRES_DB: postgresdb
POSTGRES_USER: postgresadmin
POSTGRES_PASSWORD: admin12345
EOF
kubectlcreate -f postgres-configmap.yaml
- 查看configMap
kubectl get configmaps -n database
- 持久化卷 Persistent Storage Volume
链接:https://www.cnblogs.com/zhongqifeng/p/18131443
(版权归原作者所有,侵删)
阅读原文 最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。