-
Notifications
You must be signed in to change notification settings - Fork 362
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
support sealer upgrade #2047
Conversation
pkg/cluster-runtime/upgrader.go
Outdated
return fmt.Errorf("exit install process, wrong cluster image type: %s", extension.Type) | ||
} | ||
|
||
// set HostAlias |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
Codecov ReportPatch coverage has no change and project coverage change:
📣 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
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. |
cmd/sealer/cmd/cluster/upgrade.go
Outdated
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 |
There was a problem hiding this comment.
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}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
cmd/sealer/cmd/cluster/upgrade.go
Outdated
|
||
var upgradeFlags *types.UpgradeFlags | ||
|
||
var longUpgradeCmdDescription = `upgrade command is used to upgrade cluster. |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not supported currently
cmd/sealer/cmd/cluster/upgrade.go
Outdated
func NewUpgradeCmd() *cobra.Command { | ||
upgradeCmd := &cobra.Command{ | ||
Use: "upgrade", | ||
Short: "upgrade kubernetes version of cluster", |
There was a problem hiding this comment.
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
cmd/sealer/cmd/cluster/upgrade.go
Outdated
} | ||
|
||
func upgradeWithClusterfile(clusterFile string, upgradeFlags *types.UpgradeFlags) error { | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confused about this func 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
0ad9597
to
ed021d9
Compare
cmd/sealer/cmd/cluster/upgrade.go
Outdated
|
||
import ( | ||
"fmt" | ||
"github.com/sealerio/sealer/cmd/sealer/cmd/types" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go import group
cmd/sealer/cmd/cluster/upgrade.go
Outdated
|
||
var exampleForUpgradeCmd = ` | ||
upgrade cluster: | ||
sealer upgrade --i upgrade:v1.22.15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/--i/-i
cmd/sealer/cmd/cluster/upgrade.go
Outdated
sealer upgrade --i upgrade:v1.22.15 | ||
` | ||
|
||
func NewUpgradeCmd() *cobra.Command { |
There was a problem hiding this comment.
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?
cmd/sealer/cmd/cluster/upgrade.go
Outdated
return err | ||
} | ||
|
||
imageMountInfo, err := imageMounter.Mount(clusterImageName) |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 | ||
} | ||
|
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
cmd/sealer/cmd/cluster/run.go
Outdated
@@ -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) |
There was a problem hiding this comment.
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
71d58a8
to
c793fb7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
af7df1f
to
da95433
Compare
Signed-off-by: wb-lyk925458 <wb-lyk925458@alibaba-inc.com>
da95433
to
3fce87f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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
Special notes for reviews