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

[WIP][VM Agent] Support antctl for VM Agent #5472

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mengdie-song
Copy link
Contributor

@mengdie-song mengdie-song commented Sep 6, 2023

Currently, antctl is not supported for VM Agent and running antctl on VM Agent will be treated as controller mode which causes unexpected output.

This change introduces a new global flag called mode for antctl. It can be controller, agent, vm or flowaggregator. If the flag is not set, we will keep identifying mode by using environment vairables and Pod names like before. But if the flag is set, it has higer priority and the flag must be set for VM mode.

This patch also adjusts some commands for VM mode. Current supported commands and their example outputs are listed below.

antctl version --mode vm
agentVersion: 1.14.0-dev-8c8f1869.dirty
antctlVersion: v1.14.0-dev-f5c34dd4.dirty
antctl get agentinfo --mode vm
NODE           STATUS  NETWORK-POLICIES ADDRESS-GROUPS APPLIED-TO-GROUPS
mengdie-vm-ubu Healthy 1                1              1
antctl get networkpolicy --mode vm
NAME                                 APPLIED-TO                           RULES SOURCE                         TIER-PRIORITY PRIORITY
4e1c09e7-eb5d-496e-8c89-0f038ee9d104 9a47b91d-76f1-5b82-a456-3816a3514090 1     AntreaNetworkPolicy:vm-ns/anp1 250           9000
antctl get appliedtogroup --mode vm
NAME                                 PODS   EXTERNAL-ENTITIES
9a47b91d-76f1-5b82-a456-3816a3514090 <NONE> vm-ns/mengdie-vm-ubu
antctl get addressgroup --mode vm
NAME                                 POD-IPS NODE-IPS EXTERNAL-ENTITY-IPS
9a47b91d-76f1-5b82-a456-3816a3514090 <NONE>  <NONE>   172.16.100.2

Currently, antctl is not supported for VM Agent and running antctl
on VM Agent will be treated as controller mode which causes unexpected output.

This change introduces a new global flag called mode for antctl.
It can be controller, agent, vm or flowaggregator. If the flag is not set,
we will keep identifying mode by using environment vairables and Pod names like before.
But if the flag is set, it has higer priority and the flag must be set for VM mode.

This patch also adjusts some commands for VM mode.
Current supported commands and their example outputs are listed below.
antctl version --mode vm
agentVersion: 1.14.0-dev-8c8f1869.dirty
antctlVersion: v1.14.0-dev-f5c34dd4.dirty
antctl get agentinfo --mode vm
NODE           STATUS  NETWORK-POLICIES ADDRESS-GROUPS APPLIED-TO-GROUPS
mengdie-vm-ubu Healthy 1                1              1
antctl get networkpolicy --mode vm
NAME                                 APPLIED-TO                           RULES SOURCE                         TIER-PRIORITY PRIORITY
4e1c09e7-eb5d-496e-8c89-0f038ee9d104 9a47b91d-76f1-5b82-a456-3816a3514090 1     AntreaNetworkPolicy:vm-ns/anp1 250           9000
antctl get appliedtogroup --mode vm
NAME                                 PODS   EXTERNAL-ENTITIES
9a47b91d-76f1-5b82-a456-3816a3514090 <NONE> vm-ns/mengdie-vm-ubu
antctl get addressgroup --mode vm
NAME                                 POD-IPS NODE-IPS EXTERNAL-ENTITY-IPS
9a47b91d-76f1-5b82-a456-3816a3514090 <NONE>  <NONE>   172.16.100.2

Signed-off-by: Mengdie Song <songm@vmware.com>
@mengdie-song mengdie-song changed the title [VM Agent] Support antctl for VM Agent [WIP][VM Agent] Support antctl for VM Agent Sep 6, 2023
@luolanzone luolanzone added this to the Antrea v1.14 release milestone Sep 18, 2023
@luolanzone luolanzone added the action/release-note Indicates a PR that should be included in release notes. label Sep 18, 2023
@luolanzone luolanzone removed this from the Antrea v1.15 release milestone Dec 13, 2023
@luolanzone luolanzone added this to the Antrea v1.16 release milestone Jan 12, 2024
Copy link
Contributor

This PR is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 12, 2024
@luolanzone luolanzone removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 16, 2024
@luolanzone luolanzone removed this from the Antrea v2.1 release milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/release-note Indicates a PR that should be included in release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants