Skip to content

Install script for configuring antrea-agent on VM#4113

Merged
tnqn merged 1 commit into
antrea-io:mainfrom
Anandkumar26:scripts
Aug 18, 2022
Merged

Install script for configuring antrea-agent on VM#4113
tnqn merged 1 commit into
antrea-io:mainfrom
Anandkumar26:scripts

Conversation

@Anandkumar26
Copy link
Copy Markdown
Contributor

  • Provides install script for both Windows and Linux
  • Expects the user to copy the antrea-agent binary, antrea-agent.conf,
    antrea-agent.kubeconfig and antrea-agent.antrea.kubeconfig files to the
    VM.
  • Update the documentation

Linux usage:
./install-vm.sh --ns vm-ns --bin /tmp/antrea-agent --config /tmp/antrea-agent.conf --kubeconfig /tmp/my.kubeconfig --antrea-kubeconfig /tmp/my.antrea.kubeconfig

Windows usage:
.\Install-vm.ps1 -NameSpace vm-ns -BinaryPath C:\temp\antrea-agent.conf -ConfigPath C:\temp\antrea-agent.conf -KubeConfigPath C:\temp\my.kubeconfig -AntreaKubeConfigPath C:\temp\my.antrea.kubeconfig

Signed-off-by: kumaranand kumaranand@vmware.com

Comment thread hack/externalnode/install-vm.sh Outdated
Comment thread hack/externalnode/install-vm.sh
Comment thread hack/externalnode/install-vm.sh
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 15, 2022

Codecov Report

Merging #4113 (fed9926) into main (727953e) will decrease coverage by 0.27%.
The diff coverage is n/a.

❗ Current head fed9926 differs from pull request most recent head 1a62ed6. Consider uploading reports for the commit 1a62ed6 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4113      +/-   ##
==========================================
- Coverage   65.14%   64.87%   -0.28%     
==========================================
  Files         304      306       +2     
  Lines       46769    47813    +1044     
==========================================
+ Hits        30467    31018     +551     
- Misses      13883    14373     +490     
- Partials     2419     2422       +3     
Flag Coverage Δ *Carryforward flag
integration-tests 35.09% <ø> (+0.14%) ⬆️
kind-e2e-tests 47.92% <ø> (ø) Carriedforward from 727953e
unit-tests 44.99% <ø> (+1.00%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...g/controller/networkpolicy/clusternetworkpolicy.go 54.00% <0.00%> (-14.08%) ⬇️
pkg/controller/networkpolicy/crd_utils.go 77.14% <0.00%> (-13.90%) ⬇️
pkg/flowaggregator/flowaggregator.go 44.33% <0.00%> (-13.84%) ⬇️
pkg/agent/config/node_config.go 84.84% <0.00%> (-11.16%) ⬇️
...lowaggregator/clickhouseclient/clickhouseclient.go 79.71% <0.00%> (-3.66%) ⬇️
...gent/controller/noderoute/node_route_controller.go 57.54% <0.00%> (-1.87%) ⬇️
pkg/controller/networkpolicy/clustergroup.go 75.59% <0.00%> (-0.65%) ⬇️
pkg/agent/config/traffic_encap_mode.go 100.00% <0.00%> (ø)
pkg/agent/config/traffic_encryption_mode.go 100.00% <0.00%> (ø)
pkg/flowaggregator/exporter/ipfix.go 33.96% <0.00%> (ø)
... and 14 more

Comment on lines +50 to +64
declare -a SUPPORTED_OS=("Ubuntu 18.04", "Ubuntu 20.04")

check_supported_platform() {
echo "Checking platform supported"
dist_version="$(lsb_release -is) $(lsb_release -rs)"
for ver in "${SUPPORTED_OS[@]}"; do
if [ "$ver" == "$dist_version" ]; then
return
fi
done
echoerr "Error ${SUPPORTED_OS[*]} are supported"
exit 1
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

should we really exit right away if the OS is not in the "supported OS" list? I feel like it's better to validate that the dependencies we need are actually present (exit if it is not the case), and log a warning if the OS is not one that has been validated by us.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I feel we should not proceed with installation. If it we continue and run into some issue, then we would be leaving the user environment in a bad state. (Especially Windows).

If the user still wants to continue installation for un-supported OSes, he can very well modify the script locally and rerun.

wenyingd
wenyingd previously approved these changes Aug 17, 2022
Comment thread docs/external-node.md Outdated
Comment thread docs/external-node.md Outdated
Comment thread docs/external-node.md Outdated
Comment thread docs/external-node.md Outdated
3. Bootstrap `antrea-agent`

1. Bootstrap `antrea-agent` using the [installation script](../hack/externalnode/install-vm.ps1)
as shown below.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
as shown below.
as shown below (only specific Windows versions have been tested and are supported).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only one version of Windows is supported. So updated it

return
fi
done
echoerr "Error ${SUPPORTED_OS[*]} are supported"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still believe that for Linux, asking the user whether they want to proceed or not even if their OS is not "verified" would be a better approach. But we can always make that change later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In the interest of time we can take this up later.

@Anandkumar26 Anandkumar26 force-pushed the scripts branch 2 times, most recently from cf004ae to d8a336e Compare August 18, 2022 03:08
Copy link
Copy Markdown
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.

The last comment is changing "NameSpace" to "Namespace" in the script parameter and document. Others LGTM

@Anandkumar26 Anandkumar26 force-pushed the scripts branch 2 times, most recently from 8311452 to fed9926 Compare August 18, 2022 03:28
@Anandkumar26
Copy link
Copy Markdown
Contributor Author

The last comment is changing "NameSpace" to "Namespace" in the script parameter and document. Others LGTM

Discussed offline to resolve the comments and addressed it.

wenyingd
wenyingd previously approved these changes Aug 18, 2022
Copy link
Copy Markdown
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

@wenyingd wenyingd added this to the Antrea v1.8 release milestone Aug 18, 2022
jianjuns
jianjuns previously approved these changes Aug 18, 2022
- Provides install script for both Windows and Linux
- Expects the user to copy the antrea-agent binary, antrea-agent.conf,
antrea-agent.kubeconfig and antrea-agent.antrea.kubeconfig files to the
VM.
- Update the documentation

Linux usage:
./install-vm.sh --ns vm-ns --bin /tmp/antrea-agent --config /tmp/antrea-agent.conf --kubeconfig /tmp/my.kubeconfig --antrea-kubeconfig /tmp/my.antrea.kubeconfig

Windows usage:
.\Install-vm.ps1 -NameSpace vm-ns -BinaryPath C:\temp\antrea-agent.conf -ConfigPath C:\temp\antrea-agent.conf -KubeConfigPath C:\temp\my.kubeconfig -AntreaKubeConfigPath C:\temp\my.antrea.kubeconfig

Signed-off-by: kumaranand <kumaranand@vmware.com>
@Anandkumar26
Copy link
Copy Markdown
Contributor Author

Updated the documentation to reflect the change in install script argument.
i.e. changed from NameSpace to Namespace

@tnqn
Copy link
Copy Markdown
Member

tnqn commented Aug 18, 2022

/skip-all

@tnqn tnqn merged commit d7c3952 into antrea-io:main Aug 18, 2022
heanlan pushed a commit to heanlan/antrea that referenced this pull request Mar 29, 2023
…rea-io#4113)

- Provides install script for both Windows and Linux
- Expects the user to copy the antrea-agent binary, antrea-agent.conf,
antrea-agent.kubeconfig and antrea-agent.antrea.kubeconfig files to the
VM.
- Update the documentation

Linux usage:
./install-vm.sh --ns vm-ns --bin /tmp/antrea-agent --config /tmp/antrea-agent.conf --kubeconfig /tmp/my.kubeconfig --antrea-kubeconfig /tmp/my.antrea.kubeconfig

Windows usage:
.\Install-vm.ps1 -Namespace vm-ns -BinaryPath C:\temp\antrea-agent.conf -ConfigPath C:\temp\antrea-agent.conf -KubeConfigPath C:\temp\my.kubeconfig -AntreaKubeConfigPath C:\temp\my.antrea.kubeconfig

Signed-off-by: kumaranand <kumaranand@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.

5 participants