VOOZH about

URL: https://thenewstack.io/securing-kubernetes-with-external-secrets-operator-on-aws/

⇱ Securing Kubernetes With External Secrets Operator on AWS - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2025-03-05 11:00:41
Securing Kubernetes With External Secrets Operator on AWS
sponsor-andela,sponsored-post-contributed,
CI/CD / Security

Securing Kubernetes With External Secrets Operator on AWS

Here’s a way to centralize management, rotate secrets conveniently without downtime, automate synchronization and reduce secret exposure risks.
Mar 5th, 2025 11:00am by Adetokunbo Ige
👁 Featued image for: Securing Kubernetes With External Secrets Operator on AWS
Image from janews on Shutterstock.
Andela sponsored this post.
Secrets management is an essential aspect of modern application development. It is vital to ensure that sensitive information such as database credentials, certificates, API keys, passwords and tokens are securely stored and accessible. Kubernetes offers a built-in solution for managing secrets, but integrating it with external secrets stores like AWS Secrets Manager provides enhanced security, flexibility and scalability. Users can easily rotate their credentials for security enhancement, and this will be replicated to the downstream applications that reside in the Kubernetes cluster. In this tutorial, I will walk you through the process of managing secrets in your Kubernetes cluster using External Secrets Operator (ESO) and AWS Secrets Manager.

What Is External Secrets Operator (ESO)?

External Secrets Operator enables developers to simplify secret management by synchronizing secrets from external secret stores such as AWS Secret Manager, Microsoft Azure Key Vault and HashiCorp Vault to Kubernetes. By using ESO, you can define a Kubernetes custom resource (CRD), whereby you can specify the location from which to fetch the secrets (the external secret store), which secrets to fetch and how to synchronize them with Kubernetes Secrets.

Why Use External Secrets Operator?

  • Centralized management: External Secrets Operator provides centralized storage for managing secrets across multiple environments, which reduces the complexity of managing secrets across large-scale and multiple applications. For example, when secrets are stored in AWS Secrets Manager, it is much easier to configure them to rotate within a specific period.
  • Automatic synchronization: External Secrets Operator automatically synchronizes from external secrets sources, ensuring the application always has the latest secrets without any manual intervention.
  • Compliance and auditing: External Secrets Operator uses external secrets stores, simplifying compliance with GDPR and the Payment Card Industry Data Security Standard (PCI DSS) by using AWS Secrets Manager’s built-in secret rotation, detailed auditing logs and access control features.

Get Started

Follow this guide, and ensure you have the following in place:
  • A Kubernetes cluster up and running (EKS, for example).
  • The `kubectl` binary installed and configured on your workstation. This will be used to apply the Kubernetes manifest.
  • An AWS account with the AWS command-line interface (CLI) configured.
  • Necessary permission to create resources in AWS Secrets Manager and Kubernetes.
  • Helm, a package manager for Kubernetes that simplifies the process of deploying, managing and scaling Kubernetes applications, must be installed.

Step 1: Install External Secrets Operator (ESO)

a. Add the ESO Helm repository.
helm repo add external-secrets https://charts.external-secrets.io
helm repo update

b. Install ESO: This will create an external secrets operator in the `external-secrets` namespace.
helm install external-secrets external-secrets/external-secrets -n external-secrets --create-namespace
c. Verify the installation by running the command below.
kubectl get all -n external-secrets

👁 Image

Step 2: Create a Secret in AWS Secrets Manager

  • Log in to AWS.
  • Open AWS Secrets Manager in the AWS Management Console.
  • Create a new secret, such as `Key: DB_PASSWORD` and `Value: my-secret-password`.
  • Take note of the secret Amazon Resource Name (ARN) once you are done.

👁 Image

  👁 Image

Step 3: Create a SecretStore for ESO

A `SecretStore` is a Kubernetes custom resource definition (CRD) introduced by the External Secrets Operator. It defines the configuration details that will be used for accessing the external secret in services such as AWS Secrets Manager. In essence, SecretStore contains details of where and how ESO can access the secrets. Before creating the SecretStore, you will need to grant the SecretStore access to your newly created secret in AWS Secrets Manager. You will be creating the following resources as a prerequisite before creating the SecretStore. a. Create an IAM Policy: The identity and access management (IAM) policy will allow access to your newly created secrets in AWS Secrets Manager. Replace the ARN below with the ARN of the freshly created secrets in AWS Secrets Manager.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"secretsmanager:GetSecretValue"
],
"Resource": "arn:aws:secretsmanager:region:account-id:secret:your-secret-id"
}
]
}


b. Create an IAM Role: Create an IAM role and attach the IAM policy created in the above example. Specify the trust relationship for the role to allow the EKS cluster to assume it.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "eks.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}


c. Associate the IAM role to a service account in Kubernetes: You can associate your IAM role to a Kubernetes service account using the `eks.amazonaws.com/role-arn` annotation to securely grant fine-grained AWS permission to your running workload in your EKS cluster without keeping long-term credentials in your application.
apiVersion: v1
kind: ServiceAccount
metadata:
name: external-secrets-sa
namespace: external-secrets
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/ExternalSecretsRole


Copy the code above in a file with the filename `sa-secretstore.yaml` and replace `eks.amazonaws.com/role-arn` with the value of your IAM role ARN. Then apply the manifest by running this command:
kubectl apply -f sa-secretstore.yaml -n external-secrets
d. Create the SecretStore to use the service account: Copy and paste the Kubernetes manifest below into the file with the file name `secretstore-eso.yaml` and apply the manifest.
apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
name: aws-secret-store
namespace: external-secrets
spec:
provider:
aws:
service: SecretsManager
region: us-east-1
auth:
jwt:
serviceAccountRef:
name: external-secrets-sa


Use this command to apply the Kubernetes manifest:
kubectl apply -f secretstore-eso.yaml

Step 4: Create an ExternalSecret Resource

Define an ESO to fetch and sync the AWS secret into your Kubernetes cluster. Copy and paste the Kubernetes manifest below into the file with the file name `eso.yaml` and apply the manifest.
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: my-app-secrets
namespace: external-secrets
spec:
refreshInterval: 1h # Set the refresh interval for secrets
secretStoreRef:
name: aws-secret-store
kind: SecretStore # Referencing the SecretStore created earlier
target:
name: my-app-secrets
creationPolicy: Owner # This ensures the Secret is owned by the ExternalSecret
data:
- secretKey: DB_PASSWORD # This is the key in the Kubernetes Secret
remoteRef:
key: arn:aws:secretsmanager:us-east-1:abc:secret:eso/example/secrets-Eq5llj #Replace this with the ARN of your AWS Secrets Manager


Use this command to apply the Kubernetes manifest:
kubectl apply -f eso.yaml

Conclusion

Managing secrets securely is an incredibly important aspect of running applications in Kubernetes. Using the External Secret Operator with AWS Secrets Manager, you can centralize your secret management, rotate secrets conveniently without downtime, enable automatic synchronization and improve security by reducing secret exposure risks. Furthermore, using ESO ensures that applications will always have access to the latest secrets without any manual intervention. To further enhance your setup, consider implementing:
  • Secret rotation: Enable automatic rotation of secrets in AWS Secrets Manager.
  • Monitoring and auditing: Use AWS CloudTrail and Kubernetes logging to track secret access and updates.
With this setup, you have a scalable and secure solution for handling secrets in Kubernetes, making secret management easier and more reliable. Looking to master database management in Kubernetes? Unlock Andela’s 8-step guide on how to run databases efficiently in a Kubernetes environment to drive innovation in your workflows.
Andela provides the world’s largest private marketplace for global remote tech talent driven by an AI-powered platform to manage the complete contract hiring lifecycle. Andela helps companies scale teams & deliver projects faster via specialized areas: App Engineering, AI, Cloud, Data & Analytics.
Learn More
The latest from Andela
Hear more from our sponsor
TRENDING STORIES
Adetokunbo Ige is a technologist for Andela, a private global talent marketplace. A seasoned platform engineer and a Certified ISO 22301 Lead Implementer in Business Continuity, he brings a wealth of experience in software engineering, enterprise application management, server infrastructure...
Read more from Adetokunbo Ige
Andela sponsored this post.
SHARE THIS STORY
TRENDING STORIES
AWS and Microsoft are sponsors of The New Stack.
TNS owner Insight Partners is an investor in: Enable, Statement.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.