Skip to content

Commit

Permalink
Merge pull request #837 from theo-ardouin/patch-1
Browse files Browse the repository at this point in the history
docs(auth-methods): update kubernetes
  • Loading branch information
colin-pm committed Aug 22, 2022
2 parents c6a6b1a + 2ceb85b commit 271c6e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/usage/auth_methods/kubernetes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ Authentication

.. code:: python
from hvac import Client
from hvac.api.auth_methods import Kubernetes
client = Client(url=url, verify=certificate_path)
# Kubernetes (from k8s pod)
f = open('/var/run/secrets/kubernetes.io/serviceaccount/token')
jwt = f.read()
client.auth.kubernetes.login("example", jwt)
Kubernetes(client.adapter).login(role=role, jwt=jwt)

0 comments on commit 271c6e1

Please sign in to comment.