+6

Csd Garr Kubernetes Openstack Integrator

  • By CSD GARR
juju deploy csd-garr-kubernetes-openstack-integrator
Show information
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
Channel Version Revision Published Runs on
latest/stable 7 7 06 Dec 2021

Platform:

Discuss this bundle

Share your thoughts on this charm with the community on discourse.

Join the discussion

Kubernetes bundle - GARR Cloud

The following instructions will get you a Kubernetes cluster deployed on the GARR Cloud.

NOTE: REQUIRES THE CONFIGURATION OF THE OPENSTACK INTEGRATOR PARAMETERS TO WORK.

Prerequisites

Currently a bug affecting the juju controller (version 2.9.X) prevents juju charms to be deployed on linux containers (lxc).

As a workaround, do as follows:

1. create a file named cloudinit-userdata.yaml like so->

    cloudinit-userdata: |
      postruncmd:
        - lxc storage create volume dir

2. Execute the following command -> juju model-config cloudinit-userdata.yaml 

Deployment

Download the bundle by clicking on the 'Download .zip' button on the files section.

Edit and configure the 'bundle.yaml' file with the right subnet and floating network ids used by your Openstack project. In order to find the subnet and floating network ids, follow these steps:

1. go to the GARR Cloud Dashboard: https://dashboard.cloud.garr.it;
2. select the project and cloud region (related to your DaaS credentials) in which you want to deploy the Kubernetes cluster;
3. go to Network -> Networks and get the default subnet ID and the floating-ip network ID. If you are on a playground project, get the playground-priv subnet ID and the playground-floating-ip network ID;

Now we can update the openstack-integrator section in the bundle with the information retrieved in the previous steps.

We also need to find the subnet network address and use it in the bundle:

1. go to the GARR Cloud Dashboard: https://dashboard.cloud.garr.it;
2. select the project and cloud region (related to your DaaS credentials) in which you want to deploy the Kubernetes cluster;
3. go to Network -> Networks, click on the previously chosen network (default/playground-priv) and then click on the Subnets tab. Here you'll find the subnet Network Address (es: 192.168.0.0/16);

Now we can uncomment the overlay section (very last section) in the bundle and then update it with the information retrieved in the previous steps.

Now, execute the following command and deploy the bundle:

juju deploy <path/to/bundle>.yaml --trust

Retrieve the kubeconfig

Once the bundle is deployed, the kubernetes configuration file can be retrieved by executing the following commands:

juju add-ssh-key "$(cat ~/.ssh/id_rsa.pub)"
juju scp kubernetes-master/0:config .

Note

If you want to remove and re-deploy the same bundle in the same openstack project please do as follows:

Remove the applications from the juju model

juju remove-application containerd easyrsa etcd flannel kubernetes-master kubernetes-worker kubernetes-worker-open-ports openstack-integrator

If some units are in an error or blocked state, execute a juju remove-machine for the remaining machines.

Use the openstack cli to remove the LoadBalancers and related resources (listeners,pools,members) previously created

source <app-cred-openrc>.sh

where app-cred-openrc.sh is the application credential related to your user account. If you do not have an application credential, you can follow this guide to create it (https://cloud.garr.it/compute/app-credential/).

Find all the loadbalancer created in your project:

openstack loadbalancer list --project <your-project-name>

Take note of all the loadbalancer ids that you want to delete and for each id execute the following command:

openstack loadbalancer delete <id> --cascade

As a result, the loadbalancers and related resources will be deleted.

Delete security groups

opensack security group delete <ids>

where ids are all the ids that the command openstack security group list returns EXCEPT the default security group.

Release Floating IPs

opensack floating ip delete <ids>

where ids are all the ids in status DOWN that the command openstack floating ip list returns.

Re-deploy the bundle

juju deploy <path/to/bundle>.yaml --trust