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

Fix VM Agent RBAC warnings #5391

Merged
merged 1 commit into from
Aug 21, 2023
Merged

Fix VM Agent RBAC warnings #5391

merged 1 commit into from
Aug 21, 2023

Conversation

mengdie-song
Copy link
Contributor

@mengdie-song mengdie-song commented Aug 15, 2023

Recent changes for K8s Node cause VM Agent RBAC warnings regarding service and node. These warnings will flood VM Agent logs.

This change fixes the issue by only initializing the related components for K8s Node case.

Signed-off-by: Mengdie Song songm@vmware.com

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.

The change looks good to me.

I am thinking shall we refine agent.go to cleanly split agent logic for container case and VM case, e.g., introducing a new interface for agent, making VM agent and K8s Node agent as different implementations, and leaving the general resources like kubeClient, antreaClient, OVS client in the shared functions, and constructing other informers in the dedicated implementations. Any thoughts @tnqn @antoninbas @jianjuns ?

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

@tnqn
Copy link
Member

tnqn commented Aug 15, 2023

I am thinking shall we refine agent.go to cleanly split agent logic for container case and VM case, e.g., introducing a new interface for agent, making VM agent and K8s Node agent as different implementations, and leaving the general resources like kubeClient, antreaClient, OVS client in the shared functions, and constructing other informers in the dedicated implementations. Any thoughts @tnqn @antoninbas @jianjuns ?

I'm not sure which kind of interface you mean and how the implementations will look like as I don't see many things can be abstracted in the run func. I feel it may be doable to have separate runXXX funcs for the two case to sperate the code path. For example:

func run(o *Options) error {
	klog.InfoS("Starting Antrea agent", "version", version.GetFullVersion())
        // Common code
	...
        //
        if o.nodeType == config.K8sNode {
                return runK8sNode(...)
        } else {
                return runExternalNode(...)              
        }
} 

@wenyingd
Copy link
Contributor

I'm not sure which kind of interface you mean and how the implementations will look like as I don't see many things can be abstracted in the run func. I feel it may be doable to have separate runXXX funcs for the two case to sperate the code path. For example:

func run(o *Options) error {
	klog.InfoS("Starting Antrea agent", "version", version.GetFullVersion())
        // Common code
	...
        //
        if o.nodeType == config.K8sNode {
                return runK8sNode(...)
        } else {
                return runExternalNode(...)              
        }
} 

It looks good to to me to use two separate funcs for the different scenarios.

@tnqn
Copy link
Member

tnqn commented Aug 18, 2023

The commit is not signed

Recent changes for K8s Node cause VM Agent RBAC warnings regarding
service and node. These warnings will flood VM Agent logs.

This change fixes the issue by only initializing the related components
for K8s Node case.

Signed-off-by: Mengdie Song <songm@vmware.com>
@mengdie-song
Copy link
Contributor Author

@tnqn I have signed the commit, thanks.

@tnqn
Copy link
Member

tnqn commented Aug 21, 2023

/test-all

@tnqn tnqn merged commit 35c113b into antrea-io:main Aug 21, 2023
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.

3 participants