Setting up rancher to work with OpenStack

From Define Wiki
Jump to navigation Jump to search

Gather OpenStack info needed for the Node Driver

  1. Get your openrc.sh file which has some of the bits you needed
  2. Setup user, security group, internal network (uuid), confirm image to be used, create an ssh key, confirm flavour, tenantId

Enable OpenStack Node Driver

To enable the Openstack node driver in rancher perform the following

  1. Top left nav
  2. Cluster Management
  3. Drivers
  4. Node Drivers
  5. OpenStack -> set to active

Add a Node Template

Node templates are where we define the infra details of VMs to be spun up for running k8s services/workloads - so we need to let rancher know about the Openstack creds.

  1. top left nav
  2. cluster management
  3. rke1 configuration
  4. node templates
  5. add template (openstack should now appear - add details and save, should have something like this when done, save and edit in API to see)
# had to input private key file along with password which dont show up below
# get the openrc file for the auth URL etc

"authUrl": "http://10.10.12.10:5000/v3",
"availabilityZone": "nova",
"domainName": "Default",
"flavorName": "m1.large-40gdisk",
"floatingipPool": "vpn-dmz-net",
"imageName": "ubuntu-22.04",
"keypairName": "dp-keypair",
"netId": "1c4ea5d5-1817-4eb8-9f19-ad0927179dcc",
"password"" "password"
"privateKeyFile": "-----BEGIN RSA PRIVATE KEY-----MIIE...."
"region": "RegionOne",
"secGroups": "allow-all",
"sshPort": "22",
"sshUser": "ubuntu",
"tenantDomainName": "default",
"tenantId": "958266050eeb4014ab9aa80154578235",
"tenantName": "david",
"username": "David",

You can copy the node template for controllers / workers, but make sure to add the private key and password back in as they don't copy across.

Create your first k8s cluster

  1. Top left nav
  2. Cluster Management
  3. Create -> OpenStack
  4. "Cluster Name"
  5. "Name prefix" this is the node name and name that will come up in Openstack
  6. Count - set to 3
  7. Template - choose the template you created above.
  8. Check: etcd Check: Control Plane Check: Worker
  9. Rest can be default -> Click create

To check logs in the background to see what happening (or failing) with the provisioning

# make sure you are on the rancher VM
docker logs $(docker ps | grep rancher | awk '{print $1}') 2>&1  -f