Skip to content

Commit

Permalink
Merge pull request #12 from sahil8060/master
Browse files Browse the repository at this point in the history
Refactor Terraform Code Structure for RDS Deployment Across Multiple Zones
  • Loading branch information
SudKul authored Feb 3, 2025
2 parents 4d9ec6b + 252228a commit 991cc9f
Show file tree
Hide file tree
Showing 125 changed files with 11,426 additions and 5,672 deletions.
Binary file modified lesson-2-sli-slo/exercises/starter/.DS_Store
Binary file not shown.
38 changes: 0 additions & 38 deletions lesson-2-sli-slo/exercises/starter/.terraform.lock.hcl

This file was deleted.

6 changes: 3 additions & 3 deletions lesson-2-sli-slo/exercises/starter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
- `curl -sSL https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash`

- terraform
- `wget https://releases.hashicorp.com/terraform/1.0.7/terraform_1.0.7_linux_amd64.zip`
- `unzip terraform_1.0.7_linux_amd64.zip`
- `wget https://releases.hashicorp.com/terraform/1.10.3/terraform_1.10.3_linux_amd64.zip`
- `unzip terraform_1.10.3_linux_amd64.zip`
- `mkdir ~/bin`
- `mv terraform ~/bin`
- `export TF_PLUGIN_CACHE_DIR="/tmp"`

- kubectl
- `curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.21.2/2021-07-05/bin/linux/amd64/kubectl`
- `curl -o kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.31.2/2024-11-15/bin/linux/amd64/kubectl`
- `chmod +x ./kubectl`
- `mkdir -p $HOME/bin && cp ./kubectl $HOME/bin/kubectl && export PATH=$PATH:$HOME/bin`
- `echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc`
Expand Down
2 changes: 1 addition & 1 deletion lesson-2-sli-slo/exercises/starter/_config.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
terraform {
backend "s3" {
bucket = "udacity-tf-tscotto"
bucket = "udacity-sre-terraform-testing" # Replace it with your S3 bucket name
key = "terraform/terraform.tfstate"
region = "us-east-2"
}
Expand Down
11 changes: 11 additions & 0 deletions lesson-2-sli-slo/exercises/starter/exercise.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ resource "kubernetes_namespace" "udacity" {
]
}

# Add the monitoring namespace resource
resource "kubernetes_namespace" "monitoring" {
metadata {
name = "monitoring"
}

depends_on = [
module.project_eks
]
}

resource "kubernetes_service" "prometheus-external" {
metadata {
name = "prometheus-external"
Expand Down
2 changes: 1 addition & 1 deletion lesson-2-sli-slo/exercises/starter/modules/eks/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ resource "aws_security_group" "eks-cluster" {
}
resource "aws_eks_cluster" "cluster" {
name = "${var.name}-cluster"
version = "1.21"
version = "1.31"
role_arn = aws_iam_role.eks_cluster_role.arn

vpc_config {
Expand Down
32 changes: 16 additions & 16 deletions lesson-2-sli-slo/exercises/starter/prometheus-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
metrics_path: /metrics
static_configs:
- targets:
- 18.117.9.54:9100
- 18.117.9.54:80
- job_name: blackbox
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://18.117.9.54
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: prometheus-blackbox-exporter.monitoring:9115
- <public_ip>:9100
- <public_ip>:80
# - job_name: blackbox
# metrics_path: /probe
# params:
# module: [http_2xx]
# static_configs:
# - targets:
# - http://<public_ip>
# relabel_configs:
# - source_labels: [__address__]
# target_label: __param_target
# - source_labels: [__param_target]
# target_label: instance
# - target_label: __address__
# replacement: blackbox-exporter-prometheus-blackbox-exporter.monitoring:9115
Loading

0 comments on commit 991cc9f

Please sign in to comment.