zalando / postgres-operator

Postgres operator creates and manages PostgreSQL clusters running in Kubernetes
https://postgres-operator.readthedocs.io/
MIT License
4.31k stars 979 forks source link

Toleration schema doesn't match k8s #1757

Open tommyzli opened 2 years ago

tommyzli commented 2 years ago

Please, answer some short questions which should help us to understand your problem / question better?

Hi The schema for tolerations in the postgresql crd don't quite match the kubernetes definition. The operator requires key and effect to be set when they are actually optional. from https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/:

There are two special cases: An empty key with operator Exists matches all keys, values and effects which means this will tolerate everything. An empty effect matches all effects with key key1.

FxKu commented 2 years ago

If you need support for these special cases please provide a PR. I think there are a couple of places in the code that would require work (mostly passing config) to support them. Won't come from us atm.

haslersn commented 2 years ago

Also k8s allows to define multiple tolerations. E.g.

  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists