Skip to content

Commit 4f78231

Browse files
committed
Add scope section to readme.
1 parent c2ca230 commit 4f78231

File tree

1 file changed

+21
-12
lines changed

1 file changed

+21
-12
lines changed

README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,38 @@
66

77
The Postgres operator manages PostgreSQL clusters on Kubernetes using the [operator pattern](https://coreos.com/blog/introducing-operators.html).
88
During the initial run it registers the [Custom Resource Definition (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources/#customresourcedefinitions) for Postgres.
9-
The PostgreSQL CRD is essentially the schema that describes the contents of the manifests for deploying individual
9+
The PostgreSQL CRD is essentially the schema that describes the contents of the manifests for deploying individual
1010
PostgreSQL clusters using StatefulSets and [Patroni](https://github.com/zalando/patroni).
1111

1212
Once the operator is running, it performs the following actions:
1313

1414
* watches for new PostgreSQL cluster manifests and deploys corresponding clusters
1515
* watches for updates to existing manifests and changes corresponding properties of the running clusters
1616
* watches for deletes of the existing manifests and deletes corresponding clusters
17-
* acts on an update to the operator definition itself and changes the running clusters when necessary
17+
* acts on an update to the operator definition itself and changes the running clusters when necessary
1818
(i.e. when the docker image inside the operator definition has been updated)
1919
* periodically checks running clusters against the manifests and acts on the differences found
2020

21-
For instance, when the user creates a new custom object of type ``postgresql`` by submitting a new manifest with
22-
``kubectl``, the operator fetches that object and creates the corresponding Kubernetes structures
21+
For instance, when the user creates a new custom object of type ``postgresql`` by submitting a new manifest with
22+
``kubectl``, the operator fetches that object and creates the corresponding Kubernetes structures
2323
(StatefulSets, Services, Secrets) according to its definition.
2424

2525
Another example is changing the docker image inside the operator. In this case, the operator first goes to all StatefulSets
2626
it manages and updates them with the new docker images; afterwards, all pods from each StatefulSet are killed one by one
2727
(rolling upgrade) and the replacements are spawned automatically by each StatefulSet with the new docker image.
2828

29+
## Scope
30+
31+
The scope of the postgres operator is on provisioning, modifying configuration and cleaning up Postgres clusters that use Patroni, basically to make it easy and convenient to run Patroni based clusters on Kubernetes.
32+
The provisioning and modifying includes Kubernetes resources on one side but also e.g. database and role provisioning once the cluster is up and running.
33+
We try to leave as much work as possible to Kubernetes and to Patroni where it fits, especially the cluster bootstrap and high availability.
34+
The operator is however involved in some overarching orchestration, like rolling upgrades to improve the user experience.
35+
36+
Monitoring of clusters is not in scope, for this good tools already exist from ZMON to Prometheus and more Postgres specific options.
37+
2938
## Status
3039

31-
This project is currently in active development. It is however already [used internally by Zalando](https://jobs.zalando.com/tech/blog/postgresql-in-a-time-of-kubernetes/) in order to run Postgres databases on Kubernetes in larger numbers for staging environments and a smaller number of production databases. In this environment the operator is deployed to multiple Kubernetes clusters, where users deploy manifests via our CI/CD infrastructure.
40+
This project is currently in active development. It is however already [used internally by Zalando](https://jobs.zalando.com/tech/blog/postgresql-in-a-time-of-kubernetes/) in order to run Postgres clusters on Kubernetes in larger numbers for staging environments and a growing number of production clusters. In this environment the operator is deployed to multiple Kubernetes clusters, where users deploy manifests via our CI/CD infrastructure or rely on a slim user interface to create manifests.
3241

3342
Please, report any issues discovered to https://github.com/zalando-incubator/postgres-operator/issues.
3443

@@ -40,7 +49,7 @@ Please, report any issues discovered to https://github.com/zalando-incubator/pos
4049

4150
## Running and testing the operator
4251

43-
The best way to test the operator is to run it in [minikube](https://kubernetes.io/docs/getting-started-guides/minikube/).
52+
The best way to test the operator is to run it in [minikube](https://kubernetes.io/docs/getting-started-guides/minikube/).
4453
Minikube is a tool to run Kubernetes cluster locally.
4554

4655
### Installing and starting minikube
@@ -72,11 +81,11 @@ All subsequent `kubectl` commands will work with the `test` namespace. The opera
7281

7382
### Specify the namespace to watch
7483

75-
Watching a namespace for an operator means tracking requests to change Postgresql clusters in the namespace such as "increase the number of Postgresql replicas to 5" and reacting to the requests, in this example by actually scaling up.
84+
Watching a namespace for an operator means tracking requests to change Postgresql clusters in the namespace such as "increase the number of Postgresql replicas to 5" and reacting to the requests, in this example by actually scaling up.
7685

7786
By default, the operator watches the namespace it is deployed to. You can change this by altering the `WATCHED_NAMESPACE` env var in the operator deployment manifest or the `watched_namespace` field in the operator configmap. In the case both are set, the env var takes the precedence. To make the operator listen to all namespaces, explicitly set the field/env var to "`*`".
7887

79-
Note that for an operator to manage pods in the watched namespace, the operator's service account (as specified in the operator deployment manifest) has to have appropriate privileges to access the watched namespace. The operator may not be able to function in the case it watches all namespaces but lacks access rights to any of them (except Kubernetes system namespaces like `kube-system`). The reason is that for multiple namespaces operations such as 'list pods' execute at the cluster scope and fail at the first violation of access rights.
88+
Note that for an operator to manage pods in the watched namespace, the operator's service account (as specified in the operator deployment manifest) has to have appropriate privileges to access the watched namespace. The operator may not be able to function in the case it watches all namespaces but lacks access rights to any of them (except Kubernetes system namespaces like `kube-system`). The reason is that for multiple namespaces operations such as 'list pods' execute at the cluster scope and fail at the first violation of access rights.
8089

8190
The watched namespace also needs to have a (possibly different) service account in the case database pods need to talk to the Kubernetes API (e.g. when using Kubernetes-native configuration of Patroni).
8291

@@ -131,8 +140,8 @@ The operator can be configured with the provided ConfigMap (`manifests/configmap
131140

132141
#### Use taints and tolerations for dedicated PostgreSQL nodes
133142

134-
To ensure Postgres pods are running on nodes without any other application pods, you can use
135-
[taints and tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) and configure the
143+
To ensure Postgres pods are running on nodes without any other application pods, you can use
144+
[taints and tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) and configure the
136145
required toleration in the operator ConfigMap.
137146

138147
As an example you can set following node taint:
@@ -168,7 +177,7 @@ spec:
168177
effect: NoSchedule
169178
```
170179

171-
Please be aware that the taint and toleration only ensures that no other pod gets scheduled to a PostgreSQL node
180+
Please be aware that the taint and toleration only ensures that no other pod gets scheduled to a PostgreSQL node
172181
but not that PostgreSQL pods are placed on such a node. This can be achieved by setting a node affinity rule in the ConfigMap.
173182

174183
### Using the operator to minimize the amount of failovers during the cluster upgrade
@@ -190,7 +199,7 @@ node_readiness_label: "lifecycle-status:ready,disagnostic-checks:ok"
190199
```
191200

192201
when multiple labels are set the operator will require all of them to be present on a node (and set to the specified value) in order to consider
193-
it ready.
202+
it ready.
194203

195204
#### Custom Pod Environment Variables
196205

0 commit comments

Comments
 (0)