Documentation
¶
Index ¶
- Constants
- type AWS
- type AutoscalerConfig
- type Azure
- type Cloudflare
- type Cluster
- type DNS
- type DynamicNodePool
- type GCP
- type Hetzner
- type HetznerDNS
- type Kubernetes
- type LoadBalancer
- type LoadBalancerCluster
- type Manifest
- func (ds *Manifest) CreateNodepools(pools []string, isControl bool) ([]*pb.NodePool, error)
- func (ds *Manifest) FindNodePool(nodePoolName string) *DynamicNodePool
- func (ds *Manifest) GetProvider(providerSpecName string) (*pb.Provider, error)
- func (m *Manifest) IsKubernetesClusterPresent(name string) bool
- func (m *Manifest) Validate() error
- type Node
- type NodePool
- type OCI
- type Pool
- type Provider
- type ProviderSpec
- type Role
- type StaticNodePool
Constants ¶
const APIServerPort = 6443
APIServerPort is the port on which the ApiServer listens.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWS ¶
type AutoscalerConfig ¶ added in v0.2.2
type Azure ¶
type Azure struct {
Name string `validate:"required" yaml:"name"`
SubscriptionId string `validate:"required" yaml:"subscriptionId"`
TenantId string `validate:"required" yaml:"tenantId"`
ClientId string `validate:"required" yaml:"clientId"`
ClientSecret string `validate:"required" yaml:"clientSecret"`
}
type Cloudflare ¶
type Cloudflare struct {
Name string `validate:"required" yaml:"name"`
ApiToken string `validate:"required" yaml:"apiToken"`
}
func (*Cloudflare) Validate ¶
func (c *Cloudflare) Validate() error
type Cluster ¶
type DynamicNodePool ¶
type DynamicNodePool struct {
Name string `validate:"required" yaml:"name"`
ProviderSpec ProviderSpec `validate:"required" yaml:"providerSpec"`
Count int32 `validate:"required_without=AutoscalerConfig,excluded_with=AutoscalerConfig" yaml:"count"`
ServerType string `validate:"required" yaml:"serverType"`
Image string `validate:"required" yaml:"image"`
DiskSize int64 `validate:"required" yaml:"diskSize"`
AutoscalerConfig AutoscalerConfig `validate:"required_without=Count,excluded_with=Count" yaml:"autoscaler"`
}
func (*DynamicNodePool) Validate ¶
func (d *DynamicNodePool) Validate() error
type GCP ¶
type Hetzner ¶
type Hetzner struct {
Name string `validate:"required" yaml:"name"`
// We can only validate the length of the token
// as Hetzner doesn't specify the structure of the token,
// only that it's a hash. We can also validate that the characters
// are alphanumeric (i.e. excluding characters like !#@$%^&*...)
// https://docs.hetzner.com/cloud/technical-details/faq#how-are-api-tokens-stored
Credentials string `validate:"required,alphanum,len=64" yaml:"credentials"`
}
type HetznerDNS ¶
type HetznerDNS struct {
Name string `validate:"required" yaml:"name"`
ApiToken string `validate:"required" yaml:"apiToken"`
}
func (*HetznerDNS) Validate ¶
func (c *HetznerDNS) Validate() error
type Kubernetes ¶
type Kubernetes struct {
Clusters []Cluster `yaml:"clusters"`
}
func (*Kubernetes) Validate ¶
func (k *Kubernetes) Validate(m *Manifest) error
Validate validates the parsed data inside the Kubernetes section of the manifest. It checks for missing/invalid filled out values defined in the Kubernetes section of the manifest.
type LoadBalancer ¶
type LoadBalancer struct {
Roles []Role `yaml:"roles"`
Clusters []LoadBalancerCluster `yaml:"clusters"`
}
func (*LoadBalancer) Validate ¶
func (l *LoadBalancer) Validate(m *Manifest) error
Validate validates the parsed data inside the LoadBalancer section of the manifest. It checks for missing/invalid filled out values defined in the LoadBalancer section of the manifest.
type LoadBalancerCluster ¶
type LoadBalancerCluster struct {
Name string `validate:"required" yaml:"name"`
Roles []string `yaml:"roles"`
DNS DNS `validate:"required" yaml:"dns,omitempty"`
TargetedK8s string `validate:"required" yaml:"targetedK8s"`
Pools []string `yaml:"pools"`
}
func (*LoadBalancerCluster) Validate ¶
func (c *LoadBalancerCluster) Validate() error
type Manifest ¶
type Manifest struct {
Name string `validate:"required" yaml:"name"`
Providers Provider `yaml:"providers"`
NodePools NodePool `yaml:"nodePools"`
Kubernetes Kubernetes `yaml:"kubernetes"`
LoadBalancer LoadBalancer `yaml:"loadBalancers"`
}
func (*Manifest) CreateNodepools ¶
CreateNodepools will create a pb.Nodepool structs based on the manifest specification returns error if nodepool/provider not defined, nil otherwise
func (*Manifest) FindNodePool ¶
func (ds *Manifest) FindNodePool(nodePoolName string) *DynamicNodePool
FindNodePool will search for the nodepool in manifest.DynamicNodePool based on the nodepool name returns *manifest.DynamicNodePool if found, nil otherwise
func (*Manifest) GetProvider ¶
GetProvider will search for a Provider config by matching name from providerSpec returns *pb.Provider,nil if matching Provider config found otherwise returns nil,error
func (*Manifest) IsKubernetesClusterPresent ¶
IsKubernetesClusterPresent checks in the manifests if a cluster was defined with the specified name.
type NodePool ¶
type NodePool struct {
Dynamic []DynamicNodePool `yaml:"dynamic"`
Static []StaticNodePool `yaml:"static"`
}
type OCI ¶
type OCI struct {
Name string `validate:"required" yaml:"name"`
PrivateKey string `validate:"required" yaml:"privateKey"`
KeyFingerprint string `validate:"required" yaml:"keyFingerprint"`
TenancyOCID string `validate:"required" yaml:"tenancyOcid"`
UserOCID string `validate:"required" yaml:"userOcid"`
CompartmentID string `validate:"required" yaml:"compartmentOcid"`
}
type Provider ¶
type Provider struct {
GCP []GCP `yaml:"gcp"`
Hetzner []Hetzner `yaml:"hetzner"`
AWS []AWS `yaml:"aws"`
OCI []OCI `yaml:"oci"`
Azure []Azure `yaml:"azure"`
Cloudflare []Cloudflare `yaml:"cloudflare"`
HetznerDNS []HetznerDNS `yaml:"hetznerdns"`
}
type ProviderSpec ¶
type Role ¶
type Role struct {
Name string `validate:"required" yaml:"name"`
Protocol string `validate:"required,oneof=tcp udp" yaml:"protocol"`
Port int32 `validate:"min=0,max=65535" yaml:"port"`
TargetPort int32 `validate:"min=0,max=65535" yaml:"targetPort"`
Target string `validate:"required,oneof=k8sAllNodes k8sControlPlane k8sComputePlane" yaml:"target"`
}
type StaticNodePool ¶
type StaticNodePool struct {
Name string `validate:"required" yaml:"name"`
Nodes []Node `validate:"dive" yaml:"nodes"`
}
func (*StaticNodePool) Validate ¶
func (s *StaticNodePool) Validate() error