|
2 | 2 |
|
3 | 3 | Welcome to AWS Observability Accelerator for Terraform!
|
4 | 4 |
|
| 5 | +We will be leveraging EKS Blueprints (https://github.com/aws-ia/terraform-aws-eks-blueprints) repository to deploy the solution. EKS Blueprints is a collection of Terraform modules that aim to make it easier and faster for customers to adopt Amazon EKS and start deploying typical workloads. This repository has examples on how to use the existing EKS cluster, Managed Service for Prometheus and Amazon Managed Grafana workspaces as well as creating the brand new environment with all new resources with monitoring enabled right out of the box. |
| 6 | + |
5 | 7 | ## Getting Started
|
6 | 8 |
|
| 9 | +## Prerequisites: |
| 10 | +First, ensure that you have installed the following tools locally. |
| 11 | + |
| 12 | +* Install Terraform (https://learn.hashicorp.com/tutorials/terraform/install-cli) |
| 13 | +* Install Kubectl (https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html) |
| 14 | +* Install docker (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-container-image.html#:~:text=the%20Docker%20CLI.-,Installing%20Docker%20on%20Amazon%20Linux%202,-Create%20a%20Docker) |
| 15 | +* AWS Command Line Interface (AWS CLI) version 2 (https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) |
| 16 | +* jq (https://stedolan.github.io/jq/download/) |
| 17 | +* An AWS Account (https://aws.amazon.com/) |
| 18 | +* Configure the credentials in AWS CLI (https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html#:~:text=refreshes%20the%20credentials.-,Set%20and%20view%20configuration%20settings,-There%20are%20several) |
| 19 | +* An existing Amazon Managed Grafana Workspace (https://aws.amazon.com/blogs/mt/amazon-managed-grafana-getting-started/) |
| 20 | + |
| 21 | +## Deployment Steps |
| 22 | +Clone the repository that contains the EKS blueprints: |
| 23 | + |
| 24 | +`git clone https://github.com/aws-observability/terraform-aws-eks-blueprints.git` |
| 25 | + |
| 26 | + |
| 27 | +# Generate Grafana API Key |
| 28 | + |
| 29 | +* Give admin access to the SSO user you set up when creating the Amazon Managed Grafana Workspace: |
| 30 | +* In the AWS Console, navigate to Amazon Grafana. In the left navigation bar, click **All workspaces**, then click on the workspace name you are using for this example. |
| 31 | +* Under **Authentication** within **AWS Single Sign-On (SSO)**, click **Configure users and user groups** |
| 32 | +* Check the box next to the SSO user you created and click **Make admin** |
| 33 | +* From the workspace in the AWS console, click on the `Grafana workspace` URL to open the workspace |
| 34 | +* If you don't see the gear icon in the left navigation bar, log out and log back in. |
| 35 | +* Click on the gear icon, then click on the **API keys** tab. |
| 36 | +* Click **Add API key**, fill in the *Key name* field and select *Admin* as the Role. |
| 37 | +* Copy your API key |
| 38 | + |
7 | 39 |
|
8 | 40 | ## Documentation
|
9 | 41 |
|
| 42 | +For complete project documentation, please visit our documentation (https://aws-ia.github.io/terraform-aws-eks-blueprints/) site. |
10 | 43 |
|
11 | 44 | ## Examples
|
12 | 45 |
|
| 46 | +To view examples for how you can leverage EKS Blueprints, please see the examples (https://github.com/aws-observability/terraform-aws-observability-accelerator/tree/main/examples) directory. |
13 | 47 |
|
14 | 48 | ## Usage
|
15 | 49 |
|
| 50 | +The below demonstrates how you can leverage AWS Observability Accelerator to enable monitoring to an existing EKS cluster, Managed Service for Prometheus and Amazon Managed Grafana workspaces. Configure the environment variables like below |
| 51 | + |
| 52 | +Change the directory |
| 53 | + |
| 54 | +`cd terraform-aws-observability-accelerator/examples/existing-cluster-with-base-and-infra/` |
| 55 | + |
| 56 | +Initialize terraform |
| 57 | + |
| 58 | +`terraform init` |
| 59 | + |
| 60 | +` |
| 61 | +export TF_VAR_eks_cluster_id=xxx |
| 62 | +export TF_VAR_managed_prometheus_workspace_id=ws-xxx #existing workspace id otherwise new workspace will be created |
| 63 | +export TF_VAR_managed_grafana_workspace_id=g-xxx #existing workspace id otherwise new workspace will be created |
| 64 | +export TF_VAR_grafana_api_key="xxx" #refer getting started section which shows the steps to create Grafana api key |
| 65 | +` |
| 66 | + |
| 67 | +Deploy |
| 68 | + |
| 69 | +`terraform apply` |
| 70 | + |
| 71 | + |
| 72 | +The code above will provision the following: |
| 73 | + |
| 74 | +* Enables the AWS EKS Add-on for ADOT operator (https://docs.aws.amazon.com/eks/latest/userguide/opentelemetry.html) to the existing Amazon EKS Cluster (specified in the environment variable) and deploys the ADOT collector with appropriate scrape configuration to ingest metrics to Amazon Managed Service for Prometheus |
| 75 | +* Deploys kube-state-metrics (https://github.com/kubernetes/kube-state-metrics) to generate Prometheus format metrics based on the current state of the Kubernetes native resource |
| 76 | +* Deploys Node_exporter (https://github.com/prometheus/node_exporter) to collect infrastructure metrics like CPU, Memory and Disk size etc |
| 77 | +* Deploys rule files in the Amazon Managed Service for Prometheus Workspace(specified in the terraform variable file) containing rule groups with over 200 rules to gather metrics about Kubernetes native objects |
| 78 | +* Configures the Amazon Managed Service for Prometheus workspace as a datasource in the Amazon Managed Grafana workspace |
| 79 | +* Creates an Observability folder within the Amazon Managed Grafana workspace(specified in the terraform variable file) and deploys 25 grafana dashboards which visually transforms the metrics collected by Amazon Managed Service for Prometheus |
| 80 | + |
16 | 81 |
|
17 | 82 | ## Submodules
|
18 | 83 |
|
| 84 | +The root module calls into several submodules which provides support for deploying and integrating a number of external AWS services that can be used in concert with Amazon EKS. This includes Amazon Managed Prometheus, AWS OpenTelemetry Operator etc.., |
19 | 85 |
|
20 | 86 | ## Motivation
|
21 | 87 |
|
| 88 | +Kubernetes is a powerful and extensible container orchestration technology that allows you to deploy and manage containerized applications at scale. The extensible nature of Kubernetes also allows you to use a wide range of popular open-source tools, commonly referred to as add-ons, in Kubernetes clusters. With such a large number of tooling and design choices available however, building a tailored EKS cluster that meets your application’s specific needs can take a significant amount of time. It involves integrating a wide range of open-source tools and AWS services and requires deep expertise in AWS and Kubernetes. |
| 89 | + |
| 90 | +AWS customers have asked for examples that demonstrate how to integrate the landscape of Kubernetes tools and make it easy for them to provision complete, opinionated EKS clusters that meet specific application requirements. Customers can use AWS Observability Accelerator to configure and deploy purpose built EKS clusters, and start onboarding workloads in days, rather than months. |
22 | 91 |
|
23 | 92 | ## Support & Feedback
|
24 | 93 |
|
| 94 | +AWS Oservability Accelerator for Terraform is maintained by AWS Solution Architects. It is not part of an AWS service and support is provided best-effort by the EKS Blueprints community. |
| 95 | + |
| 96 | +To post feedback, submit feature ideas, or report bugs, please use the Issues (https://github.com/aws-observability/terraform-aws-observability-accelerator/issues) section of this GitHub repo. |
| 97 | + |
| 98 | +If you are interested in contributing to EKS Blueprints, see the Contribution (https://github.com/aws-observability/terraform-aws-observability-accelerator/blob/main/CONTRIBUTING.md) guide. |
| 99 | + |
25 | 100 | ---
|
26 | 101 |
|
27 | 102 | <!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
|
|
0 commit comments