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] Support run antrea-agent directly from scripts #1013

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

ruicao93
Copy link
Contributor

@ruicao93 ruicao93 commented Jul 31, 2020

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:

  • Adds scripts help to install and run antrea-agent and kube-proxy.
  • Supports read kubeconfig from file for antrea-agent apiserver,
    which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao rcao@vmware.com

@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

These commands can only be run by members of the vmware-tanzu organization.

ruicao93 added a commit to ruicao93/antrea that referenced this pull request Jul 31, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@ruicao93
Copy link
Contributor Author

/test-all

ruicao93 added a commit to ruicao93/antrea that referenced this pull request Jul 31, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
ruicao93 added a commit to ruicao93/antrea that referenced this pull request Jul 31, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@ruicao93
Copy link
Contributor Author

/test-all

ruicao93 added a commit to ruicao93/antrea that referenced this pull request Jul 31, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@ruicao93 ruicao93 requested a review from wenyingd July 31, 2020 09:13
ruicao93 added a commit to ruicao93/antrea that referenced this pull request Jul 31, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 3, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 3, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 3, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@ruicao93
Copy link
Contributor Author

ruicao93 commented Aug 4, 2020

/test-all

@ruicao93 ruicao93 added this to the Antrea v0.9.0 release milestone Aug 4, 2020
ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 5, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@ruicao93
Copy link
Contributor Author

ruicao93 commented Aug 6, 2020

/test-all

docs/windows.md Outdated Show resolved Hide resolved
docs/windows.md Outdated Show resolved Hide resolved
hack/windows/Helper.psm1 Show resolved Hide resolved
hack/windows/Helper.psm1 Outdated Show resolved Hide resolved
hack/windows/Helper.psm1 Outdated Show resolved Hide resolved
hack/windows/Helper.psm1 Outdated Show resolved Hide resolved
ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 6, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

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

Is there any plan to validate this script in CI?

docs/windows.md Outdated Show resolved Hide resolved
docs/windows.md Outdated Show resolved Hide resolved
docs/windows.md Outdated Show resolved Hide resolved
docs/windows.md Outdated Show resolved Hide resolved
docs/windows.md Outdated Show resolved Hide resolved
hack/windows/Helper.psm1 Outdated Show resolved Hide resolved
```
mkdir c:\k\antrea
cd c:\k\antrea
curl.exe -LO https://raw.githubusercontent.com/vmware-tanzu/antrea/master/hack/windows/Start.ps1
Copy link
Contributor

Choose a reason for hiding this comment

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

do you think we should have Start.ps1 in the release assets and that it should take care of pulling / starting the correct version of Antrea?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I think it's a good advice.

I can update upload_release_assets.yaml in next patch to add following files in assets:

  • Start.ps1
  • antrea-agent-windows-x86_64.exe
  • antrea-cni-windows-x86_64.exe

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. You can look at it in a follow-up patch.

hack/windows/Start.ps1 Outdated Show resolved Hide resolved
hack/windows/Start.ps1 Show resolved Hide resolved
ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 7, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@ruicao93
Copy link
Contributor Author

ruicao93 commented Aug 7, 2020

Is there any plan to validate this script in CI?

Yes @antoninbas , I'm working with Zhecheng to add CI for the scripts.

ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 8, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Support read kubeconfig from file for antrea-agent apiserver.
  Which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@reachjainrahul
Copy link
Contributor

@jianjuns @antoninbas Do we need to support this workflow? If I understand, it requires access to worker node. The script will download and install Antrea and run it as process on the node, which is different than running Antrea as POD.
He need to understand its implication on upgrade, support bundle, log collection etc.

Lets have a offline meeting to discuss this. ?

@ruicao93
Copy link
Contributor Author

ruicao93 commented Aug 10, 2020

@jianjuns @antoninbas Do we need to support this workflow? If I understand, it requires access to worker node. The script will download and install Antrea and run it as process on the node, which is different than running Antrea as POD.
He need to understand its implication on upgrade, support bundle, log collection etc.

Lets have a offline meeting to discuss this. ?

Currently suportbundle/log collection is not supported if antrea-agent is run as process directly. And we also don't provide a specific script for upgrade.

In my opinion, in consideration of the different requirements among different platforms, the scripts we provide is more like a template to guide how to run antrea-agent as process if antrea-agent Pod is not allowed. It's hard to cover all functions as we support for Pod management. The platforms which integrated with Antrea may need custmize thire own scripts/solution based on the scripts/functions we provide.

Looing forward tto hear he ideas from Jianjun and Antonin.

Copy link
Contributor

@jianjuns jianjuns left a comment

Choose a reason for hiding this comment

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

In commit message:

Support read kubeconfig from file for antrea-agent apiserver.
Which is needed when antrea-agent is running as process.
Support -> Supports
Which -> which

@jianjuns
Copy link
Contributor

I think process mode is not the recommended way.
However, I thought we need this mode for AKS Engine, then do we need to support upgrade? Even no upgrade, it will still be good to have support bundle for AKS Engine.
@reachjainrahul @ruicao93

@reachjainrahul
Copy link
Contributor

I think process mode is not the recommended way.

However, I thought we need this mode for AKS Engine, then do we need to support upgrade? Even no upgrade, it will still be good to have support bundle for AKS Engine.

@reachjainrahul @ruicao93

Actually AKS engine folks asked if we can remove wins dependency as they don't want to add lot of components on windows host. However, if wins dependency is must and adding a script is the only alternative, than I would prefer to reach out to them again and mention why wins is needed. We would prefer not to add antrea as a process.

@jianjuns
Copy link
Contributor

I think process mode is not the recommended way.
However, I thought we need this mode for AKS Engine, then do we need to support upgrade? Even no upgrade, it will still be good to have support bundle for AKS Engine.
@reachjainrahul @ruicao93

Actually AKS engine folks asked if we can remove wins dependency as they don't want to add lot of components on windows host. However, if wins dependency is must and adding a script is the only alternative, than I would prefer to reach out to them again and mention why wins is needed. We would prefer not to add antrea as a process.

If that is the case, please talk to AKS guys again. Definitely I want not to support process mode. But on the other hand, I feel this PR has nothing wrong. We just document a manual way to run Antrea agent. Does not mean we commit anything.

@antoninbas
Copy link
Contributor

I agree with Jianjun. Let's hold off on adding additional support for this process mode though (e.g. support bundle). Maybe @ruicao93 can emphasize the limitations of this mode in the doc as well.

ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 11, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Supports read kubeconfig from file for antrea-agent apiserver,
  which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@antrea-bot
Copy link
Collaborator

Thanks for your PR.
Unit tests and code linters are run automatically every time the PR is updated.
E2e, conformance and network policy tests can only be triggered by a member of the vmware-tanzu organization. Regular contributors to the project should join the org.

The following commands are available:

  • /test-e2e: to trigger e2e tests.
  • /skip-e2e: to skip e2e tests.
  • /test-conformance: to trigger conformance tests.
  • /skip-conformance: to skip conformance tests.
  • /test-whole-conformance: to trigger all conformance tests on linux.
  • /skip-whole-conformance: to skip all conformance tests on linux.
  • /test-networkpolicy: to trigger networkpolicy tests.
  • /skip-networkpolicy: to skip networkpolicy tests.
  • /test-windows-conformance: to trigger windows conformance tests.
  • /skip-windows-conformance: to skip windows conformance tests.
  • /test-windows-networkpolicy: to trigger windows networkpolicy tests.
  • /skip-windows-networkpolicy: to skip windows networkpolicy tests.
  • /test-hw-offload: to trigger ovs hardware offload test.
  • /skip-hw-offload: to skip ovs hardware offload test.
  • /test-all: to trigger all tests (except whole conformance).
  • /skip-all: to skip all tests (except whole conformance).

ruicao93 added a commit to ruicao93/antrea that referenced this pull request Aug 11, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Supports read kubeconfig from file for antrea-agent apiserver,
  which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Supports read kubeconfig from file for antrea-agent apiserver,
  which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
@ruicao93
Copy link
Contributor Author

In commit message:

Support read kubeconfig from file for antrea-agent apiserver.
Which is needed when antrea-agent is running as process.
Support -> Supports
Which -> which

Done.

@ruicao93
Copy link
Contributor Author

I agree with Jianjun. Let's hold off on adding additional support for this process mode though (e.g. support bundle). Maybe @ruicao93 can emphasize the limitations of this mode in the doc as well.

Sure, I will add the limitations in doc.

@ruicao93
Copy link
Contributor Author

/test-all

@ruicao93
Copy link
Contributor Author

/test-windows-conformance

1 similar comment
@ruicao93
Copy link
Contributor Author

/test-windows-conformance

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

@ruicao93 ruicao93 merged commit 649d174 into antrea-io:master Aug 11, 2020
GraysonWu pushed a commit to GraysonWu/antrea that referenced this pull request Sep 22, 2020
)

Currently Antrea runs antrea-agent and kube-proxy from management
Pods. But there is still need to run these two components directly
using scripts. This patch:
- Adds scripts help to install and run antrea-agent and kube-proxy.
- Supports read kubeconfig from file for antrea-agent apiserver,
  which is needed when antrea-agent is running as process.

Signed-off-by: Rui Cao <rcao@vmware.com>
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.

7 participants