To authenticate with the Kubernetes API using a Bearer Token, configure the api_key dictionary in the Configuration object using the key 'BearerToken'. If your API server requires the Bearer prefix, you must also set the api_key_prefix for that key.
configuration = kubernetes.aio.client.Configuration(host="http://localhost")
# Set the token
configuration.api_key['BearerToken'] = 'YOUR_API_KEY'
# Set the prefix if required (e.g., 'Bearer')
configuration.api_key_prefix['BearerToken'] = 'Bearer'
configuration.api_key['BearerToken'] = 'YOUR_API_KEY'
# configuration.api_key_prefix['BearerToken'] = 'Bearer'