-
Notifications
You must be signed in to change notification settings - Fork 239
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
[BUG] gitRepo resources aren't applying to clusters when changing fleet workspace #1845
Comments
The root cause of this issue is an error seen in the
This is because the base cluster used when filing this issue was a hardened Since the new namespace is not "allow-listed" to deploy privileged pods, the initContainer of the I suspect this might be a general issue that was not tested in previous releases, so here are some new steps for reproduction: To Reproduce
Expected Bad Result @slickwarren can you explicitly test this on an older Rancher version? cc: @manno @olblak, this is a Fleet issue, so we should ideally transfer this over. |
tested on a released version of rancher, 2.7.8, with a hardened local cluster and am experiencing the same error there:
I'm actually seeing similar behavior on non-hardened clusters. (on 2.8-head)
|
here are my 2 cents: |
@sbulage - can you please verify this bug ? |
|
The issue here is that these workspaces are user-created resources, so there may be security implications with any automatic process that would attempt to whitelist such a namespace. cc: @macedogm @pjbgf, this may fall in your wheelhouse |
We should not add new namespaces to the PSAC exempt list already provided by Rancher, because such namespaces would be user controlled (outside of Rancher's trust boundaries). Additionally, doing such allow lists dynamically is risky. The recommendation is to fix Fleet's deployment to make sure that all components run with an unprivileged I haven't dig deep, but if I saw correctly, wouldn't be the case of fixing GitJob's deployment to match Fleet's and Fleet-Agent's deployment, respectively? fleet/charts/fleet/templates/deployment.yaml Lines 62 to 68 in a1dd929
fleet/charts/fleet-agent/templates/deployment.yaml Lines 29 to 35 in a1dd929
Note: @aiyengar2 thanks for pinging us on this. |
This is the I can't transfer a Rancher version: v2.8.0-alpha2 Steps:
Then |
@raulcabello the relationship between the GitRepo and Job is through the GitJob. When the GitRepo is modified, the related GitJob will also be changed:
That’s why the GitJob spawns a new Job. So it is indeed tied to Job created when a GitRepo is modified. That is the k8s Job that runs the fleet apply. |
Transferring the Fleet cluster is gated by a feature flag in Rancher, once you enable that in the UI (or by modifying the feature resource in the management cluster) you should be able to execute a transfer. |
After enabling the feature flag mentioned in this PR: rancher/dashboard#9730 (comment) #1845 (comment). It is working as expected. As we (me and @raulcabello ) can see the cluster can be moved from Cluster details: It is non-hardened cluster
Also, tried to create new No
We will try with hardened cluster and try to reproduce it. |
I think #1852 and rancher/gitjob#331 should fix this issue. However, we can't test it as we are still not able to reproduce the issue. @sbulage will try tomorrow to reproduce it in a hardened cluster |
It needs to be
Also:
|
@macedogm is it ok if we don't add the The following
Is this |
@raulcabello You can mount an |
@raulcabello agree with Paulo's suggestion above (in case its feasible). |
This comment was marked as resolved.
This comment was marked as resolved.
Ignore this comment as I see |
/backport v2.8.0 release/v0.9 |
@manno or @sbulage it doesn't look like rancher has picked up the new RC. Is this something your team can update so that I can run another round of testing? |
@slickwarren There was some issue with CI in rancher/charts which seems like it is fixed. It will be available once rancher/charts#3138 merged(hopefully in next hour or so. 🤞 ) |
It is available now |
All below test scenario performed on RKE2 cluster with and without hardening it. Environment Details:
QA TEST PLAN Scenarios
|
TEST RESULT RKE2 hardened cluster is created by following documentation. Scenarios
REPRO STEPS RKE2 Hardened cluster used
RKE2 Non-hardened cluster used
RKE2 Hardened cluster used
RKE2 Hardened cluster used
RKE2 Non-hardened cluster used
|
@slickwarren - please give it a try 😉 |
my tests through rancher using rc5 are working well, and I've closed the rancher-side issues. Not sure of fleet's process for closing these, but rancher-qa signs off on this 👍🏼 |
Thanks @slickwarren I will close this issue now. 👍 |
Rancher Server Setup
Information about the Cluster
User Information
Describe the bug
when changing a cluster's workspace, the git-repo resources for fleet aren't applying to the clusters.
To Reproduce
Result
resources from fleet's new workspace aren't deploying. The cluster count remains at 0
Expected Result
resources from the gitRepo in the user added workspace should apply to any clusters that are matched.
Screenshots
Additional context
adding a git-repo and switching the cluster back to fleet-default results in the expected behavior
tested by using the 'all clusters in workspace' setting and manually selecting a cluster in the workspace, but neither is working
possibly affected by rancher/rancher#43078 as this was found on the same setup
The text was updated successfully, but these errors were encountered: