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

[Windows] Update Windows instructions #2456

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

lzhecheng
Copy link
Contributor

@lzhecheng lzhecheng commented Jul 23, 2021

* Mkdir kube-proxy log path before installation as a Service
  Otherwise kube-proxy Service may not work well.
* Updated asset links from kubernetes-sigs/sig-windows-tools repo
* Retry for Get-WebFileIfNotExist
* Have cleaner environment for docker (stop, remove docker.pid, start)
* Start Antrea Windows agent in Daemonset way for Windows NetworkPolicy test
  Currently the script way leads to many flaky failures
* Skip SCTP test for Windows NetworkPolicy tests since it requires privilege mode
  which is not available on Windows Node
* Force date sync after Windows VM is reverted to a snapshot

Signed-off-by: Zhecheng Li lzhecheng@vmware.com

@lzhecheng lzhecheng requested review from wenyingd and tnqn July 23, 2021 09:41
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2021

Codecov Report

Merging #2456 (bd24d29) into main (9adf9c9) will decrease coverage by 17.61%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             main    #2456       +/-   ##
===========================================
- Coverage   59.79%   42.18%   -17.62%     
===========================================
  Files         284      148      -136     
  Lines       22171    18222     -3949     
===========================================
- Hits        13258     7687     -5571     
- Misses       7490     9840     +2350     
+ Partials     1423      695      -728     
Flag Coverage Δ
kind-e2e-tests ?
unit-tests 42.18% <ø> (+0.16%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/agent/agent_linux.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/ovs/openflow/default.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/util/runtime/runtime.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/agent/config/node_config.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/agent/cniserver/pod_configuration_linux.go 0.00% <0.00%> (-100.00%) ⬇️
pkg/apis/controlplane/v1beta1/register.go 0.00% <0.00%> (-92.86%) ⬇️
pkg/ovs/openflow/logs.go 9.52% <0.00%> (-90.48%) ⬇️
pkg/apis/controlplane/register.go 0.00% <0.00%> (-90.00%) ⬇️
pkg/agent/nodeportlocal/k8s/annotations.go 0.00% <0.00%> (-83.88%) ⬇️
pkg/agent/client.go 0.00% <0.00%> (-77.42%) ⬇️
... and 231 more

@lzhecheng lzhecheng changed the title [Windows] Mkdir kube-proxy log path before installation as a Service [Windows] Update Windows instructions Jul 23, 2021
docs/windows.md Outdated Show resolved Hide resolved
@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

1 similar comment
@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

docs/windows.md Outdated
@@ -130,7 +132,7 @@ kube-proxy version.

```bash
# Example:
curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/kube-proxy.yml | sed 's/VERSION/v1.18.0/g' > kube-proxy.yml
curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/download/v0.1.5/kube-proxy.yml | sed 's/VERSION/v1.18.0/g' > kube-proxy.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to use a varible for the version? You can use v0.1.5 as a default value if it is the version we wanted to pin.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

hack/windows/Helper.psm1 Outdated Show resolved Hide resolved
@@ -4,7 +4,7 @@

.DESCRIPTION
This script is only used for test to assist with joining a Windows node to a cluster.
For production environment please follow the antrea windows installation guide and use kubernetes official script: https://github.com/kubernetes-sigs/sig-windows-tools/blob/master/kubeadm/scripts/PrepareNode.ps1
For production environment please follow the antrea windows installation guide and use kubernetes official script: https://github.com/kubernetes-sigs/sig-windows-tools/releases/download/v0.1.5/PrepareNode.ps1
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the script description so I think we can keep it as it is? I have used variables for others.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe just point to the release page, without specifying a version, or we will probably forget to update it...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

antoninbas
antoninbas previously approved these changes Jul 26, 2021
@@ -4,7 +4,7 @@

.DESCRIPTION
This script is only used for test to assist with joining a Windows node to a cluster.
For production environment please follow the antrea windows installation guide and use kubernetes official script: https://github.com/kubernetes-sigs/sig-windows-tools/blob/master/kubeadm/scripts/PrepareNode.ps1
For production environment please follow the antrea windows installation guide and use kubernetes official script: https://github.com/kubernetes-sigs/sig-windows-tools/releases/download/v0.1.5/PrepareNode.ps1
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe just point to the release page, without specifying a version, or we will probably forget to update it...

New-DirectoryIfNotExist "${AntreaHome}/logs"
New-DirectoryIfNotExist "${KubeProxyLogPath}"
nssm install kube-proxy "${KubernetesHome}/kube-proxy.exe" "--proxy-mode=userspace --kubeconfig=${KubeProxyKubeconfigPath} --log-dir=${KubeProxyLogPath} --logtostderr=false --alsologtostderr"
nssm install antrea-agent "${AntreaHome}/bin/antrea-agent.exe" "--config=${AntreaHome}/etc/antrea-agent.conf --logtostderr=false --log_dir=${AntreaHome}/logs --alsologtostderr --log_file_max_size=100 --log_file_max_num=4"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if Antrea logs should go to c:/var/log/antrea instead, as this would be a less "unexpected" location and it may be easier for users to find the logs there. But there is no need to address this in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I have created an issue to track this: #2472

@lzhecheng
Copy link
Contributor Author

/skip-all

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

4 similar comments
@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

1 similar comment
@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@@ -232,7 +232,7 @@ function deliver_antrea_windows {
chmod -R g-w build/images/ovs
chmod -R g-w build/images/base
DOCKER_REGISTRY="${DOCKER_REGISTRY}" ./hack/build-antrea-ubuntu-all.sh --pull
if [[ "$TESTCASE" =~ "networkpolicy" ]]; then
if [[ "$TESTCASE" =~ "networkpolicy-no" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

What is networkpolicy-no for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used to let Antrea Windows agent start as Daemonset for Windows NetworkPolicy test.

@@ -280,13 +282,15 @@ function deliver_antrea_windows {
done

# Use a script to run antrea agent in windows Network Policy cases
if [ "$TESTCASE" == "windows-networkpolicy" ]; then
if [ "$TESTCASE" == "windows-networkpolicy-temp-disabled" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

what do you mean about "windows-networkpolicy-temp-disabled"? what about "windows-networkpolicy-process"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@@ -495,13 +499,13 @@ function run_conformance_windows {
export PATH=$GOROOT/bin:$PATH
export KUBECONFIG=$KUBECONFIG_PATH

if [[ "$TESTCASE" == "windows-conformance" ]]; then
if [[ "$TESTCASE" =~ "windows-networkpolicy-temp-disabled" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

You use "not" in the "if" statement, but says user wanna process in the content, is it as your design?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think =~ means equal or include while != is no equal.

@lzhecheng
Copy link
Contributor Author

/skip-e2e /skip-conformance /skip-networkpolicy /test-windows-conformance /test-windows-networkpolicy

docs/windows.md Outdated
@@ -250,7 +253,8 @@ container.

```powershell
# Example:
curl.exe -LO https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/PrepareNode.ps1
$SigWindowsToolsVersion="v0.1.5"
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

docs/windows.md Outdated
@@ -130,7 +132,8 @@ kube-proxy version.

```bash
# Example:
curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/kube-proxy.yml | sed 's/VERSION/v1.18.0/g' > kube-proxy.yml
$SigWindowsToolsVersion="v0.1.5"
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is a guide document, I think you could have one generic introduction about the example version of variable $SigWindowsToolsVersion and $kubernetesVersion we used in the examples, then we can use the variable directly anywhere. And we can explain sig-windows v0.1.5 is tested if you feel necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used v0.1.5 for sig-windows-tool version. We think we can update kubernetes version in another PR after we verified a newer one than v1.18.0.

wenyingd
wenyingd previously approved these changes Jul 29, 2021
Copy link
Contributor

@wenyingd wenyingd left a comment

Choose a reason for hiding this comment

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

LGTM

@lzhecheng
Copy link
Contributor Author

@antoninbas @tnqn PTAL. This PR wil unblock other PRs' Windows tests.

@lzhecheng
Copy link
Contributor Author

/skip-e2e /skip-conformance /skip-networkpolicy /test-windows-conformance /test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

How does this PR achieve "Start Antrea Windows agent in Daemonset way for Windows NetworkPolicy test"? Is it because we set "TESTCASE" to "windows-networkpolicy" so it won't mach "windows-networkpolicy-process"? And do we know why "Currently the script way leads to many flaky failures"? why we used different modes for conformance and networkpolicy tests in the beginning?

docs/windows.md Outdated
@@ -58,6 +58,8 @@ and daemons are pre-installed on the Windows Nodes in the demo.
Antrea on Windows, Antrea provides a test-signed OVS package for you.
See details in [Join Windows worker Nodes](#Join-Windows-worker-nodes)
section.
* Some manifests are from [sig-windows-tool](https://github.com/kubernetes-sigs/sig-windows-tools) repo. Release version
Copy link
Member

Choose a reason for hiding this comment

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

could you wrap it like other lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@@ -4,7 +4,8 @@

.DESCRIPTION
This script is only used for test to assist with joining a Windows node to a cluster.
For production environment please follow the antrea windows installation guide and use kubernetes official script: https://github.com/kubernetes-sigs/sig-windows-tools/blob/master/kubeadm/scripts/PrepareNode.ps1
For production environment please follow the antrea windows installation guide and use kubernetes official PrepareNode.ps1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
For production environment please follow the antrea windows installation guide and use kubernetes official PrepareNode.ps1
For production environment please follow the antrea windows installation guide and use Kubernetes official PrepareNode.ps1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@@ -495,13 +499,13 @@ function run_conformance_windows {
export PATH=$GOROOT/bin:$PATH
export KUBECONFIG=$KUBECONFIG_PATH

if [[ "$TESTCASE" == "windows-conformance" ]]; then
if [[ "$TESTCASE" =~ "windows-networkpolicy-process" ]]; then
Copy link
Member

Choose a reason for hiding this comment

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

I notice some code use "==" while some use "=~". We don't need regular expression, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need it.
e.g.

if [[ ${TESTCASE} =~ "windows" ]]; then

We use =~ here because windows testcases (windows-e2e, windows-conformance, windows-networpolicy) have windows in variable ${TESTCASE}

Copy link
Member

Choose a reason for hiding this comment

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

I mean even when it matchs "windows-networkpolicy-process", it sometimes uses "==" and sometimes uses "=~". I think the script should be accurate to express its intention, like what you explained here. We should use "==" when we want exact match.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used == for all "windows-networkpolicy-process".

@lzhecheng
Copy link
Contributor Author

How does this PR achieve "Start Antrea Windows agent in Daemonset way for Windows NetworkPolicy test"? Is it because we set "TESTCASE" to "windows-networkpolicy" so it won't mach "windows-networkpolicy-process"? And do we know why "Currently the script way leads to many flaky failures"? why we used different modes for conformance and networkpolicy tests in the beginning?

Yes.
No. I will investigate. #2500
So we can test both deployments (script and daemonset).

@lzhecheng
Copy link
Contributor Author

/skip-e2e /skip-conformance /skip-networkpolicy

* Mkdir kube-proxy log path before installation as a Service
  Otherwise kube-proxy Service may not work well.
* Updated asset links from kubernetes-sigs/sig-windows-tools repo
* Retry for Get-WebFileIfNotExist
* Have cleaner environment for docker (stop, remove docker.pid, start)
* Start Antrea Windows agent in Daemonset way for Windows NetworkPolicy test
  Currently the script way leads to many flaky failures
* Skip SCTP test for Windows NetworkPolicy tests since it requires privilege mode
  which is not available on Windows Node
* Force date sync after Windows VM is reverted to a snapshot

Signed-off-by: Zhecheng Li <lzhecheng@vmware.com>
Copy link
Member

@tnqn tnqn left a comment

Choose a reason for hiding this comment

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

LGTM

@lzhecheng
Copy link
Contributor Author

/test-windows-conformance /test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

/skip-e2e /skip-conformance /skip-networkpolicy /test-windows-networkpolicy

@lzhecheng
Copy link
Contributor Author

@tnqn Please help merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants