bootstrap

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0 Imports: 21 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)

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 BottlerocketKubernetes

type BottlerocketKubernetes struct {
	APIServer                   *string                          `toml:"api-server"`
	ClusterCertificate          *string                          `toml:"cluster-certificate"`
	ClusterName                 *string                          `toml:"cluster-name"`
	ClusterDNSIP                *string                          `toml:"cluster-dns-ip,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"`
	ImageGCLowThresholdPercent  *int32                           `toml:"image-gc-high-threshold-percent,omitempty"`
	ImageGCHighThresholdPercent *int32                           `toml:"image-gc-low-threshold-percent,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/develop/sources/models/src/aws-k8s-1.22/mod.rs 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 Options

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

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

Jump to

Keyboard shortcuts

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