apecloud / kubeblocks

KubeBlocks is an open-source control plane software that runs and manages databases, message queues and other stateful applications on K8s.
https://kubeblocks.io
GNU Affero General Public License v3.0
2.22k stars 185 forks source link

[BUG] orioledb cluster container pgbouncer logs contain secret password #7854

Open JashBook opened 4 months ago

JashBook commented 4 months ago

Describe the bug

kbcli version
Kubernetes: v1.29.6-gke.1038001
KubeBlocks: 0.9.1-beta.6
kbcli: 0.9.0

+ echo '"postgres" "75rbcktq"'

To Reproduce Steps to reproduce the behavior:

  1. create etcd cluster
    kbcli cluster create  etcdo-boroli --termination-policy=WipeOut --cluster-definition=etcd --enable-all-logs=false --cluster-version=etcd-v3.5.6 --set cpu=100m,memory=0.5Gi,replicas=3,storage=1Gi  
  2. create orioledb cluster
    kbcli cluster create  orioledb-boroli --termination-policy=Delete --cluster-definition=orioledb --enable-all-logs=false --cluster-version=orioledb-beta1 --set cpu=100m,memory=0.5Gi,replicas=1,storage=1Gi --service-reference name=etcdService,cluster=etcdo-boroli,namespace=default 
    
    kubectl get pod -l app.kubernetes.io/instance=orioledb-boroli
    NAME                         READY   STATUS    RESTARTS   AGE
    orioledb-boroli-orioledb-0   5/5     Running   0          28m
    orioledb-boroli-orioledb-1   5/5     Running   0          27m

kubectl get secrets orioledb-boroli-conn-credential -o jsonpath="{.data.password}"|base64 -d 75rbcktq

3. See error

kubectl logs orioledb-boroli-orioledb-0 -c pgbouncer

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

JashBook commented 4 months ago

opengauss cluster container opengauss logs contain secret password

  1. create cluster
    kbcli cluster create  ogauss-cluster --termination-policy=Halt --cluster-definition=opengauss --cluster-version=opengauss-3.0.0
    
    kubectl get pod -l app.kubernetes.io/instance=ogauss-cluster                                
    NAME                         READY   STATUS    RESTARTS   AGE
    ogauss-cluster-opengauss-0   1/1     Running   0          19s

kubectl get secrets ogauss-cluster-conn-credential -o jsonpath="{.data.password}"|base64 -d p@ssW0rd1

2.  see error

kubectl logs ogauss-cluster-opengauss-0 -c opengauss|grep "p@ssW0rd1" Execute SQL: gsql -v ON_ERROR_STOP=1 --username omm --password p@ssW0rd1 --dbname postgres --set db=opengauss --set passwd=p@ssW0rd1 Execute SQL: gsql -v ON_ERROR_STOP=1 --username omm --password p@ssW0rd1 --dbname postgres --set db=opengauss --set passwd=p@ssW0rd1 --set user=kbadmin

1aal commented 4 months ago

Get it