Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

support run spoke agent outside of managed cluster #175

Merged

Conversation

zhujian7
Copy link
Member

@zhujian7 zhujian7 commented Nov 4, 2021

Signed-off-by: zhujian jiazhu@redhat.com

The registration-agent pod can be deployed on a separate cluster from the managed cluster, and the hub-kubeconfig-secret will be stored in the cluster where the registration-agent pod resides.

related issue: open-cluster-management-io/registration-operator#158


todo:

  • add description and script to deploy registration agent in Detached mode. (not contained in this PR)

cc @xuezhaojun @qiujian16

@@ -177,7 +193,8 @@ func (o *SpokeAgentOptions) RunSpokeAgent(ctx context.Context, controllerContext
clientCertForHubController := managedcluster.NewClientCertForHubController(
o.ClusterName, o.AgentName, o.ComponentNamespace, o.HubKubeconfigSecret,
kubeconfigData,
spokeKubeClient.CoreV1(),
// store the secret in the cluster where the agent pod runs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add some more comment here. Maybe also a TODO to revisit whether we should put secret for addon on agent cluster or spoke cluster.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added here.

Copy link
Member

@qiujian16 qiujian16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should save the secret on spoke cluster for now instead of agent cluster. It can at least ensure that addon can still work today.

@zhujian7 zhujian7 force-pushed the agent-outside branch 3 times, most recently from db0fb42 to 1ae7b80 Compare December 6, 2021 16:01
pkg/spoke/spokeagent.go Outdated Show resolved Hide resolved
Signed-off-by: zhujian <jiazhu@redhat.com>
Copy link
Member

@qiujian16 qiujian16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

leave @skeeey to review

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 7, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16, zhujian7

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Dec 7, 2021
@qiujian16
Copy link
Member

/assign @skeeey

pkg/spoke/spokeagent.go Outdated Show resolved Hide resolved
pkg/spoke/spokeagent.go Outdated Show resolved Hide resolved
Signed-off-by: zhujian <jiazhu@redhat.com>
@skeeey
Copy link
Member

skeeey commented Dec 8, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Dec 8, 2021
@openshift-merge-robot openshift-merge-robot merged commit e5722d5 into open-cluster-management-io:main Dec 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants