This repository shows you how to inject secrets in your application from Hashicorp Vault in Kubernetes
-
Create cluster | Install Vault Helm chart
make start
-
Build Golang api and push docker image
make image
-
Create secret, kubernetes authentication, policies and roles in Vault
make vault
-
Deploy Helm chart
make api
-
Create port forward with application container
make forward
-
Now, you can request http://localhost:8080
{ "APP_ENV_SECRET":"my_secure_secret", "APP_ENV_VALUE":"production", "HOME":"/home/nonroot", "HOSTNAME":"api-deployment-78c847444f-5wmgl", "OS_RELEASE":"NAME=\"Alpine Linux\"\nID=alpine\nVERSION_ID=3.18.2\nPRETTY_NAME=\"Alpine Linux v3.18\"\nHOME_URL=\"https://alpinelinux.org/\"\nBUG_REPORT_URL=\"https://gitlab.alpinelinux.org/alpine/aports/-/issues\"\n" }
- delete everything in your system about this project
make cleanup