postgres-operator/e2e
Dmitry Dolgov 9dfa433363
Connection pooler (#799)
Connection pooler support

Add support for a connection pooler. The idea is to make it generic enough to
be able to switch between different implementations (e.g. pgbouncer or
odyssey). Operator needs to create a deployment with pooler and a service for
it to access.

For connection pool to work properly, a database needs to be prepared by
operator, namely a separate user have to be created with an access to an
installed lookup function (to fetch credential for other users).

This setups is supposed to be used only by robot/application users. Usually a
connection pool implementation is more CPU bounded, so it makes sense to create
several pods for connection pool with more emphasize on cpu resources. At the
moment there are no special affinity or tolerations assigned to bring those
pods closer to the database. For availability purposes minimal number of
connection pool pods is 2, ideally they have to be distributed between
different nodes/AZ, but it's not enforced in the operator itself. Available
configuration supposed to be ergonomic and in the normal case require minimum
changes to a manifest to enable connection pool. To have more control over the
configuration and functionality on the pool side one can customize the
corresponding docker image.

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
2020-03-25 12:57:26 +01:00
..
tests Connection pooler (#799) 2020-03-25 12:57:26 +01:00
Dockerfile make run.sh executable from within e2e (#619) 2019-07-24 15:07:32 +02:00
Makefile install kind as GO module (#742) 2019-11-28 17:39:25 +01:00
README.md Add ServiceAnnotations cluster config (#803) 2020-02-10 12:03:25 +01:00
kind-cluster-postgres-operator-e2e-tests.yaml Implement runner for e2e tests (#548) 2019-06-05 17:07:27 +02:00
requirements.txt Implement runner for e2e tests (#548) 2019-06-05 17:07:27 +02:00
run.sh install kind as GO module (#742) 2019-11-28 17:39:25 +01:00

README.md

Postgres Operator end-to-end tests

End-to-end tests shall ensure that the Postgres Operator does its job when applying manifests against a Kubernetes (K8s) environment. A test runner Dockerfile is provided to run e2e tests without the need to install K8s and its runtime kubectl in advance. The test runner uses kind to create a local K8s cluster which runs on Docker.

Prerequisites

Docker Go

Build test runner

In the directory of the cloned Postgres Operator repository change to the e2e folder and run:

make

This will build the postgres-operator-e2e-tests image and download the kind runtime.

Run tests

In the e2e folder you can invoke tests either with make test or with:

./run.sh

To run both the build and test step you can invoke make e2e from the parent directory.

Covered use cases

The current tests are all bundled in test_e2e.py:

  • support for multiple namespaces
  • scale Postgres cluster up and down
  • taint-based eviction of Postgres pods
  • invoking logical backup cron job
  • uniqueness of master pod
  • custom service annotations