Documentation ¶
Index ¶
- Constants
- type AWS
- 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 Azure ¶
type Azure struct { Name string `validate:"required" yaml:"name"` SubscriptionId string `validate:"required" yaml:"subscription_id"` TenantId string `validate:"required" yaml:"tenant_id"` ClientId string `validate:"required" yaml:"client_id"` ClientSecret string `validate:"required" yaml:"client_secret"` }
type Cloudflare ¶ added in v0.1.1
type Cloudflare struct { Name string `validate:"required" yaml:"name"` ApiToken string `validate:"required" yaml:"api_token"` }
func (*Cloudflare) Validate ¶ added in v0.1.1
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 int64 `yaml:"count"` ServerType string `validate:"required" yaml:"server_type"` Image string `validate:"required" yaml:"image"` DiskSize int64 `validate:"required" yaml:"disk_size"` }
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 ¶ added in v0.1.1
type HetznerDNS struct { Name string `validate:"required" yaml:"name"` ApiToken string `validate:"required" yaml:"api_token"` }
func (*HetznerDNS) Validate ¶ added in v0.1.1
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:"targeted-k8s"` 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:"private_key"` KeyFingerprint string `validate:"required" yaml:"key_fingerprint"` TenancyOCID string `validate:"required" yaml:"tenancy_ocid"` UserOCID string `validate:"required" yaml:"user_ocid"` CompartmentID string `validate:"required" yaml:"compartment_ocid"` }
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:"target_port"` 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