Skip to content

Commit

Permalink
add variables to enable auto deploy addons and workloads
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Santana <[email protected]>
  • Loading branch information
csantanapr committed Oct 30, 2023
1 parent a0702a7 commit 86fcaa5
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
11 changes: 9 additions & 2 deletions patterns/gitops/getting-started-argocd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,19 @@ The output looks like the following:
```
The labels offer a straightforward way to enable or disable an addon in ArgoCD for the cluster.
```shell
kubectl get secret -n argocd -l argocd.argoproj.io/secret-type=cluster -o json | jq '.items[0].metadata.labels'
kubectl get secret -n argocd -l argocd.argoproj.io/secret-type=cluster -o json | jq '.items[0].metadata.labels' | grep -v false | jq .
```
The output looks like the following:
```json
{
"argocd.argoproj.io/secret-type": "cluster",
"aws_cluster_name": "getting-started-gitops",
"cluster_name": "in-cluster",
"enable_argocd": "true",
"enable_aws_load_balancer_controller": "true",
"enable_metrics_server": "true",
"kubernetes_version": "1.28",
"environment": "dev",
"kubernetes_version": "1.28"
}
```

Expand Down Expand Up @@ -169,6 +172,10 @@ Check the application's CPU and memory metrics:
```shell
kubectl top pods -n game-2048
```
Check all pods CPU and memory metrics:
```shell
kubectl top pods -A
```

## Destroy the EKS Cluster
To tear down all the resources and the EKS cluster, run the following command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,4 @@ spec:
syncOptions:
- CreateNamespace=true
retry:
backoff:
duration: 1m
limit: 60
11 changes: 11 additions & 0 deletions patterns/gitops/getting-started-argocd/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,16 @@ locals {
}
)

argocd_app_of_appsets_addons = var.enable_gitops_auto_addons ? {
addons = file("${path.module}/bootstrap/addons.yaml")
} : {}
argocd_app_of_appsets_workloads = var.enable_gitops_auto_workloads ? {
workloads = file("${path.module}/bootstrap/workloads.yaml")
} : {}

argocd_apps = merge(local.argocd_app_of_appsets_addons, local.argocd_app_of_appsets_workloads)


tags = {
Blueprint = local.name
GithubRepo = "github.com/aws-ia/terraform-aws-eks-blueprints"
Expand All @@ -137,6 +147,7 @@ module "gitops_bridge_bootstrap" {
metadata = local.addons_metadata
addons = local.addons
}
apps = local.argocd_apps
}

################################################################################
Expand Down
12 changes: 12 additions & 0 deletions patterns/gitops/getting-started-argocd/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,15 @@ variable "gitops_workload_path" {
type = string
default = "getting-started-argocd/k8s"
}

variable "enable_gitops_auto_addons" {
description = "Automatically deploy addons"
type = bool
default = false
}

variable "enable_gitops_auto_workloads" {
description = "Automatically deploy addons"
type = bool
default = false
}

0 comments on commit 86fcaa5

Please sign in to comment.