Running this action requires a Vault token with permission to create or update Kubernetes auth backend roles.

CreateVaultKubernetesAuthRole — creates or updates a Kubernetes authentication role in HashiCorp Vault.

Request example

mountPath: kubernetes
role: example
bound_service_account_names:
  - default
bound_service_account_namespaces:
  - default
optional:
  token_ttl: 1h
  token_max_ttl: 12h
  audience: vault
  token_policies:
    - default

Request specification

NameRequiredDescription
mountPathYesMount path of the Kubernetes auth backend in Vault (e.g., kubernetes)
roleYesName of the role to create in Vault
bound_service_account_namesYesList of service account names allowed to access via this role
bound_service_account_namespacesYesList of namespaces allowed to access via this role
optionalNoAdditional role parameters (listed in the table below)

Supported values for optional:

FieldTypeDescription
token_ttlstringTime-to-live (TTL) of the token issued at login
token_max_ttlstringMaximum TTL of the token
token_policies[]stringAdditional policies assigned at login
audiencestringValue of the JWT audience (aud) that Vault expects from the token
token_periodstringToken renewal period
token_explicit_max_ttlstringExplicit upper bound on the token’s TTL
token_num_usesintLimit on the number of times the token can be used
token_typestringType of token issued (e.g., service, batch)
alias_name_sourcestringSource of the alias name for identity
token_no_default_policyboolExclude the default policy from the token
token_bound_cidrs[]stringRestriction on the CIDR ranges from which the issued token can be used

The full list of supported parameters is provided in the official HashiCorp Vault documentation.