Giter Club home page Giter Club logo

vaultingkube's Introduction

vaultingkube

logo FOSSA Status

Take config maps and secrets stored inside Hashicorp Vault and sync them to your Kubernetes cluster.

How it works

After Vaultingkube is running in your cluster it will look at the Vault server configured via the Vault client config options. Based on the VK_VAULT_ROOT_MOUNT_PATH Vaultingkube will read all kv secrets it has access to and reference any with a matching mount path. EG if VK_VAULT_ROOT_MOUNT_PATH is set to vaultingkube/my-cluster it will look at all mounts at vaultingkube/my-cluster/*.

The type of secret and namespace are configured in the mount path as well. It looks like [VK_VAULT_ROOT_MOUNT_PATH]/[NAMESPACE]/[SECRET_TYPE]/[NAME]. If I wanted to create a configmap in the default namespace named tom I would create a kv secret at [VK_VAULT_ROOT_MOUNT_PATH]/default/configmaps/tom.

Vaultingkube will only overwrite, manage, or delete ConfigMaps and Secrets that have the annotation vaultingkube.io/managed: "true" set. You will need to manually set this on existing Secrets and Configmaps for Vaultingkube to take over.

Vaultingkube does not have any logic to determine if Vault has changed, and so it uses the VK_SYNC_PERIOD environment variable to determine how frequently (in seconds) it sends update requests to Kubernetes to stay in sync with Vault.

By default Vaultingkube will delete ConfigMaps and Secrets that exist in Kubernetes and not Vault that have the annotation of vaultingkube.io/managed: "true". To turn this off set the environment variable VK_DELETE_OLD to "false".

Demo

Deployment

On lines 25-34 in deployment/003-deployment.yaml are configurable environment variables that will need to be set on a per deployment basis. After these are updated for your environment run kubectl apply -f deployment/. See environment variables.

If you are not using RBAC then just run

kubectl apply -f deployment/001-common.yaml
kubectl apply -f deployment/003-deployment.yaml

Client Versions

You should be able to infer the supported versions of Kubernetes and Vault that will work with this program from these.

  • client-go: 5.0.1
  • vault: 0.9.0

Environment Variables

Variable Explanation
VK_DELETE_OLD Delete CM/Secret's that are in Kube but not Vault [Default: true]
VK_SYNC_PERIOD How many seconds to wait in between syncs [Default: 300]
VK_VAULT_ROOT_MOUNT_PATH Path to configmaps and secrets [Example: vaultingkube/cluster-name]

License

Apache 2

FOSSA Status

vaultingkube's People

Contributors

fossabot avatar sunshinekitty avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.