I am a DevOps engineer at Cloudify.co and I will share in this post my experience related to automation of Vault backup creation using Kubernetes CronJob.
This post is a continuation of the previous post: https://igorzhivilo.com/vault/scheduled-backup-vault-secrets/
The repository with all the code: https://github.com/warolv/vault-backup
What is HashiCorp’s Vault?
A vault is a tool for securely accessing secrets. A secret is anything that you want to tightly control access to, such as API keys, passwords, certificates, and more. Vault provides a unified interface to any secret while providing tight access control and recording a detailed audit log.
My Setup
- EKS Kubernetes cluster
- Vault runs on EKS cluster
What you will learn from this post?
- How to create a scheduled backup for Vault secrets with CronJob of Kubernetes.
- How to add Prometheus alerts for failed jobs.
You can find all the code presented in my repository: https://github.com/warolv/vault-backup
Let’s start.
Building the docker container
First, need to build a docker container based on python3 and include the code of vault_handler.py.
Need clone the repo first with Docker file: ‘git clone https://github.com/warolv/vault-backup’
Docker file: