Add global option to enable/disable init containers and sidecars

This commit is contained in:
Felix Kunde
2019-11-26 12:02:37 +01:00
committed by Felix Kunde
parent 5f87384d7f
commit 5fd53d0b28
16 changed files with 118 additions and 31 deletions
+13 -12
View File
@@ -49,14 +49,15 @@ git clone https://github.com/zalando/postgres-operator.git
cd postgres-operator
# apply the manifests in the following order
kubectl create -f manifests/configmap.yaml # configuration
kubectl create -f manifests/operatorconfiguration.crd.yaml # registers the CRD
kubectl create -f manifests/postgresql-operator-default-configuration.yaml # configuration
kubectl create -f manifests/operator-service-account-rbac.yaml # identity and permissions
kubectl create -f manifests/postgres-operator.yaml # deployment
```
There is a [Kustomization](https://github.com/kubernetes-sigs/kustomize)
manifest that [combines the mentioned resources](../manifests/kustomization.yaml) -
it can be used with kubectl 1.14 or newer as easy as:
manifest that [combines the mentioned resources](../manifests/kustomization.yaml).
It can be used with kubectl 1.14 or newer as easy as:
```bash
kubectl apply -k github.com/zalando/postgres-operator/manifests
@@ -119,15 +120,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
+6
View File
@@ -327,6 +327,7 @@ defined in the sidecar dictionary:
(https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/)
for environment variables. Optional.
<<<<<<< HEAD
* **resources**
[CPU and memory requests and limits](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container)
for each sidecar container. Optional.
@@ -354,3 +355,8 @@ CPU and memory limits for the sidecar container.
* **memory**
memory limits for the sidecar container. Optional, overrides the
`default_memory_limits` operator configuration parameter. Optional.
=======
**Note**: The operator will not launch a cluster if sidecar containers are specified
but globally disabled in the configuration. The `enable_sidecars` option
must be set to `true`.
>>>>>>> efce5a5f... updated docs
+20 -3
View File
@@ -82,10 +82,18 @@ Those are top-level keys, containing both leaf keys and groups.
your own Spilo image from the [github
repository](https://github.com/zalando/spilo).
* **enable_init_containers**
global option to allow for creating init containers to run actions before
Spilo is started. Disabled by default.
* **enable_sidecars**
global option to allow for creating sidecar containers to run alongside Spilo
on the same pod. Disabled by default.
* **sidecar_docker_images**
a map of sidecar names to docker images for the containers to run alongside
Spilo. In case of the name conflict with the definition in the cluster
manifest the cluster-specific one is preferred.
a map of sidecar names to docker images to run with Spilo. In case of the name
conflict with the definition in the cluster manifest the cluster-specific one
is preferred.
* **enable_shm_volume**
Instruct operator to start any new database pod without limitations on shm
@@ -444,10 +452,19 @@ grouped under the `logical_backup` key.
* **logical_backup_s3_endpoint**
When using non-AWS S3 storage, endpoint can be set as a ENV variable.
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> ebd09880... Modified dump.sh so it knows how to handle new features. Configurable S3 SSE
* **logical_backup_s3_sse**
Specify server side encription that S3 storage is using. If empty string
is specified, no argument will be passed to `aws s3` command. Default: "AES256".
<<<<<<< HEAD
=======
>>>>>>> 7cd05ba4... Updated documentation for logical backup endpoint, access and secret key.
=======
>>>>>>> ebd09880... Modified dump.sh so it knows how to handle new features. Configurable S3 SSE
* **logical_backup_s3_access_key_id**
When set, value will be in AWS_ACCESS_KEY_ID env variable. The Default is empty.
+8
View File
@@ -350,6 +350,10 @@ variables are always passed to sidecars:
The PostgreSQL volume is shared with sidecars and is mounted at
`/home/postgres/pgdata`.
**Note**: The operator will not launch a cluster if sidecar containers are
specified but globally disabled in the configuration. The `enable_sidecars`
option must be set to `true`.
## InitContainers Support
Each cluster can specify arbitrary init containers to run. These containers can
@@ -374,6 +378,10 @@ spec:
`initContainers` accepts full `v1.Container` definition.
**Note**: The operator will not launch a cluster if init containers are specified
but globally disabled in the configuration. The `enable_init_containers` option
must be set to `true`.
## Increase volume size
PostgreSQL operator supports statefulset volume resize if you're using the