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

Add HubApiServerHostAlias for registration-agent and work-agent #258

Conversation

promacanthus
Copy link
Member

Update dependency of open-cluster-management.io/api , and fix a typo.

Add hostAliases rendering logic into registration-agent and work-agent's YAML template files.

Signed-off-by: Bowen Zhu Promacanthus@gmail.com

@openshift-ci openshift-ci bot requested review from deads2k and qiujian16 June 30, 2022 13:30
@qiujian16
Copy link
Member

please add a separate integration test or e2e test for this. Note the klusterlet status part need to be updated, otherwise it will break

@promacanthus
Copy link
Member Author

please add a separate integration test or e2e test for this. Note the klusterlet status part need to be updated, otherwise it will break

I will add integration tests and e2e tests , and update the status part of the klusterlet.

)
}

if klusterlet.Spec.HubApiServerHostAlias != nil {
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 the major problem is klusterlet will use hubKubeConfig to talk to hub with sar request to check connectivity.
When hostAliase is set, klusterlet should also use this hostAliase to talk to hub.

Copy link
Member Author

@promacanthus promacanthus Jul 5, 2022

Choose a reason for hiding this comment

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

I am a little bit confused.

When i set the hostAliase into klusterlet deployment, the klusterlet_ssar_controller will use this hostAliase to talk to hub. And the status of klusterlet is updated as shown below. I think this is working.

status:
  conditions:
  - lastTransitionTime: "2022-07-03T07:42:27Z"
    message: Hub kubeconfig secret open-cluster-management-agent/hub-kubeconfig-secret
      to apiserver https://xxx.yyy.zzz is working
    observedGeneration: 14
    reason: HubConnectionFunctional
    status: "False"
    type: HubConnectionDegraded

Copy link
Member

Choose a reason for hiding this comment

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

hrm, so it needs user to manually update klusterlet deployment. I was thinking you could set a custom dialer in rest.Config for this certain controller. So it will setup connection via IP.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed with you,set a custom dialer in rest.Config is better than update deployment manually.

Copy link
Member

Choose a reason for hiding this comment

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

do you want do it as a followup or in this one? Could be a follow up I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed with you. And I will revet this commit 1b2b428.

What should I do next?

Copy link
Member

Choose a reason for hiding this comment

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

please add a todo in sar controller for hostaliase update, and then I think it is good to merge!

Copy link
Member Author

Choose a reason for hiding this comment

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

I have left a todo in the latest commit.

@@ -582,6 +587,39 @@ var _ = ginkgo.Describe("Klusterlet", func() {
return nil
}, eventuallyTimeout, eventuallyInterval).ShouldNot(gomega.HaveOccurred())
})

ginkgo.It("Deployment should be added hostAliases when add hostAlias into klusterlet", func() {
_, err := operatorClient.OperatorV1().Klusterlets().Create(context.Background(), klusterlet, metav1.CreateOptions{})
Copy link
Member

Choose a reason for hiding this comment

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

nit: shouldn't hostAliase configuration set here? it would not impact other cases

Copy link
Member Author

Choose a reason for hiding this comment

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

I will set hostAlias configuration here only for this case.

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

just one nit.

@openshift-ci openshift-ci bot added the approved label Jul 6, 2022
@qiujian16
Copy link
Member

@promacanthus looks like some commits do not signoff. would you squash the commit and signoff again?

Signed-off-by: Bowen Zhu <Promacanthus@gmail.com>

Add HubApiServerHostAlias for registration-agent and work-agent
@promacanthus promacanthus force-pushed the feat/support_host_alias_for_agents branch from d1739bf to 92a2b21 Compare July 7, 2022 06:11
@promacanthus
Copy link
Member Author

@promacanthus looks like some commits do not signoff. would you squash the commit and signoff again?

I have squashed the commits and signoff again.

@promacanthus
Copy link
Member Author

@qiujian16 Please review again, when you have time.

@qiujian16
Copy link
Member

/approve
/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jul 11, 2022

[APPROVALNOTIFIER] This PR is APPROVED

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

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 merged commit 79d280a into open-cluster-management-io:main Jul 11, 2022
@promacanthus promacanthus deleted the feat/support_host_alias_for_agents branch July 11, 2022 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants