部署及日志

​[root@k8s-n0 workspace]# sudo helm install postgresql postgresql-8.6.4.tgz -n dmgeo-lib​

WARNING: This chart is deprecated

NAME: postgresql

LAST DEPLOYED: Thu Feb 4 21:37:55 2021

NAMESPACE: dmgeo-lib

STATUS: deployed

REVISION: 1

TEST SUITE: None

NOTES:

This Helm chart is deprecated

Given the ​​stable​​ deprecation timeline (https://github.com/helm/charts#deprecation-timeline), the Bitnami maintained Helm chart is now located at bitnami/charts (https://github.com/bitnami/charts/).

The Bitnami repository is already included in the Hubs and we will continue providing the same cadence of updates, support, etc that we’ve been keeping here these years. Installation instructions are very similar, just adding the bitnami repo and using it during the installation (​​bitnami/<chart>​​​ instead of ​​stable/<chart>​​)

$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/<chart> # Helm 3
$ helm install --name my-release bitnami/<chart> # Helm 2

To update an exisiting stable deployment with a chart hosted in the bitnami repository you can execute

$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm upgrade my-release bitnami/<chart>

Issues and PRs related to the chart itself will be redirected to ​​bitnami/charts​​ GitHub repository. In the same way, we’ll be happy to answer questions related to this migration process in this issue (https://github.com/helm/charts/issues/20969) created as a common place for discussion.

** Please be patient while the chart is being deployed **

PostgreSQL can be accessed via port 5432 on the following DNS name from within your cluster:

postgresql.dmgeo-lib.svc.cluster.local - Read/Write connection

To get the password for “postgres” run:

export POSTGRES_PASSWORD=$(kubectl get secret --namespace dmgeo-lib postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode)

To connect to your database run the following command:

kubectl run postgresql-client --rm --tty -i --restart='Never' --namespace dmgeo-lib --image docker.io/bitnami/postgresql:11.7.0-debian-10-r9 --env="PGPASSWORD=$POSTGRES_PASSWORD" --command -- psql --host postgresql -U postgres -d postgres -p 5432

To connect to your database from outside the cluster execute the following commands:

kubectl port-forward --namespace dmgeo-lib svc/postgresql 5432:5432 &
PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U postgres -d postgres -p 5432

获取密码

​KYp1Y8DSAF​

[root@k8s-n0 workspace]# sudo kubectl get secret --namespace dmgeo-lib postgresql -o jsonpath="{.data.postgresql-password}" | base64 --decode
KYp1Y8DSAF

helm部署postgresql_github