Inject Secrets at Runtime with HashiCorp Vault Agent
Advanced · 60 minutes · 4 tasks, checked automatically · 100 points
In this advanced security lab you will deploy HashiCorp Vault on a local kind cluster, configure Kubernetes authentication, store database credentials as Vault secrets, and use the Vault Agent Injector to transparently inject those secrets into an application pod at runtime — without the application ever reading from the Kubernetes Secrets API. You will walk through every layer: Vault server, policy, role, annotation-driven sidecar injection, and live secret verification.
What you’ll learn
- Deploy HashiCorp Vault in development mode on Kubernetes using Helm and configure the Vault Agent Injector
- Enable Kubernetes authentication in Vault, create a secret, a policy, and a role that binds to a Kubernetes ServiceAccount
- Deploy a sample application with Vault Agent Injector annotations so secrets are rendered into the pod filesystem at runtime without using Kubernetes Secrets
How this lab works
- Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Cluster: A real Kubernetes cluster on your computer (kind)
- Kubernetes: 1.34.8
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- A kind cluster created in the Kubernetes Playground
Topics: vault, secrets-management, security, kubernetes, helm, sidecar-injection, vault-agent, kubernetes-auth
Create a free account to start this lab.
Keep going
- Harden Workloads with Pod Security Standards and SecurityContext
- Enforce Pod Security Admission at the Namespace Level
- Read-Only Root Filesystems and seccomp Profiles
- Aggregated ClusterRoles for Extensible Permissions
- Bound ServiceAccount Tokens for Workload Identity
- Issue and Auto-Renew TLS Certificates with cert-manager