opentelekomcloud.cloud.cce_node_pool (0.14.2) — module

Add/Delete CCE Node Pool

| "added in version" 0.5.0 of opentelekomcloud.cloud"

Authors: Tino Schreiber (@tischrei)

Install collection

Install with ansible-galaxy collection install opentelekomcloud.cloud:==0.14.2


Add to requirements.yml

  collections:
    - name: opentelekomcloud.cloud
      version: 0.14.2

Description

Add or Remove CCE Node Pool in OTC


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create CCE Node Pool with minimal configuration
- cce_node_pool:
    cloud: "{{ test_cloud }}"
    cluster: clustername
    flavor: s2.large.2
    os: 'CentOS 7.7'
    name: my-nodepool
    network: '25d24fc8-d019-4a34-9fff-0a09fde6a123'
    ssh_key: 'ssh-pub'
    state: present
  register: pool
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Create CCE Node Pool with fine-grained configuration
- cce_node_pool:
    cloud: "{{ test_cloud }}"
    availability_zone: "random"
    autoscaling_enabled: True
    cluster: tino-test
    data_volumes:
      - volumetype: SSD
        size: 120
      - volumetype: SATA
        size: 100
        encrypted: False
        cmk_id: ''
    flavor: s2.large.2
    initial_node_count: 0
    k8s_tags:
      mytag: myvalue
      mysecondtag: mysecondvalue
    min_node_count: 1
    max_node_count: 3
    name: test-ansible2
    network: '25d24fc8-d019-4a34-9fff-0a09fde6a123'
    priority: 2
    os: 'CentOS 7.7'
    scale_down_cooldown_time: 5
    ssh_key: 'sshkey-pub'
    tags:
      - key: 'my_first_key'
        value: 'my_first_value'
      - key: 'my_second_key'
        value: 'my_secound_value'
    taints:
      - key: 'first_taint_key'
        value: 'first_taint_value'
        effect: 'NoSchedule'
      - key: 'second_taint_key'
        value: 'secound_taint_value'
        effect: 'NoExecute'
    state: present
  register: pool
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Delete CCE Node Pool
- opentelekomcloud.cloud.cce_node_pool:
    cluster: "{{ cluster_name_or_id }}"
    name: "{{ cce_node_pool_name_or_id }}"
    state: absent

Inputs

    
os:
    description: Operating System of the cluster node.
    type: str

auth:
    description:
    - Dictionary containing auth information as needed by the cloud's auth plugin strategy.
      For the default I(password) plugin, this would contain I(auth_url), I(username),
      I(password), I(project_name) and any information about domains (for example, I(os_user_domain_name)
      or I(os_project_domain_name)) if the cloud supports them. For other plugins, this
      param will need to contain whatever parameters that auth plugin requires. This parameter
      is not needed if a named cloud is provided or OpenStack OS_* environment variables
      are present.
    type: dict

name:
    description:
    - Name of the CCE Node Pool
    required: true
    type: str

tags:
    description: List of tags used to build UI labels.
    elements: dict
    type: list

wait:
    default: true
    description:
    - Should ansible wait until the requested resource is complete.
    type: bool

cloud:
    description:
    - Named cloud or cloud config to operate against. If I(cloud) is a string, it references
      a named cloud config as defined in an OpenStack clouds.yaml file. Provides default
      values for I(auth) and I(auth_type). This parameter is not needed if I(auth) is
      provided or if OpenStack OS_* environment variables are present. If I(cloud) is
      a dict, it contains a complete cloud configuration like would be in a section of
      clouds.yaml.
    type: raw

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Should the resource be present or absent.
    type: str

flavor:
    description: Flavor ID of the cluster node
    type: str

taints:
    description: List of taints.
    elements: dict
    type: list

ca_cert:
    aliases:
    - cacert
    description:
    - A path to a CA Cert bundle that can be used as part of verifying SSL API requests.
    type: str

cluster:
    description:
    - CCE cluster name or id which hosts the CCE Node Pool
    type: str

network:
    description:
    - ID of the network to which the CCE node pool belongs to.
    type: str

ssh_key:
    description: Name of the public key to login into the nodes
    type: str

timeout:
    default: 180
    description:
    - How long should ansible wait for the requested resource.
    type: int

k8s_tags:
    description: Dictionary of Kubernetes tags.
    type: dict

max_pods:
    description: Maximum number of pods on the node.
    type: int

priority:
    description: Node pool weight for scale-up operations.
    type: int

auth_type:
    description:
    - Name of the auth plugin to use. If the cloud uses something other than password
      authentication, the name of the plugin should be indicated here and the contents
      of the I(auth) parameter should be updated accordingly.
    type: str

ecs_group:
    description: ID of the ECS group where the CCE node can belong to.
    type: str

interface:
    aliases:
    - endpoint_type
    choices:
    - admin
    - internal
    - public
    default: public
    description:
    - Endpoint URL type to fetch from the service catalog.
    type: str

client_key:
    aliases:
    - key
    description:
    - A path to a client key to use as part of the SSL transaction.
    type: str

lvm_config:
    description: ConfigMap of the Docker data disk.
    type: str

public_key:
    description: Additional public key to be added for login.
    type: str

api_timeout:
    description:
    - How long should the socket layer wait before timing out for API calls. If this is
      omitted, nothing will be passed to the requests library.
    type: int

client_cert:
    aliases:
    - cert
    description:
    - A path to a client certificate to use as part of the SSL transaction.
    type: str

region_name:
    description:
    - Name of the region.
    type: str

data_volumes:
    default:
    - cmk_id: ''
      encrypted: false
      size: 100
      volumetype: SATA
    description: List of data volumes attached to the cluster node.
    elements: dict
    type: list

sdk_log_path:
    description:
    - Path to the logfile of the OpenStackSDK. If empty no log is written
    type: str

node_image_id:
    description:
    - Mandatory if custom image is used on a
    - bare metall node.
    type: str

sdk_log_level:
    choices:
    - ERROR
    - WARN
    - INFO
    - DEBUG
    default: WARN
    description: Log level of the OpenStackSDK
    type: str

max_node_count:
    description: Maximum number of nodes after scale-up.
    type: int

min_node_count:
    description: Minimum number of nodes after a scale-down.
    type: int

validate_certs:
    aliases:
    - verify
    description:
    - Whether or not SSL API requests should be verified.
    - Before Ansible 2.3 this defaulted to C(yes).
    type: bool

root_volume_size:
    default: 40
    description:
    - Size of the root volume
    type: int

root_volume_type:
    choices:
    - SATA
    - SAS
    - SSD
    default: SATA
    description:
    - Type of the root volume.
    type: str

availability_zone:
    default: random
    description: Availability zone or 'random' for all zones
    type: str

preinstall_script:
    description: Base64 encoded pre installation script.
    type: str

initial_node_count:
    default: 0
    description: Expected number of nodes in this node pool.
    type: int

postinstall_script:
    description: Base64 encoded post installation script.
    type: str

autoscaling_enabled:
    default: false
    description: Enable or disable Autoscaling
    type: bool

scale_down_cooldown_time:
    description:
    - Interval in minutes during which nodes added after a scale-up will
    - not be deleted.
    type: int

Outputs

cce_node_pool:
  description: Dictionary describing the CCE Node Pool.
  returned: On success when C(state=present)
  sample:
    api_version: v3
    id: e2d0d5f3-572e-11eb-8fea-0255ac101123
    kind: NodePool
    metadata: null
    name: test-ansible2
    spec:
      autoscaling:
        enable: true
        max_node_count: 3
        min_node_count: 1
        priority: 2
        scale_down_cooldown_time: 5
      initial_node_count: 0
      node_management:
        ecs_group: null
      node_pool_type: vm
      node_template_spec:
        availability_zone: random
        billing_mode: 0
        count: null
        data_volumes:
        - extend_params: null
          metadata: null
          size: 120
          type: SSD
        - extend_params: null
          metadata: null
          size: 100
          type: SATA
        ecs_group: null
        extend_params:
          lvm_config: null
          max_pods: 110
          node_image_id: null
          postinstall_script: null
          preinstall_script: null
          public_key: ssh_pubkey_value
        flavor: s2.large.2
        floating_ip:
          count: null
          floating_ip_spec:
            bandwidth: {}
          ids: null
        k8s_tags:
          cce.cloud.com/cce-nodepool: nodepool-name
          mysecondtag: mysecondvalue
          mytag: myvalue
        login:
          ssh_key: tischrei-pub
        node_nic_spec:
          primary_nic:
            network_id: 25d24fc8-d019-4a34-9fff-0a09fde6a123
        os: CentOS 7.7
        root_volume:
          size: 40
          type: SATA
        tags:
        - key: my_first_key
          value: my_first_value
        - key: my_second_key
          value: my_secound_value
        taints:
        - effect: NoSchedule
          key: first_taint_key
          value: first_taint_value
        - effect: NoExecute
          key: second_taint_key
          value: secound_taint_value
    status:
      current_node: 0
      status: ''
  type: dict
id:
  description: The CCE Node Pool UUID.
  returned: On success when C(state=present)
  sample: 39007a7e-ee4f-4d13-8283-b4da2e037123
  type: str