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 ApplianceEnter "help" for a list of available commandsCONTROL> 

Create node template#

CONTROL> kubernetesCONTROL:kubernetes> iaas_template_create

Select domain#

Select domain:1: defaultEnter index: 1

Select tenant#

Select tenant:1: admin2: WISE-STACKEnter index: 1

Select user#

Select user:1: admin2: admin_cliEnter index: 1Input user password: PASSWORD

Select public network#

Select public network:1: publicEnter index: 1

Select private network#

Select private network:1: admin_private_102: manila_service_network3: lb-mgmt-netEnter index: 1

Select router#

Select router:1: admin_pri_10_routerEnter index: 1

Select flavor#

Select flavor:1: name: m1.xlarge, cpu: 8, mem: 16384mb, disk: 160gb2: name: m1.tiny, cpu: 1, mem: 512mb, disk: 1gb3: name: m1.large, cpu: 8, mem: 8192mb, disk: 80gb4: name: demo.1, cpu: 1, mem: 128mb, disk: 2gb5: name: m1.small, cpu: 1, mem: 2048mb, disk: 20gb6: name: m1.medium, cpu: 2, mem: 4096mb, disk: 40gbEnter index: 5

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

Input ssh user, usually 'ubuntu' or 'centos' (non-root): ubuntuSelect keypair or press enter to create a new one:1: bigstack2: cirrosEnter index:Command cancelledCreate a new keypair. Specify name: test_demo-----BEGIN RSA PRIVATE KEY-----MIIEowIBAAKCAQEAqG4lHnSxEnZOedwOhC35kmAcumuEOsXtVA/O98EwICPd+tH0szBgnBpbRDfTB9fu6EqK6ZsTmjpV7PJv8vzmLWSr8IKfTtKRj28yx26zNhqKwrIfuaZUjgXjlk1GOBUichHbrRnMwaLPUXxQK3oG8rqzRAY9CwkI55gfjk0iVCdKzhFo3Jzf3FjgPWEw2hBhv/TaCiswwj3r49vtOo3KGv62SzQMG0WaHlkBUzFyJJDVtvLWTFc85M7apiB08gyMufpKdHhXUQ1k6OIJo6QYlgXRlabILeQwFp5OxFvmlW2xZmxTQx6Kk6t6BavQ+bWeAY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wKBgGpjqxwZc2hUiPFRwc1e0nVf/W2TgzhgQmChfqJy77sEtFcdA7nF+QEpUwZYzHsNEcNgP12xY3NsnLQbxNraWB16MmC9YSxD67r8a0ovvqOqnbApRCaYhb4bK/QwxSR3GJ4OyNGz3r5e8V368c6O26FJD+J8DqaysBdTCcEsO3l5-----END RSA PRIVATE KEY-----

Create a new security group - k8s#

Select security group or press enter to create a new one:1: default2: lb-mgmt-sec-grp3: lb-hmgr-sec-grpEnter index:Command cancelledCreate a new SG. Specify name: k8sPlease 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 snippetrancher_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

Last updated on by Roy Tan