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

Remove creation of cluster role in service account reconcile of connect cluster #3296

Merged
merged 3 commits into from
Sep 7, 2023

Conversation

ranatrk
Copy link
Contributor

@ranatrk ranatrk commented Sep 6, 2023

Update on #3086

What changed?
Use exisiting cluster role instead of creating a new one for the service account

Why was this change made?
To reduce number of resources created when an existing resource can be used

How was this change implemented?

  • Remove creation of cluster role
  • Use exisiting cluster role cluster-admin when creating the cluster role binding

How did you validate the change?

  • Explain how a reviewer can verify the change themselves
    Given a hub and spoke cluster, runnning the following command and checking for the created resources in the spoke cluster and secret with kubeconfig in the hub cluster
./gitops connect cluster --namespace default --service-account test-service-account  --cluster-role-binding test-service-account  --connect-context <SPOKE_CONTEXT_NAME> <SPOKE_CLUSTER_NAME>

note: won't work directly if the spoke cluster is a local kind cluster because the IP will be localhost

  • Unit tests -- what is covered, what cannot be covered; are
    there tests that fail without the change?

Release notes

Documentation Changes

Other follow ups

@ranatrk ranatrk added the enhancement New feature or request label Sep 6, 2023
@ranatrk ranatrk force-pushed the cluster-connect-rmv-clusterrole branch from 709c2b1 to 674dd8c Compare September 6, 2023 11:46
@ranatrk ranatrk changed the title Remove creation of cluster role in service account reconcile Remove creation of cluster role in service account reconcile of connect cluster Sep 6, 2023
@ranatrk ranatrk force-pushed the cluster-connect-rmv-clusterrole branch 2 times, most recently from d604f57 to 45904fd Compare September 6, 2023 14:59
@ranatrk ranatrk marked this pull request as ready for review September 6, 2023 15:06
@ranatrk ranatrk requested review from bigkevmcd and a team September 6, 2023 15:07
@bigkevmcd
Copy link
Contributor

I suspect at some point we'll end up introducing a way to customise the ClusterRoleBinding but we don't need it just now.

Thanks for this1

@ranatrk ranatrk force-pushed the cluster-connect-rmv-clusterrole branch from 49d0679 to 6fe0e8f Compare September 7, 2023 09:03
@ranatrk ranatrk merged commit 56b8f89 into main Sep 7, 2023
@ranatrk ranatrk deleted the cluster-connect-rmv-clusterrole branch September 7, 2023 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants