Git Product home page Git Product logo

vault-secrets-operator-demo's Introduction

Vault Secrets Operator Demo

This repository contains some samples on how to use the Vault Secrets Operator (VSO) with different Cloud hosted kubernetes solutions.

Deploy your Kubernetes cluster

KIND

kind get clusters | grep --silent "^kind$$" || kind create cluster --wait=5m \
    --image kindest/node:v1.25.3 --name kind --config infra/kind/config.yaml

kubectl config use-context kind-kind

Google Cloud (GKE)

gcloud init
gcloud auth application-default login
echo 'project_id = "'$(gcloud config get-value project)'"' > infra/gke/terraform.tfvars \
    && echo 'region = "us-west1"' >> infra/gke/terraform.tfvars

terraform -chdir=infra/gke/ init -upgrade
terraform -chdir=infra/gke/ apply -auto-approve
gcloud container clusters get-credentials \
    $(terraform -chdir=infra/gke/ output -raw kubernetes_cluster_name) \
    --region $(terraform -chdir=infra/gke/ output -raw region)

AWS (EKS)

export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_SESSION_TOKEN="..."
                          
terraform -chdir=infra/eks/ init -upgrade
terraform -chdir=infra/eks/ apply -auto-approve
aws eks --region $(terraform -chdir=infra/eks/ output -raw region) \
    update-kubeconfig --name $(terraform -chdir=infra/eks/ output -raw cluster_name)

Azure (AKS)

az config set core.allow_broker=true && az account clear && az login
az account set --subscription <subscription_id>
az ad sp create-for-rbac --output json \
    | jq -r '. | "appId = \"" + .appId + "\"\npassword = \"" + .password + "\"" ' \
    > infra/aks/terraform.tfvars

terraform -chdir=infra/aks/ init -upgrade
terraform -chdir=infra/aks/ apply -auto-approve
az aks get-credentials --resource-group \
    $(terraform -chdir=infra/aks/ output -raw resource_group_name) \
    --name $(terraform -chdir=infra/aks/ output -raw kubernetes_cluster_name)

Vault

Deploy Vault

helm repo add hashicorp https://helm.releases.hashicorp.com
helm repo update
helm search repo hashicorp/vault
helm install vault hashicorp/vault -n vault \
    --create-namespace --values vault/vault-server-values.yaml

For OpenShift

helm install vault hashicorp/vault -n vault \
    --create-namespace --values vault/vault-server-values.yaml \
    --set "global.openshift=true"

Deploy the Vault Secrets Operator

helm install vault-secrets-operator hashicorp/vault-secrets-operator \
    --version 0.1.0 -n vault-secrets-operator-system \
    --create-namespace --values vault/vault-operator-values.yaml

Using the Vault Secrets Operator

HCP Vault

Limited support: works with pre-deployed public cluster & static secrets only

This guide assumes you have HCP Vault deployed and configured with your cloud providers already and the cluster URL is publicly accessible

Deploy the Vault Secrets Operator (HCP Vault)

export VAULT_ADDR="..."
export VAULT_NAMESPACE="..."
export VAULT_TOKEN="..."

# Uncomment line 7 in hcp-vault/vault-operator-values.yaml file
# Add publicly accessible endpoint for HCP Vault "https://vault-public-url.hashicorp.cloud:8200"

helm install vault-secrets-operator hashicorp/vault-secrets-operator \
    --version 0.1.0 -n vault-secrets-operator-system \
    --create-namespace --values hcp-vault/vault-operator-values.yaml

Using the Vault Secrets Operator (HCP Vault)

vault-secrets-operator-demo's People

Contributors

gautambaghel avatar p-devops avatar

Stargazers

George Doykan avatar  avatar Hyungwook Yu avatar  avatar Mark Beacom avatar Jinwoong Kim avatar Welly Siauw AWS avatar

Watchers

James Cloos avatar  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.