Connecting CloudStatic nodes

To connect manually created EC2 instances to a Deckhouse Platform cluster, follow these steps:

  1. Attach the IAM role <prefix>-node.
  2. Attach the security group <prefix>-node.
  3. Add the following tags:

    "kubernetes.io/cluster/<cluster_uuid>" = "shared"
    "kubernetes.io/cluster/<prefix>" = "shared"
    

To get the cluster_uuid, use the following command:

d8 k -n kube-system get cm d8-cluster-uuid -o json | jq -r '.data."cluster-uuid"'

To get the prefix, use the following command:

d8 k get mc global -o jsonpath='{.spec.settings.prefix}{"\n"}'

If the value is empty, get it from the deprecated cloud.prefix parameter of ClusterConfiguration (the prefix has moved to the ModuleConfig global):

d8 k -n kube-system get secret d8-cluster-configuration -o json | \
  jq -r '.data."cluster-configuration.yaml"' | base64 -d | grep prefix

Preemptible nodes

Preemptible virtual machines in AWS are called Spot Instances. To make a node group order them, set the spot parameter of the AWSInstanceClass resource to true.

When an EC2 Instance Rebalance Recommendation signals an elevated risk of Spot Instance interruption, the node-termination-handler component automatically applies the aws-node-termination-handler/rebalance-recommendation taint with effect: NoSchedule to the CloudEphemeral node. This taint prevents the scheduler from placing new workloads on the node unless they have a matching toleration.

The aws-node-termination-handler/spot-itn taint indicates a notice of an upcoming Spot Instance interruption.

If either taint is present, the node-manager module cordons and drains the node, then deletes it. If the node count in a zone falls below the minPerZone parameter value, the group provisions new nodes.

The recommendation allows node decommissioning to start before an interruption notice arrives. AWS may send both notifications at the same time.

How to create such nodes and the limitations of their use are described in “How to create preemptible nodes in AWS?”.

Replacing the OS image

The OS image of the nodes is set by the ami parameter of the AWSInstanceClass resource for CloudEphemeral nodes and in the instanceClass section of the AWSClusterConfiguration resource for CloudPermanent nodes and master nodes. To move the cluster nodes to a new image, follow the steps from “How do I replace the OS image in a cloud cluster?”.

Additional resources