Coder Social home page Coder Social logo

k8s-with-vault-integration's Introduction

PURPOSE

This is a setup of using Vault secret injection into pods. The goal of this is to be able to better manage secrets stored in vault and how we get them into our pods. This will also help with secert rotation as the pods should restart once the secret has changed. ( It turns out that restarting the pods is not as simple and needs more work)

During my research I also saw people mention that working with ISTIO was not as straight forward either. This will need to be investigated further.

There are two solutions used to handle secrets from Vault.

  1. agent injector
  2. Secret Store CSI

Pre-requisites

  1. minikube
  2. setup of vault agent sidecar injector
  3. setup for CSI driver
  4. A vault running in dev mode ( I am using version v1.10 )
  5. helm ( version v3.8.1 )

Notes

To restart a pod when a secret has changed we can use the vault-hashicorp-com-agent-inject-command annotation to kill the pod and restart it. (Agent Inject only not the CSI driver) See this demo

There are some notes about how this doesn't work so well with istio. This would need some investigation as istio is a pretty important service mesh.

Issues

Since the minikube cluster does not resolve the /etc/hosts alias host.minikube.internal from within PODS running in the cluster, I had to either add the following to the pod/deployment definition or change the VAULT URL to the IP address of my host gateway so that I could access the Vault server runing in my terminal session on my desktop.

  hostAliases:
  - hostnames:
      - "host.minikube.internal"
    ip: "192.168.79.1"

You will need to update the ip to your gateway IP address. TODO: Change this to use kustomize?

Minikube kept setting my /etc/hosts entry for host.minikube.internal to 192.168.68.1 yet that was not the IP address of my bridge network on my host so I had to make sure it was set properly each time I started minikube.

References

k8s-with-vault-integration's People

Contributors

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