Merge branch 'master' into add-logical-backup

This commit is contained in:
Sergey Dudoladov
2019-04-01 13:52:18 +02:00
19 changed files with 502 additions and 50 deletions
+12 -2
View File
@@ -29,6 +29,16 @@ ConfigMap is used to store the configuration of the operator
## Deploying the operator
### - Helm chart
You can install postgres-operator with helm chart.
```bash
$ helm install --name my-release ./charts/postgres-operator
```
### - Kubernetes manifest
First you need to install the service account definition in your Minikube cluster.
```bash
@@ -153,7 +163,7 @@ minikube. The following steps will get you the docker image built and deployed.
# Code generation
The operator employs k8s-provided code generation to obtain deep copy methods and Kubernetes-like APIs for its custom resource definitons, namely the Postgres CRD and the operator CRD. The usage of the code generation follows conventions from the k8s community. Relevant scripts live in the `hack` directory: the `update-codegen.sh` triggers code generation for the APIs defined in `pkg/apis/acid.zalan.do/`,
The operator employs k8s-provided code generation to obtain deep copy methods and Kubernetes-like APIs for its custom resource definitons, namely the Postgres CRD and the operator CRD. The usage of the code generation follows conventions from the k8s community. Relevant scripts live in the `hack` directory: the `update-codegen.sh` triggers code generation for the APIs defined in `pkg/apis/acid.zalan.do/`,
the `verify-codegen.sh` checks if the generated code is up-to-date (to be used within CI). The `/pkg/generated/` contains the resultant code. To make these scripts work, you may need to `export GOPATH=$(go env GOPATH)`
References for code generation are:
@@ -282,5 +292,5 @@ To test the multinamespace setup, you can use
```
It will automatically create an `acid-minimal-cluster` in the namespace `test`. Then you can for example check the Patroni logs:
```
kubectl logs acid-minimal-cluster-0
kubectl logs acid-minimal-cluster-0
```
+20 -1
View File
@@ -18,11 +18,30 @@ cd postgres-operator
minikube start
# start the operator; may take a few seconds
# start the operator using one of helm chart or yaml manifests;
# - install postgres-operator with helm chart.
# 1) initialize helm
helm init
# 2) install postgres-operator chart
helm install --name postgres-operator ./charts/postgres-operator
# - install postgres-operator with yaml manifests.
kubectl create -f manifests/configmap.yaml # configuration
kubectl create -f manifests/operator-service-account-rbac.yaml # identity and permissions
kubectl create -f manifests/postgres-operator.yaml # deployment
# starting the operator may take a few seconds
# check if operator pod is running
# - if you've created the operator using helm chart
kubectl get po -l app.kubernetes.io/name=postgres-operator
# - if you've created the operator using yaml manifests
kubectl get po -l name=postgres-operator
# create a Postgres cluster
kubectl create -f manifests/minimal-postgres-manifest.yaml
+5
View File
@@ -226,6 +226,11 @@ configuration they are grouped under the `kubernetes` key.
[topology key](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#interlude-built-in-node-labels)
for pod anti affinity. The default is `kubernetes.io/hostname`.
* **pod_management_policy**
specify the
[pod management policy](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#pod-management-policies)
of stateful sets of PG clusters. The default is `ordered_ready`, the second possible value is `parallel`.
## Kubernetes resource requests
This group allows you to configure resource requests for the Postgres pods.