Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

Commit

Permalink
fix: disable docker when containerD is specified (#4282)
Browse files Browse the repository at this point in the history
* Disable docker when containerd is enabled

* Set nssm DependOnService when depending service exists

* Add generated code

* Kubelet should depend on container runtime service

* Remove unnecessary check

* Resolve comments
  • Loading branch information
Qingchuan Hao authored Mar 24, 2021
1 parent c316d27 commit 41a716a
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
3 changes: 2 additions & 1 deletion parts/k8s/kuberneteswindowssetup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ try
New-ExternalHnsNetwork -IsDualStackEnabled $global:IsDualStackEnabled

Install-KubernetesServices `
-KubeDir $global:KubeDir
-KubeDir $global:KubeDir `
-ContainerRuntime $global:ContainerRuntime

Get-LogCollectionScripts

Expand Down
13 changes: 9 additions & 4 deletions parts/k8s/windowskubeletfunc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,12 @@ New-NSSMService {
$KubeletStartFile,
[string]
[Parameter(Mandatory = $true)]
$KubeProxyStartFile
$KubeProxyStartFile,
[Parameter(Mandatory = $false)][string]
$ContainerRuntime = "docker"
)

$kubeletDependOnServices = "docker"
$kubeletDependOnServices = $ContainerRuntime
if ($global:EnableCsiProxy) {
$kubeletDependOnServices += " csi-proxy"
}
Expand Down Expand Up @@ -373,7 +375,9 @@ function
Install-KubernetesServices {
param(
[Parameter(Mandatory = $true)][string]
$KubeDir
$KubeDir,
[Parameter(Mandatory = $false)][string]
$ContainerRuntime = "docker"
)

# TODO ksbrmnn fix callers to this function
Expand All @@ -383,5 +387,6 @@ Install-KubernetesServices {

New-NSSMService -KubeDir $KubeDir `
-KubeletStartFile $KubeletStartFile `
-KubeProxyStartFile $KubeProxyStartFile
-KubeProxyStartFile $KubeProxyStartFile `
-ContainerRuntime $ContainerRuntime
}
16 changes: 11 additions & 5 deletions pkg/engine/templates_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vhd/packer/configure-windows-vhd.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,10 @@ switch ($env:ProvisioningPhase) {
"2" {
Write-Log "Performing actions for provisioning phase 2 for container runtime '$containerRuntime'"
Set-WinRmServiceAutoStart
# TODO: make decision on if we want to install docker along with containerd (will need to update CSE too,)
Install-Docker
if ($containerRuntime -eq 'containerd') {
Install-ContainerD
} else {
Install-Docker
}
Update-Registry
Get-ContainerImages -containerRuntime $containerRuntime -WindowsServerVersion $windowsServerVersion
Expand Down

0 comments on commit 41a716a

Please sign in to comment.