赞
踩
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
[root@master ~]# helm search repo bitnami/postgresql
NAME CHART VERSION APP VERSION DESCRIPTION
bitnami/postgresql 11.1.9 14.2.0 PostgreSQL (Postgres) is an open source object-...
bitnami/postgresql-ha 8.6.3 11.15.0 This PostgreSQL cluster solution includes the P...
cat << EOF> my-values.yaml
global:
storageClass: nfs-storage
postgresql:
auth:
postgresPassword: "root"
username: "wanfei"
password: "www19930327"
database: "gitlab-db"
image:
registry: registry.cn-shanghai.aliyuncs.com
repository: wanfei/postgresql
tag: 14.2.0-debian-10-r35
EOF
helm install gitlib-db bitnami/postgresql \
-f my-values.yaml -n gitlab
# 卸载
helm uninstall gitlib-db -n gitlab
集群内域名:gitlib-db-postgresql.gitlab.svc.cluster.local
获取 postgres
用户密码:
export POSTGRES_ADMIN_PASSWORD=$(kubectl get secret --namespace gitlab gitlib-db-postgresql -o jsonpath="{.data.postgres-password}" | base64 --decode)
echo $POSTGRES_ADMIN_PASSWORD
pgadmin
用户密码export POSTGRES_PASSWORD=$(kubectl get secret --namespace gitlab gitlib-db-postgresql -o jsonpath="{.data.password}" | base64 --decode)
echo $POSTGRES_PASSWORD
验证连接数据
kubectl run gitlib-db-postgresql-client --rm --tty -i --restart='Never' --namespace gitlab --image registry.cn-shanghai.aliyuncs.com/wanfei/postgresql:14.2.0-debian-10-r35 --env="PGPASSWORD=$POSTGRES_PASSWORD" \
--command -- psql --host gitlib-db-postgresql -U wanfei -d gitlab-db -p 5432
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。