Skip to content

Latest commit

 

History

History
37 lines (29 loc) · 1.83 KB

integrations.md

File metadata and controls

37 lines (29 loc) · 1.83 KB

Integrating with Mirantis Launchpad

Mirantis Launchpad is distributed as a binary executable. The main integration point with cluster management is the launchpad apply command and the input launchpad.yaml configuration for the cluster. As the configuration is in YAML format you can integrate other tooling with it. One of the common use cases uses infrastructure management tooling such as Terraform.

Terraform with Mirantis Launchpad

When using cloud environments many people use Terraform to manage the infrastructure declaratively. The easiest way to integrate Terraform to Mirantis Launchpad is to use Terraform output values to specify the whole launchpad.yaml structure.

output "ucp_cluster" {
  value = {
    apiVersion = "launchpad.mirantis.com/v1beta3"
    kind = "UCP"
    spec = {
      ucp = {
        installFlags: [
          "--admin-username=admin",
          "--admin-password=${var.admin_password}",
          "--default-node-orchestrator=kubernetes",
          "--san=${module.managers.lb_dns_name}",
        ]
      }
      hosts = concat(local.managers, local.workers)
    }
  }
}

Terraform is currently limited to output json format. To convert the json to yaml, you can use a tool called yq that converts the json to yaml so you can use command piping to convert the Terraform output to launchpad.yaml.

terraform output -json | yq r --prettyPrint - ucp_cluster.value > launchpad.yaml

You can now use the launchpad apply command, and Launchpad will install all the needed cluster components.

You can see real-life examples for using Terraform with Mirantis Launchpad in Terraform Examples.