Kubedb operator issues

1/14/2019

Has anyone used the kubedb operator before? https://kubedb.com/docs/0.9.0/welcome/

I've gotten a postgres instance bootstrapped and now im trying to do a snapshot to s3 but cant seem to get it working

Waiting... database is not ready yet

The db is up and accepting connections:

$ kubectl exec -it db-0 -n ${namespace} bash
  bash-4.3# pg_isready
  /var/run/postgresql:5432 - accepting connections

The db pod is running at :

db-0 1/1 Running 0 37m

Which is accessible in pgadmin via the server name db.${namespace}

Here's my snapshot object spec:

---
apiVersion: kubedb.com/v1alpha1
kind: Snapshot
metadata:
  name: db-snapshot
  namespace: ${namespace}
  labels:
    kubedb.com/kind: Postgres
spec:
  databaseName: db
  storageSecretName: s3-creds
  s3:
    endpoint: 's3.amazonaws.com'
    bucket: ${bucket}

If anyone can point out where im going wrong that would be great!

-- Amar Sattaur
amazon-s3
amazon-web-services
kubernetes

1 Answer

1/15/2019
#while ! nc "$DB_HOST" "$DB_PORT" -w 30 >/dev/null; do
#  echo "Waiting... database is not ready yet"
#  sleep 5
#done

This nc command wasnt connecting to the db host for some reason. The container could psql into it using the db name so I commented it out and it worked like a charm.

Guess there's some issue with the nc binary that's bundled in this container.

-- Amar Sattaur
Source: StackOverflow