Strimzi-kafka-operator: [Enhancement] Use status field to share warnings and encourage best practice

Created on 27 Feb 2020  路  5Comments  路  Source: strimzi/strimzi-kafka-operator

_This came out of a discussion in https://github.com/strimzi/strimzi-kafka-operator/pull/2563_

Is your feature request related to a problem? Please describe.
Users can create custom resources with invalid values, or values that could lead to future problems, and not realise this.

Describe the solution you'd like
The operator could look for common problems, misconfigurations, or potential warnings - and populate the status field for the relevant spec with them.

The specific issue that prompted this was creating a single node ZooKeeper cluster with ephemeral storage. This is the sort of thing that we could look for - it's not technically invalid, and will work. But it's potentially bad if a user doesn't realise the implications until it's too late (and they restart their ZooKeeper node).

Describe alternatives you've considered

  • Writing warnings to the operator log.

    • Although simpler, I think users are less likely to look here, and for non-cluster-admin users they may not even be able to look here. Putting it in the CR makes the warnings more discoverable.

  • Validating admission webhook to enforce

    • If we introduced a validating webhook, we could prevent invalid CRs being created. I think that's also a useful feature we should look at, but for now/this issue, I'm focused on things that aren't necessarily invalid or things we want to prevent - just things that it could be helpful to bring to the user's attention. Warnings, more than errors.

enhancement

Most helpful comment

@dalelane Ok, great ... I assigned it to you so now you have to do it ;-)

All 5 comments

@dalelane Are you (or any colleagues) planning to work on this? Or is this something anyone can work on?

Yeah, I was thinking of working on it, but I'm equally happy if someone else jumps on it first and beats me to it :-)

@dalelane Ok, great ... I assigned it to you so now you have to do it ;-)

@scholzj Sorry, last week was super-busy so I didn't get a chance to look at this.

To revive it this week, I've put a quick placeholder up at https://github.com/strimzi/strimzi-kafka-operator/pull/2663 to show what I had in mind. If you get a chance, please could you have a look and see if you think that's a sensible place in the flow to do these checks. From some manual testing, it seems to do the right thing.

If we agree this is the right approach, I'll get a proper PR ready with tests and a more thought-through set of warnings to check for.

@dalelane I assume we can now close this?

Was this page helpful?
0 / 5 - 0 ratings