Skip to content

Commit

Permalink
feat: Add argo events addon module (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovaleanu authored Jul 24, 2023
1 parent 61c4fc0 commit c4c821c
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module "eks_blueprints_addons" {

| Name | Source | Version |
|------|--------|---------|
| <a name="module_argo_events"></a> [argo\_events](#module\_argo\_events) | aws-ia/eks-blueprints-addon/aws | 1.0.0 |
| <a name="module_argo_rollouts"></a> [argo\_rollouts](#module\_argo\_rollouts) | aws-ia/eks-blueprints-addon/aws | 1.0.0 |
| <a name="module_argo_workflows"></a> [argo\_workflows](#module\_argo\_workflows) | aws-ia/eks-blueprints-addon/aws | 1.0.0 |
| <a name="module_argocd"></a> [argocd](#module\_argocd) | aws-ia/eks-blueprints-addon/aws | 1.0.0 |
Expand Down Expand Up @@ -151,6 +152,7 @@ module "eks_blueprints_addons" {

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_argo_events"></a> [argo\_events](#input\_argo\_events) | Argo Events add-on configuration values | `any` | `{}` | no |
| <a name="input_argo_rollouts"></a> [argo\_rollouts](#input\_argo\_rollouts) | Argo Rollouts add-on configuration values | `any` | `{}` | no |
| <a name="input_argo_workflows"></a> [argo\_workflows](#input\_argo\_workflows) | Argo Workflows add-on configuration values | `any` | `{}` | no |
| <a name="input_argocd"></a> [argocd](#input\_argocd) | ArgoCD add-on configuration values | `any` | `{}` | no |
Expand All @@ -176,6 +178,7 @@ module "eks_blueprints_addons" {
| <a name="input_create_delay_duration"></a> [create\_delay\_duration](#input\_create\_delay\_duration) | The duration to wait before creating resources | `string` | `"30s"` | no |
| <a name="input_eks_addons"></a> [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 |
| <a name="input_eks_addons_timeouts"></a> [eks\_addons\_timeouts](#input\_eks\_addons\_timeouts) | Create, update, and delete timeout configurations for the EKS add-ons | `map(string)` | `{}` | no |
| <a name="input_enable_argo_events"></a> [enable\_argo\_events](#input\_enable\_argo\_events) | Enable Argo Events add-on | `bool` | `false` | no |
| <a name="input_enable_argo_rollouts"></a> [enable\_argo\_rollouts](#input\_enable\_argo\_rollouts) | Enable Argo Rollouts add-on | `bool` | `false` | no |
| <a name="input_enable_argo_workflows"></a> [enable\_argo\_workflows](#input\_enable\_argo\_workflows) | Enable Argo workflows add-on | `bool` | `false` | no |
| <a name="input_enable_argocd"></a> [enable\_argocd](#input\_enable\_argocd) | Enable Argo CD Kubernetes add-on | `bool` | `false` | no |
Expand Down Expand Up @@ -230,6 +233,7 @@ module "eks_blueprints_addons" {

| Name | Description |
|------|-------------|
| <a name="output_argo_events"></a> [argo\_events](#output\_argo\_events) | Map of attributes of the Helm release created |
| <a name="output_argo_rollouts"></a> [argo\_rollouts](#output\_argo\_rollouts) | Map of attributes of the Helm release created |
| <a name="output_argo_workflows"></a> [argo\_workflows](#output\_argo\_workflows) | Map of attributes of the Helm release created |
| <a name="output_argocd"></a> [argocd](#output\_argocd) | Map of attributes of the Helm release created |
Expand Down
34 changes: 34 additions & 0 deletions docs/addons/argo-events.md
Original file line number Diff line number Diff line change
@@ -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
```
54 changes: 54 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down

0 comments on commit c4c821c

Please sign in to comment.