mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-26 01:22:51 +00:00
doc: add a notice when deploying k8s v1.24
Signed-off-by: 24sama <jacksama@foxmail.com>
This commit is contained in:
parent
16e918132c
commit
c3806f85a4
|
|
@ -106,6 +106,18 @@ func (i *InstallationConfirm) Execute(runtime connector.Runtime) error {
|
|||
fmt.Println("https://github.com/kubesphere/kubekey#requirements-and-recommendations")
|
||||
fmt.Println("")
|
||||
|
||||
if k8sVersion, err := versionutil.ParseGeneric(i.KubeConf.Cluster.Kubernetes.Version); err == nil {
|
||||
if k8sVersion.AtLeast(versionutil.MustParseSemantic("v1.24.0")) && i.KubeConf.Cluster.Kubernetes.ContainerManager == common.Docker {
|
||||
fmt.Println("[Notice]")
|
||||
fmt.Println("Incorrect runtime. Please specify a container runtime other than Docker to install Kubernetes v1.24 or later.")
|
||||
fmt.Println("For more information, please refer to:")
|
||||
fmt.Println("https://kubernetes.io/docs/setup/production-environment/container-runtimes/#container-runtimes")
|
||||
fmt.Println("https://kubernetes.io/blog/2022/02/17/dockershim-faq/")
|
||||
fmt.Println("")
|
||||
stopFlag = true
|
||||
}
|
||||
}
|
||||
|
||||
if stopFlag {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
|
@ -236,8 +248,22 @@ Warning:
|
|||
}
|
||||
fmt.Println()
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
if k8sVersion, err := versionutil.ParseGeneric(u.KubeConf.Cluster.Kubernetes.Version); err == nil {
|
||||
if cri, ok := u.PipelineCache.GetMustString(common.ClusterNodeCRIRuntimes); ok {
|
||||
k8sV124 := versionutil.MustParseSemantic("v1.24.0")
|
||||
if k8sVersion.AtLeast(k8sV124) && versionutil.MustParseSemantic(currentK8sVersion).LessThan(k8sV124) && strings.Contains(cri, "docker") {
|
||||
fmt.Println("[Notice]")
|
||||
fmt.Println("Kubernetes v1.24 and later no longer support dockershim and Docker.")
|
||||
fmt.Println("Please make sure you have completed the migration from Docker to other container runtimes that are compatible with the Kubernetes CRI.")
|
||||
fmt.Println("For more information, please refer to:")
|
||||
fmt.Println("https://kubernetes.io/docs/setup/production-environment/container-runtimes/#container-runtimes")
|
||||
fmt.Println("https://kubernetes.io/blog/2022/02/17/dockershim-faq/")
|
||||
fmt.Println("")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
confirmOK := false
|
||||
for !confirmOK {
|
||||
fmt.Printf("Continue upgrading cluster? [yes/no]: ")
|
||||
|
|
|
|||
|
|
@ -301,11 +301,16 @@ type GetKubernetesNodesStatus struct {
|
|||
}
|
||||
|
||||
func (g *GetKubernetesNodesStatus) Execute(runtime connector.Runtime) error {
|
||||
nodeStatus, err := runtime.GetRunner().SudoCmd("/usr/local/bin/kubectl get node", false)
|
||||
nodeStatus, err := runtime.GetRunner().SudoCmd("/usr/local/bin/kubectl get node -o wide", false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
g.PipelineCache.Set(common.ClusterNodeStatus, nodeStatus)
|
||||
|
||||
cri, err := runtime.GetRunner().SudoCmd("/usr/local/bin/kubectl get node -o jsonpath=\"{.items[*].status.nodeInfo.containerRuntimeVersion}\"", false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
g.PipelineCache.Set(common.ClusterNodeCRIRuntimes, cri)
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,13 +68,14 @@ const (
|
|||
|
||||
// global cache key
|
||||
// PreCheckModule
|
||||
NodePreCheck = "nodePreCheck"
|
||||
K8sVersion = "k8sVersion" // current k8s version
|
||||
KubeSphereVersion = "kubeSphereVersion" // current KubeSphere version
|
||||
ClusterNodeStatus = "clusterNodeStatus"
|
||||
DesiredK8sVersion = "desiredK8sVersion"
|
||||
PlanK8sVersion = "planK8sVersion"
|
||||
NodeK8sVersion = "NodeK8sVersion"
|
||||
NodePreCheck = "nodePreCheck"
|
||||
K8sVersion = "k8sVersion" // current k8s version
|
||||
KubeSphereVersion = "kubeSphereVersion" // current KubeSphere version
|
||||
ClusterNodeStatus = "clusterNodeStatus"
|
||||
ClusterNodeCRIRuntimes = "ClusterNodeCRIRuntimes"
|
||||
DesiredK8sVersion = "desiredK8sVersion"
|
||||
PlanK8sVersion = "planK8sVersion"
|
||||
NodeK8sVersion = "NodeK8sVersion"
|
||||
|
||||
// ETCDModule
|
||||
ETCDCluster = "etcdCluster"
|
||||
|
|
|
|||
Loading…
Reference in New Issue