diff --git a/README.md b/README.md index 09bc504d..b2c9c2c1 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ module "eks_blueprints_addons" { | Name | Source | Version | |------|--------|---------| +| [argo\_events](#module\_argo\_events) | aws-ia/eks-blueprints-addon/aws | 1.0.0 | | [argo\_rollouts](#module\_argo\_rollouts) | aws-ia/eks-blueprints-addon/aws | 1.0.0 | | [argo\_workflows](#module\_argo\_workflows) | aws-ia/eks-blueprints-addon/aws | 1.0.0 | | [argocd](#module\_argocd) | aws-ia/eks-blueprints-addon/aws | 1.0.0 | @@ -151,6 +152,7 @@ module "eks_blueprints_addons" { | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| +| [argo\_events](#input\_argo\_events) | Argo Events add-on configuration values | `any` | `{}` | no | | [argo\_rollouts](#input\_argo\_rollouts) | Argo Rollouts add-on configuration values | `any` | `{}` | no | | [argo\_workflows](#input\_argo\_workflows) | Argo Workflows add-on configuration values | `any` | `{}` | no | | [argocd](#input\_argocd) | ArgoCD add-on configuration values | `any` | `{}` | no | @@ -176,6 +178,7 @@ module "eks_blueprints_addons" { | [create\_delay\_duration](#input\_create\_delay\_duration) | The duration to wait before creating resources | `string` | `"30s"` | no | | [eks\_addons](#input\_eks\_addons) | Map of EKS add-on configurations to enable for the cluster. Add-on name can be the map keys or set with `name` | `any` | `{}` | no | | [eks\_addons\_timeouts](#input\_eks\_addons\_timeouts) | Create, update, and delete timeout configurations for the EKS add-ons | `map(string)` | `{}` | no | +| [enable\_argo\_events](#input\_enable\_argo\_events) | Enable Argo Events add-on | `bool` | `false` | no | | [enable\_argo\_rollouts](#input\_enable\_argo\_rollouts) | Enable Argo Rollouts add-on | `bool` | `false` | no | | [enable\_argo\_workflows](#input\_enable\_argo\_workflows) | Enable Argo workflows add-on | `bool` | `false` | no | | [enable\_argocd](#input\_enable\_argocd) | Enable Argo CD Kubernetes add-on | `bool` | `false` | no | @@ -230,6 +233,7 @@ module "eks_blueprints_addons" { | Name | Description | |------|-------------| +| [argo\_events](#output\_argo\_events) | Map of attributes of the Helm release created | | [argo\_rollouts](#output\_argo\_rollouts) | Map of attributes of the Helm release created | | [argo\_workflows](#output\_argo\_workflows) | Map of attributes of the Helm release created | | [argocd](#output\_argocd) | Map of attributes of the Helm release created | diff --git a/docs/addons/argo-events.md b/docs/addons/argo-events.md new file mode 100644 index 00000000..b5dd6498 --- /dev/null +++ b/docs/addons/argo-events.md @@ -0,0 +1,34 @@ +# Argo Events + +[Argo Events](https://argoproj.github.io/argo-events/) is an open source container-native event-driven workflow automation framework for Kubernetes which helps you trigger K8s objects, Argo Workflows, Serverless workloads, etc. on events from a variety of sources. Argo Events is implemented as a Kubernetes CRD (Custom Resource Definition). + +## Usage + +Argo Events can be deployed by enabling the add-on via the following. + +```hcl +enable_argo_events = true +``` + +You can optionally customize the Helm chart that deploys Argo Events via the following configuration. + +```hcl + enable_argo_events = true + + argo_events = { + name = "argo-events" + chart_version = "2.4.0" + repository = "https://argoproj.github.io/argo-helm" + namespace = "argo-events" + values = [templatefile("${path.module}/values.yaml", {})] + } + +``` + +Verify argo-events pods are running. + +```sh +$ kubectl get pods -n argo-events +NAME READY STATUS RESTARTS AGE +argo-events-controller-manager-bfb894cdb-k8hzn 1/1 Running 0 11m +``` diff --git a/main.tf b/main.tf index 4ac42072..990267c6 100644 --- a/main.tf +++ b/main.tf @@ -225,6 +225,60 @@ module "argocd" { tags = var.tags } +################################################################################ +# Argo Events +################################################################################ + +module "argo_events" { + source = "aws-ia/eks-blueprints-addon/aws" + version = "1.0.0" + + create = var.enable_argo_events + + # https://github.com/argoproj/argo-helm/tree/main/charts/argo-events + # (there is no offical helm chart for argo-events) + name = try(var.argo_events.name, "argo-events") + description = try(var.argo_events.description, "A Helm chart to install the Argo Events") + namespace = try(var.argo_events.namespace, "argo-events") + create_namespace = try(var.argo_events.create_namespace, true) + chart = "argo-events" + chart_version = try(var.argo_events.chart_version, "2.4.0") + repository = try(var.argo_events.repository, "https://argoproj.github.io/argo-helm") + values = try(var.argo_events.values, []) + + timeout = try(var.argo_events.timeout, null) + repository_key_file = try(var.argo_events.repository_key_file, null) + repository_cert_file = try(var.argo_events.repository_cert_file, null) + repository_ca_file = try(var.argo_events.repository_ca_file, null) + repository_username = try(var.argo_events.repository_username, null) + repository_password = try(var.argo_events.repository_password, null) + devel = try(var.argo_events.devel, null) + verify = try(var.argo_events.verify, null) + keyring = try(var.argo_events.keyring, null) + disable_webhooks = try(var.argo_events.disable_webhooks, null) + reuse_values = try(var.argo_events.reuse_values, null) + reset_values = try(var.argo_events.reset_values, null) + force_update = try(var.argo_events.force_update, null) + recreate_pods = try(var.argo_events.recreate_pods, null) + cleanup_on_fail = try(var.argo_events.cleanup_on_fail, null) + max_history = try(var.argo_events.max_history, null) + atomic = try(var.argo_events.atomic, null) + skip_crds = try(var.argo_events.skip_crds, null) + render_subchart_notes = try(var.argo_events.render_subchart_notes, null) + disable_openapi_validation = try(var.argo_events.disable_openapi_validation, null) + wait = try(var.argo_events.wait, false) + wait_for_jobs = try(var.argo_events.wait_for_jobs, null) + dependency_update = try(var.argo_events.dependency_update, null) + replace = try(var.argo_events.replace, null) + lint = try(var.argo_events.lint, null) + + postrender = try(var.argo_events.postrender, []) + set = try(var.argo_events.set, []) + set_sensitive = try(var.argo_events.set_sensitive, []) + + tags = var.tags +} + ################################################################################ # AWS Cloudwatch Metrics ################################################################################ diff --git a/outputs.tf b/outputs.tf index 8d962228..a2e3b035 100644 --- a/outputs.tf +++ b/outputs.tf @@ -13,6 +13,11 @@ output "argocd" { value = module.argocd } +output "argo_events" { + description = "Map of attributes of the Helm release created" + value = module.argo_events +} + output "aws_cloudwatch_metrics" { description = "Map of attributes of the Helm release and IRSA created" value = module.aws_cloudwatch_metrics diff --git a/variables.tf b/variables.tf index 44608608..3411b758 100644 --- a/variables.tf +++ b/variables.tf @@ -94,6 +94,22 @@ variable "argocd" { default = {} } +################################################################################ +# Argo Events +################################################################################ + +variable "enable_argo_events" { + description = "Enable Argo Events add-on" + type = bool + default = false +} + +variable "argo_events" { + description = "Argo Events add-on configuration values" + type = any + default = {} +} + ################################################################################ # AWS Cloudwatch Metrics ################################################################################