-
Notifications
You must be signed in to change notification settings - Fork 281
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
Static manifests are not automatically reapplied #5481
Comments
This is expected behavior. We monitor the files for changes and apply them. If you modify the Addon yourself through kubectl, RKE2 will not reapply because the manifest file itself has not changed. |
We cover this better in the k3s docs; I believe @dereknola is working on adapting some of this content for the rke2 docs but in the mean time you can reference: https://docs.k3s.io/installation/packaged-components#auto-deploying-manifests-addons
|
I see, thank you for clarifying. Is there any feature or possibility with RKE2 to enforce manifest application to the cluster even when it's deleted via kubectl? To provide some background: I want to apply some Admission Webhooks and make sure that not even a user with cluster admin permissions is able to remove it. |
No, we are not planning on doing that. You should use RBAC to ensure that people don't have permission to delete things you don't want them deleting. Having something else that just puts them back is not a sufficient control. |
Environmental Info:
RKE2 Version:
Node(s) CPU architecture, OS, and Version:
Cluster Configuration: 3 Servers, 4 Agents
Describe the bug:
According to the documentation, one can place YAML manifests under
/var/lib/rancher/rke2/server/manifests
to be automatically applied to the cluster. While this works perfectly fine a) upon initially writing the file and b) when editing and saving it, when you manually delete the resource the manifest shall create from the cluster, it will not get automatically re-applied. When restarting therke2-server
, it is reapplied. When editing the file and saving it again, it is reapplied. When renaming it, it is reapplied. But not when you just delete its resulting resource from the cluster.Steps To Reproduce:
/var/lib/rancher/rke2/server/manifests
, e.g. one to create a randomClusterRole
object.kubectl delete clusterrole foo
rke2-server
systemd unit on one of the rke2-serversExpected behavior:
As with a default kubeadm setup, I'd expect the manifest to be automatically reapplied when the resulting resource is being deleted from the cluster.
Actual behavior:
The manifest is not reapplied until the
rke2-server
is being restarted.The text was updated successfully, but these errors were encountered: