A laboratory for EKS cluster. Contains a publicly acessible grafana service, for monitoring data visualization.
The Prometheus and Grafana deployment is based o kube-prometheus-stack helm chart. https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack
In adition to the community monitoring items and dashboards, this project contains a service monitor called ping-exporter. https://github.com/czerwonk/ping_exporter.
It runs as a daemonset, sending ping requests to every node on the cluster, collecting data about connectivity between nodes.
A specific Grafana dashboard was created to visualize it, named: Ping Exporter - Inter node ping statistics
- AWS CLI (https://github.com/aws/aws-cli)
Execute
$ aws configure
(https://github.com/aws/aws-cli#configuration) - Terraform (https://learn.hashicorp.com/tutorials/terraform/install-cli)
- kubectl (https://kubernetes.io/docs/tasks/tools/)
Install terraform dependencies
terraform init
Preview the execution plan and apply it
terraform plan
terraform apply
aws eks update-kubeconfig --name eks_lab_cluster --region us-west-1
Used for data visualization, it's configured with some community dashboards from kube-prometheus-stack
To access it, after running the terraform apply
, get the Grafana Load Balancer URL with:
terraform output grafana_url
Paste it on your browser and use the following credentials to access it.
username: admin
password: admin123
Navigate to Dashboards and search for Ping Exporter - Inter node ping statistics
.
The source node can be selected on the NodeIP template variable on the top left corner.
To clean up created resources and avoid costs don't forget to run
terraform destroy
Documentation generated using terraform-docs https://github.com/terraform-docs/terraform-docs
terraform-docs markdown . | tee README.md
https://stackoverflow.com/questions/52991038/how-to-create-a-servicemonitor-for-prometheus-operator
https://learn.hashicorp.com/tutorials/terraform/eks
https://antonputra.com/category/aws-amazon-web-services/
Name | Version |
---|---|
terraform | >= 0.13 |
aws | ~> 3.0 |
grafana | 1.13.3 |
helm | 2.2.0 |
kubectl | 1.11.3 |
null | 3.1.0 |
Name | Version |
---|---|
aws | 3.52.0 |
grafana | 1.13.3 |
helm | 2.2.0 |
kubernetes | 2.3.2 |
null | 3.1.0 |
Name | Source | Version |
---|---|---|
eks | terraform-aws-modules/eks/aws | 17.1.0 |
networking | ./networking | n/a |
ping-exporter | ./ping-exporter | n/a |
Name | Type |
---|---|
grafana_dashboard.ping-exporter | resource |
helm_release.prometheus | resource |
kubernetes_namespace.monitoring | resource |
kubernetes_service.grafana | resource |
null_resource.wait_for_grafana_dns | resource |
aws_eks_cluster.cluster | data source |
aws_eks_cluster_auth.cluster | data source |
aws_instances.cluster_nodes | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
cluster_name | Name of the cluster | string |
"lab_cluster" |
no |
monitoring_namespace | Namespace for monitoring resources | string |
"monitoring" |
no |
region | AWS region | string |
"us-west-1" |
no |
worker_nodes | Number of worker nodes | number |
3 |
no |
Name | Description |
---|---|
cluster_endpoint | Endpoint for EKS control plane. |
cluster_id | EKS cluster ID. |
cluster_name | Kubernetes Cluster Name |
config_map_aws_auth | A kubernetes configuration to authenticate to this EKS cluster. |
grafana_url | Grafana external URL |
kubectl_config | kubectl config as generated by the module. |