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

support sealer upgrade #2047

Merged
merged 1 commit into from
Mar 1, 2023
Merged

Conversation

wizardlyk
Copy link
Collaborator

@wizardlyk wizardlyk commented Feb 17, 2023

Describe what this PR does / why we need it

Support sealer upgrade

Does this pull request fix one issue?

Describe how you did it

Distribute materials by sealer & Upgrade cluster by plugin。

Describe how to verify it

sealer run ack-agility-registry.cn-shanghai.cr.aliyuncs.com/ecp_builder/ackdistro:v1-22-15-ack-upgrade-lyk-test --mode upgrade

Special notes for reviews

return fmt.Errorf("exit install process, wrong cluster image type: %s", extension.Type)
}

// set HostAlias
Copy link
Collaborator

Choose a reason for hiding this comment

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

no need set hostalias in upgrade

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.02 🎉

Comparison is base (e6117de) 18.33% compared to head (3fce87f) 18.36%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2047      +/-   ##
==========================================
+ Coverage   18.33%   18.36%   +0.02%     
==========================================
  Files          99      100       +1     
  Lines        9330     9313      -17     
==========================================
- Hits         1711     1710       -1     
+ Misses       7394     7378      -16     
  Partials      225      225              
Impacted Files Coverage Δ
pkg/cluster-runtime/hook.go 3.72% <ø> (ø)
pkg/cluster-runtime/upgrader.go 0.00% <0.00%> (ø)
pkg/imageengine/buildah/manifest.go 0.00% <0.00%> (ø)
build/kubefile/parser/app_handler.go 48.05% <0.00%> (+1.13%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

var exampleForUpgradeCmd = `
upgrade cluster:
sealer upgrade --masters 192.168.0.1 --nodes 192.168.0.2 -p Sealer123
sealer upgrade --masters 192.168.0.1-192.168.0.3 --nodes 192.168.0.4-192.168.0.6 -p Sealer123
Copy link
Member

Choose a reason for hiding this comment

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

could i ask why we set master ips ? do node scale after upgrade ?
i have a idea: sealer upgrade ${cluster-name} --image ${wanted-version}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

updated


var upgradeFlags *types.UpgradeFlags

var longUpgradeCmdDescription = `upgrade command is used to upgrade cluster.
Copy link
Member

Choose a reason for hiding this comment

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

if this cluster is not installed by sealer , can we upgrade it ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not supported currently

func NewUpgradeCmd() *cobra.Command {
upgradeCmd := &cobra.Command{
Use: "upgrade",
Short: "upgrade kubernetes version of cluster",
Copy link
Member

Choose a reason for hiding this comment

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

could we upgrade others are similar to k8s clusters in this implementation , like k3s, k0s

}

func upgradeWithClusterfile(clusterFile string, upgradeFlags *types.UpgradeFlags) error {
return nil
Copy link
Member

Choose a reason for hiding this comment

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

Confused about this func 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

removed

@wizardlyk wizardlyk force-pushed the feature/upgrade-cluster branch from 0ad9597 to ed021d9 Compare February 20, 2023 10:00

import (
"fmt"
"github.com/sealerio/sealer/cmd/sealer/cmd/types"
Copy link
Collaborator

Choose a reason for hiding this comment

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

go import group


var exampleForUpgradeCmd = `
upgrade cluster:
sealer upgrade --i upgrade:v1.22.15
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/--i/-i

sealer upgrade --i upgrade:v1.22.15
`

func NewUpgradeCmd() *cobra.Command {
Copy link
Collaborator

Choose a reason for hiding this comment

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

define upgrade cmd just like sealer run

@kakaZhou719 WDYT?

return err
}

imageMountInfo, err := imageMounter.Mount(clusterImageName)
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe should use new cluster image here

@@ -55,6 +55,8 @@ const (
PreScaleUpCluster Phase = "pre-scaleup"
//PostScaleUpCluster on master0
PostScaleUpCluster Phase = "post-scaleup"
//UpgradeHost on master0
UpgradeCluster Phase = "upgrade"
Copy link
Collaborator

Choose a reason for hiding this comment

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

mark

if err := i.runClusterHook(master0, UpgradeCluster); err != nil {
return err
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

should we exec cmds after upgrade the cluster

return err
}

if err := i.runClusterHook(master0, UpgradeCluster); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

pls check if role Or taints still exist after cluster upgrade. use config those info via clusterfile

@@ -115,6 +118,13 @@ func NewRunCmd() *cobra.Command {
app, extension, nil, imageEngine, runFlags.Mode)
}

if runFlags.Mode == common.ApplyModeUpgrade {
if extension.Type != v12.KubeInstaller {
return fmt.Errorf("exit upgrade process, wrong cluster image type: %s", extension.Type)
Copy link
Collaborator

Choose a reason for hiding this comment

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

wrong cluster image type/wrong image type

@wizardlyk wizardlyk force-pushed the feature/upgrade-cluster branch 2 times, most recently from 71d58a8 to c793fb7 Compare February 28, 2023 09:41
Copy link
Collaborator

@starnop starnop left a comment

Choose a reason for hiding this comment

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

LGTM

@wizardlyk wizardlyk force-pushed the feature/upgrade-cluster branch 2 times, most recently from af7df1f to da95433 Compare March 1, 2023 06:59
Signed-off-by: wb-lyk925458 <wb-lyk925458@alibaba-inc.com>
@wizardlyk wizardlyk force-pushed the feature/upgrade-cluster branch from da95433 to 3fce87f Compare March 1, 2023 07:16
Copy link
Collaborator

@starnop starnop left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants