Create token with policy vault
Issue a short-lived token limited to a specific policy
vault token create -policy=read-only -ttl=1h
more vault
all 31 commands →
List auth methods
vault auth list
Enable Kubernetes auth
vault auth enable kubernetes && vault write auth/kubernetes/config kubernetes_host=https://$KUBERNETES_PORT_443_TCP_ADDR:443
Create Kubernetes role
vault write auth/kubernetes/role/my-role bound_service_account_names=<sa> bound_service_account_namespaces=<ns> policies=<policy> ttl=1h
Write policy
vault policy write my-policy policy.hcl
List policies
vault policy list