HashiCorp Vault Kubernetes API

Kubernetes auth method for pod authentication

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).
Business capability
Identity & Access Management BC-620.20

Operations 6

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /auth/kubernetes/login Authenticate a pod with a Kubernetes JWT · HashiCorp Vault Login with Kubernetes #
Ask an LLM
“How does a Kubernetes pod get a Vault token using its service account JWT?”
“Can I authenticate a pod to Vault with a role and its JWT?”
Tell an agent
Log in to Vault as role {role} with JWT {jwt}.
Authenticate pod {jwt} to Vault using role {role}.
GET /auth/kubernetes/config Read the Kubernetes auth method settings · HashiCorp Vault Read Kubernetes auth configuration #
Ask an LLM
“Which Kubernetes host and CA certificate does the Kubernetes auth method use?”
“Is the Kubernetes auth method configured to verify JWTs?”
Tell an agent
Show the Kubernetes auth method configuration.
Read the Kubernetes host and CA cert used for Vault authentication.
POST /auth/kubernetes/config Configure the Kubernetes auth method · HashiCorp Vault Configure Kubernetes auth #
Ask an LLM
“How do I point Vault's Kubernetes auth method at my cluster's API server?”
“Can I set a JWT issuer and PEM keys for Kubernetes auth?”
Tell an agent
Configure Kubernetes auth to use host {kubernetes_host}.
Set Kubernetes auth to verify JWTs from issuer {issuer} with keys {pem_keys}.
GET /auth/kubernetes/role/{name} Read a Kubernetes auth role · HashiCorp Vault Read Kubernetes role #
Ask an LLM
“What policies and TTL does a specific Kubernetes role grant?”
“Can I see the configuration of one Kubernetes auth role?”
Tell an agent
Show Kubernetes role {name}.
Read the policies and TTL of Kubernetes role {name}.
POST /auth/kubernetes/role/{name} Create or update a Kubernetes auth role · HashiCorp Vault Create or update Kubernetes role #
Ask an LLM
“How do I let a pod in a namespace get a Vault token?”
“Can I limit a Kubernetes role to a service account and audience?”
Tell an agent
Create Kubernetes role {name} allowing service accounts {bound_service_account_names}.
Set role {name} to issue tokens with audience {audience} and TTL {token_ttl}.
DELETE /auth/kubernetes/role/{name} Delete a Kubernetes auth role · HashiCorp Vault Delete Kubernetes role #
Ask an LLM
“How do I revoke a Kubernetes role?”
“Can I remove a Kubernetes auth role by name?”
Tell an agent destructive · confirm first
Delete Kubernetes role {name}.
Revoke the Kubernetes role {name}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/hvault:hvault-kubernetes-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

hvault-kubernetes-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: HashiCorp Vault Vault Auth Methods Kubernetes API
  description: APIs for authentication methods in HashiCorp Vault including Token, AppRole, Kubernetes, LDAP, JWT/OIDC, GitHub, Userpass, and AWS auth methods. These endpoints handle user and machine authentication to obtain Vault tokens.
  version: '1.0'
  contact:
    name: HashiCorp Support
    email: support@hashicorp.com
    url: https://support.hashicorp.com/
  license:
    name: Business Source License 1.1
    url: https://github.com/hashicorp/vault/blob/main/LICENSE
servers:
- url: https://vault.example.com/v1
  description: Vault Server
security:
- vaultToken: []
tags:
- name: Kubernetes
  description: Kubernetes auth method for pod authentication
paths:
  /auth/kubernetes/login:
    post:
      operationId: loginWithKubernetes
      summary: HashiCorp Vault Login with Kubernetes
      description: Authenticates with Vault using a Kubernetes service account JWT token.
      tags:
      - Kubernetes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - role
              - jwt
              properties:
                role:
                  type: string
                  description: Name of the Vault role
                jwt:
                  type: string
                  description: Kubernetes service account JWT token
      responses:
        '200':
          description: Authentication successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthResponse'
        '400':
          description: Invalid credentials
      security: []
  /auth/kubernetes/config:
    get:
      operationId: readKubernetesConfig
      summary: HashiCorp Vault Read Kubernetes auth configuration
      description: Returns the Kubernetes auth method configuration.
      tags:
      - Kubernetes
      responses:
        '200':
          description: Configuration returned
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      kubernetes_host:
                        type: string
                        description: Kubernetes API server URL
                      kubernetes_ca_cert:
                        type: string
                        description: PEM-encoded CA certificate
                      pem_keys:
                        type: array
                        items:
                          type: string
                        description: PEM-encoded public keys
                      issuer:
                        type: string
                        description: JWT issuer
    post:
      operationId: configureKubernetesAuth
      summary: HashiCorp Vault Configure Kubernetes auth
      description: Configures the Kubernetes auth method.
      tags:
      - Kubernetes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - kubernetes_host
              properties:
                kubernetes_host:
                  type: string
                  description: Kubernetes API server URL
                kubernetes_ca_cert:
                  type: string
                  description: PEM-encoded CA certificate
                token_reviewer_jwt:
                  type: string
                  description: Service account JWT for token review
                pem_keys:
                  type: array
                  items:
                    type: string
                  description: PEM-encoded public keys for JWT verification
                issuer:
                  type: string
                  description: JWT issuer to validate
      responses:
        '204':
          description: Configuration updated
        '400':
          description: Invalid request
  /auth/kubernetes/role/{name}:
    get:
      operationId: readKubernetesRole
      summary: HashiCorp Vault Read Kubernetes role
      description: Reads the named Kubernetes auth role configuration.
      tags:
      - Kubernetes
      parameters:
      - name: name
        in: path
        required: true
        description: Name of the role
        schema:
          type: string
      responses:
        '200':
          description: Role configuration returned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KubernetesRole'
        '404':
          description: Role not found
    post:
      operationId: createOrUpdateKubernetesRole
      summary: HashiCorp Vault Create or update Kubernetes role
      description: Creates or updates the named Kubernetes auth role.
      tags:
      - Kubernetes
      parameters:
      - name: name
        in: path
        required: true
        description: Name of the role
        schema:
          type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KubernetesRole'
      responses:
        '204':
          description: Role created or updated
        '400':
          description: Invalid request
    delete:
      operationId: deleteKubernetesRole
      summary: HashiCorp Vault Delete Kubernetes role
      description: Deletes the named Kubernetes auth role.
      tags:
      - Kubernetes
      parameters:
      - name: name
        in: path
        required: true
        description: Name of the role
        schema:
          type: string
      responses:
        '204':
          description: Role deleted
components:
  schemas:
    KubernetesRole:
      type: object
      properties:
        bound_service_account_names:
          type: array
          items:
            type: string
          description: Allowed service account names
        bound_service_account_namespaces:
          type: array
          items:
            type: string
          description: Allowed Kubernetes namespaces
        audience:
          type: string
          description: Expected audience claim
        alias_name_source:
          type: string
          enum:
          - serviceaccount_uid
          - serviceaccount_name
          description: Source for the identity alias name
        token_ttl:
          type: string
          description: Default token TTL
        token_max_ttl:
          type: string
          description: Maximum token TTL
        token_policies:
          type: array
          items:
            type: string
          description: Policies to attach to tokens
        token_bound_cidrs:
          type: array
          items:
            type: string
          description: CIDR blocks restricting token usage
        token_num_uses:
          type: integer
          description: Maximum number of token uses
        token_type:
          type: string
          enum:
          - default
          - service
          - batch
          description: Token type
    AuthResponse:
      type: object
      properties:
        request_id:
          type: string
          description: Unique request identifier
        lease_id:
          type: string
          description: Lease identifier (empty for auth responses)
        renewable:
          type: boolean
          description: Whether the token is renewable
        lease_duration:
          type: integer
          description: Token TTL in seconds
        auth:
          type: object
          properties:
            client_token:
              type: string
              description: The Vault authentication token
            accessor:
              type: string
              description: Token accessor
            policies:
              type: array
              items:
                type: string
              description: Policies attached to the token
            token_policies:
              type: array
              items:
                type: string
              description: Token-specific policies
            identity_policies:
              type: array
              items:
                type: string
              description: Identity-derived policies
            metadata:
              type: object
              additionalProperties:
                type: string
              description: Metadata associated with the token
            lease_duration:
              type: integer
              description: Token TTL in seconds
            renewable:
              type: boolean
              description: Whether the token is renewable
            entity_id:
              type: string
              description: Identity entity ID
            token_type:
              type: string
              description: Type of token (service, batch)
            orphan:
              type: boolean
              description: Whether the token is an orphan
  securitySchemes:
    vaultToken:
      type: apiKey
      in: header
      name: X-Vault-Token
      description: Vault authentication token
externalDocs:
  description: Vault Auth Methods API Documentation
  url: https://developer.hashicorp.com/vault/api-docs/auth