-
Notifications
You must be signed in to change notification settings - Fork 1k
Add ServiceAnnotations cluster config #803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6aa2437
to
725c44e
Compare
446c410
to
17a58de
Compare
@FxKu thanks for your review. I addressed these points. |
Thanks, tested it myself and worked. Not sure, if I really like the extra manifest. But if you are planning another PR, where it can be removed again, it's fine with me. Just one more thing: Could you revert the changes in go.mod and go.sum. They probably got introduced due to running e2e tests. That's something we should fix soon. |
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
17a58de
to
ba4e094
Compare
Yes, definitely we can remove it soon on my next PR.
Done. thanks again for your review @FxKu |
👍 |
👍 |
The operator parameters 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. Thecustom_service_annotations
as all the other operator parameters 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 betweencustom_service_annotations
andserviceAnnotations
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) bothcustom_service_annotations
andserviceAnnotations
are applied independently of load-balancing configuration. For retro-compatibility purposes,custom_service_annotations
is still under Load balancer related options. The two default annotations when using LoadBalancer services,external-dns.alpha.kubernetes.io/hostname
andservice.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 bycustom_service_annotations
orserviceAnnotations
, 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.Also, it updates the documentation and creates the necessary unit and e2e tests to the above-described feature.