Consul-Template to Automate Certificate Management for HashiCorp Vault PKI

Опубликовано: 17 Март 2026
на канале: TeKanAid - Platform Engineering and AI
3,805
48

In this video, we talk about how to use Consul-Template to automate certificate management for the #HashiCorp #Vault #PKI secrets engine.

In a previous video ►    • Hashicorp Vault PKI Secrets Engine Demo fo...   we discussed how the HashiCorp Vault PKI secrets engine works to create certificates. However, we didn't discuss how to automate the creation and renewal of certificates. This is what we cover here.

I have my same setup with HashiCorp Vault running a root and an intermediate CA. Then we configure consul-template to automatically:
1. Authenticate to Vault
2. Renew the Vault authentication token
3. Create a new certificate in Vault
4. Place the newly created certificate in the proper folder for Grafana
5. Reload the Grafana Docker container so that Grafana could apply the newly generated certificate

The distribution and installation of consul-template itself could be done by one of the two following methods:
1. HashiCorp Packer to embed consul-template in the images of VMs created
2. A configuration management tool such as Ansible

▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
00:00 Introduction
00:55 Diagram of Workflow
03:50 Demo Steps
05:47 Demo Config Walk-through
10:00 Run the Demo
17:27 Distributing Consul-Template
18:35 Conclusion

▬▬▬▬▬▬▬▬▬ Courses 🎓 ▬▬▬▬▬▬▬▬
TeKanAid Academy Subscription ► https://bit.ly/subscription-premium
Terraform 101 - Certified Terraform Associate ► https://bit.ly/hc-terraform-101
🎟️ Get 15% off of my Terraform 101 Course with this coupon ► YOUTUBE15TF101
HashiCorp Sentinel 101 ► https://bit.ly/hc-sentinel-101
HashiCorp Vault 101 - Certified Vault Associate ► https://bit.ly/hc-vault101
🎟️ Get 15% off of my Vault 101 Course with this coupon ► YOUTUBE15VAULT101
HashiCorp Vault 201 - Vault for Apps in Kubernetes ► https://bit.ly/hc-vault-201

▬▬▬▬▬▬▬▬ Useful Links 🛠 ▬▬▬▬▬▬▬
Get the code ► https://tekanaid.com/posts/consul-tem...
Blog post that goes with this video ► https://tekanaid.com/posts/consul-tem...
Hashicorp Vault PKI Secrets Engine Demo Video ►    • Hashicorp Vault PKI Secrets Engine Demo fo...  
HashiCorp Vault (Uses Consul-Template in K8s) ►    • Secrets Development Phases with HashiCorp ...  
Generate mTLS Certificates for Nomad using Vault ► https://learn.hashicorp.com/tutorials...

▬▬▬▬▬▬▬▬ Community 🌎 ▬▬▬▬▬▬▬▬▬
TeKanAid Community Forum ► https://tekanaid.com/community

▬▬▬▬▬▬▬▬ Connect 👋 ▬▬▬▬▬▬▬▬▬
Website ► https://bit.ly/TeKanAid_Website
Facebook Page ► https://bit.ly/TeKanAid_Facebook
Don't forget to subscribe ► https://bit.ly/TeKanAid_YouTube_Subsc...
MEDIUM ► https://bit.ly/Sam_Medium
TWITTER TeKanAid ► https://bit.ly/TeKanAid_Twitter
TWITTER Sam ► https://bit.ly/Sam_Twitter
LINKEDIN TeKanAid ► https://bit.ly/TeKanAid_LinkedIn
LINKEDIN Sam ► https://bit.ly/Sam_linkedin



In this course you will get to:

⭐ Learn everything you need to know about Vault to ace the Vault Associate Exam
⭐ 8+ hours of video content
⭐ Instructor has his camera on making you feel that you're right in the classroom
⭐ Hand-drawn animated diagrams to help you grasp the topics better
⭐ Lots of hands-on labs to learn by doing
⭐ English closed captions that are searchable so you won't miss a word
⭐ Quizzes to help you grasp the material well
⭐ Join our Community