Skip to content
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

Opt-in to tolerate ad-hoc modification in resources #418

Open
yujunz opened this issue Jul 18, 2023 · 8 comments
Open

Opt-in to tolerate ad-hoc modification in resources #418

yujunz opened this issue Jul 18, 2023 · 8 comments
Labels

Comments

@yujunz
Copy link
Contributor

yujunz commented Jul 18, 2023

During development, we sometimes want to make ad-hoc changes to temporal instances, e.g. adding an environment variable. The current behavior of the operator is reconciling it to the generated manifests which will reset such changes.

It would be nice to tolerate ad-hoc changes, particularly when it does not conflict with CRD. The feature can be opt-in for development and debugging purpose.

@alexandrevilain
Copy link
Owner

Hi! The operator role is to always ensure the current state matches the desired state. I personally don't know any operator providing such features, do you know one ? I have no idea how to implement such pattern. Maybe it could be something like clusterAPI with paused clusters.

Adding custom env vars using overrides is not enough for your use case ?

@yujunz
Copy link
Contributor Author

yujunz commented Jul 19, 2023

Maybe not be a perfect example, but argocd app controller does not replace resources by default. It applies the desired manifest as a patch and does not reset the unmanaged fields. There is an explicit option to replace resources if needed.

I'm looking for similar behavior in the operator so that we can have a workaround when some features are not supported yet, e.g. archival support mentioned in #364

@alexandrevilain
Copy link
Owner

ArgoCD and this operator have completely different behavior for resource management and diff generation.

I have to double check how ArgoCD does this to decide if it can be implemented in this operator and if it's not an anti-pattern.

About the archival feature, I planned it for 0.15.0, I'm about to release 0.14.0 in the next days.

@yujunz
Copy link
Contributor Author

yujunz commented Jul 20, 2023

Maybe it is related to https://kubernetes.io/docs/reference/using-api/server-side-apply/

A fully specified intent is a partial object that only includes the fields and values for which the user has an opinion. That intent either creates a new object or is combined, by the server, with the existing object.

Consider the operator as a kind of user aforementioned.

@alexandrevilain
Copy link
Owner

SSA could be a good idea !

Looks like server-side apply is not ready yet in controller-runtime see kubernetes-sigs/kubebuilder#2514

Let's mark this issue "on hold" and I'll come back when controller-runtime will provide a clean and easy way to support SSA 🙂

@yujunz
Copy link
Contributor Author

yujunz commented Jul 27, 2023

@yujunz
Copy link
Contributor Author

yujunz commented Aug 2, 2023

@alexandrevilain
Copy link
Owner

@yujunz ! Yes, you're right :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants