0

I know OpenStack has a supported method of installing a Container Container Orchestration Engine (COE) like Kubernetes using Magnum. I can not use Magnum because I am not an administrator on OpenStack and we do not have the "Service Endpoint" for Magnum installed.


Terraform has the ability to provision resources on OpenStack: I have this working. Is there any easy way to provision multiple resources and to configure a Kubernetes cluster on top of OpenStack from a non-admin level of permissions? I'm open to using other tools like Ansible to get this job done. I'm just wondering if this is possible as a regular non-admin of OpenStack to easily set up a Kubernetes cluster from the resources I can provision?

3
  • You can try rancher Kubernetes Engine (rke), that helps us to configure the Openstack provider in the Kubernetes cluster for creating resources like persistent volumes, Loadbalancers etc. rancher.com/docs/rke/latest/en/config-options/cloud-providers/… Jan 31, 2022 at 19:00
  • Can you give more info on what kind of permissions are we talking about? I use the Terraform helm_provider to directly deploy applications, controllers, and basically everything. You can also use kubernetes or kubectl manifest(again terraform resource) to accomplish this, but it's a bit messy for my taste. So I basically have an EKS cluster built with Terraform, and I have deployed all the resources and controllers with the helm_provider and I maintain it fully with that. Feb 7, 2022 at 14:56
  • @KristianKanchev I want to answer that question, but I don't know how. So I asked a follow up devops.stackexchange.com/q/15407/18965 Feb 7, 2022 at 16:28

2 Answers 2

0

Most likely the best path forward is to provision the VMs using Terraform, and the rest with Ansible.

OpenStack can be set up a number of ways, but I believe the only hook in the terraform provider that would allow you to execute code on the node would be via cloud-init user data (bash script).

What I would do is provision nodes with terraform and have it provide outputs, have python generate Ansible hosts and vars from those outputs, and then run Ansible.

What flavor of k8s are you looking at? k0s, k3s, microk8s, etc?

0

Terraform + Ansible could be the best path forward.

Terraform also has local and remote exec provisioners when provisioning VMs. Local exec runs scripts from the local machine you're deploying from and remote exec spins up an on demand SSH server using a local public key for authentication to run commands on the deployed VM for configuration (eg setup.sh)

https://developer.hashicorp.com/terraform/language/resources/provisioners/remote-exec

resource "aws_instance" "web" {
  # ...

  # Establishes connection to be used by all
  # generic remote provisioners (i.e. file/remote-exec)
  connection {
    type     = "ssh"
    user     = "root"
    password = var.root_password
    host     = self.public_ip
  }

  provisioner "remote-exec" {
    inline = [
      "puppet apply",
      "consul join ${aws_instance.web.private_ip}",
    ]
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.