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

KUDO init --upgrade #1505

Merged
merged 20 commits into from
Jul 10, 2020
Merged

KUDO init --upgrade #1505

merged 20 commits into from
Jul 10, 2020

Conversation

ANeumann82
Copy link
Member

@ANeumann82 ANeumann82 commented May 11, 2020

What this PR does / why we need it:

  • Add kudo init --upgrade to upgrade an existing KUDO installation

  • Add kudo init --verify to check the state of an existing KUDO installation

  • kudo init without any flag will now complain if it is run on a cluster that has an existing KUDO installation (to prevent accidental upgrades)

  • Added migration framework - There are no actual migrations in there at the moment, but the upgrade path is there to add them when we need them

  • Added basic upgrade test in the e2e section - This might need some update if we're going to add more tests here, as we probably want a fresh kind-cluster for each test. They're probably going to be the most expensive tests we do

The new branch, because refactoring was extracted from the old #1467 Also fixes DCO issues from the old branch.

Fixes #891

Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
renamed validate option to verify

Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>

# Conflicts:
#	hack/run-e2e-tests.sh
#	pkg/kudoctl/cmd/init.go
#	pkg/kudoctl/kudoinit/manager/manager.go
#	pkg/kudoctl/kudoinit/options.go
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>

# Conflicts:
#	hack/run-e2e-tests.sh
#	pkg/kudoctl/cmd/init.go
#	pkg/kudoctl/cmd/init_integration_test.go
#	pkg/kudoctl/kudoinit/manager/manager.go
#	pkg/kudoctl/kudoinit/options.go
#	pkg/kudoctl/kudoinit/prereq/namespace_test.go
#	pkg/kudoctl/kudoinit/prereq/serviceaccount_test.go
#	pkg/kudoctl/kudoinit/prereq/webhook_test.go
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>

# Conflicts:
#	hack/run-e2e-tests.sh
#	pkg/kudoctl/cmd/init.go
#	pkg/kudoctl/cmd/init_test.go
#	pkg/kudoctl/kudoinit/prereq/webhook.go
#	pkg/kudoctl/kudoinit/setup/setup.go
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
# Conflicts:
#	pkg/kudoctl/kudoinit/prereq/webhook.go
@ANeumann82 ANeumann82 marked this pull request as ready for review June 10, 2020 09:37
Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

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

Looks good, I left a few questions/comments

hack/run-e2e-tests.sh Outdated Show resolved Hide resolved
kudo-upgrade-test.yaml Outdated Show resolved Hide resolved
pkg/kudoctl/cmd/init.go Outdated Show resolved Hide resolved
pkg/kudoctl/cmd/init.go Outdated Show resolved Hide resolved
pkg/kudoctl/cmd/init.go Outdated Show resolved Hide resolved
pkg/kudoctl/kudoinit/manager/manager.go Outdated Show resolved Hide resolved
pkg/kudoctl/kudoinit/prereq/webhook.go Show resolved Hide resolved
pkg/kudoctl/kudoinit/prereq/webhook.go Show resolved Hide resolved
pkg/kudoctl/kudoinit/setup/setup.go Outdated Show resolved Hide resolved
pkg/kudoctl/kudoinit/setup/setup.go Show resolved Hide resolved
@kensipe kensipe changed the base branch from master to main June 24, 2020 00:39
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

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

Aside from more user-friendly output for invalid parameters and some console output for happy checks, this lgtm. But since this is a bit involved, I'd like for another pair of 👀 before we merge it 😉

Copy link
Member

@nfnt nfnt left a comment

Choose a reason for hiding this comment

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

LGTM!

pkg/kudoctl/kudoinit/crd/crds.go Outdated Show resolved Hide resolved
pkg/kudoctl/kudoinit/manager/manager.go Outdated Show resolved Hide resolved
pkg/kudoctl/kudoinit/manager/manager.go Outdated Show resolved Hide resolved
Added more debug output

Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>
Signed-off-by: Andreas Neumann <aneumann@mesosphere.com>

# Conflicts:
#	pkg/kudoctl/kudoinit/crd/crds.go
#	pkg/kudoctl/kudoinit/manager/manager.go
}

// Upgrade an existing KUDO installation
func (i *Installer) Upgrade(client *kube.Client) error {
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

We could - We actually patch the CRDs, but for the Service and statefulset this would involve either manually creating the patch, or saving the old version in annotations, similar to TaskApply. Delete/Recreate is a lot easier. We may come back to patching later on though.

Copy link
Contributor

@zen-dog zen-dog left a comment

Choose a reason for hiding this comment

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

🚢

@ANeumann82
Copy link
Member Author

Holding the merge until after KUDO v0.15.0 is released

@ANeumann82 ANeumann82 merged commit 6cf0683 into main Jul 10, 2020
@ANeumann82 ANeumann82 deleted the an/upgrading branch July 10, 2020 11:48
@ANeumann82 ANeumann82 added release/breaking-change This PR contains breaking changes and is marked in the release notes release/highlight This PR is a highlight for the next release labels Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release/breaking-change This PR contains breaking changes and is marked in the release notes release/highlight This PR is a highlight for the next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve kudo init (for upgrade)
4 participants