File: kubernetes.rst

package info (click to toggle)
python-hvac 2.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,800 kB
  • sloc: python: 29,360; makefile: 42; sh: 14
file content (17 lines) | stat: -rw-r--r-- 381 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Kubernetes
==========

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()
    Kubernetes(client.adapter).login(role=role, jwt=jwt)