bootstrap

package
v0.37.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Boundary                      = "//"
	MIMEVersionHeader             = "MIME-Version: 1.0"
	MIMEContentTypeHeaderTemplate = "Content-Type: multipart/mixed; boundary=\"%s\""
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bootstrapper

type Bootstrapper interface {
	Script() (string, error)
}

Bootstrapper can be implemented to generate a bootstrap script that uses the params from the Bootstrap type for a specific bootstrapping method. Examples are the Bottlerocket config and the eks-bootstrap script

type Bottlerocket

type Bottlerocket struct {
	Options
}

func (Bottlerocket) Script

func (b Bottlerocket) Script() (string, error)

nolint:gocyclo

type BottlerocketConfig

type BottlerocketConfig struct {
	SettingsRaw map[string]interface{} `toml:"settings"`
	Settings    BottlerocketSettings   `toml:"-"`
}

BottlerocketConfig is the root of the bottlerocket config, see more here https://github.com/bottlerocket-os/bottlerocket#using-user-data

func NewBottlerocketConfig

func NewBottlerocketConfig(userdata *string) (*BottlerocketConfig, error)

func (*BottlerocketConfig) MarshalTOML

func (c *BottlerocketConfig) MarshalTOML() ([]byte, error)

func (*BottlerocketConfig) UnmarshalTOML

func (c *BottlerocketConfig) UnmarshalTOML(data []byte) error

type BottlerocketCredentialProvider

type BottlerocketCredentialProvider struct {
	Enabled       *bool             `toml:"enabled"`
	CacheDuration *string           `toml:"cache-duration,omitempty"`
	ImagePatterns []string          `toml:"image-patterns"`
	Environment   map[string]string `toml:"environment,omitempty"`
}

BottlerocketCredentialProvider is k8s specific configuration for Bottlerocket Kubelet image credential provider See Bottlerocket struct at https://github.com/bottlerocket-os/bottlerocket/blob/d427c40931cba6e6bedc5b75e9c084a6e1818db9/sources/models/modeled-types/src/kubernetes.rs#L1307

type BottlerocketKubernetes

type BottlerocketKubernetes struct {
	APIServer                          *string                                   `toml:"api-server"`
	CloudProvider                      *string                                   `toml:"cloud-provider"`
	ClusterCertificate                 *string                                   `toml:"cluster-certificate"`
	ClusterName                        *string                                   `toml:"cluster-name"`
	ClusterDNSIP                       *string                                   `toml:"cluster-dns-ip,omitempty"`
	CredentialProviders                map[string]BottlerocketCredentialProvider `toml:"credential-providers,omitempty"`
	NodeLabels                         map[string]string                         `toml:"node-labels,omitempty"`
	NodeTaints                         map[string][]string                       `toml:"node-taints,omitempty"`
	MaxPods                            *int                                      `toml:"max-pods,omitempty"`
	StaticPods                         map[string]BottlerocketStaticPod          `toml:"static-pods,omitempty"`
	EvictionHard                       map[string]string                         `toml:"eviction-hard,omitempty"`
	KubeReserved                       map[string]string                         `toml:"kube-reserved,omitempty"`
	SystemReserved                     map[string]string                         `toml:"system-reserved,omitempty"`
	AllowedUnsafeSysctls               []string                                  `toml:"allowed-unsafe-sysctls,omitempty"`
	ServerTLSBootstrap                 *bool                                     `toml:"server-tls-bootstrap,omitempty"`
	RegistryQPS                        *int                                      `toml:"registry-qps,omitempty"`
	RegistryBurst                      *int                                      `toml:"registry-burst,omitempty"`
	EventQPS                           *int                                      `toml:"event-qps,omitempty"`
	EventBurst                         *int                                      `toml:"event-burst,omitempty"`
	KubeAPIQPS                         *int                                      `toml:"kube-api-qps,omitempty"`
	KubeAPIBurst                       *int                                      `toml:"kube-api-burst,omitempty"`
	ContainerLogMaxSize                *string                                   `toml:"container-log-max-size,omitempty"`
	ContainerLogMaxFiles               *int                                      `toml:"container-log-max-files,omitempty"`
	CPUManagerPolicy                   *string                                   `toml:"cpu-manager-policy,omitempty"`
	CPUManagerReconcilePeriod          *string                                   `toml:"cpu-manager-reconcile-period,omitempty"`
	TopologyManagerScope               *string                                   `toml:"topology-manager-scope,omitempty"`
	TopologyManagerPolicy              *string                                   `toml:"topology-manager-policy,omitempty"`
	ImageGCHighThresholdPercent        *string                                   `toml:"image-gc-high-threshold-percent,omitempty"`
	ImageGCLowThresholdPercent         *string                                   `toml:"image-gc-low-threshold-percent,omitempty"`
	CPUCFSQuota                        *bool                                     `toml:"cpu-cfs-quota-enforced,omitempty"`
	ShutdownGracePeriod                *string                                   `toml:"shutdown-grace-period,omitempty"`
	ShutdownGracePeriodForCriticalPods *string                                   `toml:"shutdown-grace-period-for-critical-pods,omitempty"`
	ClusterDomain                      *string                                   `toml:"cluster-domain,omitempty"`
	SeccompDefault                     *bool                                     `toml:"seccomp-default,omitempty"`
}

BottlerocketKubernetes is k8s specific configuration for bottlerocket api

type BottlerocketSettings

type BottlerocketSettings struct {
	Kubernetes BottlerocketKubernetes `toml:"kubernetes"`
}

BottlerocketSettings is a subset of all configuration in https://github.com/bottlerocket-os/bottlerocket/blob/d427c40931cba6e6bedc5b75e9c084a6e1818db9/sources/models/src/lib.rs#L260 These settings apply across all K8s versions that karpenter supports.

type BottlerocketStaticPod

type BottlerocketStaticPod struct {
	Enabled  *bool   `toml:"enabled,omitempty"`
	Manifest *string `toml:"manifest,omitempty"`
}

type Custom

type Custom struct {
	Options
}

func (Custom) Script

func (e Custom) Script() (string, error)

type EKS

type EKS struct {
	Options
	ContainerRuntime string
}

func (EKS) Script

func (e EKS) Script() (string, error)

type Nodeadm added in v0.35.0

type Nodeadm struct {
	Options
}

func (Nodeadm) Script added in v0.35.0

func (n Nodeadm) Script() (string, error)

type Options

type Options struct {
	ClusterName             string
	ClusterEndpoint         string
	ClusterCIDR             *string
	KubeletConfig           *corev1beta1.KubeletConfiguration
	Taints                  []core.Taint      `hash:"set"`
	Labels                  map[string]string `hash:"set"`
	CABundle                *string
	AWSENILimitedPodDensity bool
	ContainerRuntime        *string
	CustomUserData          *string
	InstanceStorePolicy     *v1beta1.InstanceStorePolicy
}

Options is the node bootstrapping parameters passed from Karpenter to the provisioning node

type Windows

type Windows struct {
	Options
}

func (Windows) Script

func (w Windows) Script() (string, error)

nolint:gocyclo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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