eks

command
v0.6.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

README

Cluster API bootstrap provider EKS

Cluster API bootstrap provider EKS (CABPE) is a component of Cluster API that is responsible for generating a cloud-init script to turn a Machine into a Kubernetes Node; this implementation uses the AWS-provided EKS bootstrap script for joining Kubernetes Nodes to EKS clusters.

CABPE is the bootstrap component of Cluster API Provider AWS' (CAPA) EKS ecosystem. This ecosystem is comprised of:

  • EKS controlplane provider (AWSManagedControlPlane)
  • AWS infrastructure provider (AWSMachine, AWSMachineTemplate, AWSMachinePool)
  • EKS bootstrap provider (EKSConfig, EKSConfigTemplate)

How does CABPE work?

CABPE generates cloud-init configuration that CAPA will use as the user-data for new EC2 instances. The generated configuration relies on the bootstrap.sh script that is present on all official AWS EKS AMIs.

The output script looks something like this (assuming an EKS cluster with the name my-cluster):

#!/bin/bash
/etc/eks/bootstrap.sh my-cluster

CAPA will look up the official EKS AMI for a particular Kubernetes version if the AMI is not overriden in the AWSMachine object. In order for this bootstrap provider to function, any user-specified AMIs will need to have /etc/eks/bootstrap.sh present (script source linked above).

Because the bootstrap script has no required fields other than the EKS cluster's name, which can be derived, an EKSConfig object with an empty spec is acceptable:

kind: EKSConfig
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
metadata:
  name: my-config
spec: {}

The only configuration option available is kubeletExtraArgs, which is a map[string]string:

kind: EKSConfig
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
metadata:
  name: my-config
spec:
  kubeletExtraArgs:
    image-gc-high-threshold: "50"
    image-gc-low-threshold: "40"
    minimum-container-ttl-duration: "1m"

This will produce the following:

#!/bin/bash
/etc/eks/bootstrap.sh my-cluster --kubelet-extra-args '--image-gc-high-threshold=50 --image-gc-low-threshold=45 --minimum-container-ttl-duration=1m'

This script will join the Node using the specified kubelet arguments.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha3
Package v1alpha3 contains API Schema definitions for the bootstrap v1alpha3 API group +kubebuilder:object:generate=true +groupName=bootstrap.cluster.x-k8s.io
Package v1alpha3 contains API Schema definitions for the bootstrap v1alpha3 API group +kubebuilder:object:generate=true +groupName=bootstrap.cluster.x-k8s.io
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL