mirror of
https://github.com/storytold/terraform-aws-observability-accelerator.git
synced 2026-10-09 00:09:43 +00:00
Add EKS Istio Dashboards (#194)
* Update readme * checking in new readme example * new istio readme * Updated mkdocs.yml * checking in readme files * checking in all changes * Test * Test * Test * Testing * Testing * test * Update main.tf * Update outputs.tf * Adding Istio dashboards * Updating URL's * Removing dashboards * Updates from pre-commit * Update istio.md * Removing empty file * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update README.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update istio.md * Update README.md * Update README.md * Istio Documentation Updates Added istioctl prereq, updated dashboards image * Updated setup and cleanup of Istio Bookinfo Updated Istio Bookinfo sample app instructions, included clean up of Bookinfo resources * Updating image and removing advanced configuration -Switching image to Github generated link -Removing advanced configuration section --------- Co-authored-by: Prithvi Reddy <ypreddy@amazon.com> Co-authored-by: Prithvi Reddy <47993564+preddy727@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
# Existing Cluster with the AWS Observability accelerator base module, Tetrate Istio Add-on and Istio monitoring
|
||||
|
||||
View the full documentation for this example [here](https://aws-observability.github.io/terraform-aws-observability-accelerator/eks/istio)
|
||||
|
||||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|
||||
## Requirements
|
||||
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.1.0 |
|
||||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 4.0.0 |
|
||||
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.4.1 |
|
||||
| <a name="requirement_kubectl"></a> [kubectl](#requirement\_kubectl) | >= 1.14 |
|
||||
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.10 |
|
||||
|
||||
## Providers
|
||||
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 4.0.0 |
|
||||
|
||||
## Modules
|
||||
|
||||
| Name | Source | Version |
|
||||
|------|--------|---------|
|
||||
| <a name="module_aws_observability_accelerator"></a> [aws\_observability\_accelerator](#module\_aws\_observability\_accelerator) | ../../ | n/a |
|
||||
| <a name="module_eks_blueprints_kubernetes_addons"></a> [eks\_blueprints\_kubernetes\_addons](#module\_eks\_blueprints\_kubernetes\_addons) | github.com/aws-ia/terraform-aws-eks-blueprints//modules/kubernetes-addons | v4.32.0 |
|
||||
| <a name="module_eks_monitoring"></a> [eks\_monitoring](#module\_eks\_monitoring) | ../../modules/eks-monitoring | n/a |
|
||||
|
||||
## Resources
|
||||
|
||||
| Name | Type |
|
||||
|------|------|
|
||||
| [aws_eks_cluster.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster) | data source |
|
||||
| [aws_eks_cluster_auth.this](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster_auth) | data source |
|
||||
|
||||
## Inputs
|
||||
|
||||
| Name | Description | Type | Default | Required |
|
||||
|------|-------------|------|---------|:--------:|
|
||||
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS Region | `string` | n/a | yes |
|
||||
| <a name="input_eks_cluster_id"></a> [eks\_cluster\_id](#input\_eks\_cluster\_id) | Name of the EKS cluster | `string` | `"eks-cluster-with-vpc"` | no |
|
||||
| <a name="input_enable_dashboards"></a> [enable\_dashboards](#input\_enable\_dashboards) | Enables or disables curated dashboards. Dashboards are managed by the Grafana Operator | `bool` | `true` | no |
|
||||
| <a name="input_grafana_api_key"></a> [grafana\_api\_key](#input\_grafana\_api\_key) | API key for authorizing the Grafana provider to make changes to Amazon Managed Grafana | `string` | n/a | yes |
|
||||
| <a name="input_managed_grafana_workspace_id"></a> [managed\_grafana\_workspace\_id](#input\_managed\_grafana\_workspace\_id) | Amazon Managed Grafana Workspace ID | `string` | n/a | yes |
|
||||
| <a name="input_managed_prometheus_workspace_id"></a> [managed\_prometheus\_workspace\_id](#input\_managed\_prometheus\_workspace\_id) | Amazon Managed Service for Prometheus Workspace ID | `string` | `""` | no |
|
||||
|
||||
## Outputs
|
||||
|
||||
| Name | Description |
|
||||
|------|-------------|
|
||||
| <a name="output_aws_region"></a> [aws\_region](#output\_aws\_region) | AWS Region |
|
||||
| <a name="output_eks_cluster_id"></a> [eks\_cluster\_id](#output\_eks\_cluster\_id) | EKS Cluster Id |
|
||||
| <a name="output_eks_cluster_version"></a> [eks\_cluster\_version](#output\_eks\_cluster\_version) | EKS Cluster version |
|
||||
| <a name="output_managed_prometheus_workspace_endpoint"></a> [managed\_prometheus\_workspace\_endpoint](#output\_managed\_prometheus\_workspace\_endpoint) | Amazon Managed Prometheus workspace endpoint |
|
||||
| <a name="output_managed_prometheus_workspace_id"></a> [managed\_prometheus\_workspace\_id](#output\_managed\_prometheus\_workspace\_id) | Amazon Managed Prometheus workspace ID |
|
||||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|
||||
@@ -0,0 +1,121 @@
|
||||
provider "aws" {
|
||||
region = local.region
|
||||
}
|
||||
|
||||
data "aws_eks_cluster_auth" "this" {
|
||||
name = var.eks_cluster_id
|
||||
}
|
||||
|
||||
data "aws_eks_cluster" "this" {
|
||||
name = var.eks_cluster_id
|
||||
}
|
||||
|
||||
provider "kubernetes" {
|
||||
host = local.eks_cluster_endpoint
|
||||
cluster_ca_certificate = base64decode(data.aws_eks_cluster.this.certificate_authority[0].data)
|
||||
token = data.aws_eks_cluster_auth.this.token
|
||||
}
|
||||
|
||||
provider "helm" {
|
||||
kubernetes {
|
||||
host = local.eks_cluster_endpoint
|
||||
cluster_ca_certificate = base64decode(data.aws_eks_cluster.this.certificate_authority[0].data)
|
||||
token = data.aws_eks_cluster_auth.this.token
|
||||
}
|
||||
}
|
||||
|
||||
locals {
|
||||
region = var.aws_region
|
||||
eks_cluster_endpoint = data.aws_eks_cluster.this.endpoint
|
||||
create_new_workspace = var.managed_prometheus_workspace_id == "" ? true : false
|
||||
tags = {
|
||||
Source = "github.com/aws-observability/terraform-aws-observability-accelerator"
|
||||
}
|
||||
}
|
||||
|
||||
# deploys the base module
|
||||
module "aws_observability_accelerator" {
|
||||
source = "../../"
|
||||
# source = "github.com/aws-observability/terraform-aws-observability-accelerator?ref=v2.0.0"
|
||||
|
||||
aws_region = var.aws_region
|
||||
|
||||
# creates a new Amazon Managed Prometheus workspace, defaults to true
|
||||
enable_managed_prometheus = local.create_new_workspace
|
||||
|
||||
# reusing existing Amazon Managed Prometheus if specified
|
||||
managed_prometheus_workspace_id = var.managed_prometheus_workspace_id
|
||||
|
||||
# sets up the Amazon Managed Prometheus alert manager at the workspace level
|
||||
enable_alertmanager = true
|
||||
|
||||
# reusing existing Amazon Managed Grafana workspace
|
||||
managed_grafana_workspace_id = var.managed_grafana_workspace_id
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
module "eks_blueprints_kubernetes_addons" {
|
||||
source = "github.com/aws-ia/terraform-aws-eks-blueprints//modules/kubernetes-addons?ref=v4.32.0"
|
||||
|
||||
eks_cluster_id = var.eks_cluster_id
|
||||
#eks_cluster_endpoint = module.eks_blueprints.eks_cluster_endpoint
|
||||
#eks_oidc_provider = module.eks_blueprints.oidc_provider
|
||||
#eks_cluster_version = module.eks_blueprints.eks_cluster_version
|
||||
|
||||
# EKS Managed Add-ons
|
||||
#enable_amazon_eks_vpc_cni = true
|
||||
#enable_amazon_eks_coredns = true
|
||||
#enable_amazon_eks_kube_proxy = true
|
||||
|
||||
# Add-ons
|
||||
enable_metrics_server = true
|
||||
enable_cluster_autoscaler = true
|
||||
|
||||
# Tetrate Istio Add-on
|
||||
enable_tetrate_istio = true
|
||||
|
||||
tags = local.tags
|
||||
}
|
||||
|
||||
module "eks_monitoring" {
|
||||
source = "../../modules/eks-monitoring"
|
||||
# source = "github.com/aws-observability/terraform-aws-observability-accelerator//modules/eks-monitoring?ref=v2.0.0"
|
||||
enable_istio = true
|
||||
eks_cluster_id = var.eks_cluster_id
|
||||
|
||||
# deploys AWS Distro for OpenTelemetry operator into the cluster
|
||||
enable_amazon_eks_adot = true
|
||||
|
||||
# reusing existing certificate manager? defaults to true
|
||||
enable_cert_manager = true
|
||||
|
||||
# deploys external-secrets in to the cluster
|
||||
enable_external_secrets = true
|
||||
grafana_api_key = var.grafana_api_key
|
||||
target_secret_name = "grafana-admin-credentials"
|
||||
target_secret_namespace = "grafana-operator"
|
||||
grafana_url = module.aws_observability_accelerator.managed_grafana_workspace_endpoint
|
||||
|
||||
# control the publishing of dashboards by specifying the boolean value for the variable 'enable_dashboards', default is 'true'
|
||||
enable_dashboards = var.enable_dashboards
|
||||
|
||||
managed_prometheus_workspace_id = module.aws_observability_accelerator.managed_prometheus_workspace_id
|
||||
|
||||
managed_prometheus_workspace_endpoint = module.aws_observability_accelerator.managed_prometheus_workspace_endpoint
|
||||
managed_prometheus_workspace_region = module.aws_observability_accelerator.managed_prometheus_workspace_region
|
||||
|
||||
# optional, defaults to 60s interval and 15s timeout
|
||||
prometheus_config = {
|
||||
global_scrape_interval = "60s"
|
||||
global_scrape_timeout = "15s"
|
||||
}
|
||||
|
||||
enable_logs = true
|
||||
|
||||
tags = local.tags
|
||||
|
||||
depends_on = [
|
||||
module.aws_observability_accelerator
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
output "aws_region" {
|
||||
description = "AWS Region"
|
||||
value = module.aws_observability_accelerator.aws_region
|
||||
}
|
||||
|
||||
output "managed_prometheus_workspace_endpoint" {
|
||||
description = "Amazon Managed Prometheus workspace endpoint"
|
||||
value = module.aws_observability_accelerator.managed_prometheus_workspace_endpoint
|
||||
}
|
||||
|
||||
output "managed_prometheus_workspace_id" {
|
||||
description = "Amazon Managed Prometheus workspace ID"
|
||||
value = module.aws_observability_accelerator.managed_prometheus_workspace_id
|
||||
}
|
||||
|
||||
output "eks_cluster_version" {
|
||||
description = "EKS Cluster version"
|
||||
value = module.eks_monitoring.eks_cluster_version
|
||||
}
|
||||
|
||||
output "eks_cluster_id" {
|
||||
description = "EKS Cluster Id"
|
||||
value = module.eks_monitoring.eks_cluster_id
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
variable "eks_cluster_id" {
|
||||
description = "Name of the EKS cluster"
|
||||
type = string
|
||||
default = "eks-cluster-with-vpc"
|
||||
}
|
||||
|
||||
variable "aws_region" {
|
||||
description = "AWS Region"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "managed_prometheus_workspace_id" {
|
||||
description = "Amazon Managed Service for Prometheus Workspace ID"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "managed_grafana_workspace_id" {
|
||||
description = "Amazon Managed Grafana Workspace ID"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "grafana_api_key" {
|
||||
description = "API key for authorizing the Grafana provider to make changes to Amazon Managed Grafana"
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "enable_dashboards" {
|
||||
description = "Enables or disables curated dashboards. Dashboards are managed by the Grafana Operator"
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
terraform {
|
||||
required_version = ">= 1.1.0"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 4.0.0"
|
||||
}
|
||||
kubernetes = {
|
||||
source = "hashicorp/kubernetes"
|
||||
version = ">= 2.10"
|
||||
}
|
||||
kubectl = {
|
||||
source = "gavinbunney/kubectl"
|
||||
version = ">= 1.14"
|
||||
}
|
||||
helm = {
|
||||
source = "hashicorp/helm"
|
||||
version = ">= 2.4.1"
|
||||
}
|
||||
}
|
||||
|
||||
# ## Used for end-to-end testing on project; update to suit your needs
|
||||
# backend "s3" {
|
||||
# bucket = "aws-observability-accelerator-terraform-states"
|
||||
# region = "us-west-2"
|
||||
# key = "e2e/eks-istio/terraform.tfstate"
|
||||
# }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user