Skip to main content
Version: 2.0

Create a Rancher Template with CLI

Connect to CLI via Terminal

ssh [email protected]
Warning: Permanently added '10.32.2.220' (ECDSA) to the list of known hosts.
Password:
Welcome to the Cube Appliance
Enter "help" for a list of available commands
CONTROL>

Create node template

CONTROL> kubernetes
CONTROL:kubernetes> iaas_template_create

Select domain

Select domain:
1: default
Enter index: 1

Select tenant

Select tenant:
1: admin
2: WISE-STACK
Enter index: 1

Select user

Select user:
1: admin
2: admin_cli
Enter index: 1
Input user password: PASSWORD

Select public network

Select public network:
1: public
Enter index: 1

Select private network

Select private network:
1: admin_private_10
2: manila_service_network
3: lb-mgmt-net
Enter index: 1

Select router

Select router:
1: admin_pri_10_router
Enter index: 1

Select flavor

Select flavor:
1: name: m1.xlarge, cpu: 8, mem: 16384mb, disk: 160gb
2: name: m1.tiny, cpu: 1, mem: 512mb, disk: 1gb
3: name: m1.large, cpu: 8, mem: 8192mb, disk: 80gb
4: name: demo.1, cpu: 1, mem: 128mb, disk: 2gb
5: name: m1.small, cpu: 1, mem: 2048mb, disk: 20gb
6: name: m1.medium, cpu: 2, mem: 4096mb, disk: 40gb
Enter index: 5

Create key pair and save the private key as test_demo.pem

Input ssh user, usually 'ubuntu' or 'centos' (non-root): ubuntu
Select keypair or press enter to create a new one:
1: bigstack
2: cirros
Enter index:
Command cancelled
Create a new keypair. Specify name: test_demo
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAqG4lHnSxEnZOedwOhC35kmAcumuEOsXtVA/O98EwICPd+tH0
szBgnBpbRDfTB9fu6EqK6ZsTmjpV7PJv8vzmLWSr8IKfTtKRj28yx26zNhqKwrIf
uaZUjgXjlk1GOBUichHbrRnMwaLPUXxQK3oG8rqzRAY9CwkI55gfjk0iVCdKzhFo
3Jzf3FjgPWEw2hBhv/TaCiswwj3r49vtOo3KGv62SzQMG0WaHlkBUzFyJJDVtvLW
TFc85M7apiB08gyMufpKdHhXUQ1k6OIJo6QYlgXRlabILeQwFp5OxFvmlW2x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zS9bhsc6Tu+xIxpaUv4o5lFRLk3rmbA46MhwGy
8sZt8wKBgGpjqxwZc2hUiPFRwc1e0nVf/W2TgzhgQmChfqJy77sEtFcdA7nF+QEp
UwZYzHsNEcNgP12xY3NsnLQbxNraWB16MmC9YSxD67r8a0ovvqOqnbApRCaYhb4b
K/QwxSR3GJ4OyNGz3r5e8V368c6O26FJD+J8DqaysBdTCcEsO3l5
-----END RSA PRIVATE KEY-----

Create a new security group - k8s

Select security group or press enter to create a new one:
1: default
2: lb-mgmt-sec-grp
3: lb-hmgr-sec-grp
Enter index:
Command cancelled
Create a new SG. Specify name: k8s
Please wait. Creating security group 'k8s'...

Enter a template name

Input template name: test_demo

Node Template is created

[Cloud Provider YAML]:
# click 'Edit as YAML' in the 'Add Cluster' dialog and
# replace line 'rancher_kubernetes_engine_config:' with the below snippet
rancher_kubernetes_engine_config:
cloud_provider:
name: 'openstack'
openstackCloudProvider:
global:
auth-url: 'http://10.32.2.220:5000/v3/'
username: 'admin'
password: 'admin'
region: 'RegionOne'
domain-name: 'default'
tenant-name: 'admin'
block_storage:
bs-version: v2
ignore-volume-az: true
trust-device-path: true
load_balancer:
lb-version: v2
subnet-id: 'f361c913-aa51-4f80-a978-ef4adf49e5b6'
floating-network-id: '9f5a4a8e-3e1c-4935-8e1b-d9cee3c0fd4e'
use-octavia: true
route:
router-id: 'f8f9dc0f-741d-4e18-ab8a-b941b0125fbf'

Creating IaaS Node template "test_demo"...
{"level":"info","timestamp":"2020-10-30T10:47:02+08:00","msg":"Node template created","name":"test_demo"}
sky2:kubernetes>

Look at your newly created node templates

  • login to CubeOS dashboard
  • click on the kubernetes from sidebar and login
  • check up the new created node template, click on the top right profile image and select Node Templates from the dropdown menu

/assets/k8s/node_template.png