Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add robusta add on #1481

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/add-ons/robusta.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Robusta

Robusta is an open source platform for Kubernetes troubleshooting. It sits on top of your monitoring stack (Prometheus, Elasticsearch, etc.) and tells you why alerts occurred and how to fix them.

Robusta has three main parts, all open source:
- An automations engine for Kubernetes
- Builtin automations to enrich and fix common alerts
- Manual troubleshooting tools for everything else

For complete project documentation, please visit the [Robusta documentation site](https://docs.robusta.dev/master/index.html).

## Usage

Robusta can be deployed by enabling the add-on via the following.

```hcl
enable_robusta = true
```

### GitOps Configuration

The following properties are made available for use when managing the add-on via GitOps.

```hcl
robusta = {
enable = true
}
```
4 changes: 4 additions & 0 deletions modules/kubernetes-addons/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
| <a name="module_prometheus"></a> [prometheus](#module\_prometheus) | ./prometheus | n/a |
| <a name="module_promtail"></a> [promtail](#module\_promtail) | ./promtail | n/a |
| <a name="module_reloader"></a> [reloader](#module\_reloader) | ./reloader | n/a |
| <a name="module_robusta"></a> [robusta](#module\_robusta) | ./robusta | n/a |
| <a name="module_secrets_store_csi_driver"></a> [secrets\_store\_csi\_driver](#module\_secrets\_store\_csi\_driver) | ./secrets-store-csi-driver | n/a |
| <a name="module_smb_csi_driver"></a> [smb\_csi\_driver](#module\_smb\_csi\_driver) | ./smb-csi-driver | n/a |
| <a name="module_spark_history_server"></a> [spark\_history\_server](#module\_spark\_history\_server) | ./spark-history-server | n/a |
Expand Down Expand Up @@ -242,6 +243,7 @@
| <a name="input_enable_prometheus"></a> [enable\_prometheus](#input\_enable\_prometheus) | Enable Community Prometheus add-on | `bool` | `false` | no |
| <a name="input_enable_promtail"></a> [enable\_promtail](#input\_enable\_promtail) | Enable Promtail add-on | `bool` | `false` | no |
| <a name="input_enable_reloader"></a> [enable\_reloader](#input\_enable\_reloader) | Enable Reloader add-on | `bool` | `false` | no |
| <a name="input_enable_robusta"></a> [enable\_robusta](#input\_enable\_robusta) | Enable Robusta add-on | `bool` | `false` | no |
| <a name="input_enable_secrets_store_csi_driver"></a> [enable\_secrets\_store\_csi\_driver](#input\_enable\_secrets\_store\_csi\_driver) | Enable CSI Secrets Store Provider | `bool` | `false` | no |
| <a name="input_enable_secrets_store_csi_driver_provider_aws"></a> [enable\_secrets\_store\_csi\_driver\_provider\_aws](#input\_enable\_secrets\_store\_csi\_driver\_provider\_aws) | Enable AWS CSI Secrets Store Provider | `bool` | `false` | no |
| <a name="input_enable_self_managed_aws_ebs_csi_driver"></a> [enable\_self\_managed\_aws\_ebs\_csi\_driver](#input\_enable\_self\_managed\_aws\_ebs\_csi\_driver) | Enable self-managed aws-ebs-csi-driver add-on; enable\_self\_managed\_aws\_ebs\_csi\_driver and enable\_amazon\_eks\_aws\_ebs\_csi\_driver are mutually exclusive | `bool` | `false` | no |
Expand Down Expand Up @@ -305,6 +307,7 @@
| <a name="input_promtail_helm_config"></a> [promtail\_helm\_config](#input\_promtail\_helm\_config) | Promtail Helm Chart config | `any` | `{}` | no |
| <a name="input_reloader_helm_config"></a> [reloader\_helm\_config](#input\_reloader\_helm\_config) | Reloader Helm Chart config | `any` | `{}` | no |
| <a name="input_remove_default_coredns_deployment"></a> [remove\_default\_coredns\_deployment](#input\_remove\_default\_coredns\_deployment) | Determines whether the default deployment of CoreDNS is removed and ownership of kube-dns passed to Helm | `bool` | `false` | no |
| <a name="input_robusta_helm_config"></a> [robusta\_helm\_config](#input\_robusta\_helm\_config) | Robusta Helm Chart config | `any` | `{}` | no |
| <a name="input_secrets_store_csi_driver_helm_config"></a> [secrets\_store\_csi\_driver\_helm\_config](#input\_secrets\_store\_csi\_driver\_helm\_config) | CSI Secrets Store Provider Helm Configurations | `any` | `null` | no |
| <a name="input_self_managed_aws_ebs_csi_driver_helm_config"></a> [self\_managed\_aws\_ebs\_csi\_driver\_helm\_config](#input\_self\_managed\_aws\_ebs\_csi\_driver\_helm\_config) | Self-managed aws-ebs-csi-driver Helm chart config | `any` | `{}` | no |
| <a name="input_self_managed_coredns_helm_config"></a> [self\_managed\_coredns\_helm\_config](#input\_self\_managed\_coredns\_helm\_config) | Self-managed CoreDNS Helm chart config | `any` | `{}` | no |
Expand Down Expand Up @@ -397,6 +400,7 @@
| <a name="output_prometheus"></a> [prometheus](#output\_prometheus) | Map of attributes of the Helm release and IRSA created |
| <a name="output_promtail"></a> [promtail](#output\_promtail) | Map of attributes of the Helm release and IRSA created |
| <a name="output_reloader"></a> [reloader](#output\_reloader) | Map of attributes of the Helm release and IRSA created |
| <a name="output_robusta"></a> [robusta](#output\_robusta) | Map of attributes of the Helm release and IRSA created |
| <a name="output_secrets_store_csi_driver"></a> [secrets\_store\_csi\_driver](#output\_secrets\_store\_csi\_driver) | Map of attributes of the Helm release and IRSA created |
| <a name="output_smb_csi_driver"></a> [smb\_csi\_driver](#output\_smb\_csi\_driver) | Map of attributes of the Helm release and IRSA created |
| <a name="output_spark_history_server"></a> [spark\_history\_server](#output\_spark\_history\_server) | Map of attributes of the Helm release and IRSA created |
Expand Down
1 change: 1 addition & 0 deletions modules/kubernetes-addons/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ locals {
consul = var.enable_consul ? module.consul[0].argocd_gitops_config : null
thanos = var.enable_thanos ? module.thanos[0].argocd_gitops_config : null
kubeStateMetrics = var.enable_kube_state_metrics ? module.kube_state_metrics[0].argocd_gitops_config : null
robusta = var.enable_robusta ? module.robusta[0].argocd_gitops_config : null
}

addon_context = {
Expand Down
9 changes: 9 additions & 0 deletions modules/kubernetes-addons/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ module "portworx" {
helm_config = var.portworx_helm_config
addon_context = local.addon_context
}

module "prometheus" {
count = var.enable_prometheus ? 1 : 0
source = "./prometheus"
Expand All @@ -414,6 +415,14 @@ module "reloader" {
addon_context = local.addon_context
}

module "robusta" {
count = var.enable_robusta ? 1 : 0
source = "./robusta"
helm_config = var.robusta_helm_config
manage_via_gitops = var.argocd_manage_add_ons
addon_context = local.addon_context
}

module "spark_history_server" {
count = var.enable_spark_history_server ? 1 : 0
source = "./spark-history-server"
Expand Down
5 changes: 5 additions & 0 deletions modules/kubernetes-addons/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ output "reloader" {
value = try(module.reloader[0], null)
}

output "robusta" {
description = "Map of attributes of the Helm release and IRSA created"
value = try(module.robusta[0], null)
}

output "secrets_store_csi_driver" {
description = "Map of attributes of the Helm release and IRSA created"
value = try(module.secrets_store_csi_driver[0], null)
Expand Down
41 changes: 41 additions & 0 deletions modules/kubernetes-addons/robusta/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Robusta Helm Chart

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |

## Providers

No providers.

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_helm_addon"></a> [helm\_addon](#module\_helm\_addon) | ../helm-addon | n/a |

## Resources

No resources.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_addon_context"></a> [addon\_context](#input\_addon\_context) | Input configuration for the addon | <pre>object({<br> aws_caller_identity_account_id = string<br> aws_caller_identity_arn = string<br> aws_eks_cluster_endpoint = string<br> aws_partition_id = string<br> aws_region_name = string<br> eks_cluster_id = string<br> eks_oidc_issuer_url = string<br> eks_oidc_provider_arn = string<br> tags = map(string)<br> })</pre> | n/a | yes |
| <a name="input_helm_config"></a> [helm\_config](#input\_helm\_config) | Helm provider config for Robusta | `any` | `{}` | no |
| <a name="input_manage_via_gitops"></a> [manage\_via\_gitops](#input\_manage\_via\_gitops) | Determines if the add-on should be managed via GitOps | `bool` | `false` | no |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_argocd_gitops_config"></a> [argocd\_gitops\_config](#output\_argocd\_gitops\_config) | Configuration used for managing the add-on with ArgoCD |
| <a name="output_irsa_arn"></a> [irsa\_arn](#output\_irsa\_arn) | IAM role ARN for the service account |
| <a name="output_irsa_name"></a> [irsa\_name](#output\_irsa\_name) | IAM role name for the service account |
| <a name="output_release_metadata"></a> [release\_metadata](#output\_release\_metadata) | Map of attributes of the Helm release metadata |
| <a name="output_service_account"></a> [service\_account](#output\_service\_account) | Name of Kubernetes service account |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
25 changes: 25 additions & 0 deletions modules/kubernetes-addons/robusta/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
locals {
name = "robusta"
}

module "helm_addon" {

source = "../helm-addon"

# https://github.com/robusta-dev/robusta/blob/master/helm/robusta/Chart.yaml
helm_config = merge(
{
name = local.name
chart = local.name
repository = "https://robusta-charts.storage.googleapis.com"
version = "v0.10.13"
namespace = local.name
create_namespace = true
description = "Robusta Helm Chart deployment configuration"
},
var.helm_config
)

manage_via_gitops = var.manage_via_gitops
addon_context = var.addon_context
}
24 changes: 24 additions & 0 deletions modules/kubernetes-addons/robusta/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
output "argocd_gitops_config" {
description = "Configuration used for managing the add-on with ArgoCD"
value = var.manage_via_gitops ? { enable = true } : null
}

output "release_metadata" {
description = "Map of attributes of the Helm release metadata"
value = module.helm_addon.release_metadata
}

output "irsa_arn" {
description = "IAM role ARN for the service account"
value = module.helm_addon.irsa_arn
}

output "irsa_name" {
description = "IAM role name for the service account"
value = module.helm_addon.irsa_name
}

output "service_account" {
description = "Name of Kubernetes service account"
value = module.helm_addon.service_account
}
26 changes: 26 additions & 0 deletions modules/kubernetes-addons/robusta/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
variable "helm_config" {
description = "Helm provider config for Robusta"
type = any
default = {}
}

variable "manage_via_gitops" {
description = "Determines if the add-on should be managed via GitOps"
type = bool
default = false
}

variable "addon_context" {
description = "Input configuration for the addon"
type = object({
aws_caller_identity_account_id = string
aws_caller_identity_arn = string
aws_eks_cluster_endpoint = string
aws_partition_id = string
aws_region_name = string
eks_cluster_id = string
eks_oidc_issuer_url = string
eks_oidc_provider_arn = string
tags = map(string)
})
}
3 changes: 3 additions & 0 deletions modules/kubernetes-addons/robusta/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
terraform {
required_version = ">= 1.0"
}
14 changes: 14 additions & 0 deletions modules/kubernetes-addons/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1472,3 +1472,17 @@ variable "consul_helm_config" {
type = any
default = {}
}


#------------ Robusta addon --------------
variable "enable_robusta" {
description = "Enable Robusta add-on"
type = bool
default = false
}

variable "robusta_helm_config" {
description = "Robusta Helm Chart config"
type = any
default = {}
}