This Terraform module creates and manages Kubernetes clusters on Magalu Cloud using the official magalucloud/mgc
provider. It offers various configuration options through input variables to customize the cluster creation as needed.
- Creation of Kubernetes clusters on Magalu Cloud
- Configuration of node pools with auto-scaling options
- Support for bastion hosts for secure access to the cluster
- Option for server groups with anti-affinity policy
- Terraform >= 0.14
- Magalu Cloud account
terraform {
required_providers {
mgc = {
source = "magalucloud/mgc"
version = "0.18.10"
}
}
}
module "kubernetes_cluster" {
source = "github.com/cloudscript-technology/terraform-mgc-kubernetes-cluster?ref=0.0.1"
name = "my-k8s-cluster"
enabled_bastion = false
enabled_server_group = true
node_pools = [
{
name = "pool-1"
flavor = "cloud-k8s.gp1.medium"
replicas = 3
auto_scale = {
max_replicas = 5
min_replicas = 2
}
tags = ["env:prod", "team:devops"]
taints = [
{
effect = "NoSchedule"
key = "dedicated"
value = "sys"
}
]
}
]
}
Name | Type | Description | Default | Required |
---|---|---|---|---|
name |
string | Name of the Kubernetes cluster | n/a | yes |
description |
string | A brief description of the Kubernetes cluster | null | no |
kubernetes_version |
string | The native Kubernetes version for the cluster in 'vX.Y.Z' format | null | no |
enabled_bastion |
bool | Enables the use of a bastion host for secure access to the cluster | n/a | yes |
enabled_server_group |
bool | Enables the use of a server group with anti-affinity policy | false | no |
node_pools |
list | A list representing node pools within the Kubernetes cluster | n/a | yes |
This module does not have defined outputs. Add outputs as needed to expose important cluster information.
Contributions are welcome! To contribute, follow these steps:
- Fork this repository
- Create a branch for your feature (
git checkout -b feature/new-feature
) - Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature/new-feature
) - Create a new Pull Request
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
This module is maintained by CloudScript Technology.