Install script for configuring antrea-agent on VM#4113
Conversation
Codecov Report
@@ 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
*This pull request uses carry forward flags. Click here to find out more.
|
| 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 | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
d88c775 to
a2f0dd1
Compare
| 3. Bootstrap `antrea-agent` | ||
|
|
||
| 1. Bootstrap `antrea-agent` using the [installation script](../hack/externalnode/install-vm.ps1) | ||
| as shown below. |
There was a problem hiding this comment.
| as shown below. | |
| as shown below (only specific Windows versions have been tested and are supported). |
There was a problem hiding this comment.
Only one version of Windows is supported. So updated it
| return | ||
| fi | ||
| done | ||
| echoerr "Error ${SUPPORTED_OS[*]} are supported" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
In the interest of time we can take this up later.
cf004ae to
d8a336e
Compare
wenyingd
left a comment
There was a problem hiding this comment.
The last comment is changing "NameSpace" to "Namespace" in the script parameter and document. Others LGTM
8311452 to
fed9926
Compare
Discussed offline to resolve the comments and addressed it. |
- 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>
|
Updated the documentation to reflect the change in install script argument. |
|
/skip-all |
…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>
antrea-agent.kubeconfig and antrea-agent.antrea.kubeconfig files to the
VM.
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