eks

package
v0.0.0-...-3d4b6db Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProvisionerName = "eks"

	OverrideDefaultLabelsAnnotation                   = "instancemgr.keikoproj.io/default-labels"
	IRSAEnabledAnnotation                             = "instancemgr.keikoproj.io/irsa-enabled"
	OsFamilyAnnotation                                = "instancemgr.keikoproj.io/os-family"
	ClusterAutoscalerEnabledAnnotation                = "instancemgr.keikoproj.io/cluster-autoscaler-enabled"
	CustomNetworkingEnabledAnnotation                 = "instancemgr.keikoproj.io/custom-networking-enabled"
	CustomNetworkingHostPodsAnnotation                = "instancemgr.keikoproj.io/custom-networking-host-pods"
	CustomNetworkingPrefixAssignmentEnabledAnnotation = "instancemgr.keikoproj.io/custom-networking-prefix-assignment-enabled"

	OsFamilyWindows      = "windows"
	OsFamilyBottleRocket = "bottlerocket"
	OsFamilyAmazonLinux2 = "amazonlinux2"
)
View Source
const (
	ScalingGroupDeletionStatus = "Delete in progress"
)

Variables

View Source
var (
	RoleNewLabel              = "node.kubernetes.io/role"
	RoleNewLabelFmt           = "node.kubernetes.io/role=%s"
	RoleOldLabel              = "node-role.kubernetes.io/%s"
	RoleOldLabelFmt           = "node-role.kubernetes.io/%s=\"\""
	InstanceMgrLifecycleLabel = "instancemgr.keikoproj.io/lifecycle"
	InstanceMgrImageLabel     = "instancemgr.keikoproj.io/image"

	AllowedOsFamilies      = []string{OsFamilyWindows, OsFamilyBottleRocket, OsFamilyAmazonLinux2}
	DefaultManagedPolicies = []string{"AmazonEKSWorkerNodePolicy", "AmazonEC2ContainerRegistryReadOnly"}
	CNIManagedPolicy       = "AmazonEKS_CNI_Policy"
	SupportedArchitectures = []string{"x86_64", "arm64"}
)

Functions

func FilterSupportedArch

func FilterSupportedArch(architectures []string) string

Types

type DiscoveredState

type DiscoveredState struct {
	Provisioned          bool
	NodesReady           bool
	ClusterNodes         *corev1.NodeList
	OwnedScalingGroups   []*autoscaling.Group
	ScalingGroup         *autoscaling.Group
	LifecycleHooks       []*autoscaling.LifecycleHook
	ScalingConfiguration scaling.Configuration
	IAMRole              *iam.Role
	AttachedPolicies     []*iam.AttachedPolicy
	InstanceProfile      *iam.InstanceProfile
	Publisher            kubeprovider.EventPublisher
	Cluster              *eks.Cluster
	VPCId                string
	InstancePool         InstancePoolSpec
	InstanceTypeInfo     []*ec2.InstanceTypeInfo
}

func (*DiscoveredState) GetAttachedPolicies

func (d *DiscoveredState) GetAttachedPolicies() []*iam.AttachedPolicy

func (*DiscoveredState) GetCluster

func (d *DiscoveredState) GetCluster() *eks.Cluster

func (*DiscoveredState) GetClusterCA

func (d *DiscoveredState) GetClusterCA() string

func (*DiscoveredState) GetClusterEndpoint

func (d *DiscoveredState) GetClusterEndpoint() string

func (*DiscoveredState) GetClusterNodes

func (d *DiscoveredState) GetClusterNodes() *corev1.NodeList

func (*DiscoveredState) GetClusterVersion

func (d *DiscoveredState) GetClusterVersion() string

func (*DiscoveredState) GetInstanceProfile

func (d *DiscoveredState) GetInstanceProfile() *iam.InstanceProfile

func (*DiscoveredState) GetInstanceTypeInfo

func (d *DiscoveredState) GetInstanceTypeInfo() []*ec2.InstanceTypeInfo

func (*DiscoveredState) GetOwnedScalingGroups

func (d *DiscoveredState) GetOwnedScalingGroups() []*autoscaling.Group

func (*DiscoveredState) GetRole

func (d *DiscoveredState) GetRole() *iam.Role

func (*DiscoveredState) GetRunningInstanceTypes

func (d *DiscoveredState) GetRunningInstanceTypes() []string

func (*DiscoveredState) GetScalingConfiguration

func (d *DiscoveredState) GetScalingConfiguration() scaling.Configuration

func (*DiscoveredState) GetScalingGroup

func (d *DiscoveredState) GetScalingGroup() *autoscaling.Group

func (*DiscoveredState) GetVPCId

func (d *DiscoveredState) GetVPCId() string

func (*DiscoveredState) HasRole

func (d *DiscoveredState) HasRole() bool

func (*DiscoveredState) HasScalingGroup

func (d *DiscoveredState) HasScalingGroup() bool

func (*DiscoveredState) IsNodesReady

func (d *DiscoveredState) IsNodesReady() bool

func (*DiscoveredState) IsProvisioned

func (d *DiscoveredState) IsProvisioned() bool

func (*DiscoveredState) SetAttachedPolicies

func (d *DiscoveredState) SetAttachedPolicies(policies []*iam.AttachedPolicy)

func (*DiscoveredState) SetCluster

func (d *DiscoveredState) SetCluster(cluster *eks.Cluster)

func (*DiscoveredState) SetClusterNodes

func (d *DiscoveredState) SetClusterNodes(nodes *corev1.NodeList)

func (*DiscoveredState) SetInstanceProfile

func (d *DiscoveredState) SetInstanceProfile(profile *iam.InstanceProfile)

func (*DiscoveredState) SetInstanceTypeInfo

func (d *DiscoveredState) SetInstanceTypeInfo(instanceTypeInfo []*ec2.InstanceTypeInfo)

func (*DiscoveredState) SetNodesReady

func (d *DiscoveredState) SetNodesReady(condition bool)

func (*DiscoveredState) SetOwnedScalingGroups

func (d *DiscoveredState) SetOwnedScalingGroups(groups []*autoscaling.Group)

func (*DiscoveredState) SetProvisioned

func (d *DiscoveredState) SetProvisioned(provisioned bool)

func (*DiscoveredState) SetRole

func (d *DiscoveredState) SetRole(role *iam.Role)

func (*DiscoveredState) SetScalingGroup

func (d *DiscoveredState) SetScalingGroup(asg *autoscaling.Group)

func (*DiscoveredState) SetSubFamilyFlexiblePool

func (d *DiscoveredState) SetSubFamilyFlexiblePool(pool map[string][]InstanceSpec)

func (*DiscoveredState) SetVPCId

func (d *DiscoveredState) SetVPCId(id string)

type EKSUserData

type EKSUserData struct {
	ApiEndpoint      string
	ClusterCA        string
	ClusterName      string
	NodeLabels       map[string]string
	NodeTaints       []corev1.Taint
	KubeletExtraArgs string
	Arguments        string
	PreBootstrap     []string
	PostBootstrap    []string
	MountOptions     []MountOpts
	MaxPods          int64
}

type EksInstanceGroupContext

type EksInstanceGroupContext struct {
	sync.Mutex
	InstanceGroup              *v1alpha1.InstanceGroup
	KubernetesClient           kubeprovider.KubernetesClientSet
	AwsWorker                  awsprovider.AwsWorker
	DiscoveredState            *DiscoveredState
	Log                        logr.Logger
	Configuration              *provisioners.ProvisionerConfiguration
	ConfigRetention            int
	ResourcePrefix             string
	Metrics                    *common.MetricsCollector
	DisableWinClusterInjection bool
}

func New

New constructs a new instance group provisioner of EKS type

func (*EksInstanceGroupContext) BootstrapNodes

func (ctx *EksInstanceGroupContext) BootstrapNodes() error

func (*EksInstanceGroupContext) CloudDiscovery

func (ctx *EksInstanceGroupContext) CloudDiscovery() error

func (*EksInstanceGroupContext) Create

func (ctx *EksInstanceGroupContext) Create() error

func (*EksInstanceGroupContext) CreateManagedRole

func (ctx *EksInstanceGroupContext) CreateManagedRole() error

func (*EksInstanceGroupContext) CreateScalingGroup

func (ctx *EksInstanceGroupContext) CreateScalingGroup(name string) error

func (*EksInstanceGroupContext) Delete

func (ctx *EksInstanceGroupContext) Delete() error

func (*EksInstanceGroupContext) DeleteManagedRole

func (ctx *EksInstanceGroupContext) DeleteManagedRole() error

func (*EksInstanceGroupContext) DeleteScalingGroup

func (ctx *EksInstanceGroupContext) DeleteScalingGroup() error

func (*EksInstanceGroupContext) GetAddedHooks

func (ctx *EksInstanceGroupContext) GetAddedHooks() ([]v1alpha1.LifecycleHookSpec, bool)

func (*EksInstanceGroupContext) GetAddedTags

func (ctx *EksInstanceGroupContext) GetAddedTags(asgName string) []*autoscaling.Tag

func (*EksInstanceGroupContext) GetBasicUserData

func (ctx *EksInstanceGroupContext) GetBasicUserData(clusterName, args string, kubeletExtraArgs string, payload UserDataPayload, mounts []MountOpts) string

func (*EksInstanceGroupContext) GetBootstrapArgs

func (ctx *EksInstanceGroupContext) GetBootstrapArgs() string

func (*EksInstanceGroupContext) GetComputedBootstrapOptions

func (ctx *EksInstanceGroupContext) GetComputedBootstrapOptions() *v1alpha1.BootstrapOptions

func (*EksInstanceGroupContext) GetComputedLabels

func (ctx *EksInstanceGroupContext) GetComputedLabels() map[string]string

func (*EksInstanceGroupContext) GetDesiredMixedInstancesPolicy

func (ctx *EksInstanceGroupContext) GetDesiredMixedInstancesPolicy(name string) *autoscaling.MixedInstancesPolicy

func (*EksInstanceGroupContext) GetDisabledMetrics

func (ctx *EksInstanceGroupContext) GetDisabledMetrics() ([]string, bool)

func (*EksInstanceGroupContext) GetDiscoveredState

func (ctx *EksInstanceGroupContext) GetDiscoveredState() *DiscoveredState

func (*EksInstanceGroupContext) GetEksLatestAmi

func (ctx *EksInstanceGroupContext) GetEksLatestAmi() (string, error)

func (*EksInstanceGroupContext) GetEksSsmAmi

func (ctx *EksInstanceGroupContext) GetEksSsmAmi(id string) (string, error)

func (*EksInstanceGroupContext) GetEnabledMetrics

func (ctx *EksInstanceGroupContext) GetEnabledMetrics() ([]string, bool)

func (*EksInstanceGroupContext) GetInstanceGroup

func (ctx *EksInstanceGroupContext) GetInstanceGroup() *v1alpha1.InstanceGroup

func (*EksInstanceGroupContext) GetKubeletExtraArgs

func (ctx *EksInstanceGroupContext) GetKubeletExtraArgs() string

func (*EksInstanceGroupContext) GetLabelList

func (ctx *EksInstanceGroupContext) GetLabelList() []string

func (*EksInstanceGroupContext) GetManagedPoliciesList

func (ctx *EksInstanceGroupContext) GetManagedPoliciesList(additionalPolicies []string) []string

func (*EksInstanceGroupContext) GetMountOpts

func (ctx *EksInstanceGroupContext) GetMountOpts() []MountOpts

func (*EksInstanceGroupContext) GetOsFamily

func (ctx *EksInstanceGroupContext) GetOsFamily() string

func (*EksInstanceGroupContext) GetOverrides

func (*EksInstanceGroupContext) GetRemovedHooks

func (ctx *EksInstanceGroupContext) GetRemovedHooks() ([]string, bool)

func (*EksInstanceGroupContext) GetRemovedTags

func (ctx *EksInstanceGroupContext) GetRemovedTags(asgName string) []*autoscaling.Tag

func (*EksInstanceGroupContext) GetState

func (*EksInstanceGroupContext) GetTaintList

func (ctx *EksInstanceGroupContext) GetTaintList() []string

func (*EksInstanceGroupContext) GetUpgradeStrategy

func (ctx *EksInstanceGroupContext) GetUpgradeStrategy() *v1alpha1.AwsUpgradeStrategy

func (*EksInstanceGroupContext) GetUserDataStages

func (ctx *EksInstanceGroupContext) GetUserDataStages() UserDataPayload

func (*EksInstanceGroupContext) IsReady

func (ctx *EksInstanceGroupContext) IsReady() bool

func (*EksInstanceGroupContext) Locked

func (ctx *EksInstanceGroupContext) Locked() bool

func (*EksInstanceGroupContext) NewRollingUpdateRequest

func (ctx *EksInstanceGroupContext) NewRollingUpdateRequest() *kubeprovider.RollingUpdateRequest

func (*EksInstanceGroupContext) RemoveAuthRole

func (ctx *EksInstanceGroupContext) RemoveAuthRole(arn string) error

func (*EksInstanceGroupContext) ResolveSecurityGroups

func (ctx *EksInstanceGroupContext) ResolveSecurityGroups() []string

func (*EksInstanceGroupContext) ResolveSubnets

func (ctx *EksInstanceGroupContext) ResolveSubnets() []string

func (*EksInstanceGroupContext) ScalingGroupUpdateNeeded

func (ctx *EksInstanceGroupContext) ScalingGroupUpdateNeeded(configName string) bool

func (*EksInstanceGroupContext) SetDiscoveredState

func (ctx *EksInstanceGroupContext) SetDiscoveredState(state *DiscoveredState)

func (*EksInstanceGroupContext) SetState

func (ctx *EksInstanceGroupContext) SetState(state v1alpha1.ReconcileState)

func (*EksInstanceGroupContext) StateDiscovery

func (ctx *EksInstanceGroupContext) StateDiscovery()

func (*EksInstanceGroupContext) TagsUpdateNeeded

func (ctx *EksInstanceGroupContext) TagsUpdateNeeded() bool

func (*EksInstanceGroupContext) Update

func (ctx *EksInstanceGroupContext) Update() error

func (*EksInstanceGroupContext) UpdateLifecycleHooks

func (ctx *EksInstanceGroupContext) UpdateLifecycleHooks(asgName string) error

func (*EksInstanceGroupContext) UpdateManagedPolicies

func (ctx *EksInstanceGroupContext) UpdateManagedPolicies(roleName string) error

func (*EksInstanceGroupContext) UpdateMetricsCollection

func (ctx *EksInstanceGroupContext) UpdateMetricsCollection(asgName string) error

func (*EksInstanceGroupContext) UpdateNodeReadyCondition

func (ctx *EksInstanceGroupContext) UpdateNodeReadyCondition() bool

func (*EksInstanceGroupContext) UpdateScalingGroup

func (ctx *EksInstanceGroupContext) UpdateScalingGroup(configName string, scalingConfig *scaling.Configuration) (bool, error)

func (*EksInstanceGroupContext) UpdateScalingProcesses

func (ctx *EksInstanceGroupContext) UpdateScalingProcesses(asgName string) error

func (*EksInstanceGroupContext) UpdateWarmPool

func (ctx *EksInstanceGroupContext) UpdateWarmPool(asgName string) error

func (*EksInstanceGroupContext) UpgradeNodes

func (ctx *EksInstanceGroupContext) UpgradeNodes() error

type InstancePool

type InstancePool struct {
	Type InstancePoolType
	Pool map[string][]InstanceSpec
}

func (*InstancePool) GetPool

func (p *InstancePool) GetPool(key string) ([]InstanceSpec, bool)

type InstancePoolSpec

type InstancePoolSpec struct {
	SubFamilyFlexiblePool InstancePool
}

type InstancePoolType

type InstancePoolType string
const (
	SubFamilyFlexible InstancePoolType = "SubFamilyFlexible"
)

type InstanceSpec

type InstanceSpec struct {
	Type   string
	Weight string
}

type MountOpts

type MountOpts struct {
	FileSystem  string
	Device      string
	Mount       string
	Persistance bool
}

type UserDataPayload

type UserDataPayload struct {
	PreBootstrap  []string
	PostBootstrap []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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