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: 🚀 Introducing Prometheus Cloudwatch Exporter (0.25.2) Addon. #48

Merged
merged 16 commits into from
Feb 6, 2024
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:
- name: Generate TF Docs
uses: terraform-docs/[email protected]
with:
working-dir: addons/aws-ebs-csi-driver,addons/aws-efs-csi-driver,addons/aws-load-balancer-controller,addons/aws-node-termination-handler,addons/calico-tigera,addons/cluster-autoscaler,addons/external-secrets,addons/fluent-bit,addons/helm,addons/ingress-nginx,addons/istio-ingress,addons/karpenter,addons/kiali-server,addons/kubeclarity,addons/metrics-server,addons/nri-bundle,addons/velero,addons/kube-state-metrics,addons/keda,addons/cert-manager,addons/filebeat,addons/reloader,addons/external-dns,addons/redis,addons/prometheus,addons/grafana,addons/actions-runner-controller
working-dir: addons/aws-ebs-csi-driver,addons/aws-efs-csi-driver,addons/aws-load-balancer-controller,addons/aws-node-termination-handler,addons/calico-tigera,addons/cluster-autoscaler,addons/external-secrets,addons/fluent-bit,addons/helm,addons/ingress-nginx,addons/istio-ingress,addons/karpenter,addons/kiali-server,addons/kubeclarity,addons/metrics-server,addons/nri-bundle,addons/velero,addons/kube-state-metrics,addons/keda,addons/cert-manager,addons/filebeat,addons/reloader,addons/external-dns,addons/redis,addons/prometheus,addons/grafana,addons/actions-runner-controller,addons/prometheus-cloudwatch-exporter
git-push: true
template: |-
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
Expand Down
13 changes: 13 additions & 0 deletions _examples/complete/config/grafana/override-grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ resources:
requests:
cpu: 50m
memory: 150Mi

# Uncomment belew code to use Prometheus Data Source for Grafana Dashboard as default
# datasources:
# datasources.yaml:
# apiVersion: 1
# datasources:
# - name: Prometheus
# type: prometheus
# url: http://prometheus-server.monitoring.svc.cluster.local:80
# access: proxy
# isDefault: true
# uid: prometheus
# editable: true
435 changes: 434 additions & 1 deletion _examples/complete/config/override-prometheus.yaml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
## Node affinity for particular node in which labels key is "Infra-Services" and value is "true"

affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "eks.amazonaws.com/nodegroup"
operator: In
values:
- "critical"

## Using limits and requests
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi

# Configuration is rendered with `tpl` function, therefore you can use any Helm variables and/or templates here
config: |-
# This is the default configuration for prometheus-cloudwatch-exporter
region: us-east-1
metrics:
- aws_dimensions:
- InstanceId
aws_metric_name: CPUUtilization
aws_namespace: AWS/EC2
aws_statistics:
- Average
aws_tag_select:
resource_type_selection: ec2:instance
resource_id_dimension: InstanceId
- aws_dimensions:
- InstanceId
aws_metric_name: NetworkIn
aws_namespace: AWS/EC2
aws_statistics:
- Average
- aws_dimensions:
- InstanceId
aws_metric_name: NetworkOut
aws_namespace: AWS/EC2
aws_statistics:
- Average
- aws_dimensions:
- InstanceId
aws_metric_name: NetworkPacketsIn
aws_namespace: AWS/EC2
aws_statistics:
- Average
- aws_dimensions:
- InstanceId
aws_metric_name: NetworkPacketsOut
aws_namespace: AWS/EC2
aws_statistics:
- Average
- aws_dimensions:
- InstanceId
aws_metric_name: DiskWriteBytes
aws_namespace: AWS/EC2
aws_statistics:
- Average
- aws_dimensions:
- InstanceId
aws_metric_name: DiskReadBytes
aws_namespace: AWS/EC2
aws_statistics:
- Average
- aws_dimensions:
- InstanceId
aws_metric_name: CPUCreditBalance
aws_namespace: AWS/EC2
aws_statistics:
- Average
- aws_dimensions:
- InstanceId
aws_metric_name: CPUCreditUsage
aws_namespace: AWS/EC2
aws_statistics:
- Average
- aws_dimensions:
- InstanceId
aws_metric_name: StatusCheckFailed
aws_namespace: AWS/EC2
aws_statistics:
- Sum
- aws_dimensions:
- InstanceId
aws_metric_name: StatusCheckFailed_Instance
aws_namespace: AWS/EC2
aws_statistics:
- Sum
- aws_dimensions:
- InstanceId
aws_metric_name: StatusCheckFailed_System
aws_namespace: AWS/EC2
aws_statistics:
- Sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: aws
namespace: monitoring # Namespace of Prometheus Cloudwatch Exporter addon destination
type: Opaque
data:
access_key: QUiNNXXxXxzJKTDIzMzhOIOdidr= # Encoded AWS Access key - Enter Correct AWS Access Key Encoded with base64
secret_key: RlBTUVdxZUxXxxxXxxXXx2JLSkVxxXxxXXXXxxxXXXxxxXXXazNZVQ== # Encoded AWS Secret Access key - Enter Correct AWS Secret Access Key Encoded with base64
# Refer https://www.baeldung.com/linux/cli-base64-encode-decode this URL to Encode and Decode of String in Base64
3 changes: 1 addition & 2 deletions _examples/complete/locals.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

locals {

name = "helm-addons"
Expand All @@ -14,5 +13,5 @@ locals {
GithubRepo = "terraform-helm-eks-addons"
GithubOrg = "clouddrove"
}
cluster_version = "1.26"
cluster_version = "1.29"
}
152 changes: 78 additions & 74 deletions _examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,30 +152,31 @@ module "addons" {
eks_cluster_name = module.eks.cluster_name

# -- Enable Addons
metrics_server = true
cluster_autoscaler = true
aws_load_balancer_controller = true
aws_node_termination_handler = true
aws_efs_csi_driver = true
aws_ebs_csi_driver = true
kube_state_metrics = true
karpenter = false # -- Set to `false` or comment line to Uninstall Karpenter if installed using terraform.
calico_tigera = true
new_relic = true
kubeclarity = true
ingress_nginx = true
fluent_bit = true
velero = true
keda = true
certification_manager = true
filebeat = true
reloader = true
external_dns = true
redis = true
actions_runner_controller = true
prometheus = true

# Grafaa Deployment
metrics_server = true
cluster_autoscaler = true
aws_load_balancer_controller = true
aws_node_termination_handler = true
aws_efs_csi_driver = true
aws_ebs_csi_driver = true
kube_state_metrics = true
karpenter = false # -- Set to `false` or comment line to Uninstall Karpenter if installed using terraform.
calico_tigera = true
new_relic = true
kubeclarity = true
ingress_nginx = true
fluent_bit = true
velero = true
keda = true
certification_manager = true
filebeat = true
reloader = true
external_dns = true
redis = true
actions_runner_controller = true
prometheus = true
prometheus_cloudwatch_exporter = true

# Grafana Deployment
grafana = true
grafana_helm_config = { values = [file("./config/grafana/override-grafana.yaml")] }
grafana_manifests = var.grafana_manifests
Expand All @@ -189,58 +190,61 @@ module "addons" {
external_secrets = true

# -- Path of override-values.yaml file
metrics_server_helm_config = { values = [file("./config/override-metrics-server.yaml")] }
cluster_autoscaler_helm_config = { values = [file("./config/override-cluster-autoscaler.yaml")] }
karpenter_helm_config = { values = [file("./config/override-karpenter.yaml")] }
aws_load_balancer_controller_helm_config = { values = [file("./config/override-aws-load-balancer-controller.yaml")] }
aws_node_termination_handler_helm_config = { values = [file("./config/override-aws-node-termination-handler.yaml")] }
aws_efs_csi_driver_helm_config = { values = [file("./config/override-aws-efs-csi-driver.yaml")] }
aws_ebs_csi_driver_helm_config = { values = [file("./config/override-aws-ebs-csi-driver.yaml")] }
calico_tigera_helm_config = { values = [file("./config/calico-tigera-values.yaml")] }
istio_ingress_helm_config = { values = [file("./config/istio/override-values.yaml")] }
kiali_server_helm_config = { values = [file("./config/kiali/override-values.yaml")] }
external_secrets_helm_config = { values = [file("./config/external-secret/override-values.yaml")] }
ingress_nginx_helm_config = { values = [file("./config/override-ingress-nginx.yaml")] }
kubeclarity_helm_config = { values = [file("./config/override-kubeclarity.yaml")] }
fluent_bit_helm_config = { values = [file("./config/override-fluent-bit.yaml")] }
velero_helm_config = { values = [file("./config/override-velero.yaml")] }
new_relic_helm_config = { values = [file("./config/override-new-relic.yaml")] }
kube_state_metrics_helm_config = { values = [file("./config/override-kube-state-matrics.yaml")] }
keda_helm_config = { values = [file("./config/keda/override-keda.yaml")] }
certification_manager_helm_config = { values = [file("./config/override-certification-manager.yaml")] }
filebeat_helm_config = { values = [file("./config/override-filebeat.yaml")] }
reloader_helm_config = { values = [file("./config/reloader/override-reloader.yaml")] }
external_dns_helm_config = { values = [file("./config/override-external-dns.yaml")] }
redis_helm_config = { values = [file("./config/override-redis.yaml")] }
actions_runner_controller_helm_config = { values = [file("./config/override-actions-runner-controller.yaml")] }
prometheus_helm_config = { values = [file("./config/override-prometheus.yaml")] }
metrics_server_helm_config = { values = [file("./config/override-metrics-server.yaml")] }
cluster_autoscaler_helm_config = { values = [file("./config/override-cluster-autoscaler.yaml")] }
karpenter_helm_config = { values = [file("./config/override-karpenter.yaml")] }
aws_load_balancer_controller_helm_config = { values = [file("./config/override-aws-load-balancer-controller.yaml")] }
aws_node_termination_handler_helm_config = { values = [file("./config/override-aws-node-termination-handler.yaml")] }
aws_efs_csi_driver_helm_config = { values = [file("./config/override-aws-efs-csi-driver.yaml")] }
aws_ebs_csi_driver_helm_config = { values = [file("./config/override-aws-ebs-csi-driver.yaml")] }
calico_tigera_helm_config = { values = [file("./config/calico-tigera-values.yaml")] }
istio_ingress_helm_config = { values = [file("./config/istio/override-values.yaml")] }
kiali_server_helm_config = { values = [file("./config/kiali/override-values.yaml")] }
external_secrets_helm_config = { values = [file("./config/external-secret/override-values.yaml")] }
ingress_nginx_helm_config = { values = [file("./config/override-ingress-nginx.yaml")] }
kubeclarity_helm_config = { values = [file("./config/override-kubeclarity.yaml")] }
fluent_bit_helm_config = { values = [file("./config/override-fluent-bit.yaml")] }
velero_helm_config = { values = [file("./config/override-velero.yaml")] }
new_relic_helm_config = { values = [file("./config/override-new-relic.yaml")] }
kube_state_metrics_helm_config = { values = [file("./config/override-kube-state-matrics.yaml")] }
keda_helm_config = { values = [file("./config/keda/override-keda.yaml")] }
certification_manager_helm_config = { values = [file("./config/override-certification-manager.yaml")] }
filebeat_helm_config = { values = [file("./config/override-filebeat.yaml")] }
reloader_helm_config = { values = [file("./config/reloader/override-reloader.yaml")] }
external_dns_helm_config = { values = [file("./config/override-external-dns.yaml")] }
redis_helm_config = { values = [file("./config/override-redis.yaml")] }
actions_runner_controller_helm_config = { values = [file("./config/override-actions-runner-controller.yaml")] }
prometheus_helm_config = { values = [file("./config/override-prometheus.yaml")] }
prometheus_cloudwatch_exporter_helm_config = { values = [file("./config/prometheus-cloudwatch-exporter/override-prometheus-cloudwatch-exporter-controller.yaml")] }
prometheus_cloudwatch_exporter_secret_manifest = file("./config/prometheus-cloudwatch-exporter/secret.yaml") # Uncomment this to use Secret Based Authentication and Update Secret manifest with real credentials

# -- Override Helm Release attributes
metrics_server_extra_configs = var.metrics_server_extra_configs
cluster_autoscaler_extra_configs = var.cluster_autoscaler_extra_configs
karpenter_extra_configs = var.karpenter_extra_configs
aws_load_balancer_controller_extra_configs = var.aws_load_balancer_controller_extra_configs
aws_node_termination_handler_extra_configs = var.aws_node_termination_handler_extra_configs
aws_efs_csi_driver_extra_configs = var.aws_efs_csi_driver_extra_configs
aws_ebs_csi_driver_extra_configs = var.aws_ebs_csi_driver_extra_configs
calico_tigera_extra_configs = var.calico_tigera_extra_configs
istio_ingress_extra_configs = var.istio_ingress_extra_configs
kiali_server_extra_configs = var.kiali_server_extra_configs
ingress_nginx_extra_configs = var.ingress_nginx_extra_configs
kubeclarity_extra_configs = var.kubeclarity_extra_configs
fluent_bit_extra_configs = var.fluent_bit_extra_configs
velero_extra_configs = var.velero_extra_configs
new_relic_extra_configs = var.new_relic_extra_configs
kube_state_metrics_extra_configs = var.kube_state_metrics_extra_configs
keda_extra_configs = var.keda_extra_configs
certification_manager_extra_configs = var.certification_manager_extra_configs
external_secrets_extra_configs = var.external_secrets_extra_configs
filebeat_extra_configs = var.filebeat_extra_configs
reloader_extra_configs = var.reloader_extra_configs
external_dns_extra_configs = var.external_dns_extra_configs
redis_extra_configs = var.redis_extra_configs
actions_runner_controller_extra_configs = var.actions_runner_controller_extra_configs
prometheus_extra_configs = var.prometheus_extra_configs
metrics_server_extra_configs = var.metrics_server_extra_configs
cluster_autoscaler_extra_configs = var.cluster_autoscaler_extra_configs
karpenter_extra_configs = var.karpenter_extra_configs
aws_load_balancer_controller_extra_configs = var.aws_load_balancer_controller_extra_configs
aws_node_termination_handler_extra_configs = var.aws_node_termination_handler_extra_configs
aws_efs_csi_driver_extra_configs = var.aws_efs_csi_driver_extra_configs
aws_ebs_csi_driver_extra_configs = var.aws_ebs_csi_driver_extra_configs
calico_tigera_extra_configs = var.calico_tigera_extra_configs
istio_ingress_extra_configs = var.istio_ingress_extra_configs
kiali_server_extra_configs = var.kiali_server_extra_configs
ingress_nginx_extra_configs = var.ingress_nginx_extra_configs
kubeclarity_extra_configs = var.kubeclarity_extra_configs
fluent_bit_extra_configs = var.fluent_bit_extra_configs
velero_extra_configs = var.velero_extra_configs
new_relic_extra_configs = var.new_relic_extra_configs
kube_state_metrics_extra_configs = var.kube_state_metrics_extra_configs
keda_extra_configs = var.keda_extra_configs
certification_manager_extra_configs = var.certification_manager_extra_configs
external_secrets_extra_configs = var.external_secrets_extra_configs
filebeat_extra_configs = var.filebeat_extra_configs
reloader_extra_configs = var.reloader_extra_configs
external_dns_extra_configs = var.external_dns_extra_configs
redis_extra_configs = var.redis_extra_configs
actions_runner_controller_extra_configs = var.actions_runner_controller_extra_configs
prometheus_extra_configs = var.prometheus_extra_configs
prometheus_cloudwatch_exporter_extra_configs = var.prometheus_cloudwatch_exporter_extra_configs

# -- Custom IAM Policy Json for Addon's ServiceAccount
cluster_autoscaler_iampolicy_json_content = file("./custom-iam-policies/cluster-autoscaler.json")
Expand Down
13 changes: 10 additions & 3 deletions _examples/complete/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,19 @@ variable "actions_runner_controller_extra_configs" {
default = {}
}

# ---------------------- PROMETHEUS-CLOUDWATCH-EXPORTER ------------------------------------------------
variable "prometheus_cloudwatch_exporter_extra_configs" {
type = any
default = {
atomic = true
}
}

# ------------------ PROMETHEUS --------------------------------------------------
variable "prometheus_extra_configs" {
type = any
default = {
atomic = true
namespace = "istio-system"
atomic = true
}
}

Expand All @@ -231,6 +238,6 @@ variable "grafana_manifests" {
grafana_virtualservice_file_path = string
})
default = {
grafana_virtualservice_file_path = "./config/grafana/grafana-vs.yaml"
grafana_virtualservice_file_path = ""
}
}
Loading
Loading