我只是想在Ubuntu 20.04的minikube中安装带有Helm的timescaleDB Single。
通过以下方式安装后:helm install timescaledb timescaledb/timescaledb-single --namespace espace-client-v2我收到消息:

➜  ~ helm install timescaledb timescaledb/timescaledb-single  --namespace espace-client-v2
NAME: timescaledb
LAST DEPLOYED: Fri Aug  7 17:17:59 2020
NAMESPACE: espace-client-v2
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
TimescaleDB can be accessed via port 5432 on the following DNS name from within your cluster:
timescaledb.espace-client-v2.svc.cluster.local

To get your password for superuser run:

    # superuser password
    PGPASSWORD_POSTGRES=$(kubectl get secret --namespace espace-client-v2 timescaledb-credentials -o jsonpath="{.data.PATRONI_SUPERUSER_PASSWORD}" | base64 --decode)

    # admin password
    PGPASSWORD_ADMIN=$(kubectl get secret --namespace espace-client-v2 timescaledb-credentials -o jsonpath="{.data.PATRONI_admin_PASSWORD}" | base64 --decode)

To connect to your database, chose one of these options:

1. Run a postgres pod and connect using the psql cli:
    # login as superuser
    kubectl run -i --tty --rm psql --image=postgres \
      --env "PGPASSWORD=$PGPASSWORD_POSTGRES" \
      --command -- psql -U postgres \
      -h timescaledb.espace-client-v2.svc.cluster.local postgres

    # login as admin
    kubectl run -i --tty --rm psql --image=postgres \
      --env "PGPASSWORD=$PGPASSWORD_ADMIN" \
      --command -- psql -U admin \
      -h timescaledb.espace-client-v2.svc.cluster.local postgres

2. Directly execute a psql session on the master node

   MASTERPOD="$(kubectl get pod -o name --namespace espace-client-v2 -l release=timescaledb,role=master)"
   kubectl exec -i --tty --namespace espace-client-v2 ${MASTERPOD} -- psql -U postgres

它似乎安装得很好。
但是然后,在执行时:
     PGPASSWORD_POSTGRES=$(kubectl get secret --namespace espace-client-v2 timescaledb-credentials -o jsonpath="{.data.PATRONI_SUPERUSER_PASSWORD}" | base64 --decode)

Error from server (NotFound): secrets "timescaledb-credentials" not found


在那之后,我意识到甚至还没有创建pod,它给了我以下错误
MountVolume.SetUp failed for volume "certificate" : secret "timescaledb-certificate" not found
Unable to attach or mount volumes: unmounted volumes=[certificate], unattached volumes=[storage-volume wal-volume patroni-config timescaledb-scripts certificate socket-directory timescaledb-token-svqqf]: timed out waiting for the condition
我该怎么办 ?

最佳答案

我能行。如果https://github.com/timescale/timescaledb-kubernetes页面未提供有关安装过程的详细信息,则可以转到此处:
https://github.com/timescale/timescaledb-kubernetes/tree/master/charts/timescaledb-single
我不得不使用kustomize生成内容:

./generate_kustomization.sh my-release
然后生成severak文件:
credentials.conf  kustomization.yaml  pgbackrest.conf  timescaledbMap.yaml  tls.crt  tls.key
然后我做了:
kubectl kustomize ./
生成了一个k8s yml文件,我将其保存为timescaledbMap.yaml最后,我做了:
kubectl apply -f timescaledbMap.yaml
然后它创建了所有必要的 secret ,我可以安装图表
。希望它对别人有帮助。

关于kubernetes - 使用K8S/Helm安装TimescaleDB时出错:卷 “certificate”的MountVolume.SetUp失败:找不到 “timescaledb-certificate” secret ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/63304715/

10-17 03:15