{"id":1009,"date":"2024-11-18T04:15:00","date_gmt":"2024-11-18T04:15:00","guid":{"rendered":"https:\/\/blog.ngocha.biz\/?p=1009"},"modified":"2024-11-18T04:15:00","modified_gmt":"2024-11-18T04:15:00","slug":"kubernetes-external-secrets-operator","status":"publish","type":"post","link":"https:\/\/blog.ngocha.biz\/?p=1009","title":{"rendered":"External Secrets Operator Setup for EKS using Secrets Manager"},"content":{"rendered":"<p>In this blog we will look at Kubernetes External secrets operator setup on <a href=\"https:\/\/devopscube.com\/create-aws-eks-cluster-eksctl\/\">AWS EKS<\/a> and integrate with AWS secrets manager for fetching secrets.<\/p>\n<p>External Secrets Operator is an operator for <a href=\"https:\/\/devopscube.com\/kubernetes-architecture-explained\/\">Kubernetes<\/a> that manages Kubernetes Secrets on external secrets managers like AWS Secrets Manager, Google Secrets Manager, Azure Key Vault, etc.<\/p>\n<h2 id=\"external-secrets-operator-workflow\">External Secrets Operator Workflow<\/h2>\n<p>Given below is the diagrammatic workflow of the External Secrets Operator, which gets secrets from the AWS Secrets Manager and saves them as a secret in the EKS cluster.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/external-secrets-operator-1-1.gif\" class=\"kg-image\" alt=\"External Secrets Operator workflow\" loading=\"lazy\" width=\"741\" height=\"980\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/external-secrets-operator-1-1.gif 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/external-secrets-operator-1-1.gif 741w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Here is how it works.<\/p>\n<ol>\n<li>An <strong>External Secrets Object<\/strong> is created in a namespace you want to use the secret.<\/li>\n<li>The <strong>External Secrets Object<\/strong> contains information such as the refresh interval, the secret store to refer to, the target where the secret needs to be stored, and the AWS Secrets Manager name and secret key.<\/li>\n<li>The <strong>SecretStore<\/strong> contains the authentication details for the <strong>External Secrets Managers<\/strong>, which helps the <strong>External Secrets Operator<\/strong> to access the secret.<\/li>\n<li><strong>External Secret Operator<\/strong> fetches the secrets stored in <strong>AWS Secrets Manager<\/strong> and saves them as <strong>Kubernetes Secrets<\/strong> on the EKS cluster.<\/li>\n<li>The <strong>Kubernetes Secrets<\/strong> created by the <strong>External Secrets Operator<\/strong> get the required secrets from the <strong>AWS Secrets Manager<\/strong> and refresh the <strong>Secrets<\/strong> with a time period to keep it up to date.<\/li>\n<li>After the <strong>Kubernetes Secret<\/strong> is created you can use the secrets in the application by specifying the <strong>Secret name<\/strong> and <strong>Secret key<\/strong> in which the secret values are mapped.<\/li>\n<\/ol>\n<h2 id=\"prerequisites\">Prerequisites<\/h2>\n<p>The prerequisites are given below.<\/p>\n<ol>\n<li><a href=\"https:\/\/devopscube.com\/install-configure-aws-cli-linux\/\">AWS CLI<\/a> with access to IAM and EKS<\/li>\n<li><a href=\"https:\/\/devopscube.com\/create-aws-eks-cluster-eksctl\/\">EKS cluster<\/a> with Amazon EKS Pod Identity Agent addon<\/li>\n<li><a href=\"https:\/\/devopscube.com\/install-configure-helm-kubernetes\/\">Helm<\/a><\/li>\n<li>kubectl<\/li>\n<li>eksctl<\/li>\n<\/ol>\n<h2 id=\"steps-to-setup-external-secrets-operator-on-eks\">Steps to Setup External Secrets Operator on EKS<\/h2>\n<p>If you are ready with the prerequisites, follow the steps below to set up an External Secrets Operator on EKS.<\/p>\n<p>In this setup, we will get the secrets on AWS Secrets Manager and save them as a Kubernetes secret using External Secrets Operator and keep them in sync.<\/p>\n<h3 id=\"step-1-create-an-iam-policy-for-the-external-secrets-operator\">Step 1: Create an IAM Policy for the External Secrets Operator<\/h3>\n<p>Let&#8217;s start with creating a policy for assigning permission to the external secrets operator to get secrets from the AWS Secrets Manager.<\/p>\n<p>The policy we are going to create only gives read permission of AWS Secrets Manager to the external secrets manager.<\/p>\n<p>Use the policy command to create a JSON file with permission for the policy.<\/p>\n<pre><code>cat &lt;&lt; EOF &gt; policy.json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"AllowAccessToSecretsManager\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"secretsmanager:ListSecrets\",\n                \"secretsmanager:GetSecretValue\",\n                \"secretsmanager:DescribeSecret\",\n                \"secretsmanager:ListSecretVersionIds\"\n            ],\n            \"Resource\": \"arn:aws:secretsmanager:$Region:$Account-ID:secret:*\"\n        }\n    ]\n}\nEOF<\/code><\/pre>\n<p>Update the region where you have the secret and your account ID in the above command.<\/p>\n<blockquote><p><strong>Note:<\/strong> As a best practise, use the specific secret name instead of \u2018*\u2019, to avoid giving permission for all the secrets.<\/p>\n<p>For example: &#8220;Resource&#8221;: &#8220;arn:aws:secretsmanager:$Region:$Account-ID:secret:testing-secrets-manager&#8221;<\/p><\/blockquote>\n<p>Run the following command to create the policy with the <strong>policy.json<\/strong> file.<\/p>\n<pre><code>aws iam create-policy \\\n    --policy-name external-secrets-policy \\\n    --policy-document file:\/\/policy.json<\/code><\/pre>\n<p>Once the policy is created, run the following command to get the ARN of the policy and save it as a variable. This will be useful when associating the policy to a role.<\/p>\n<pre><code>export POLICY_ARN=$(aws iam list-policies --query \"Policies[?PolicyName=='external-secrets-policy'].Arn\" --output text)<\/code><\/pre>\n<p>Now, run the following command to check if the ARN is saved as a variable.<\/p>\n<pre><code>echo $POLICY_ARN<\/code><\/pre>\n<p>This command will show the policy&#8217;s ARN.<\/p>\n<h3 id=\"step-2-create-an-iam-role-for-the-service-account\">Step 2: Create an IAM Role for the Service Account<\/h3>\n<p>We will be using pod identity mapping to attach a role to a service account.<\/p>\n<p>Using the following command, write a trust relationship for pod identity in a JSON file.<\/p>\n<pre><code>cat &lt;&lt;EOF &gt; trust-policy.json\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Effect\": \"Allow\",\n      \"Principal\": {\n        \"Service\": \"pods.eks.amazonaws.com\"\n      },\n      \"Action\": [\n        \"sts:AssumeRole\",\n        \"sts:TagSession\"\n      ]\n    }\n  ]\n}\nEOF<\/code><\/pre>\n<p>Now, run the following command to create a role with the trust relationship in the <strong>trust-policy.json<\/strong> file.<\/p>\n<pre><code>aws iam create-role \\\n    --role-name  external-secrets-role \\\n    --assume-role-policy-document file:\/\/trust-policy.json<\/code><\/pre>\n<p>Once the role is created, run the following command to associate the policy with the role.<\/p>\n<pre><code>aws iam attach-role-policy \\\n    --role-name external-secrets-role \\\n    --policy-arn $POLICY_ARN<\/code><\/pre>\n<p>Run the following command to get the role&#8217;s ARN and save it as a variable. This will be useful when assigning the role to the service account.<\/p>\n<pre><code>export ROLE_ARN=$(aws iam get-role --role-name external-secrets-role --query \"Role.Arn\" --output text)<\/code><\/pre>\n<p>Now, run the following command to check if the ARN is saved as a variable.<\/p>\n<pre><code>echo $ROLE_ARN<\/code><\/pre>\n<p>This command will show the role&#8217;s ARN.<\/p>\n<h3 id=\"step-3-create-a-service-account-and-assign-the-role\">Step 3: Create a Service Account and Assign the Role<\/h3>\n<p>The next step is to create a service account and assign the role we created in the previous step using pod identity.<\/p>\n<p>First, create a namespace, we will be creating every resource inside the <strong>external-secrets <\/strong>namespace.<\/p>\n<pre><code>kubectl create ns external-secrets<\/code><\/pre>\n<p>Now, create a service account inside the namespace using the following command.<\/p>\n<pre><code>kubectl create sa external-secrets-sa -n external-secrets<\/code><\/pre>\n<p>Once the service account is created, run the following command to assign the role to the service account using pod identity.<\/p>\n<pre><code>eksctl create podidentityassociation \\\n    --cluster $Cluster-Name \\\n    --namespace external-secrets \\\n    --service-account-name external-secrets-sa \\\n    --role-arn $ROLE_ARN<\/code><\/pre>\n<p>In the above command, update the name of your cluster.<\/p>\n<p>To check if the role has been attached to the service account, run the following command.<\/p>\n<pre><code>eksctl get podidentityassociation --cluster $Cluster-Name <\/code><\/pre>\n<p>If the role is successfully attached to the service account, you will get the following output:<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-120-5.png\" class=\"kg-image\" alt=\"checking if role is attached to the service account\" loading=\"lazy\" width=\"2000\" height=\"514\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-120-5.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-120-5.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/03\/image-120-5.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w2400\/2025\/03\/image-120-5.png 2400w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<h3 id=\"step-4-install-external-secrets-operator\">Step 4: Install External Secrets Operator<\/h3>\n<p>Now, we are going to install External Secrets Operator using Helm.<\/p>\n<p>Add the repo for External Secrets Operator on your system using the command given below.<\/p>\n<pre><code>helm repo add external-secrets https:\/\/charts.external-secrets.io<\/code><\/pre>\n<p>After adding the repo, get the <strong>values.yaml<\/strong> file of the helm chart so that we can specify the service account we created in the<strong> <\/strong>previous step.<\/p>\n<pre><code>helm show values external-secrets\/external-secrets &gt; values.yaml<\/code><\/pre>\n<p>Open the values.yaml file set the create a service account to false because we have already created it and specify the name of the service account as shown below<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-122-6.png\" class=\"kg-image\" alt=\"updating values.yaml file\" loading=\"lazy\" width=\"661\" height=\"287\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-122-6.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-122-6.png 661w\"><\/figure>\n<p>This makes the service account we created earlier the default service account of the External Secrets pod.<\/p>\n<p>Now run the following command to install External Secrets Operator with the values.yaml file<\/p>\n<pre><code>helm install external-secrets external-secrets\/external-secrets \\\n  --namespace external-secrets \\\n  --set installCRDs=true \\\n  -f values.yaml<\/code><\/pre>\n<p>This command installs the External Secrets Operator on the external-secrets namespace.<\/p>\n<p>The CRDs are set to true so that the Helm can install the required custom resources for the External Secret Operator on the cluster.<\/p>\n<p>Use the following command to check if the pods of external secrets operator are up and running.<\/p>\n<pre><code>kubectl get po -n external-secrets<\/code><\/pre>\n<p>You will get the following output.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-126-6.png\" class=\"kg-image\" alt=\"to check if the pods of external secrets operator are up and running\" loading=\"lazy\" width=\"1896\" height=\"570\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-126-6.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-126-6.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/03\/image-126-6.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-126-6.png 1896w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<h3 id=\"step-5-create-a-secretstore\">Step 5: Create a SecretStore<\/h3>\n<p>To create a SecretStore, create a YML file <strong>secretstore.yml<\/strong> and copy the below content<\/p>\n<pre><code>apiVersion: external-secrets.io\/v1beta1\nkind: SecretStore\nmetadata:\n  name: aws-secret-store\n  namespace: external-secrets\nspec:\n  provider:\n    aws:\n      service: SecretsManager\n      region: $Region<\/code><\/pre>\n<p>Make sure to update<strong> <\/strong>the <strong>region<\/strong> where you have the secret.<\/p>\n<p>Run this YML file to create a SecretStore <strong>aws-secret-store<\/strong> on the namespace external-secrets.<\/p>\n<p>The SecretStore is the resource that tells the External Secrets controller how to access external resources.<\/p>\n<p>It uses the role we attached to the Service Account <strong>external-secrets-sa<\/strong> for authentication.<\/p>\n<p>You may have doubts about how it knows the correct service account to use.<\/p>\n<p>Since we are using pod identity, we cannot specify the service account with serviceAccountRef; it only works when using OIDC.<\/p>\n<p>Without <strong>serviceAccountRef<\/strong>, it will make use of the default service account of External Secrets pod, which is <strong>external-secrets-sa<\/strong> that we created in <strong>Step 3<\/strong>.<\/p>\n<p>Now, run the following command to create the secret store.<\/p>\n<pre><code>kubectl apply -f secretstore.yaml<\/code><\/pre>\n<p>Run the following command to check if the secret store has been created successfully.<\/p>\n<pre><code>kubectl get secretstore -n external-secrets<\/code><\/pre>\n<p>You will get the following output as shown below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-128-4.png\" class=\"kg-image\" alt=\"checking if the secret store has been created successfully\" loading=\"lazy\" width=\"1294\" height=\"450\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-128-4.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-128-4.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-128-4.png 1294w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>You can see in the above image, the status of the secret store is valid and it is ready to use.<\/p>\n<h3 id=\"step-6-create-an-external-secret\">Step 6: Create an External Secret<\/h3>\n<p>To create a Secret, create a YML file <strong>externalsecret.yaml<\/strong> and copy the below content<\/p>\n<pre><code>apiVersion: external-secrets.io\/v1beta1\nkind: ExternalSecret\nmetadata:\n  name: external-secret\n  namespace: external-secrets\nspec:\n  refreshInterval: 1h\n  secretStoreRef:\n    name: aws-secret-store\n    kind: SecretStore\n  target:\n    name: aws-secret\n    creationPolicy: Owner\n  data:\n  - secretKey: aws-secrets-manager\n    remoteRef:\n      key: {secret-name}\n      property: {secret-key}<\/code><\/pre>\n<p>Make sure to replace <strong>secret-name<\/strong> and <strong>secret-key<\/strong> with your Secrets Manager Secrets name and key of the value you want to fetch.<\/p>\n<p>The above YML file stores the secret on the target <strong>aws-secret<\/strong> on the namespace <strong>external-secrets<\/strong>.<\/p>\n<p>For every 1hr, it refreshes and updates the secrets from the SecretStore.<\/p>\n<p>It fetches the specific secret from <strong>AWS Secrets Manager<\/strong> and stores it in a Kubernetes secret as <strong>aws-secret<\/strong>.<\/p>\n<p>Now, run the following command to create an External Secret to sync the secret between AWS Secrets Manager and Kubernetes secret in the Cluster.<\/p>\n<pre><code>kubectl apply -f externalsecret.yaml<\/code><\/pre>\n<p>Run the following command to check if the external secrets have been created.<\/p>\n<pre><code>kubectl get externalsecret -n external-secrets<\/code><\/pre>\n<p>You can see the external secret is ready, and the secret is synced.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-131-6.png\" class=\"kg-image\" alt=\"checking if the external secrets have been created\" loading=\"lazy\" width=\"1728\" height=\"450\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-131-6.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-131-6.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/03\/image-131-6.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-131-6.png 1728w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Run the following command to check if the secret has been created successfully.<\/p>\n<pre><code>kubectl get secret aws-secret -n external-secrets<\/code><\/pre>\n<p>You will get the following output.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-132-5.png\" class=\"kg-image\" alt=\"checking if the secret has been created successfully\" loading=\"lazy\" width=\"1318\" height=\"450\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-132-5.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-132-5.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-132-5.png 1318w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<h3 id=\"step-7-verify-the-secret\">Step 7: Verify the Secret<\/h3>\n<p>Now, verify if the secret in the Kubernetes secret <strong>aws-secret<\/strong> and the secret in <strong>AWS Secrets Manager<\/strong> are the same.<\/p>\n<p>The secret in my Secrets Manager is given below.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-134-5.png\" class=\"kg-image\" alt=\"secret in aws secrets manager\" loading=\"lazy\" width=\"2000\" height=\"1209\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-134-5.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-134-5.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/03\/image-134-5.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-134-5.png 2120w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<p>Run the following command to get the secret aws-secret in YAML format.<\/p>\n<pre><code>kubectl get secret aws-secret -n external-secrets -o yaml<\/code><\/pre>\n<p>You will get the output as below<\/p>\n<pre><code>apiVersion: v1\ndata:\n  aws-secretsmanager: dGVzdGluZyBleHRlcm5hbCBzZWNyZXRzIG1hbmFnZXI=\nimmutable: false\nkind: Secret<\/code><\/pre>\n<p>Let&#8217;s decode the secret<strong> dGVzdGluZyBleHRlcm5hbCBzZWNyZXRzIG1hbmFnZXI= and see if the secret is the same as AWS Secrets Manager.<\/strong><\/p>\n<p>To decode the value, run the following command.<\/p>\n<pre><code>echo 'dGVzdGluZyBleHRlcm5hbCBzZWNyZXRzIG1hbmFnZXI=' | base64 --decode<\/code><\/pre>\n<p>You can see the secret is the same.<\/p>\n<figure class=\"kg-card kg-image-card\"><img decoding=\"async\" src=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-135-6.png\" class=\"kg-image\" alt=\"decoding secret value\" loading=\"lazy\" width=\"1800\" height=\"390\" srcset=\"https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w600\/2025\/03\/image-135-6.png 600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1000\/2025\/03\/image-135-6.png 1000w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/size\/w1600\/2025\/03\/image-135-6.png 1600w, https:\/\/storage.ghost.io\/c\/5f\/2f\/5f2f4d20-2abf-4534-8d40-7aa233aedd43\/content\/images\/2025\/03\/image-135-6.png 1800w\" sizes=\"auto, (min-width: 720px) 720px\"><\/figure>\n<h3 id=\"step-8-cleanup\">Step 8: Cleanup<\/h3>\n<p>If you no longer need to use the setup and want to clean it up, run the following commands.<\/p>\n<pre><code>helm uninstall external-secrets -n external-secrets\n\nkubectl delete ns external-secrets<\/code><\/pre>\n<h2 id=\"conclusion\">Conclusion<\/h2>\n<p>In this blog, we explored how to set up an External Secrets Operator on AWS EKS to fetch secrets from AWS Secrets Manager and keep them in sync.<\/p>\n<p>We also covered how to verify that the secrets are correct and provided commands to clean up the setup when it is no longer needed.<\/p>\n<p>If you\u2019re looking for native methods to integrate Secrets Manager with EKS, check out the <a href=\"https:\/\/devopscube.com\/secrets-store-csi-dirver-eks\/\" rel=\"noreferrer noopener\">Secrets Store CSI Driver integration with EKS<\/a>.<\/p>\n<hr>\n<p><strong>Ngu\u1ed3n:<\/strong> <a href=\"https:\/\/devopscube.com\/kubernetes-external-secrets-operator\/\" target=\"_blank\" rel=\"noopener noreferrer\">External Secrets Operator Setup for EKS using Secrets Manager \u2014 DevOpsCube<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Source: https:\/\/devopscube.com\/kubernetes-external-secrets-operator\/<\/p>\n","protected":false},"author":1,"featured_media":1010,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1009","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-devops"],"_links":{"self":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/1009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1009"}],"version-history":[{"count":0,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/posts\/1009\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=\/wp\/v2\/media\/1010"}],"wp:attachment":[{"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ngocha.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}