Skip to content

Latest commit

 

History

History
198 lines (164 loc) · 9.75 KB

lke_cluster.md

File metadata and controls

198 lines (164 loc) · 9.75 KB

lke_cluster

Manage Linode LKE clusters.

Minimum Required Fields

Field Type Required Description
api_token str Required The Linode account personal access token. It is necessary to run the module.
It can be exposed by the environment variable LINODE_API_TOKEN instead.
See details in Usage.

Examples

- name: Create a Linode LKE cluster
  linode.cloud.lke_cluster:
    label: 'my-cluster'
    region: us-southeast
    k8s_version: 1.28
    node_pools:
      - type: g6-standard-1
        count: 3
      - type: g6-standard-2
        count: 2
    state: present
- name: Create a Linode LKE cluster with autoscaler
  linode.cloud.lke_cluster:
    label: 'my-cluster'
    region: us-southeast
    k8s_version: 1.28
    node_pools:
      - type: g6-standard-1
        count: 2
        autoscaler:
          enable: true
          min: 2
          max: 5
    state: present
- name: Delete a Linode LKE cluster
  linode.cloud.lke_cluster:
    label: 'my-cluster'
    state: absent

Parameters

Field Type Required Description
label str Required This Kubernetes cluster’s unique label.
state str Required The desired state of the target. (Choices: present, absent)
k8s_version str Optional The desired Kubernetes version for this Kubernetes cluster in the format of ., and the latest supported patch version will be deployed. A version upgrade requires that you manually recycle the nodes in your cluster. (Updatable)
region str Optional This Kubernetes cluster’s location.
tags list Optional An array of tags applied to the Kubernetes cluster.
high_availability bool Optional Defines whether High Availability is enabled for the Control Plane Components of the cluster. (Default: False; Updatable)
acl (sub-options) dict Optional The ACL configuration for this cluster's control plane. NOTE: Control Plane ACLs may not currently be available to all users. (Updatable)
node_pools (sub-options) list Optional A list of node pools to configure the cluster with (Updatable)
skip_polling bool Optional If true, the module will not wait for all nodes in the cluster to be ready. (Default: False)
wait_timeout int Optional The period to wait for the cluster to be ready in seconds. (Default: 600)

acl

Field Type Required Description
enabled bool Optional Whether control plane ACLs are enabled for this cluster. (Updatable)
addresses (sub-options) dict Optional The addresses allowed to access this cluster's control plane. (Updatable)

addresses

Field Type Required Description
ipv4 list Optional A list of IPv4 addresses to grant access to this cluster's control plane.
ipv6 list Optional A list of IPv6 addresses to grant access to this cluster's control plane.

node_pools

Field Type Required Description
count int Required The number of nodes in the Node Pool. (Updatable)
type str Required The Linode Type for all of the nodes in the Node Pool.
autoscaler (sub-options) dict Optional When enabled, the number of nodes autoscales within the defined minimum and maximum values. (Updatable)
labels dict Optional Key-value pairs added as labels to nodes in the node pool. Labels help classify your nodes and to easily select subsets of objects. (Updatable)
taints (sub-options) list Optional Kubernetes taints to add to node pool nodes. Taints help control how pods are scheduled onto nodes, specifically allowing them to repel certain pods. (Updatable)

autoscaler

Field Type Required Description
enabled bool Optional Whether autoscaling is enabled for this Node Pool. NOTE: Subsequent playbook runs will override nodes created by the cluster autoscaler. (Updatable)
max int Optional The maximum number of nodes to autoscale to. Defaults to the value provided by the count field. (Updatable)
min int Optional The minimum number of nodes to autoscale to. Defaults to the Node Pool’s count. (Updatable)

taints

Field Type Required Description
key str Required The Kubernetes taint key. (Updatable)
value str Required The Kubernetes taint value. (Updatable)
effect str Required The Kubernetes taint effect. (Choices: NoSchedule, PreferNoSchedule, NoExecute; Updatable)

Return Values

  • cluster - The LKE cluster in JSON serialized form.

    • Sample Response:
      {
        "control_plane": {
          "acl": {
              "addresses": {
                  "ipv4": ["0.0.0.0/0"], 
                  "ipv6": ["2001:db8:1234:abcd::/64"]
              }, 
              "enabled": true
          },
          "high_availability": true
        },
        "created": "2019-09-12T21:25:30Z",
        "id": 1234,
        "k8s_version": "1.28",
        "label": "lkecluster12345",
        "region": "us-central",
        "tags": [
          "ecomm",
          "blogs"
        ],
        "updated": "2019-09-13T21:24:16Z"
      }
    • See the Linode API response documentation for a list of returned fields
  • node_pools - A list of node pools in JSON serialized form.

    • Sample Response:
      [
        {
          "autoscaler": {
            "enabled": true,
            "max": 12,
            "min": 3
          },
          "disk_encryption": "enabled",
          "count": 6,
          "disks": [
            {
              "size": 1024,
              "type": "ext-4"
            }
          ],
          "id": 456,
          "nodes": [
            {
              "id": "123456",
              "instance_id": 123458,
              "status": "ready"
            }
          ],
          "tags": [
            "example tag",
            "another example"
          ],
          "type": "g6-standard-4"
        }
      ]
    • See the Linode API response documentation for a list of returned fields
  • kubeconfig - The Base64-encoded kubeconfig used to access this cluster. NOTE: This value may be unavailable if skip_polling is true.

  • dashboard_url - The Cluster Dashboard access URL.