Skip to content

Commit 423a713

Browse files
committed
fix bugs
Signed-off-by: Carlos Santana <csantana23@gmail.com>
1 parent ad2c485 commit 423a713

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

argocd/iac/terraform/examples/eks/external-secrets/README.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,8 @@
22

33
This example shows how to deploy Amazon EKS with addons configured via ArgoCD
44

5-
The example demonstrate how to use private git repository for workload apps.
6-
7-
The example stores your ssh key in AWS Secret Manager, and External Secret Operator to create the secret
8-
for ArgoCD to access the git repositories.
9-
10-
## Prerequisites
11-
- Create a Github ssh key file, example assumes the file path `~/.ssh/id_rsa`, update `main.tf` if using a different location
5+
The example demonstrate how to use [External Secret Operator(ESO)](https://external-secrets.io) with
6+
AWS Secret Manager and AWS Systems Manager Parameter Store
127

138
Deploy EKS Cluster
149
```shell
@@ -21,16 +16,16 @@ Access Terraform output to configure `kubectl` and `argocd`
2116
terraform output
2217
```
2318

24-
There is a file `github.yaml` located in the addons git repository `clusters/ex-external-secrets/secret/` this file creates the resources `ClusterSecretStore` and `ExternalSecret`. Update git url in this file when you change the git repository for the workloads specified in `bootstrap/workloads.yaml`. Also update the region in this file if you are using a different region for AWS Secret Manager.
25-
26-
To verify that the ArgoCD secret with ssh key is created run the following command
19+
Verify that the secrets `external-secrets-ps` and `external-secrets-sm` are present
2720
```shell
28-
kubectl get secret private-repo-creds -n argocd
21+
kubectl get secrets -n external-secrets
2922
```
23+
3024
Expected output, should have 3 data items in secret
3125
```
32-
NAME TYPE DATA AGE
33-
private-repo-creds Opaque 3 6m45s
26+
NAME TYPE DATA AGE
27+
external-secrets-ps Opaque 2 1m
28+
external-secrets-sm Opaque 2 1m
3429
```
3530

3631
Destroy EKS Cluster

argocd/iac/terraform/examples/eks/external-secrets/bootstrap/addons.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: argoproj.io/v1alpha1
33
kind: ApplicationSet
44
metadata:
55
name: bootstrap-addons
6+
namespace: argocd
67
spec:
78
syncPolicy:
89
preserveResourcesOnDeletion: true

argocd/iac/terraform/examples/eks/external-secrets/bootstrap/workloads.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ apiVersion: argoproj.io/v1alpha1
33
kind: ApplicationSet
44
metadata:
55
name: external-secrets-example
6+
namespace: argocd
67
spec:
78
syncPolicy:
89
preserveResourcesOnDeletion: true
@@ -30,12 +31,12 @@ spec:
3031
clusterSecretStore:
3132
secret: '{{metadata.annotations.workload_sm_secret}}'
3233
secretStore:
33-
secret: '{{metadata.annotations.workload_pm_secret}}'
34+
secret: '{{metadata.annotations.workload_ps_secret}}'
3435
destination:
3536
namespace: '{{metadata.annotations.external_secrets_namespace}}'
3637
name: '{{name}}'
3738
syncPolicy:
38-
automated:
39+
automated: {}
3940
retry:
4041
backoff:
4142
duration: 1m

argocd/iac/terraform/examples/eks/external-secrets/main.tf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ locals {
6565

6666

6767
aws_addons = {
68-
enable_cert_manager = true
68+
#enable_cert_manager = true
6969
#enable_aws_efs_csi_driver = true
7070
#enable_aws_fsx_csi_driver = true
7171
#enable_aws_cloudwatch_metrics = true
@@ -92,7 +92,7 @@ locals {
9292
#enable_ingress_nginx = true
9393
#enable_kyverno = true
9494
#enable_kube_prometheus_stack = true
95-
enable_metrics_server = true
95+
#enable_metrics_server = true
9696
#enable_prometheus_adapter = true
9797
#enable_secrets_store_csi_driver = true
9898
#enable_vpa = true
@@ -114,19 +114,19 @@ locals {
114114
gitops_bridge_repo_revision = local.gitops_addons_revision
115115
},
116116
{
117-
workload_repo_url = local.gitops_addons_url
118-
workload_repo_path = local.gitops_addons_path
119-
workload_repo_revision = local.gitops_addons_revision
117+
workload_repo_url = local.gitops_workload_url
118+
workload_repo_path = local.gitops_workload_path
119+
workload_repo_revision = local.gitops_workload_revision
120120
},
121121
{
122-
workload_sm_secret = aws_ssm_parameter.secret_parameter.name
123-
workload_pm_secret = aws_secretsmanager_secret.secret.name
122+
workload_sm_secret = aws_secretsmanager_secret.secret.name
123+
workload_ps_secret = aws_ssm_parameter.secret_parameter.name
124124
}
125125
)
126126

127127
argocd_bootstrap_app_of_apps = {
128-
addons = file("${path.module}/bootstrap/addons.yaml")
129-
addons = file("${path.module}/bootstrap/workloads.yaml")
128+
addons = file("${path.module}/bootstrap/addons.yaml")
129+
workloads = file("${path.module}/bootstrap/workloads.yaml")
130130
}
131131

132132
vpc_cidr = "10.0.0.0/16"

0 commit comments

Comments
 (0)