stackabletech / nifi-operator

A kubernetes operator for Apache NiFi
Other
30 stars 5 forks source link

Changing configOverrides doesn't restart NiFi pods #531

Open chris922 opened 1 year ago

chris922 commented 1 year ago

Affected version

23.7

Current and expected behavior

When I add a configOverrides entry to the NifiCluster resource the config-map -node-default will get updated, but as the pod doesn't restart the update doesn't have any effect.

I would expect that the operator ensures the pod will be restarted, so that the new config override will be active.

Possible solution

I think that's a usual issue with Kubernetes apps that ConfigMaps will be updated but the updates are not reflected inside the pod. There are several solutions available, e. g. kustomize appends a kind of hash to the ConfigMap name and has to update the deployment with the new name to force a restart of the pods.

I don't have any explicit solution here.

Additional context

No extra context, but the documentation is also a bit hard to understand in this regards (https://docs.stackable.tech/home/stable/nifi/usage_guide/configuration-environment-overrides). I was not sure where to put the configOverrides properties.. Looking at the CRD I found out I have to put it below nodes.

Environment

Client Version: v1.27.3 Kustomize Version: v5.0.1 Server Version: v1.26.8+k3s1 Stackable Version 23.7 NiFi product version: 1.21.0

Would you like to work on fixing this bug?

None

lfrancke commented 1 year ago

Thanks for the feedback. @fhennig can you look at the docs for this one?

This is known behavior. Someone will get back to you tomorrow morning. Sorry about that.

fhennig commented 1 year ago

@lfrancke The docs are already improved in the nightly version, there it already shows that the configOverrides go below nodes.

sbernauer commented 1 year ago

Hi @chris922, many thanks for your feedback!

we are aware of changing ConfigMaps/Secrets not resulting in a Pod restart. We actually have a solution for this, the restart-controller. It can be enabled by adding the restarter.stackable.tech/enabled label on a StatefulSet. We have not enabled it yet on most of the products, as we currently have a problem described in https://github.com/stackabletech/commons-operator/issues/111, which is rather complex to fix. Once we have fixed the problem we will enable the restart-controller on all products and it should work as expected.

Regarding the docs for configOverrides: We have actually reworked and improved them since 23.7, they are currently in the nightly version and will be part of 23.11. You can find the current nightly version here: https://docs.stackable.tech/home/nightly/nifi/usage_guide/configuration-environment-overrides. There is also the concepts page on overrides: https://docs.stackable.tech/home/nightly/concepts/overrides#config-overrides Do they do a better job of documenting the feature?