api

package
v0.0.0-...-bfc5e5e Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	Alias                 string            `json:"alias"                  yaml:"alias"`
	APIServerURL          string            `json:"api_server_url"         yaml:"api_server_url"`
	Channel               string            `json:"channel"                yaml:"channel"`
	ConfigItems           map[string]string `json:"config_items"           yaml:"config_items"`
	CriticalityLevel      int32             `json:"criticality_level"      yaml:"criticality_level"`
	Environment           string            `json:"environment"            yaml:"environment"`
	ID                    string            `json:"id"                     yaml:"id"`
	InfrastructureAccount string            `json:"infrastructure_account" yaml:"infrastructure_account"`
	LifecycleStatus       string            `json:"lifecycle_status"       yaml:"lifecycle_status"`
	LocalID               string            `json:"local_id"               yaml:"local_id"`
	NodePools             []*NodePool       `json:"node_pools"             yaml:"node_pools"`
	Provider              string            `json:"provider"               yaml:"provider"`
	Region                string            `json:"region"                 yaml:"region"`
	Status                *ClusterStatus    `json:"status"                 yaml:"status"`
	Owner                 string            `json:"owner"                  yaml:"owner"`
}

Cluster describes a kubernetes cluster and related configuration.

func SampleCluster

func SampleCluster() *Cluster

func (*Cluster) ASGBackedPools

func (cluster *Cluster) ASGBackedPools() []*NodePool

func (*Cluster) ChannelOverrides

func (cluster *Cluster) ChannelOverrides() (map[string]string, error)

func (*Cluster) KarpenterPools

func (cluster *Cluster) KarpenterPools() []*NodePool

func (*Cluster) Version

func (cluster *Cluster) Version(channelVersion channel.ConfigVersion) (*ClusterVersion, error)

Version returns the version derived from a sha1 hash of the cluster struct and the channel config version.

type ClusterStatus

type ClusterStatus struct {
	CurrentVersion string     `json:"current_version" yaml:"current_version"`
	LastVersion    string     `json:"last_version"    yaml:"last_version"`
	NextVersion    string     `json:"next_version"    yaml:"next_version"`
	Problems       []*Problem `json:"problems"        yaml:"problems"`
}

ClusterStatus describes the status of a cluster.

type ClusterVersion

type ClusterVersion struct {
	ConfigVersion string
	ClusterHash   string
}

ClusterVersion is a combination of configuration version from the configuration repository and a hash of cluster's metadata.

func ParseVersion

func ParseVersion(version string) *ClusterVersion

ParseVersion parses a version string into a ConfigVersion. Invalid version strings are parsed into empty ClusterVersion structs.

func (*ClusterVersion) String

func (version *ClusterVersion) String() string

type NodePool

type NodePool struct {
	DiscountStrategy string            `json:"discount_strategy" yaml:"discount_strategy"`
	InstanceTypes    []string          `json:"instance_types"    yaml:"instance_types"`
	Name             string            `json:"name"              yaml:"name"`
	Profile          string            `json:"profile"           yaml:"profile"`
	MinSize          int64             `json:"min_size"          yaml:"min_size"`
	MaxSize          int64             `json:"max_size"          yaml:"max_size"`
	ConfigItems      map[string]string `json:"config_items"      yaml:"config_items"`

	// Deprecated, only kept here so the existing clusters don't break
	InstanceType string
}

NodePool describes a node pool in a kubernetes cluster.

func (NodePool) IsKarpenter

func (np NodePool) IsKarpenter() bool

func (NodePool) IsMaster

func (np NodePool) IsMaster() bool

func (NodePool) IsSpot

func (np NodePool) IsSpot() bool

func (NodePool) KarpenterInstanceTypeStrategy

func (np NodePool) KarpenterInstanceTypeStrategy() string

func (NodePool) KarpenterRequirements

func (np NodePool) KarpenterRequirements() []v1.NodeSelectorRequirementApplyConfiguration

func (NodePool) Taints

func (np NodePool) Taints() []*corev1.Taint

type Problem

type Problem struct {
	Detail   string `json:"detail"   yaml:"detail"`
	Instance string `json:"instance" yaml:"instance"`
	Status   int32  `json:"status"   yaml:"status"`
	Title    string `json:"title"    yaml:"title"`
	Type     string `json:"type"     yaml:"type"`
}

Problem describes a problem.

Jump to

Keyboard shortcuts

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