Skip to content

Conversation

@andrewsykim
Copy link
Member

@andrewsykim andrewsykim commented Mar 11, 2024

Why are these changes needed?

We are currently using the default controller-runtime user-agent which is manager/v0.0.0. This PR updates Kuberay's user-agent to kuberay-operator.

Note that it does not include the version of kuberay yet, but we should add that in a follow-up PR. Here's example HTTP log from apiserver that shows the new user-agent being used:

I0311 02:35:26.041556       1 httplog.go:131] "HTTP" verb="PUT" URI="/apis/ray.io/v1/namespaces/default/rayservices/rayservice-sample/status" latency="10.397049ms" userAgent="kuberay-operator" audit-ID="8b543d30-4d26-4e0f-96ff-7b2596d0ecb8" srcIP="10.244.0.3:54042" apf_pl="workload-low" apf_fs="service-accounts" apf_iseats=1 apf_fseats=0 apf_execution_time="8.0205ms" resp=200

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Signed-off-by: Andrew Sy Kim <andrewsy@google.com>
@andrewsykim
Copy link
Member Author

@kevin85421 PTAL

Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

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

Would you mind sharing more details on why we need this change? I don't have the related context. Thanks!

@kevin85421 kevin85421 self-assigned this Mar 11, 2024
@andrewsykim
Copy link
Member Author

Would you mind sharing more details on why we need this change? I don't have the related context. Thanks!

It's mainly for auditing HTTP traffic in kube-apiserver. If we use the default user-agent from controller-runtime (manager/v0.0.0), it will be hard to distinguish kuberay traffic from other clients that also use controller-runtime. Changing this to ray-operator will make it easy to filter out HTTP logs that came from kuberay

Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

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

How do I manually test this PR? I checked the apiserver logs in my local Kind cluster by running kubectl logs -n kube-system kube-apiserver-kind-control-plane, but I didn't find any log message similar to [...httplog.go:131] "HTTP" verb="PUT" .....

@andrewsykim
Copy link
Member Author

andrewsykim commented Mar 12, 2024

How do I manually test this PR? I checked the apiserver logs in my local Kind cluster by running kubectl logs -n kube-system kube-apiserver-kind-control-plane, but I didn't find any log message similar to [...httplog.go:131] "HTTP" verb="PUT" .....

You need to increase log verbosity to see the HTTP logs.

Here's the kind cluster config I used:

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
  kubeadmConfigPatches:
  - |
    kind: ClusterConfiguration
    apiServer:
        extraArgs:
          v: "4"

Co-authored-by: Kai-Hsun Chen <kaihsun@apache.org>
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
@kevin85421
Copy link
Member

cc @Yicheng-Lu-llll would you mind reviewing this PR? Thanks!

@Yicheng-Lu-llll
Copy link
Collaborator

lgtm! I can reproduce it.
image

@andrewsykim andrewsykim changed the title Use a default user agent 'ray-operator' instead of the default user-agent from controller-runtime Use a default user agent 'kuberay-operator' instead of the default user-agent from controller-runtime Mar 12, 2024
@kevin85421 kevin85421 merged commit 838bc19 into ray-project:master Mar 13, 2024
kevin85421 pushed a commit to kevin85421/kuberay that referenced this pull request Mar 15, 2024
kevin85421 added a commit that referenced this pull request Mar 15, 2024
…the default user-agent from controller-runtime (#1982) (#2014)
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