Skip to content

Package k8s provides authentication with Vault on Kubernetes

License

Notifications You must be signed in to change notification settings

postfinance/vaultk8s

Repository files navigation

Go Report Card GoDoc Build Status Coverage Status

Package vaultk8s

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.

Tests

For testing, HashiCorp's Vault and a Kubernetes cluster will be used.

HashiCorp Vault

  • 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.

Kubernetes

  • Install and start kind.
  • kubectl apply -f ci/rbac.yaml

About

Package k8s provides authentication with Vault on Kubernetes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages