Fix cluster auto-scaling.
This commit is contained in:
parent
e531077596
commit
447c70a271
10
main.tf
10
main.tf
@ -14,7 +14,7 @@ terraform {
|
|||||||
variable "project" {
|
variable "project" {
|
||||||
description = "Project ID."
|
description = "Project ID."
|
||||||
type = string
|
type = string
|
||||||
default = "secret-footing-312423"
|
default = "hip-wharf-319304"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "region" {
|
variable "region" {
|
||||||
@ -36,7 +36,7 @@ provider "google" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
data "google_project" "project" {
|
data "google_project" "project" {
|
||||||
project = var.project
|
project_id = var.project
|
||||||
}
|
}
|
||||||
|
|
||||||
#################### KMS ##################################
|
#################### KMS ##################################
|
||||||
@ -136,6 +136,7 @@ resource "google_container_node_pool" "primary" {
|
|||||||
name_prefix = "node-pool"
|
name_prefix = "node-pool"
|
||||||
location = var.region
|
location = var.region
|
||||||
cluster = google_container_cluster.primary.name
|
cluster = google_container_cluster.primary.name
|
||||||
|
initial_node_count = 1
|
||||||
|
|
||||||
autoscaling {
|
autoscaling {
|
||||||
min_node_count = 0
|
min_node_count = 0
|
||||||
@ -162,3 +163,8 @@ resource "google_container_node_pool" "primary" {
|
|||||||
google_project_service.container
|
google_project_service.container
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
output "gke_connect_command" {
|
||||||
|
description = "Command to run to connect to the kubernetes cluster."
|
||||||
|
value = "gcloud container clusters get-credentials ${google_container_cluster.primary.name} --region ${var.region} --project ${var.project}"
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user