Skip to content

Terraform deployment to provision an kubernetes cluster on maas.io

License

Notifications You must be signed in to change notification settings

Cloud-native-engineering/terraform_maas_k8s

Repository files navigation

Terraform Automation of K0s Setup on MAAS

Provisioning with Terraform to deploy a High Availability Kubernetes cluster using K0s on MAAS (Metal as a Service) from Canonical.

Usage

  1. Initialize Terraform:

    terraform init
  2. Export necessary variables:

    export TF_VAR_url=<MAAS-URL>
    export TF_VAR_key=<API-KEY-4-MAAS>
    export TF_VAR_hostname_prefix=<KVM-HOST>
  3. Plan the deployment:

    terraform plan
  4. Apply the deployment:

    terraform apply
  5. Destroy the deployment:

    terraform destroy

Configuration

  • cloud_init_k0s.tftpl: Cloud-init template configuration for K0s setup.
  • main.tf: Main Terraform configuration file.
  • provider.tf: Provider configuration for Terraform.
  • variables.tf: Variable definitions for Terraform.

How to Change Kubernetes Nodes

To change the nodes, follow these steps:

  1. Update the following variables:

    worker_instances_count     = 3
    controller_instances_count = 2

Yes really that's all you need to do...

Disclaimer

This code is intended for educational purposes only and includes a publicly known SSH key. It should not be used in production environments.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author Information

This code was created in 2024 by Yves Wetter.

About

Terraform deployment to provision an kubernetes cluster on maas.io

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages