Giter VIP home page Giter VIP logo

vault-kubernetes's Introduction

Vault Logo

Vault in Kubernetes.

Vault is a secrets manager, developed by Hashicorp. This repository, it's for people like me, who wants to deploy a Vault cluster in Kubernetes, but don't want to follow use Hashicorp's approach (using Helm). For this implementation, I suppose that you already have an operational Kubernetes cluster, kubectl command line knowlegde and practise with Terraform. This implementation tries to "transpose" Helm chart template from Hashicorp repository, to Terraform.

If you don't know how to use Terraform, a very good Infrastruture as Code tool, please check Hashicorp's page with all the documentation that you need to know. - Start using Terraform for your Kubernetes deploys

main.tf file

In this file you can find the following Kubernetes resources:

  • ConfigMap (vault-conf) - used to create the configuration file to Vault
  • Cluster Role Binding (vault-server-binding)
  • Service Account (vault-service-account)
  • Service (vault-service) - Used to expose Vault deployment
  • Statefulset (vault)

In this file, you must change the content of config.hcl file (in the config map), specially storage config.

For example, if you want to storage your secrets in filesystem add:

storage "file" {
  path = "/mnt/vault/data"
}

and uncomment this lines in the statefulset template:

volume_mount {
  name       = "vault-data"
  mount_path = "mnt/vault/data"
}
...

volume_claim_template {
  metadata {
    name = "vault-data"
  }
  spec {
    access_modes = ["ReadWriteOnce"]
    resources {
      requests = {
        storage = "${var.dataStorageSize}"
      }
    }
  }
}

I choose using a Statefulset approach, to have persistent volumes and don't loose any critical data between redeploys, when using filesystem storage approach.

vars.tf file

In this file you can find some variables to improve your deployment. Each of them have a comment.

Contributing

Please, be free to contributing and improve this repository.

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.