kubernetes / client-go

Go client for Kubernetes.
Apache License 2.0
8.79k stars 2.91k forks source link

Looking for a way to Set a Custom Header #1222

Closed joshkurz closed 1 year ago

joshkurz commented 1 year ago

I'd like to know if it's possible to append a custom Header to requests to send to the k8s api through the auth plugin mechanism.

Can I write a custom exec plugin, that gets access to the request object to set custom Headers, which are then sent alongside the auth token to the k8s api? This goes along with issue https://github.com/kubernetes/kubectl/issues/1352 I opened up.

I am trying to find out a way to do this without creating a custom k8s client.