Skip to content

Commit

Permalink
include init config data in kubelet-config file
Browse files Browse the repository at this point in the history
  • Loading branch information
kpiyush17 committed Jan 15, 2025
1 parent b8bb163 commit 9975550
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
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

0 comments on commit 9975550

Please sign in to comment.