aws / amazon-vpc-resource-controller-k8s

Controller for managing Trunk & Branch Network Interfaces on EKS Cluster using Security Group For Pod feature and IPv4 Addresses for Windows Node.
Apache License 2.0
77 stars 51 forks source link

Show correct vpc-resource-controller version in the userAgent #442

Open ClareCat opened 1 month ago

ClareCat commented 1 month ago

Brought this up with @orsenthil over slack

What would you like to be enhanced: The cloudwatch EKS cluster logs for vpc-resource-controller actions shows the userAgent field as: "userAgent": "controller/v0.0.0 (linux/amd64) kubernetes/$Format",

It would be better if instead of always showing v0.0.0 the logs showed which version of the vpc-resource-controller made the request.

Why is the change needed and what use case will it solve:

It would have been simpler for us to track and report the v1.5.0 trunk initialization issues if the userAgent version mapped to the version of the vpc-resource-controller that made the request.

haouc commented 1 month ago

@ClareCat thanks for reporting this. We have correct agent version showing in EC2 dashboards. I am not sure why CloudWatch doesn't have version correctly showing. I will take a look.

orsenthil commented 1 month ago

@haouc - I pointed out to the GitVersion that is displayed during the bootstrap ( https://github.com/aws/amazon-vpc-resource-controller-k8s/blob/964a3cce8281e25c185369f63859ed63bedd491f/main.go#L179) . this is different from that log; the request is if the controller version can be set in user agent.

ClareCat commented 1 month ago

Yeah, this is the userAgent that is set in the manager k8s client. It's probably an option value in there.

ClareCat commented 1 month ago

Right now it seems like it's just using this default: https://github.com/kubernetes/client-go/blob/master/rest/config.go#L491-L505

orsenthil commented 1 week ago

I have updated the userAgent to reflect the vpc-resource-controller and gitVersion in this PR https://github.com/aws/amazon-vpc-resource-controller-k8s/pull/455