I need to access K8S api from outside of Rancher for Prometheus metrics, but I don’t know how to specify the token.
Here are the available parameters in Prometheus we can use to discover Kubernetes, we can either use “basic_auth”, “bearer_token” or “bearer_token_file” to access api server:
[ api_server: ]
role:
Optional authentication information used to authenticate to the API server.
Note that basic_auth
, bearer_token
and bearer_token_file
options are
mutually exclusive.
Optional HTTP basic authentication information.
basic_auth:
[ username: ]
[ password: ]
Optional bearer token authentication information.
[ bearer_token: ]
Optional bearer token file authentication information.
[ bearer_token_file: ]
So, how can I find the value of api server url and authentication values (“basic_auth”, “bearer_token” or “bearer_token_file”)?
Thanks for the help.