I’m trying to deploy a Kong API gateway backed up with Postgres to Kubernetes subrouting to a Docker container.
After executing the step of kubectl -n kong apply -f kong-control-plane-postgres.yaml , then try to kubectl get pods -n kong , it returns the following pods which is always in Initializing status
NAME READY STATUS RESTARTS AGE
kong-control-plane-6c8b4c89b7-heist 0/1 Init:0/2 0 19s
kong-control-plane-bootstrap-heist20/1 Init:0/1 0 19s
Postgres-heist 1/1 Running 0 84s
Try to debug the container through kubectl logs kong-control-plane-bootstrap-bgfmg wait-for-postgres -n kong , it shows the following error:
nc: bad address ‘postgres.kong.svc’
waiting for db
This is more of a Kong problem, but I’ll be glad to help you here, and honestly this is a little bit out of Travis CI’s wheelhouse.
The Kong control plane manifests a subroutine to bootstrap, this in turn pushes to the datastore. Can you check if it that ran or even was successful?
kubectl get job -n kong
You might want to rev-parse in git. You need to verify that exactly one parameter is provided, and that it can be turned into a raw 20-byte SHA-1 that can be used to access the object database. If so, emit it to the standard output; otherwise, error out.
kubectl apply -f kong-namespace.yaml
./setup_certificate.sh
kubectl create -f postgres.yaml
kubectl get all -n kong #waited for postgres to be ready
kubectl -n kong apply -f kong-control-plane-postgres.yaml
kubectl get all -n kong
If you’re still having difficulty swap the init container with something you’re comfortable debugging from (Busybox, Ubuntu or even something like HashiCorp’s Vagrant.) Then change the command to tail -f /dev/null and then kubectl exec into it and try and determine why it can’t reach PostGRES.
You may want to checkout the documentation on Kong’s website.