-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from descomplicando-terraform/mgc/kubernetes
feat: adição de módulo terraform para criação de clusters kubernetes na magalu cloud
- Loading branch information
Showing
7 changed files
with
57 additions
and
210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Após a criação do recurso do cluster, o Terraform irá exibir o nome e o ID do cluster criado. | ||
output "cluster_name" { | ||
value = mgc_kubernetes_cluster.cluster_with_nodepool.name | ||
value = mgc_kubernetes_cluster.cluster.name | ||
} | ||
|
||
output "cluster_id" { | ||
value = mgc_kubernetes_cluster.cluster_with_nodepool.id | ||
value = mgc_kubernetes_cluster.cluster.id | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,41 @@ | ||
variable "cluster_name" { | ||
description = "Nome do Cluster" | ||
description = "Cluster name" | ||
type = string | ||
default = "nataliagranato" | ||
default = "mgc-cluster" | ||
} | ||
|
||
variable "kubernetes_version" { | ||
description = "Versão do Kubernetes" | ||
description = "Kubernetes version" | ||
type = string | ||
default = "v1.30.2" | ||
} | ||
|
||
variable "cluster_description" { | ||
description = "Descrição do Cluster" | ||
description = "Cluster description" | ||
type = string | ||
default = "Um cluster de Kubernetes gerenciado pela Magalu Cloud." | ||
default = "A Kubernetes cluster managed by Magalu Cloud." | ||
} | ||
|
||
variable "timer_duration" { | ||
description = "Duração do Timer" | ||
type = string | ||
default = "5m" | ||
} | ||
|
||
variable "mgc_api_key" { | ||
variable "nodepool_name" { | ||
description = "Nodepool name" | ||
type = string | ||
description = "Chave da Magalu Cloud" | ||
default = "mgc-nodepool" | ||
} | ||
|
||
variable "mgc_obj_key_id" { | ||
type = string | ||
description = "ID da Chave do Object Storage" | ||
variable "nodepool_replicas" { | ||
description = "Number of nodepool replicas" | ||
type = number | ||
default = 1 | ||
} | ||
|
||
variable "mgc_obj_key_secret" { | ||
variable "nodepool_flavor_name" { | ||
description = "Nodepool flavor" | ||
type = string | ||
description = "Secret da Chave do Object Storage" | ||
default = "cloud-k8s.gp1.small" | ||
} | ||
|
||
variable "mgc_region" { | ||
variable "timer_duration" { | ||
description = "Timer duration" | ||
type = string | ||
description = "Região da Magalu Cloud" | ||
default = "br-se1" | ||
} | ||
|
||
variable "node_pools" { | ||
description = "Mapa de Node Pools" | ||
type = map(object({ | ||
flavor = string | ||
min_replicas = number | ||
max_replicas = number | ||
})) | ||
default = { | ||
default = { | ||
flavor = "cloud-k8s.gp1.medium" | ||
min_replicas = 2 | ||
max_replicas = 5 | ||
} | ||
} | ||
validation { | ||
condition = alltrue([for np in var.node_pools : np.min_replicas < np.max_replicas]) | ||
error_message = "min_replicas deve ser menor que max_replicas para todos os pools de nós." | ||
} | ||
default = "15m" | ||
} |