postgres-operator/pkg/cluster
Jonathan Juares Beber ba60e15d07 Add ServiceAnnotations cluster config (#803)
The [operator parameters][1] already support the
`custom_service_annotations` config.With this parameter is possible to
define custom annotations that will be used on the services created by the
operator. The `custom_service_annotations` as all the other
[operator parameters][1] are defined on the operator level and do not allow
customization on the cluster level. A cluster may require different service
annotations, as for example, set up different cloud load balancers
timeouts, different ingress annotations, and/or enable more customizable
environments.

This commit introduces a new parameter on the cluster level, called
`serviceAnnotations`, responsible for defining custom annotations just for
the services created by the operator to the specifically defined cluster.
It allows a mix of configuration between `custom_service_annotations` and
`serviceAnnotations` where the latest one will have priority. In order to
allow custom service annotations to be used on services without
LoadBalancers (as for example, service mesh services annotations) both
`custom_service_annotations` and `serviceAnnotations` are applied
independently of load-balancing configuration. For retro-compatibility
purposes, `custom_service_annotations` is still under
[Load balancer related options][2]. The two default annotations when using
LoadBalancer services, `external-dns.alpha.kubernetes.io/hostname` and
`service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout` are
still defined by the operator.
`service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout` can
be overridden by `custom_service_annotations` or `serviceAnnotations`,
allowing a more customizable environment.
`external-dns.alpha.kubernetes.io/hostname` can not be overridden once
there is no differentiation between custom service annotations for
replicas and masters.

It updates the documentation and creates the necessary unit and e2e
tests to the above-described feature too.

[1]: https://github.com/zalando/postgres-operator/blob/master/docs/reference/operator_parameters.md
[2]: https://github.com/zalando/postgres-operator/blob/master/docs/reference/operator_parameters.md#load-balancer-related-options
2020-02-10 12:03:25 +01:00
..
cluster.go make minimum limits boundaries configurable (#808) 2020-02-03 11:43:18 +01:00
cluster_test.go Add ServiceAnnotations cluster config (#803) 2020-02-10 12:03:25 +01:00
database.go database.go: remove hardcoded .svc.cluster.local dns suffix (#561) 2019-05-31 16:32:00 +02:00
exec.go reflect change in github url (#496) 2019-02-25 11:26:55 +01:00
filesystems.go reflect change in github url (#496) 2019-02-25 11:26:55 +01:00
k8sres.go Add ServiceAnnotations cluster config (#803) 2020-02-10 12:03:25 +01:00
k8sres_test.go Add global option to enable/disable init containers and sidecars (#478) 2019-12-10 15:45:54 +01:00
pod.go move StatefulSet to apps/v1 (#675) 2019-09-30 16:42:04 +02:00
resources.go Add global option to enable/disable init containers and sidecars (#478) 2019-12-10 15:45:54 +01:00
sync.go make minimum limits boundaries configurable (#808) 2020-02-03 11:43:18 +01:00
types.go Add global option to enable/disable init containers and sidecars (#478) 2019-12-10 15:45:54 +01:00
util.go move StatefulSet to apps/v1 (#675) 2019-09-30 16:42:04 +02:00
volumes.go Fixing spelling mistake in delete PVC function name (#691) 2019-10-18 16:41:56 +02:00