How to Deploy Kubernetes with Juju

In this short guide i will teach you step by step how to deploy a kubernetes cluster using Juju.

Beware that i assume you are using:

  • JuJu
  • Metal as a Service (MaaS)

Moreover this guide refers to the kubernetes bundle customized by GARR that you can find here: https://git.garr.it/cloud/bundles/kubernetes/blob/master/README.md

Prepare cluster machines on MaaS

Depending on the machines you need, you have to set up machines for the deploying. Go on MaaS and check if you have a sufficient number of them available. After that, on each machine you want to use you have to:

  • configure the network
  • select the machines to use for the cluster and set the tag (e.g. “kubernetes”) on each of them.
  • select one of these machines to be the master and configure it for having a public IP and add the tag (e.g. “kubernetes-public-ip”) to it.

In order to assign a public ip with MaaS, you have to go into the interface tab of the node you want to set as public and assign to it an IP from your public network (statically/static-assing or dinamically/auto-assign, it depends on your network configuration). You can find more information about network configuration in the MaaS documentation here: https://docs.ubuntu.com/maas/2.3/en/installconfig-networking

Configure Ceph-OSD

If you want to use Fiber Channel devices as ceph-osd you have to do some additional steps following this guide https://cloud.garr.it/support/kb/ceph/configure_fiber_channel_devices_as_osd-disk/ .

Be careful that this procedure is necessary just if you are using Fiber Channel devices. Otherwise you can simply set a list of devices in the bundle as explained below.

Prepare and deploy your bundle

I suggest you to create a standard bundle keeping model-specific configuration in a separate file. You can read how to do it in this guide https://cloud.garr.it/support/kb/juju/create_bundle_with_configuration_file/ .

Find more informations about how to shape the bundle on our kubernetes git repository https://git.garr.it/cloud/bundles/kubernetes .