pke

package
v0.0.0-...-e7c744b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB, logger logrus.FieldLogger) error

Migrate executes the table migrations for the provider.

Types

type CRI

type CRI struct {
	Model

	Runtime       Runtime `yaml:"runtime"`
	RuntimeConfig Config  `yaml:"runtimeConfig" gorm:"type:text"`
}

CRI is the schema for the DB.

func (CRI) String

func (c CRI) String() string

func (CRI) TableName

func (CRI) TableName() string

TableName changes the default table name.

type CloudNetworkProvider

type CloudNetworkProvider string

NetworkProvider is the schema for the DB.

const (
	CNPAmazon CloudNetworkProvider = "ec2" // Amazon EC2 network provider.
)

func (*CloudNetworkProvider) Scan

func (n *CloudNetworkProvider) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (CloudNetworkProvider) Value

func (n CloudNetworkProvider) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type Config

type Config map[string]interface{}

func (*Config) Scan

func (n *Config) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (Config) Value

func (n Config) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type EC2PKEClusterModel

type EC2PKEClusterModel struct {
	ID                 uint                      `gorm:"primary_key"`
	Cluster            clustermodel.ClusterModel `gorm:"foreignkey:ClusterID"`
	ClusterID          uint
	MasterInstanceType string
	MasterImage        string
	CurrentWorkflowID  string

	Network    Network    `gorm:"foreignkey:ClusterID;association_foreignkey:ClusterID" yaml:"network"`
	NodePools  NodePools  `gorm:"foreignkey:ClusterID;association_foreignkey:ClusterID" yaml:"nodepools"`
	Kubernetes Kubernetes `gorm:"foreignkey:ClusterID;association_foreignkey:ClusterID" yaml:"kubernetes"`
	KubeADM    KubeADM    `gorm:"foreignkey:ClusterID;association_foreignkey:ClusterID" yaml:"kubeadm"`
	CRI        CRI        `gorm:"foreignkey:ClusterID;association_foreignkey:ClusterID" yaml:"cri"`
}

func (*EC2PKEClusterModel) BeforeDelete

func (m *EC2PKEClusterModel) BeforeDelete(tx *gorm.DB) error

BeforeDelete callback / hook to delete related entries from the database

func (EC2PKEClusterModel) TableName

func (EC2PKEClusterModel) TableName() string

TableName changes the default table name.

type ExtraArg

type ExtraArg string

ExtraArg is the schema for the DB.

func (*ExtraArg) Scan

func (e *ExtraArg) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (ExtraArg) Value

func (e ExtraArg) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type ExtraArgs

type ExtraArgs []ExtraArg

ExtraArgs is the schema for the DB.

func (*ExtraArgs) Scan

func (m *ExtraArgs) Scan(src interface{}) error

func (ExtraArgs) Value

func (m ExtraArgs) Value() (driver.Value, error)

type Host

type Host struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	CreatedBy uint

	NodePoolID uint `gorm:"name:nodepool_id;foreignkey:NodePoolID"`

	Name             string `yaml:"name"`
	PrivateIP        string `yaml:"privateIP"`
	NetworkInterface string `yaml:"networkInterface"`
	Roles            Roles  `yaml:"roles" gorm:"type:varchar(255)"`
	Labels           Labels `yaml:"labels" gorm:"type:varchar(255)"`
	Taints           Taints `yaml:"taint" gorm:"type:varchar(255)"`
}

func (Host) String

func (h Host) String() string

String prints row contents.

func (Host) TableName

func (Host) TableName() string

TableName changes the default table name.

type Hosts

type Hosts []Host

type KubeADM

type KubeADM struct {
	Model

	ExtraArgs ExtraArgs `yaml:"extraArgs" gorm:"type:json"`
}

KubeADM is the schema for the DB.

func (KubeADM) String

func (k KubeADM) String() string

func (KubeADM) TableName

func (KubeADM) TableName() string

TableName changes the default table name.

type Kubernetes

type Kubernetes struct {
	Model

	Version     string `yaml:"version"`
	RBAC        RBAC   `yaml:"rbac" gorm:"-"`
	RBACEnabled bool   `gorm:"column:rbac_enabled"`
}

Kubernetes is the schema for the DB.

func (*Kubernetes) AfterFind

func (k *Kubernetes) AfterFind() error

AfterFind unmarshals fields.

func (*Kubernetes) BeforeCreate

func (k *Kubernetes) BeforeCreate(scope *gorm.Scope) error

BeforeCreate marshals fields.

func (*Kubernetes) BeforeUpdate

func (k *Kubernetes) BeforeUpdate(scope *gorm.Scope) error

func (Kubernetes) String

func (k Kubernetes) String() string

func (Kubernetes) TableName

func (Kubernetes) TableName() string

TableName changes the default table name.

type Labels

type Labels map[string]string

func (*Labels) Scan

func (n *Labels) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (Labels) Value

func (n Labels) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type Model

type Model struct {
	ID        uint `gorm:"primary_key"`
	CreatedAt time.Time
	CreatedBy uint

	ClusterID uint `gorm:"foreignkey:ClusterID"`
}

type Network

type Network struct {
	Model

	ServiceCIDR         string               `yaml:"serviceCIDR" gorm:"column:service_cidr"`
	PodCIDR             string               `yaml:"podCIDR" gorm:"column:pod_cidr"`
	Provider            NetworkProvider      `yaml:"provider"`
	APIServerAddress    string               `yaml:"apiServerAddress"`
	CloudProvider       CloudNetworkProvider `yaml:"cloudProvider" gorm:"column:cloud_provider"`
	CloudProviderConfig Config               `yaml:"cloudProviderConfig" gorm:"column:cloud_provider_config;type:text"`
}

Network is the schema for the DB.

func (Network) String

func (n Network) String() string

func (Network) TableName

func (Network) TableName() string

TableName changes the default table name.

type NetworkCloudProviderConfigAmazon

type NetworkCloudProviderConfigAmazon struct {
	VPCID   string  `yaml:"vpcID"`
	Subnets Subnets `yaml:"subnets"`
}

type NetworkProvider

type NetworkProvider string

NetworkProvider is the schema for the DB.

func (*NetworkProvider) Scan

func (n *NetworkProvider) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (NetworkProvider) Value

func (n NetworkProvider) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type NodePool

type NodePool struct {
	NodePoolID uint `gorm:"primary_key;name:id"`
	CreatedAt  time.Time
	CreatedBy  uint

	ClusterID uint `gorm:"foreignkey:ClusterIDl;association_foreignkey:ClusterID;unique_index:idx_topology_nodepools_cluster_id_name"`

	Name           string            `yaml:"name" gorm:"unique_index:idx_topology_nodepools_cluster_id_name"`
	Roles          Roles             `yaml:"roles" gorm:"type:varchar(255)"`
	Hosts          Hosts             `yaml:"hosts" gorm:"foreignkey:NodePoolID"`
	Provider       NodePoolProvider  `yaml:"provider"`
	ProviderConfig Config            `yaml:"providerConfig" gorm:"column:provider_config;type:text"`
	Labels         map[string]string `yaml:"labels" gorm:"-"`
	Autoscaling    bool              `yaml:"autoscaling" gorm:"default:false"`
}

func (NodePool) String

func (n NodePool) String() string

func (NodePool) TableName

func (NodePool) TableName() string

TableName changes the default table name.

type NodePoolProvider

type NodePoolProvider string
const (
	NPPAmazon NodePoolProvider = "amazon"
)

func (*NodePoolProvider) Scan

func (n *NodePoolProvider) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (NodePoolProvider) Value

func (n NodePoolProvider) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type NodePoolProviderConfigAmazon

type NodePoolProviderConfigAmazon struct {
	AutoScalingGroup struct {
		Name                    string  `yaml:"name"`
		Image                   string  `yaml:"image"`
		VolumeSize              int     `yaml:"volumeSize"`
		Zones                   Zones   `yaml:"zones"`
		InstanceType            string  `yaml:"instanceType"`
		LaunchConfigurationName string  `yaml:"launchConfigurationName"`
		LaunchTemplate          string  `yaml:"launchTemplate"`
		VPCID                   string  `yaml:"vpcID"`
		SecurityGroupID         string  `yaml:"securityGroupID"`
		Subnets                 Subnets `yaml:"subnets"`
		Tags                    Tags    `yaml:"tags"`
		Size                    struct {
			Min     int `yaml:"min"`
			Max     int `yaml:"max"`
			Desired int `yaml:"desired"`
		} `yaml:"size"`
		SpotPrice string `yaml:"spotPrice"`
	} `yaml:"autoScalingGroup"`
}

type NodePools

type NodePools []NodePool

type RBAC

type RBAC struct {
	Enabled bool `yaml:"enabled"`
}

RBAC is the schema for the DB.

type Role

type Role string
const (
	RoleMaster         Role = "master"
	RoleWorker         Role = "worker"
	RolePipelineSystem Role = "pipeline-system"
)

func (*Role) Scan

func (r *Role) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (Role) Value

func (r Role) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type Roles

type Roles []Role

func (*Roles) Scan

func (n *Roles) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (Roles) Value

func (n Roles) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type Runtime

type Runtime string

Runtime is the schema for the DB.

const (
	CRIDocker     Runtime = "docker"
	CRIContainerd Runtime = "containerd"
)

func (*Runtime) Scan

func (n *Runtime) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (Runtime) Value

func (n Runtime) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type Subnet

type Subnet string

type Subnets

type Subnets []Subnet

type Tags

type Tags map[string]string

type Taint

type Taint string

type Taints

type Taints []Taint

func (*Taints) Scan

func (n *Taints) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (Taints) Value

func (n Taints) Value() (driver.Value, error)

Value implements the driver.Valuer interface

type Zone

type Zone string

type Zones

type Zones []Zone

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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