From dfb69f01d688c413533f26680671a4644f8f209e Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Wed, 19 Feb 2020 12:08:16 +0100 Subject: [PATCH] add documentation --- docs/administrator.md | 27 +++++++++++++++++++++++++++ manifests/postgres-operator.yaml | 2 +- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/docs/administrator.md b/docs/administrator.md index 5b8769edb..39b912c60 100644 --- a/docs/administrator.md +++ b/docs/administrator.md @@ -113,6 +113,33 @@ If your cluster uses a DNS domain other than the default `cluster.local`, this needs to be set in the operator configuration (`cluster_domain` variable). This is used by the operator to connect to the clusters after creation. +## Operators with defined ownership on certain Postgres clusters + +By default, multiple operators can only run together in Kubernetes when isolated +into their [own namespaces](administrator.md#specify-the-namespace-to-watch). +But, it is also possible to define ownership between operator instances and +Postgres clusters running all in the same namespace without interfering. + +First, define the [`CONTROLLER_ID`](../../manifests/postgres-operator.yaml#L38) +environment variable in the operator deployment manifest. Then specify the ID +in every Postgres cluster manifest you want this operator to watch using the +`"acid.zalan.do/controller"` annotation: + +```yaml +apiVersion: "acid.zalan.do/v1" +kind: postgresql +metadata: + name: demo-cluster + annotations: + "acid.zalan.do/controller": "second-operator" +spec: + ... +``` + +Every other Postgres cluster which lacks the annotation will be ignored by this +operator. Conversely, operators without a defined `CONTROLLER_ID` will ignore +clusters with a defined ownership of another cluster. + ## Role-based access control for the operator The manifest [`operator-service-account-rbac.yaml`](../manifests/operator-service-account-rbac.yaml) diff --git a/manifests/postgres-operator.yaml b/manifests/postgres-operator.yaml index ff0d3d7af..82025a9c5 100644 --- a/manifests/postgres-operator.yaml +++ b/manifests/postgres-operator.yaml @@ -35,6 +35,6 @@ spec: # In order to use the CRD OperatorConfiguration instead, uncomment these lines and comment out the two lines above # - name: POSTGRES_OPERATOR_CONFIGURATION_OBJECT # value: postgresql-operator-default-configuration - # Define a ID to isoalte controllers from each other + # Define an ID to isolate controllers from each other # - name: CONTROLLER_ID # value: "second-operator"