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

PE-5935: include init config data in kubelet-config file #167

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions stages/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func GetInitYipStagesV1Beta3(clusterCtx *domain.ClusterContext, kubeadmConfig do
getKubeadmPostInitStage(clusterCtx.RootPath),
getKubeadmInitUpgradeStage(clusterCtx),
getKubeadmInitCreateClusterConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.InitConfiguration, clusterCtx.RootPath),
getKubeadmInitCreateKubeletConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.KubeletConfiguration, clusterCtx.RootPath),
getKubeadmInitCreateKubeletConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.InitConfiguration, &kubeadmConfig.KubeletConfiguration, clusterCtx.RootPath),
getKubeadmInitReconfigureStage(clusterCtx),
}
}
Expand All @@ -68,7 +68,7 @@ func GetInitYipStagesV1Beta4(clusterCtx *domain.ClusterContext, kubeadmConfig do
getKubeadmPostInitStage(clusterCtx.RootPath),
getKubeadmInitUpgradeStage(clusterCtx),
getKubeadmInitCreateClusterConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.InitConfiguration, clusterCtx.RootPath),
getKubeadmInitCreateKubeletConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.KubeletConfiguration, clusterCtx.RootPath),
getKubeadmInitCreateKubeletConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.InitConfiguration, &kubeadmConfig.KubeletConfiguration, clusterCtx.RootPath),
getKubeadmInitReconfigureStage(clusterCtx),
}
}
Expand Down Expand Up @@ -133,8 +133,8 @@ func getKubeadmInitCreateClusterConfigStage(clusterCfgObj, initCfgObj runtime.Ob
return utils.GetFileStage("Generate Cluster Config File", filepath.Join(rootPath, configurationPath, "cluster-config.yaml"), getUpdatedInitClusterConfig(clusterCfgObj, initCfgObj))
}

func getKubeadmInitCreateKubeletConfigStage(clusterCfgObj, kubeletCfg runtime.Object, rootPath string) yip.Stage {
return utils.GetFileStage("Generate Kubelet Config File", filepath.Join(rootPath, configurationPath, "kubelet-config.yaml"), getUpdatedKubeletConfig(clusterCfgObj, kubeletCfg))
func getKubeadmInitCreateKubeletConfigStage(clusterCfgObj, initCfg, kubeletCfg runtime.Object, rootPath string) yip.Stage {
return utils.GetFileStage("Generate Kubelet Config File", filepath.Join(rootPath, configurationPath, "kubelet-config.yaml"), getUpdatedKubeletConfig(clusterCfgObj, initCfg, kubeletCfg))
}

func getKubeadmInitReconfigureStage(clusterCtx *domain.ClusterContext) yip.Stage {
Expand Down Expand Up @@ -229,8 +229,8 @@ func getUpdatedInitClusterConfig(clusterCfgObj, initCfgObj runtime.Object) strin
return printObj([]runtime.Object{clusterCfgObj, initCfgObj})
}

func getUpdatedKubeletConfig(clusterCfgObj, kubeletCfg runtime.Object) string {
return printObj([]runtime.Object{clusterCfgObj, kubeletCfg})
func getUpdatedKubeletConfig(clusterCfgObj, initCfg, kubeletCfg runtime.Object) string {
return printObj([]runtime.Object{clusterCfgObj, initCfg, kubeletCfg})
}

func printObj(objects []runtime.Object) string {
Expand Down
8 changes: 4 additions & 4 deletions stages/join.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func GetJoinYipStagesV1Beta3(clusterCtx *domain.ClusterContext, kubeadmConfig do
if clusterCtx.NodeRole != clusterplugin.RoleWorker {
joinStg = append(joinStg,
getKubeadmJoinCreateClusterConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.InitConfiguration, &kubeadmConfig.JoinConfiguration, clusterCtx.RootPath),
getKubeadmJoinCreateKubeletConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.KubeletConfiguration, clusterCtx.RootPath))
getKubeadmJoinCreateKubeletConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.InitConfiguration, &kubeadmConfig.KubeletConfiguration, clusterCtx.RootPath))
}

return append(joinStg, getKubeadmJoinReconfigureStage(clusterCtx))
Expand All @@ -56,7 +56,7 @@ func GetJoinYipStagesV1Beta4(clusterCtx *domain.ClusterContext, kubeadmConfig do
if clusterCtx.NodeRole != clusterplugin.RoleWorker {
joinStg = append(joinStg,
getKubeadmJoinCreateClusterConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.InitConfiguration, &kubeadmConfig.JoinConfiguration, clusterCtx.RootPath),
getKubeadmJoinCreateKubeletConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.KubeletConfiguration, clusterCtx.RootPath))
getKubeadmJoinCreateKubeletConfigStage(&kubeadmConfig.ClusterConfiguration, &kubeadmConfig.InitConfiguration, &kubeadmConfig.KubeletConfiguration, clusterCtx.RootPath))
}

return append(joinStg, getKubeadmJoinReconfigureStage(clusterCtx))
Expand Down Expand Up @@ -196,8 +196,8 @@ func getKubeadmJoinCreateClusterConfigStage(clusterCfgObj, initCfgObj, joinCfgOb
return utils.GetFileStage("Generate Cluster Config File", filepath.Join(rootPath, configurationPath, "cluster-config.yaml"), getUpdatedJoinClusterConfig(clusterCfgObj, initCfgObj, joinCfgObj))
}

func getKubeadmJoinCreateKubeletConfigStage(clusterCfgObj, kubeletCfg runtime.Object, rootPath string) yip.Stage {
return utils.GetFileStage("Generate Kubelet Config File", filepath.Join(rootPath, configurationPath, "kubelet-config.yaml"), getUpdatedKubeletConfig(clusterCfgObj, kubeletCfg))
func getKubeadmJoinCreateKubeletConfigStage(clusterCfgObj, initCfg, kubeletCfg runtime.Object, rootPath string) yip.Stage {
return utils.GetFileStage("Generate Kubelet Config File", filepath.Join(rootPath, configurationPath, "kubelet-config.yaml"), getUpdatedKubeletConfig(clusterCfgObj, initCfg, kubeletCfg))
}

func getKubeadmJoinReconfigureStage(clusterCtx *domain.ClusterContext) yip.Stage {
Expand Down
Loading