Skip to content

Commit

Permalink
issue #1: removed unused cluster node pool
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCardin committed Jan 5, 2024
1 parent 7dd8399 commit cb82279
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 48 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,6 @@ override.tf.json
# Ignore CLI configuration files
.terraformrc
terraform.rc

# jq (used to gather information when terraform applying or plannig)
jq
102 changes: 102 additions & 0 deletions .terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions backends.tf

This file was deleted.

Empty file removed terraform/dns/provider.tf
Empty file.
Empty file removed terraform/dns/variables.tf
Empty file.
40 changes: 5 additions & 35 deletions terraform/gcp-kubernetes-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,52 +68,22 @@ resource "google_container_node_pool" "nodepool" {
auto_upgrade = true
}

node_config {
preemptible = false
machine_type = "e2-small"

labels = {
role = "general"
}

service_account = google_service_account.kubernetes.email
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}

resource "google_container_node_pool" "spot" {
name = "${var.cluster_name}-spot-nodepool"
cluster = google_container_cluster.cluster.id

management {
auto_repair = true
auto_upgrade = true
}

autoscaling {
min_node_count = 0
max_node_count = 3
min_node_count = 1
max_node_count = 10
}

node_config {
preemptible = true
preemptible = false
machine_type = "e2-small"

labels = {
team = "devsecops"
}

taint {
key = "instance_type"
value = "${var.cluster_name}-spot"
effect = "NO_SCHEDULE"
role = "general"
}

service_account = google_service_account.kubernetes.email
oauth_scopes = [
"https://www.googleapis.com/auth/cloud-platform"
]
}
}
}

0 comments on commit cb82279

Please sign in to comment.