vinfra service compute k8saas create
Create a new Kubernetes cluster:
usage: vinfra service compute k8saas create [--master-node-count <count>]
[--node-count <count>]
[--volume-storage-policy <policy>]
[--kubernetes-version <version>]
--master-flavor <flavor> --flavor
<flavor> [--volume-size <size>]
--external-network <network>
[--network <network>]
--key-name <key-name>
[--use-floating-ip <use-floating-ip>]
[--enable-public-access]
[--containers-network-cidr <cidr>]
[--containers-network-node-subnet-
prefix-length <prefix_length>]
[--service-network-cidr <cidr>]
[--dns-service-ip <ip>] <name>
<name>- Kubernetes cluster name
--master-node-count <count>- The amount of master nodes in the Kubernetes cluster
--node-count <count>- The amount of worker nodes in the Kubernetes cluster
--volume-storage-policy <policy>- The name of the storage policy for the volume where containers will reside.
--kubernetes-version <version>- Kubernetes version (
v1.21.3,v1.20.7, andv1.19.9) --master-flavor <flavor>- The flavor to use for Kubernetes master nodes.
--flavor <flavor>- The flavor to use for Kubernetes worker nodes.
--volume-size <size>- The size of the storage volume on each Kubernetes node
--external-network <network>- The ID or name of a physical network that will provide Internet access to Kubernetes nodes.
--network <netwlork>- The ID or name of a virtual network that will provide networking between Kubernetes nodes.
--key-name <key-name>- The key pair to use for accessing the Kubernetes nodes.
--use-floating-ip <use-floating-ip>- Use floating IP addresses for all Kubernetes nodes (
trueorfalse). --enable-public-access-
Use a floating IP address for the Kubernetes API (
trueorfalse). --containers-network-cidr <cidr>- Container network range in CIDR notation
--containers-network-node-subnet-prefix-length <prefix_length>- The prefix length of a container subnet allocated to each Kubernetes node
--service-network-cidr <cidr>- Kubernetes service network range in CIDR notation
--dns-service-ip <ip>- DNS service IP address
The prerequisites for creating a Kubernetes cluster are:
- The Kubernetes-as-a-service component. It can be deployed along with the compute cluster or later (refer to "Creating the compute cluster" or "Provisioning Kubernetes clusters" in the Administrator Guide).
- A virtual network that will interconnect Kubernetes nodes. It needs to have a gateway and a DNS server specified.
- An SSH key that will be installed on both the master and worker nodes.
- Enough resources for all of the Kubernetes nodes, taking their flavors into account.
Example:
# vinfra service compute k8saas create k8s1 --kubernetes-version v1.20.7 \ --master-node-count 1 --node-count 3 --volume-storage-policy default \ --master-flavor medium --volume-size 10 --external-network public \ --network private1 --flavor small --key-name key1 --use-floating-ip true \ --vinfra-username user1 --vinfra-password password --vinfra-domain domain1 \ --vinfra-project project1 +----------------------------------+--------------------------------------------+ | Field | Value | +----------------------------------+--------------------------------------------+ | action_status | CREATE_IN_PROGRESS | | boot_volume_size | 10 | | boot_volume_storage_policy | default | | containers_volume_size | 10 | | containers_volume_storage_policy | default | | create_timeout | 60 | | external_network_id | 10cc4d59-adac-4ec1-8e0a-df5015b82c64 | | id | 749737ae-2452-4a98-a057-b59b1c579a85 | | key_name | key1 | | master_flavor | medium | | master_node_count | 1 | | name | k8s1 | | network_id | d037623b-0db7-40c2-b38a-9ac34fbd1cc5 | | nodegroups | - action_status: CREATE_IN_PROGRESS | | | flavor: medium | | | id: c3b4ec41-b8c1-4dae-9e1c-aa586b99a62c | | | is_default: true | | | name: default-master | | | node_count: 1 | | | role: master | | | status: CREATING | | | version: v1.20.7 | | | - action_status: CREATE_IN_PROGRESS | | | flavor: small | | | id: 65b80f19-0920-48b7-84e0-d0c63c46e99f | | | is_default: true | | | name: default-worker | | | node_count: 3 | | | role: worker | | | status: CREATING | | | version: v1.20.7 | | project_id | d8a72d59539c431381989af6cb48b05d | | status | CREATING | | user_id | 5846f988280f42199ed030a22970d48e | | worker_pools | - flavor: small | | | node_count: 3 | +----------------------------------+--------------------------------------------+
This command, run as user1 from domain1 > project1, starts creation of the Kubernetes cluster k8s1 with these parameters:
- Kubernetes version 1.20.7
- 1 master node based on the
mediumflavor and 3 worker nodes based on thesmallflavor - 10 GB storage volumes covered by the default storage policy
- Virtual network
private1that will connect to the Internet via the physical networkpublic - Floating IP addresses for each node picked from the specified physical network
- Public SSH key
key1