Difference between revisions of "Setting up rancher to work with OpenStack"
Jump to navigation
Jump to search
(Created page with "* Assumes the rancher UI is up and running - if not check here https://wiki.define-technology.com/mediawiki-1.35.0/index.php/Setting_up_the_rancher_UI == Enable OpenStack Nod...") |
|||
| Line 1: | Line 1: | ||
* Assumes the rancher UI is up and running - if not check here https://wiki.define-technology.com/mediawiki-1.35.0/index.php/Setting_up_the_rancher_UI | * Assumes the rancher UI is up and running - if not check here https://wiki.define-technology.com/mediawiki-1.35.0/index.php/Setting_up_the_rancher_UI | ||
| + | * Instructions based on Rancher 2.7 (Feb23) | ||
| + | |||
| + | == Gather OpenStack info needed for the Node Driver == | ||
| + | # Get your openrc.sh file which has some of the bits you needed | ||
| + | # Setup user, security group, internal network (uuid), confirm image to be used, create an ssh key, confirm flavour, tenantId | ||
== Enable OpenStack Node Driver == | == Enable OpenStack Node Driver == | ||
| Line 10: | Line 15: | ||
# Node Drivers | # Node Drivers | ||
# OpenStack -> set to active | # 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. | ||
| + | |||
| + | # top left nav | ||
| + | # cluster management | ||
| + | # rke1 configuration | ||
| + | # node templates | ||
| + | # add template (openstack should now appear - add details and save, should have something like this when done, save and edit in API to see) | ||
| + | |||
| + | <pre> | ||
| + | # 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", | ||
| + | </pre> | ||
| + | |||
| + | <b> 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. </b> | ||
| + | |||
| + | == Create your first k8s cluster == | ||
| + | |||
| + | # Top left nav | ||
| + | # Cluster Management | ||
| + | # Create -> OpenStack | ||
| + | # "Cluster Name" | ||
| + | # "Name prefix" this is the node name and name that will come up in Openstack | ||
| + | # Count - set to 3 | ||
| + | # Template - choose the template you created above. | ||
| + | # Check: etcd Check: Control Plane Check: Worker | ||
| + | # Rest can be default -> Click create | ||
| + | |||
| + | To check logs in the background to see what happening (or failing) with the provisioning | ||
| + | |||
| + | <pre> | ||
| + | # make sure you are on the rancher VM | ||
| + | docker logs $(docker ps | grep rancher | awk '{print $1}') 2>&1 -f | ||
| + | </pre> | ||
Latest revision as of 18:01, 21 February 2023
- Assumes the rancher UI is up and running - if not check here https://wiki.define-technology.com/mediawiki-1.35.0/index.php/Setting_up_the_rancher_UI
- Instructions based on Rancher 2.7 (Feb23)
Gather OpenStack info needed for the Node Driver
- Get your openrc.sh file which has some of the bits you needed
- 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
- Top left nav
- Cluster Management
- Drivers
- Node Drivers
- 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.
- top left nav
- cluster management
- rke1 configuration
- node templates
- 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
- Top left nav
- Cluster Management
- Create -> OpenStack
- "Cluster Name"
- "Name prefix" this is the node name and name that will come up in Openstack
- Count - set to 3
- Template - choose the template you created above.
- Check: etcd Check: Control Plane Check: Worker
- 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