Skip to content

Commit

Permalink
Merge pull request #2157 from chilianyi/init-harbor
Browse files Browse the repository at this point in the history
fix start docker error when init harbor
  • Loading branch information
ks-ci-bot authored Mar 14, 2024
2 parents 8b066d3 + 3cd588b commit 1b892c3
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions cmd/kk/pkg/bootstrap/registry/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,20 @@ func InstallHarbor(i *InstallRegistryModule) []task.Interface {
Retry: 2,
}

generateContainerdService := &task.RemoteTask{
Name: "GenerateContainerdService",
Desc: "Generate containerd service",
Hosts: i.Runtime.GetHostsByRole(common.K8s),
Prepare: &prepare.PrepareCollection{
&container.ContainerdExist{Not: true},
},
Action: &action.Template{
Template: docker_template.ContainerdService,
Dst: filepath.Join("/etc/systemd/system", docker_template.ContainerdService.Name()),
},
Parallel: true,
}

generateDockerService := &task.RemoteTask{
Name: "GenerateDockerService",
Desc: "Generate docker service",
Expand Down Expand Up @@ -202,6 +216,17 @@ func InstallHarbor(i *InstallRegistryModule) []task.Interface {
Parallel: true,
}

enableContainerdForDocker := &task.RemoteTask{
Name: "EnableContainerd",
Desc: "Enable containerd",
Hosts: i.Runtime.GetHostsByRole(common.K8s),
Prepare: &prepare.PrepareCollection{
&container.ContainerdExist{Not: true},
},
Action: new(container.EnableContainerdForDocker),
Parallel: true,
}

enableDocker := &task.RemoteTask{
Name: "EnableDocker",
Desc: "Enable docker",
Expand Down Expand Up @@ -269,8 +294,10 @@ func InstallHarbor(i *InstallRegistryModule) []task.Interface {

return []task.Interface{
syncBinaries,
generateContainerdService,
generateDockerService,
generateDockerConfig,
enableContainerdForDocker,
enableDocker,
installDockerCompose,
syncHarborPackage,
Expand Down

0 comments on commit 1b892c3

Please sign in to comment.