Kubernetes部署PostgreSQL集群
共 1399字,需瀏覽 3分鐘
·
2024-05-18 19:23
一、基本架構圖
環(huán)境:CentOS 7.9
二、安裝helm
下載helm
https://github.com/helm/helm/releases
centos7 環(huán)境選擇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數(shù)據(jù)庫創(chuàng)建獨立的命名空間。
kubectl create namespace database
查看命名空間
kubectl get namespaces
創(chuàng)建存儲池和存儲類:創(chuàng)建一個名為disk-pool的存儲池,并定義一個OpenEBS存儲類openebs-standard。
cat > postgres-configmap.yaml << EOFapiVersion: v1kind: ConfigMapmetadata:name: postgres-configlabels:app: postgresnamespace: databasedata:POSTGRES_DB: postgresdbPOSTGRES_USER: postgresadminPOSTGRES_PASSWORD: admin12345EOFkubectl create -f postgres-configmap.yaml
查看configMap
kubectl get configmaps -n database
持久化卷 Persistent Storage Volume
鏈接:https://www.cnblogs.com/zhongqifeng/p/18131443
(版權歸原作者所有,侵刪)
評論
圖片
表情
