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

EXPERIMENTAL HA support #163

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

adrianludwin
Copy link
Contributor

This change lets the HNC manager be run both without webhooks and
in webhook-only mode. This allows us to create two Deployments - one for
the controller which actually makes changes, and another replicated
deployment for the webhooks, each of which independently sync their
in-memory forests and serve webhook requests.

Taking advantage of this new feature requires considerable changes to
the manifests, which I'm checking in as a separate commit.

Tested: change passes smoke test when deployed with HA manifests, but I
haven't done any careful validation that (for example) the HA deployment
isn't actually writing anything.

@adrianludwin adrianludwin added this to the release-v1.0 milestone Mar 25, 2022
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 25, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianludwin

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 25, 2022
@adrianludwin
Copy link
Contributor Author

/hold
/assign @rjbez17
/assign @erikgb

Here's my first stab at making HNC HA. It seems to actually work with a new manifest that I can generate with a followup PR, but let's review the code changes separately.

I've put a hold on this since I'd like both of you to sign off on it if possible. Thanks!

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 25, 2022
cmd/manager/main.go Show resolved Hide resolved
cmd/manager/main.go Show resolved Hide resolved
@rjbez17
Copy link
Contributor

rjbez17 commented Mar 25, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 25, 2022
This change lets the HNC manager be run both without webhooks and
in webhook-only mode. This allows us to create two Deployments - one for
the controller which actually makes changes, and another replicated
deployment for the webhooks, each of which independently sync their
in-memory forests and serve webhook requests.

Taking advantage of this new feature requires considerable changes to
the manifests, which I'm checking in as a separate commit.

Tested: change passes smoke test when deployed with HA manifests, but I
haven't done any careful validation that (for example) the HA deployment
isn't actually writing anything.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 27, 2022
@rjbez17
Copy link
Contributor

rjbez17 commented Mar 28, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2022
@adrianludwin
Copy link
Contributor Author

Erik's busy so submitting this now.

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 28, 2022
@@ -102,7 +102,7 @@ func HNCBeforeSuite() {
Expect(err).ToNot(HaveOccurred())

By("creating reconcilers")
err = setup.CreateReconcilers(k8sManager, forest.NewForest(), 100, true)
err = setup.CreateReconcilers(k8sManager, forest.NewForest(), 100, false, true)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could it make sense to create some constants to make the code more readable? What does false, true really mean here? ReadOnlyMode, UseFakeClient would read better IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, I just removed the hold. This is an easy followup.

@k8s-ci-robot k8s-ci-robot merged commit 55c0c2a into kubernetes-sigs:master Mar 28, 2022
@adrianludwin adrianludwin deleted the webhook-only branch March 28, 2022 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants