k8ssandra / k8ssandra-operator

The Kubernetes operator for K8ssandra
https://k8ssandra.io/
Apache License 2.0
168 stars 78 forks source link

Add a valid status condition for K8ssandraCluster #617

Open jsanda opened 2 years ago

jsanda commented 2 years ago

What is missing? We have a lot of OpenAPI validation checks for the K8ssandraCluster CRD. For checks that have to be applied dynamically at runtime we have a validating webhook. There are also some validation checks performed during the reconciliation loop.

Several things are needed:

Why do we need it? First, let's address why we need validation checks during reconciliation if we have a validating webhook. It's because the operator can be deployed without the webhook.

We need a Valid condition to better surface validation errors. When there is a validation error during reconciliation, the user won't find out until he looks at the operator logs. The status condition will let him know right away and can be easily monitored.

Validation checks should be performed as early as possible during reconciliation. We should fail fast and avoid doing unnecessary work if the desired state is invalid. That's not the case today. Furthermore, we have validation checks scattered in different places. Ideally, those checks should happen in a single place.

Environment

┆Issue is synchronized with this Jira Story by Unito ┆Issue Number: K8OP-191

adejanovski commented 2 years ago

Hey team! Please add your planning poker estimate with ZenHub @jsanda @Miles-Garnsey