Skip to content

Commit

Permalink
adding prometheus and deleted eks-cert-mgr-ns as it included in eks-c…
Browse files Browse the repository at this point in the history
…ert-manager
  • Loading branch information
nangu001 committed Jul 16, 2024
1 parent 72a7807 commit 557dadc
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 233 deletions.
80 changes: 0 additions & 80 deletions lab/us-gov-east-1/vpc/cluster/eks-cert-mgr-ns/cert-mgr.tf

This file was deleted.

78 changes: 0 additions & 78 deletions lab/us-gov-east-1/vpc/cluster/eks-cert-mgr-ns/copy_images.tf

This file was deleted.

22 changes: 0 additions & 22 deletions lab/us-gov-east-1/vpc/cluster/eks-cert-mgr-ns/terragrunt.hcl

This file was deleted.

53 changes: 0 additions & 53 deletions lab/us-gov-east-1/vpc/cluster/eks-cert-mgr-ns/variables.tf

This file was deleted.

55 changes: 55 additions & 0 deletions lab/us-gov-east-1/vpc/cluster/eks-prometheus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## eks-prometheus
This module deploys EKS kubeenetes prometheus inside existing EKS cluster. Prometheus is an open-source systems monitoring and alerting tool.
This module consisits of 4 components. It creates prometheus namespace and copies image repositories for the following components from quay.io into local account ECR repository. It deploys these components using helm charts using the configured ECR repositories.
1. prometheus-alert-manager
2. prometheus-node-exporter
3. prometheus-pushgateway
4. prometheus-server

### Dependencies
This module is dependent on EKS module (eks). The cluster should exist already for this module to work.

### Inputs
cluster_name
profile
prometheus_chart_version
prometheus_server_tag
prometheus_config_reloader_tag
alertmanager_tag
kube_state_metrics_tag
node_exporter_tag
pushgateway_tag
rwo_storage_class

### Outputs
alertmanager_internal_endpoint
alertmanager_headless_internal_endpoint
pushgateway_internal_endpoint
prometheus_server_internal_endpoint

### Issues observed/fixed
1. The rwo_storage_class value had to be updated from "gp3" to "gp3-encrypted"
2. The node_exporter_tag value had to be updated from "1.6.1" to "v1.8.1"
3. The kube_state_metrics_tag value had to be updated from "2.10.0" to "v2.6.0"
4. The alertmanager_tag value had to be updated from
5. The helm chart set config for the ecr image had to be split into 2 components, one for registry and other for repository as an example mentioned below:
```
set {
name = "kube-state-metrics.image.registry"
value = module.images.images[local.ksm_key].dest_registry
}
set {
name = "kube-state-metrics.image.repository"
value = module.images.images[local.ksm_key].dest_repository
}
```
6. In some other cases the image ecr repository had to be split by the colon separatory (:)
```
set {
name = "alertmanager.configmapReload.image.repository"
value = split(":", module.images.images[local.prom_config_reload_key].dest_full_path)[0]
}
```
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# provider.tf
provider "aws" {
region = "us-gov-east-1"
profile = "224384469011-lab-dev-gov.inf-admin-t3"
Expand Down
31 changes: 31 additions & 0 deletions lab/us-gov-east-1/vpc/cluster/eks-prometheus/terragrunt.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
terraform {
source = "git@github.e.it.census.gov:SCT-Engineering/tfmod-prometheus.git?ref=platform-changes"
extra_arguments "retry_lock" {
commands = get_terraform_commands_that_need_locking()
arguments = ["-lock-timeout=20m"]
}
}

remote_state {
backend = "s3"
generate = {
path = "backend.tf"
if_exists = "overwrite_terragrunt"
}
config = {
bucket = "tg-infrastructure-tf-state-lab-dev-ew-us-gov-east-1"
key = "platform-eks-test-prometheus/terraform.tfstate"
region = "us-gov-east-1"
encrypt = true
}
}

dependency "eks" {
config_path = "../eks"
}

inputs = {
profile = dependency.eks.inputs.profile
cluster_name = dependency.eks.inputs.cluster_name
region = "us-gov-east-1"
}

0 comments on commit 557dadc

Please sign in to comment.