models

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClusterNotFound      = errors.New("cluster not found")
	ErrClusterStateNotFound = errors.New("cluster state not found")
)

Functions

This section is empty.

Types

type CloudProvider

type CloudProvider struct {
	Hetzner  CloudProviderHetzner `yaml:"hetzner"`
	External bool                 `yaml:"external"`
}

type CloudProviderHetzner

type CloudProviderHetzner struct {
}

type Cluster

type Cluster struct {
	ID           uuid.UUID    `db:"id"`
	CustomerID   uuid.UUID    `db:"customer_id"`
	ProviderID   uuid.UUID    `db:"provider_id"`
	Customer     Customer     `db:"customers"`
	Provider     Provider     `db:"providers"`
	KubeConfig   *string      `db:"kube_config"`
	ClusterState ClusterState `db:"cs"`
}

type ClusterPhase

type ClusterPhase int
const (
	ClusterPhaseStarted          ClusterPhase = 0
	ClusterPhaseSetupInit        ClusterPhase = 10
	ClusterPhaseSetupDone        ClusterPhase = 15
	ClusterPhaseSshInit          ClusterPhase = 20
	ClusterPhaseSshDone          ClusterPhase = 25
	ClusterPhaseTerraformInit    ClusterPhase = 30
	ClusterPhaseTerraformDone    ClusterPhase = 35
	ClusterPhaseKubeOneInit      ClusterPhase = 40
	ClusterPhaseKubeOneDone      ClusterPhase = 45
	ClusterPhaseProviderConfInit ClusterPhase = 50
	ClusterPhaseProviderConfDone ClusterPhase = 55
	ClusterPhaseClusterReady     ClusterPhase = 100
	ClusterPhaseInstallCephInit  ClusterPhase = 110
	ClusterPhaseInstallCephDone  ClusterPhase = 120

	// Make sure we have enough room for any other non-destructive cluster phases
	ClusterPhaseDeletingCluster ClusterPhase = 900
	ClusterPhaseClusterDeleted  ClusterPhase = 999
)

type ClusterState

type ClusterState struct {
	ID        uuid.UUID    `db:"id"`
	ClusterID uuid.UUID    `db:"cluster_id"`
	Phase     ClusterPhase `db:"phase"`
	Cluster   *Cluster
}

func NewClusterState

func NewClusterState(cluster *Cluster) *ClusterState

func (*ClusterState) Serialize

func (cs *ClusterState) Serialize() ([]byte, error)

type Customer

type Customer struct {
	ID    uuid.UUID `db:"id"`
	Name  string    `db:"name"`
	Email string    `db:"email"`
}

type KubeOneConfig

type KubeOneConfig struct {
	ApiVersion    string        `yaml:"apiVersion"`
	Kind          string        `yaml:"kind"`
	Name          string        `yaml:"name"`
	Versions      Versions      `yaml:"versions"`
	CloudProvider CloudProvider `yaml:"cloudProvider"`
}

func NewKubeOneConfig

func NewKubeOneConfig(clusterName string) *KubeOneConfig

type Provider

type Provider struct {
	ID   uuid.UUID `db:"id"`
	Name string    `db:"name"`
}

type Ssh

type Ssh struct {
	ID              uuid.UUID `db:"id"`
	ClusterID       uuid.UUID `db:"cluster_id"`
	PrivateFilePath string    `db:"private_file_path"`
	PublicFilePath  string    `db:"public_file_path"`
	PrivateKey      string    `db:"private_key"`
	PublicKey       string    `db:"public_key"`
}

type TerraformConfig

type TerraformConfig struct {
	ClusterName                      string `json:"cluster_name"`
	SshPublicKeyFile                 string `json:"ssh_public_key_file"`
	ControlPlaneVmCount              int    `json:"control_plane_vm_count"`
	InitialMachineDeploymentReplicas int    `json:"initial_machinedeployment_replicas"`
	WorkerType                       string `json:"worker_type"`
	ControlPlaneType                 string `json:"control_plane_type"`
	Os                               string `json:"os"`
	WorkerOs                         string `json:"worker_os"`
}

func NewTerraformConfig

func NewTerraformConfig(cluster *Cluster, dst string) *TerraformConfig

type Versions

type Versions struct {
	Kubernetes string `yaml:"kubernetes"`
}

Jump to

Keyboard shortcuts

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