Package vaultk8s provides authentication with Vault on Kubernetes
Replaces package
github.com/postfinance/vault/k8s
Authentication is done either with Vault's Kubernetes Auth Method or AppRole Auth Method.
Checkout the Vault documentation for details:
If the environment variables VAULT_ROLE_ID
and VAULT_SECRET_ID
are set, AppRole Auth Method will be used, Kubernetes Auth Method otherwise.
For a successful Kubernetes authentication the environment variable VAULT_ROLE
must be set.
For testing, HashiCorp's Vault and a Kubernetes cluster will be used.
- Install Vault
- Start Vault:
export VAULT_DEV_ROOT_TOKEN_ID="90b03685-e17b-7e5e-13a0-e14e45baeb2f" export VAULT_DEV_LISTEN_ADDRESS="127.0.0.1:8200" vault server -dev
IMPORTANT: Start vault with the same root token and listen address as defined in
k8s_test.go
.
- Install and start kind.
kubectl apply -f ci/rbac.yaml