launchtemplate

package
v1.7.3-hash-fix-backport Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2025 License: Apache-2.0 Imports: 34 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectDoNotSyncTaintsLabel added in v1.5.0

func InjectDoNotSyncTaintsLabel(amiFamilyName string, labels map[string]string) map[string]string

InjectDoNotSyncTaintsLabel adds a label for all non-custom AMI families. It is exported just for ease of testing. This label is to tell karpenter that it should *not* sync taints. This is to work around a race condition. By default, this label is not added to the custom AMI family as users may still want their taints synced. Startup taints will be racy for custom AMIs if they do not add this label, however. https://github.com/kubernetes-sigs/karpenter/issues/1772

func LaunchTemplateName added in v0.36.0

func LaunchTemplateName(options *amifamily.LaunchTemplate) string

Types

type CreateLaunchTemplateInputBuilder added in v1.6.0

type CreateLaunchTemplateInputBuilder struct {
	LaunchModeProvider
	// contains filtered or unexported fields
}

func NewCreateLaunchTemplateInputBuilder added in v1.6.0

func NewCreateLaunchTemplateInputBuilder(
	options *amifamily.LaunchTemplate,
	clusterIPFamily corev1.IPFamily,
	userData string,
) *CreateLaunchTemplateInputBuilder

func (*CreateLaunchTemplateInputBuilder) Build added in v1.6.0

func (*CreateLaunchTemplateInputBuilder) WithLaunchModeProvider added in v1.6.0

type DefaultProvider added in v0.36.0

type DefaultProvider struct {
	sync.Mutex
	LaunchModeProvider

	KubeDNSIP       net.IP
	CABundle        *string
	ClusterEndpoint string
	ClusterCIDR     atomic.Pointer[string]
	ClusterIPFamily corev1.IPFamily
	// contains filtered or unexported fields
}

func NewDefaultProvider added in v0.36.0

func NewDefaultProvider(
	ctx context.Context,
	cache *cache.Cache,
	ec2api sdk.EC2API,
	eksapi sdk.EKSAPI,
	amiFamily amifamily.Resolver,
	securityGroupProvider securitygroup.Provider,
	subnetProvider subnet.Provider,
	caBundle *string,
	startAsync <-chan struct{},
	kubeDNSIP net.IP,
	clusterEndpoint string,
	opts ...DefaultProviderOpts,
) *DefaultProvider

func (*DefaultProvider) CreateAMIOptions added in v1.3.3

func (p *DefaultProvider) CreateAMIOptions(ctx context.Context, nodeClass *v1.EC2NodeClass, labels, tags map[string]string) (*amifamily.Options, error)

func (*DefaultProvider) DeleteAll added in v0.36.0

func (p *DefaultProvider) DeleteAll(ctx context.Context, nodeClass *v1.EC2NodeClass) error

func (*DefaultProvider) EnsureAll added in v0.36.0

func (p *DefaultProvider) EnsureAll(
	ctx context.Context,
	nodeClass *v1.EC2NodeClass,
	nodeClaim *karpv1.NodeClaim,
	instanceTypes []*cloudprovider.InstanceType,
	capacityType string,
	tags map[string]string,
) ([]*LaunchTemplate, error)

func (*DefaultProvider) InvalidateCache added in v0.36.0

func (p *DefaultProvider) InvalidateCache(ctx context.Context, ltName string, ltID string)

InvalidateCache deletes a launch template from cache if it exists

func (*DefaultProvider) ResolveClusterCIDR added in v0.36.0

func (p *DefaultProvider) ResolveClusterCIDR(ctx context.Context) error

type DefaultProviderOpts added in v1.6.0

type DefaultProviderOpts = option.Function[defaultProviderOpts]

func WithLaunchModeProvider added in v1.6.0

func WithLaunchModeProvider(provider LaunchModeProvider) DefaultProviderOpts

type LaunchMode added in v1.6.0

type LaunchMode int
const (
	LaunchModeOpen LaunchMode = iota
	LaunchModeTargeted
)

type LaunchModeProvider added in v1.6.0

type LaunchModeProvider interface {
	LaunchMode(context.Context) LaunchMode
}

type LaunchTemplate

type LaunchTemplate struct {
	Name                  string
	InstanceTypes         []*cloudprovider.InstanceType
	ImageID               string
	CapacityReservationID string
}

type Provider

type Provider interface {
	EnsureAll(context.Context, *v1.EC2NodeClass, *karpv1.NodeClaim,
		[]*cloudprovider.InstanceType, string, map[string]string) ([]*LaunchTemplate, error)
	DeleteAll(context.Context, *v1.EC2NodeClass) error
	InvalidateCache(context.Context, string, string)
	ResolveClusterCIDR(context.Context) error
	CreateAMIOptions(context.Context, *v1.EC2NodeClass, map[string]string, map[string]string) (*amifamily.Options, error)
}

Jump to

Keyboard shortcuts

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