Use Case to access AWS secrets from pods in EKS Cluster
Ramandeep Chandna
System Engineering Manager AWS | 7xAWS | CKA | CKAD | 2xCloudBees
Situation: You have an application running in pods within an EKS cluster that requires sensitive information like database passwords, API keys, or certificates. You want to securely manage and provide access to these secrets to your pods without hardcoding them into your application code or configurations.
Task: Attach AWS Secrets Manager secrets to your pods running in the EKS cluster securely.
Action:
Create Secrets in AWS Secrets Manager:
Set Up IAM Role for Pods:
Install Kubernetes CSI Driver for AWS Secrets Manager:
Modify Kubernetes Manifests:
Configure Pod to Use Secrets:
Result: Your pods running in the EKS cluster are securely accessing sensitive information stored in AWS Secrets Manager without exposing them in plaintext or hardcoding them into your application code or configurations.
Here's an example Kubernetes manifest snippet demonstrating how to mount an AWS Secrets Manager secret into a pod:
Ensure that you replace my-app-image:latest with your application image and adjust the mountPath to match your application's requirements. Also, make sure to define the secretProviderClass attribute appropriately based on your CSI driver configuration.
By following these steps, you can securely attach AWS Secrets Manager secrets to pods in your EKS cluster using Kubernetes manifests and Kubernetes CSI addons for AWS.
领英推荐
How to configure addons and CSI drivers :
To install and configure the necessary addons and CSI drivers for using AWS Secrets Manager with Kubernetes pods in an EKS cluster, follow these steps:
Install AWS IAM Authenticator:
Install AWS CLI:
Install EKS CSI Driver:
Install Secrets Store CSI Driver for AWS Secrets Manager:
Create Secret Provider Class:
Deploy Pods:
After completing these steps, your Kubernetes pods in the EKS cluster should be able to securely access secrets stored in AWS Secrets Manager using the CSI driver and the Secrets Store CSI driver addon.
If you want to get notifications for all my post and content you can follow/subscribe on below links.
Subscribe to my Newsletter : https://lnkd.in/gqgkFZCpBook 1:1 Mentorship Connect at : https://lnkd.in/dKZyZSYWFollow: https://lnkd.in/gy8xy2GbSubscribe to my YouTube Channel: https://lnkd.in/g6mSHukfPlease do like, share and comment for better reach. Keep on learning keep on sharing.
Great info, thank you so much for sharing.
Your Organic Growth Partner | Proven OG Funnel System to Build a Profitable Audience | Guaranteeing 1M+ Views in 90 Days with Organic Content!
7 个月Thanks for sharing this informative post! Accessing AWS secrets from pods in EKS clusters is crucial for maintaining security and managing sensitive information effectively. Your use case provides valuable insights into implementing this process seamlessly. I'll be sure to check out your Newsletter and YouTube Channel for more insightful content. Keep up the great work!