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

Commit

Permalink
feat: Windows azure-cni with containerd
Browse files Browse the repository at this point in the history
  • Loading branch information
ksubrmnn committed Mar 24, 2020
1 parent 0313b9f commit 80f0ed3
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 10 deletions.
55 changes: 55 additions & 0 deletions examples/windows/kubernetes-hybrid.azure-containerd.json
@@ -0,0 +1,55 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.18",
"kubernetesConfig": {
"networkPlugin": "azure",
"containerRuntime": "containerd",
"windowsContainerdURL": "https://aksenginee2etestimages.blob.core.windows.net/test-content/windows-cri-containerd.zip",
"windowsSdnPluginURL": "https://aksenginee2etestimages.blob.core.windows.net/test-content/windows-cni-containerd.zip"
}
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_D2_v2"
},
"agentPoolProfiles": [
{
"name": "linuxpool1",
"count": 2,
"vmSize": "Standard_D2_v2",
"availabilityProfile": "AvailabilitySet"
},
{
"name": "windowspool2",
"count": 2,
"vmSize": "Standard_D2s_v3",
"availabilityProfile": "AvailabilitySet",
"osType": "Windows"
}
],
"windowsProfile": {
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$",
"enableAutomaticUpdates": false,
"sshEnabled": true
},
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}
1 change: 0 additions & 1 deletion parts/k8s/kuberneteswindowssetup.ps1
Expand Up @@ -360,7 +360,6 @@ try
} else {
Update-WinCNI -CNIPath $global:CNIPath
}
Get-HnsPsm1 -HNSModule $global:HNSModule
}

New-ExternalHnsNetwork
Expand Down
11 changes: 8 additions & 3 deletions parts/k8s/windowscontainerdfunc.ps1
Expand Up @@ -27,7 +27,11 @@ function Install-Containerd
{
Param(
[Parameter(Mandatory = $true)][string]
$ContainerdUrl
$ContainerdUrl,
[Parameter(Mandatory=$true)][string]
$CNIConfDir,
[Parameter(Mandatory=$true)][string]
$CNIBinDir,
)
$zipfile = [Io.path]::Combine($ENV:TEMP, "containerd.zip")
DownloadFileOverHttp -Url $ContainerdUrl -DestinationPath $zipfile
Expand All @@ -44,6 +48,7 @@ function Install-Containerd

# TODO: call containerd.exe dump config, then modify instead of starting with hardcoded
$configFile = [Io.Path]::Combine($global:ContainerdInstallLocation, "config.toml")

@"
version = 2
root = "C:\\ProgramData\\containerd\\root"
Expand Down Expand Up @@ -131,8 +136,8 @@ oom_score = 0
runtime_root = ""
privileged_without_host_devices = false
[plugins."io.containerd.grpc.v1.cri".cni]
bin_dir = "C:\\k\\cni"
conf_dir = "C:\\k\\cni\\config"
bin_dir = "$(($CNIBinDir).Replace("\","//"))"
conf_dir = "$(($CNIConfDir).Replace("\","//"))"
max_conf_num = 1
conf_template = ""
[plugins."io.containerd.grpc.v1.cri".registry]
Expand Down
3 changes: 0 additions & 3 deletions pkg/api/vlabs/validate.go
Expand Up @@ -1677,9 +1677,6 @@ func (a *Properties) validateContainerRuntime() error {

// TODO: These validations should be relaxed once ContainerD and CNI plugins are more readily available
if containerRuntime == Containerd && a.HasWindows() {
if a.OrchestratorProfile.KubernetesConfig.NetworkPlugin != "kubenet" {
return errors.Errorf("Windows only supports kubenet with containerd runtime. %q is not supported", a.OrchestratorProfile.KubernetesConfig.NetworkPlugin)
}
if a.OrchestratorProfile.KubernetesConfig.WindowsContainerdURL == "" {
return errors.Errorf("WindowsContainerdURL must be provided when using Windows with ContainerRuntime=containerd")
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/engine/templates_generated.go

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

0 comments on commit 80f0ed3

Please sign in to comment.