mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-07 00:21:38 +02:00
add toggle to disable creation of CRD validation and document it
This commit is contained in:
@@ -3,6 +3,30 @@
|
||||
Learn how to configure and manage the Postgres Operator in your Kubernetes (K8s)
|
||||
environment.
|
||||
|
||||
## CRD Validation
|
||||
|
||||
[CustomResourceDefinitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions)
|
||||
will be registered with schema validation by default when the operator is
|
||||
deployed. The `OperatorConfiguration` CRD will only get created if the
|
||||
`POSTGRES_OPERATOR_CONFIGURATION_OBJECT` [environment variable](../manifests/postgres-operator.yaml#L36)
|
||||
in the deployment yaml is set and not empty.
|
||||
|
||||
When submitting manifests of [`postgresql`](../manifests/postgresql.crd.yaml) or
|
||||
[`OperatorConfiguration`](../manifests/operatorconfiguration.crd.yaml) custom
|
||||
resources with kubectl, validation can be bypassed with `--validate=false`. The
|
||||
operator can also be configured to not register CRDs with validation on `ADD` or
|
||||
`UPDATE` events. Running instances are not affected when enabling the validation
|
||||
afterwards unless the manifests is not changed then. Note, that the provided CRD
|
||||
manifests contain the validation for users to understand what schema is
|
||||
enforced.
|
||||
|
||||
Once the validation is enabled it can only be disabled manually by editing or
|
||||
patching the CRD manifest:
|
||||
|
||||
```bash
|
||||
zk8 patch crd postgresqls.acid.zalan.do -p '{"spec":{"validation": null}}'
|
||||
```
|
||||
|
||||
## Namespaces
|
||||
|
||||
### Select the namespace to deploy to
|
||||
|
||||
+9
-9
@@ -119,15 +119,15 @@ kubectl get pod -l app.kubernetes.io/name=postgres-operator
|
||||
kubectl create -f manifests/minimal-postgres-manifest.yaml
|
||||
```
|
||||
|
||||
After the cluster manifest is submitted the operator will create Service and
|
||||
Endpoint resources and a StatefulSet which spins up new Pod(s) given the number
|
||||
of instances specified in the manifest. All resources are named like the
|
||||
cluster. The database pods can be identified by their number suffix, starting
|
||||
from `-0`. They run the [Spilo](https://github.com/zalando/spilo) container
|
||||
image by Zalando. As for the services and endpoints, there will be one for the
|
||||
master pod and another one for all the replicas (`-repl` suffix). Check if all
|
||||
components are coming up. Use the label `application=spilo` to filter and list
|
||||
the label `spilo-role` to see who is currently the master.
|
||||
After the cluster manifest is submitted and passed the validation the operator
|
||||
will create Service and Endpoint resources and a StatefulSet which spins up new
|
||||
Pod(s) given the number of instances specified in the manifest. All resources
|
||||
are named like the cluster. The database pods can be identified by their number
|
||||
suffix, starting from `-0`. They run the [Spilo](https://github.com/zalando/spilo)
|
||||
container image by Zalando. As for the services and endpoints, there will be one
|
||||
for the master pod and another one for all the replicas (`-repl` suffix). Check
|
||||
if all components are coming up. Use the label `application=spilo` to filter and
|
||||
list the label `spilo-role` to see who is currently the master.
|
||||
|
||||
```bash
|
||||
# check the deployed cluster
|
||||
|
||||
@@ -69,6 +69,11 @@ Variable names are underscore-separated words.
|
||||
|
||||
Those are top-level keys, containing both leaf keys and groups.
|
||||
|
||||
* **enable_crd_validation**
|
||||
toggles if the operator will create or update CRDs with
|
||||
[OpenAPI v3 schema validation](https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#validation)
|
||||
The default is `true`.
|
||||
|
||||
* **etcd_host**
|
||||
Etcd connection string for Patroni defined as `host:port`. Not required when
|
||||
Patroni native Kubernetes support is used. The default is empty (use
|
||||
|
||||
Reference in New Issue
Block a user