hwceco.hwcollection.hwc_cce_cluster – Creates a resource of cce cluster in Huawei Cloud

Note

This plugin is part of the hwceco.hwcollection collection (version 1.0.5).

To install it use: ansible-galaxy collection install hwceco.hwcollection.

To use it in a playbook, specify: hwceco.hwcollection.hwc_cce_cluster.

New in version 1.0.0: of hwceco.hwcollection

Synopsis

  • Creates and manages a resource of cce cluster in Huawei Cloud.

Requirements

The below requirements are needed on the host that executes this module.

  • huaweicloudsdkcore >= 3.0.47

  • huaweicloudsdkcce >= 3.0.47

Parameters

Parameter Choices/Defaults Comments
access_key
string / required
Specifies the access key of the HuaweiCloud to use.
authenticating_proxy_ca
string
Specifies the CA root certificate provided in the authenticating_proxy mode. The CA root certificate is encoded to the Base64 format.
authentication_mode
string
Default:
"rbac"
Specifies the Authentication mode of the cluster, possible values are x509 and rbac.
cloud
string
Default:
"myhuaweicloud.com"
Specifies the endpoint of the cloud. Required if you are using other cloud supported by Huaweicloud.
cluster_type
string
Default:
"VirtualMachine"
Specifies the cluster type, possible values are VirtualMachine, BareMetal and ARM64.
cluster_version
string
Specifies the cluster version, defaults to the latest supported version.
container_network_cidr
string
Specifies the container network segment.
container_network_type
string / required
Specifies the container network type.
description
string
Specifies the cluster description.
eip
string
Specifies the EIP address of the cluster.
eni_subnet_cidr
string
Specifies the ENI network segment. Specified when creating a CCE Turbo cluster.
eni_subnet_id
string
Specifies the ENI subnet id. Specified when creating a CCE Turbo cluster.
enterprise_project_id
dictionary
Specifies enterprise project id of the cce cluster.
extend_param
dictionary
Specifies the extended parameter.
filters
list / elements=string / required
A list of filters to apply when deciding whether existing resources match and should be altered. The item of filters is the name of input options.
flavor_id
string / required
Specifies the cluster specifications.
cce.s1.small is small-scale single cluster (up to 50 nodes).
cce.s1.medium is medium-scale single cluster (up to 200 nodes).
cce.s1.large is large-scale single cluster (up to 1000 nodes).
cce.s2.small is small-scale HA cluster (up to 50 nodes).
cce.s2.medium is medium-scale HA cluster (up to 200 nodes).
cce.s2.large is large-scale HA cluster (up to 1000 nodes).
cce.t1.small is small-scale single physical machine cluster (up to 10 nodes).
cce.t1.medium is medium-scale single physical machine cluster (up to 100 nodes).
cce.t1.large is large-scale single physical machine cluster (up to 500 nodes).
cce.t2.small is small-scale HA physical machine cluster (up to 10 nodes).
cce.t2.medium is medium-scale HA physical machine cluster (up to 100 nodes).
cce.t2.large is large-scale HA physical machine cluster (up to 500 nodes).
identity_endpoint
string
Default:
"https://iam.myhuaweicloud.com:443/v3"
Specifies the Identity authentication URL. Required if you are using other cloud supported by Huaweicloud.
kube_proxy_mode
string
Specifies the service forwarding mode.
iptables: Traditional kube-proxy uses iptables rules to implement service load balancing. In this mode, too many iptables rules will be generated when many services are deployed. In addition, non-incremental updates will cause a latency and even obvious performance issues in the case of heavy service traffic.
ipvs: Optimized kube-proxy mode with higher throughput and faster speed. This mode supports incremental updates and can keep connections uninterrupted during service updates. It is suitable for large-sized clusters.
multi_az
boolean
    Choices:
  • no
  • yes
Specifies whether enable multiple AZs for the cluster, only when using HA flavors.
name
string / required
Specifies the name of the cluster.
project_id
string / required
Specifies the of ID of the project to login with.
region
string / required
Specifies the Huawei Cloud region.
secret_key
string / required
Specifies the secret key of the HuaweiCloud to use.
service_network_cidr
string
Specifies the service network segment.
state
string
    Choices:
  • present ←
  • absent
Whether the given object should exist in Huawei Cloud.
subnet_id
string / required
Specifies the ID of the subnet used to create the node.
timeouts
dictionary
The timeouts for each operations.
create
string
Default:
"30m"
The timeouts for create operation.
delete
string
Default:
"30m"
The timeouts for delete operation.
vpc_id
string / required
Specifies the ID of the VPC used to create the node.

Notes

Note

  • For authentication, you can set access_key using the `ANSIBLE_HWC_ACCESS_KEY’ env variable.

  • For authentication, you can set secret_key using the `ANSIBLE_HWC_SECRET_KEY’ env variable.

  • For authentication, you can set project_id using the `ANSIBLE_HWC_PROJECT_ID’ env variable.

  • For authentication, you can set region using the `ANSIBLE_HWC_REGION’ env variable.

  • For authentication, you can set identity_endpoint using the `ANSIBLE_HWC_IDENTITY_ENDPOINT’ env variable.

  • For authentication, you can set cloud using the `ANSIBLE_HWC_CLOUD’ env variable.

  • Environment variables values will only be used if the playbook values are not set.

Examples

# create an cce cluster
- name: create a vpc
  hwc_vpc:
    cidr: "192.168.100.0/24"
    name: "ansible_vpc_test"
  register: vpc

- name: create a subnet
  hwc_vpc_subnet:
    filters:
      - "name"

    gateway_ip: "192.168.100.32"
    name: "ansible_subnet_test"
    dhcp_enable: true
    vpc_id: "{{ vpc.state.id }}"
    cidr: "192.168.100.0/26"
    # dns is required for cce node installing
    dns_address:
      - "100.125.1.250"
      - "100.125.21.250"
  register: subnet

- name: create a cce cluster
    hwc_cce_cluster:
      filters:
        - "name"

      name: "ansible-cce-cluster-test"
      description: "ansible cce cluster test"
      flavor_id: "cce.s1.small"
      vpc_id: "{{ vpc.state.id }}"
      subnet_id: "{{ subnet.state.id }}"
      container_network_type: "overlay_l2"
      authentication_mode: "rbac"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
authenticating_proxy_ca
string
success
Specifies the CA root certificate provided in the authenticating_proxy mode. The CA root certificate is encoded to the Base64 format.

authentication_mode
string
success
Specifies the Authentication mode of the cluster, possible values are x509 and rbac.

cluster_type
string
success
Specifies the cluster type, possible values are VirtualMachine, BareMetal and ARM64.

cluster_version
string
success
Specifies the cluster version, defaults to the latest supported version.

container_network_cidr
string
success
Specifies the container network segment.

container_network_type
string
success
Specifies the container network type.

description
string
success
Specifies the cluster description.

eip
string
success
Specifies the EIP address of the cluster.

eni_subnet_cidr
string
success
Specifies the ENI network segment. Specified when creating a CCE Turbo cluster.

eni_subnet_id
string
success
Specifies the ENI subnet id. Specified when creating a CCE Turbo cluster.

enterprise_project_id
string
success
Specifies enterprise project id of the cce cluster.

extend_param
dictionary
success
Specifies the extended parameter.

flavor_id
string
success
Specifies the cluster specifications.
cce.s1.small is small-scale single cluster (up to 50 nodes).
cce.s1.medium is medium-scale single cluster (up to 200 nodes).
cce.s1.large is large-scale single cluster (up to 1000 nodes).
cce.s2.small is small-scale HA cluster (up to 50 nodes).
cce.s2.medium is medium-scale HA cluster (up to 200 nodes).
cce.s2.large is large-scale HA cluster (up to 1000 nodes).
cce.t1.small is small-scale single physical machine cluster (up to 10 nodes).
cce.t1.medium is medium-scale single physical machine cluster (up to 100 nodes).
cce.t1.large is large-scale single physical machine cluster (up to 500 nodes).
cce.t2.small is small-scale HA physical machine cluster (up to 10 nodes).
cce.t2.medium is medium-scale HA physical machine cluster (up to 100 nodes).
cce.t2.large is large-scale HA physical machine cluster (up to 500 nodes).

kube_proxy_mode
string
success
Specifies the service forwarding mode.
iptables: Traditional kube-proxy uses iptables rules to implement service load balancing. In this mode, too many iptables rules will be generated when many services are deployed. In addition, non-incremental updates will cause a latency and even obvious performance issues in the case of heavy service traffic.
ipvs: Optimized kube-proxy mode with higher throughput and faster speed. This mode supports incremental updates and can keep connections uninterrupted during service updates. It is suitable for large-sized clusters.

multi_az
boolean
success
Specifies whether enable multiple AZs for the cluster, only when using HA flavors.

name
string
success
Specifies the name of the cluster.

service_network_cidr
string
success
Specifies the service network segment.

status
string
success
Specifies the cce cluster status.

subnet_id
string
success
Specifies the ID of the subnet used to create the node.

vpc_id
string
success
Specifies the ID of the VPC used to create the node.



Authors

  • Huawei (@huaweicloud)