Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8s Python interface issue #2222

Open
Jicming opened this issue Apr 29, 2024 · 4 comments
Open

K8s Python interface issue #2222

Jicming opened this issue Apr 29, 2024 · 4 comments
Labels
kind/documentation Categorizes issue or PR as related to documentation. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@Jicming
Copy link

Jicming commented Apr 29, 2024

When I was experimenting with the Python client, I found a configuration that I didn't know what to fill in as follows:

configuration.api_key['authorization'] = 'YOUR_API_KEY'

@Jicming Jicming added the kind/documentation Categorizes issue or PR as related to documentation. label Apr 29, 2024
@roycaihw
Copy link
Member

roycaihw commented May 8, 2024

Please take a look at the examples on how to use this client

@Jicming
Copy link
Author

Jicming commented May 14, 2024

下面这个例子中 configuration.api_key['authorization'] = 'YOUR_API_KEY' 这块填啥呢?

from future import print_function
import time
import kubernetes.client
from kubernetes.client.rest import ApiException
from pprint import pprint

configuration = kubernetes.client.Configuration()

Configure API key authorization: BearerToken

configuration.api_key['authorization'] = 'YOUR_API_KEY'

Uncomment below to setup prefix (e.g. Bearer) for API key, if needed

configuration.api_key_prefix['authorization'] = 'Bearer'

Defining host is optional and default to http://localhost

configuration.host = "http://localhost"

Defining host is optional and default to http://localhost

configuration.host = "http://localhost"

Enter a context with an instance of the API kubernetes.client

with kubernetes.client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = kubernetes.client.WellKnownApi(api_client)

try:
    api_response = api_instance.get_service_account_issuer_open_id_configuration()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling WellKnownApi->get_service_account_issuer_open_id_configuration: %s\n" % e)

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 12, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle rotten
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/documentation Categorizes issue or PR as related to documentation. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants