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

Add support for Windows OVS Containerisation in Install-OVS script #5055

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 9 additions & 0 deletions docs/windows.md
NamanAg30 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The following components should be configured and run on the Windows Node.

antrea-agent and kube-proxy run as processes on host and are managed by
management Pods. It is recommended to run OVS daemons as Windows services.
We also support running OVS processes inside container.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you adjust lines to wrap at column 80?

If you don't want to run antrea-agent and kube-proxy from the management Pods
Antrea also provides scripts which help install and run these two components
directly without Pod, please see [Manually run kube-proxy and antrea-agent on Windows worker Nodes](#Manually-run-kube-proxy-and-antrea-agent-on-Windows-worker-Nodes)
Expand Down Expand Up @@ -302,6 +303,14 @@ get-service ovsdb-server
get-service ovs-vswitchd
```

If you want to containerise OVS for containerd runtime, OVS userspace processes is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"containerize" is used more?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is -> are

not required on host and hence you can use the `InstallUserspace` parameter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"not required" -> "not run"?

on the host

as false.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

set the InstallUserspace parameter to false


```powershell
.\Install-OVS.ps1 -InstallUserspace $false
```

#### 2. Disable Windows Firewall

```powershell
Expand Down
17 changes: 12 additions & 5 deletions hack/windows/Install-OVS.ps1
NamanAg30 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,25 @@
.PARAMETER ImportCertificate
Specifies if a certificate file is needed for OVS package. If true, certificate
will be retrieved from OVSExt.sys and a package.cer file will be generated.

.PARAMETER InstallUserspace
Specifies whether OVS userspace processes are included in the installation. If false, these processes will not
be installed as Windows service on the host.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a Windows service

#>
Param(
[parameter(Mandatory = $false)] [string] $DownloadDir,
[parameter(Mandatory = $false)] [string] $DownloadURL,
[parameter(Mandatory = $false)] [string] $OVSInstallDir = "C:\openvswitch",
[parameter(Mandatory = $false)] [bool] $CheckFileHash = $true,
[parameter(Mandatory = $false)] [string] $LocalFile,
[parameter(Mandatory = $false)] [bool] $ImportCertificate = $true
[parameter(Mandatory = $false)] [bool] $ImportCertificate = $true,
[parameter(Mandatory = $false)] [bool] $InstallUserspace = $true
)

$ErrorActionPreference = "Stop"
$OVSDownloadURL = "https://downloads.antrea.io/ovs/ovs-2.16.7-antrea.0-win64.zip"
$OVSDownloadURL = "https://downloads.antrea.io/ovs/ovs-3.0.5-antrea.0-win64.zip"
# Use a SHA256 hash to ensure that the downloaded archive is correct.
$OVSPublishedHash = '17d23ca0fbf84e1eac9a392f67ee4315edffd1d5233a729655e04e1332a9f565'
$OVSPublishedHash = 'fd27703ef7314b26b98cffb7aea27d569530ebd3ac3c98daa981ca2654373032'
$WorkDir = [System.IO.Path]::GetDirectoryName($myInvocation.MyCommand.Definition)
$OVSDownloadDir = $WorkDir
$PowerShellModuleBase = "C:\Windows\System32\WindowsPowerShell\v1.0\Modules"
Expand Down Expand Up @@ -259,8 +264,10 @@ DownloadOVS

InstallOVS

InstallDependency
if ($InstallUserspace -eq $true) {
InstallDependency

ConfigOVS
ConfigOVS
}

Log "OVS Installation Complete!"
7 changes: 6 additions & 1 deletion hack/windows/Prepare-Node.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Install OVS
.PARAMETER NodeIP
The node ip used by kubelet
.PARAMETER InstallOVSUserspace
Specifies whether OVS userspace processes is included in the installation. If false, these processes will not
be installed as Windows service on the host.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

.EXAMPLE
PS> .\Prepare-Node.ps1 -KubernetesVersion v1.18.0 -InstallOVS -NodeIP 192.168.1.10
Expand All @@ -32,6 +36,7 @@ Param(
[parameter(Mandatory = $true, HelpMessage="Node IP")] [string] $NodeIP,
[parameter(Mandatory = $false)] [switch] $InstallOVS = $false,
[parameter(Mandatory = $false, HelpMessage="Kubernetes download")] [string] $KubernetesURL="dl.k8s.io"
[parameter(Mandatory = $false)] [bool] $InstallOVSUserspace = $true
)
$ErrorActionPreference = 'Stop'

Expand Down Expand Up @@ -127,5 +132,5 @@ New-NetFirewallRule -Name kubelet -DisplayName 'kubelet' -Enabled True -Directio

if ($InstallOVS) {
Write-Host "Installing OVS"
& .\Install-OVS.ps1
& .\Install-OVS.ps1 -InstallUserspace $InstallOVSUserspace
}