kubectl get pod --selector=name=postgres-operator
v2.6, 2018-04-27
This document details verifying the installation of the PostgreSQL Operator is successful, in addition to detailing some different storage configurations that can be made.
To verify that the operator is deployed and running, run the following:
kubectl get pod --selector=name=postgres-operator
You should see output similar to this:
NAME READY STATUS RESTARTS AGE postgres-operator-56598999cd-tbg4w 2/2 Running 0 1m
There are 2 containers in the operator pod, both should be ready as above.
When you first run the operator, it will create the required CustomResourceDefinitions. You can view these as follows -
kubectl get crd
The operator creates the following Custom Resource Definitions over time as the associated commands are triggered.
kubectl get crd NAME AGE pgbackups.cr.client-go.k8s.io 2d pgclusters.cr.client-go.k8s.io 2d pgingests.cr.client-go.k8s.io 2d pgpolicies.cr.client-go.k8s.io 2d pgreplicas.cr.client-go.k8s.io 2d pgtasks.cr.client-go.k8s.io 2d pgupgrades.cr.client-go.k8s.io 2d
At this point, the server side of the operator is deployed and ready.
The complete set of environment variables used in the installation so far are -
export CO_IMAGE_PREFIX=crunchydata export CO_IMAGE_TAG=centos7-2.6 export GOPATH=$HOME/odev export GOBIN=$GOPATH/bin export PATH=$PATH:$GOBIN export COROOT=$GOPATH/src/github.com/crunchydata/postgres-operator export CO_CMD=kubectl
You would normally add these into your .bashrc at this point to be used later on or if you want to redeploy the operator.
The pgo command line client requires TLS for securing the connection to the operator’s REST API. This configuration is performed as follows -
export PGO_CA_CERT=$COROOT/conf/apiserver/server.crt export PGO_CLIENT_CERT=$COROOT/conf/apiserver/server.crt export PGO_CLIENT_KEY=$COROOT/conf/apiserver/server.key
The pgo client uses Basic Authentication to authenticate to the operator REST API, for authentication, add the following .pgouser file to your $HOME -
echo "username:password" > $HOME/.pgouser
The pgo client needs the URL to connect to the operator.
Depending on your Kubernetes environment this can be done the following ways.
At this point you should be able to connect to the operator as follows -
pgo version pgo client version 2.6 apiserver version 2.6
Operator commands are documented on the Getting Started page.
Most users after they try out the operator will want to create a more customized installation and deployment of the operator using specific storage types.
The operator will work with HostPath, NFS, Dynamic, and GKE Storage.
There are many ways to configure the operator further. Some sample configurations are documented on the Configuration page.
You may also want to find out more information on how the operator is designed to work and deploy. This information can be found in the How It Works page.
Information can be found on the full scope of commands on the Getting Started page.