eksmodel

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: 13 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 application models.

Types

type AmazonNodePoolsModel

type AmazonNodePoolsModel struct {
	ID               uint `gorm:"primary_key"`
	CreatedAt        time.Time
	CreatedBy        uint
	ClusterID        uint   `gorm:"unique_index:idx_amazon_node_pools_cluster_id_name"`
	Name             string `gorm:"unique_index:idx_amazon_node_pools_cluster_id_name"`
	StackID          string
	NodeSpotPrice    string
	Autoscaling      bool
	NodeMinCount     int
	NodeMaxCount     int
	Count            int
	NodeVolumeSize   int    `gorm:"-"` // Note: not stored in DB.
	NodeVolumeType   string `gorm:"-"` // Note: not stored in DB.
	NodeImage        string
	NodeInstanceType string
	Status           eks.NodePoolStatus // Note: stored status info is only used when CF stack is not existing.
	StatusMessage    string             `gorm:"type:text"`
	Labels           map[string]string  `gorm:"-"`
	Delete           bool               `gorm:"-"`
}

AmazonNodePoolsModel describes Amazon node groups model of a cluster

func (AmazonNodePoolsModel) String

func (m AmazonNodePoolsModel) String() string

func (AmazonNodePoolsModel) TableName

func (AmazonNodePoolsModel) TableName() string

TableName sets AmazonNodePoolsModel's table name

type EKSAPIServerAccessPoints

type EKSAPIServerAccessPoints = JSONStringArray

type EKSClusterModel

type EKSClusterModel struct {
	ID      uint                      `gorm:"primary_key"`
	Cluster clustermodel.ClusterModel `gorm:"foreignkey:ClusterID"`

	Version string

	ClusterID    uint                    `gorm:"unique_index:idx_eks_clusters_cluster_id"`
	NodePools    []*AmazonNodePoolsModel `gorm:"foreignkey:ClusterID"`
	VpcId        *string                 `gorm:"size:32"`
	VpcCidr      *string                 `gorm:"size:18"`
	RouteTableId *string                 `gorm:"size:32"`
	Subnets      []*EKSSubnetModel       `gorm:"foreignkey:ClusterID"`

	// IAM settings
	DefaultUser        bool
	ClusterRoleId      string
	NodeInstanceRoleId string

	LogTypes EKSLogTypes `sql:"type:json"`

	APIServerAccessPoints EKSAPIServerAccessPoints `sql:"type:json"`

	CurrentWorkflowID string

	SSHGenerated bool `gorm:"default:true"`

	AuthConfigMap string `gorm:"type:text"`
}

EKSClusterModel describes the EKS cluster model

func (*EKSClusterModel) AfterUpdate

func (cm *EKSClusterModel) AfterUpdate(tx *gorm.DB) error

AfterUpdate removes marked node pool(s)

func (EKSClusterModel) IsSSHGenerated

func (cm EKSClusterModel) IsSSHGenerated() bool

func (*EKSClusterModel) PersistSSHGenerate

func (cm *EKSClusterModel) PersistSSHGenerate(sshGenerated bool) error

func (*EKSClusterModel) SetCurrentWorkflowID

func (cm *EKSClusterModel) SetCurrentWorkflowID(workflowID string) error

SetCurrentWorkflowID sets currentWorkflowID

func (EKSClusterModel) String

func (cm EKSClusterModel) String() string

func (EKSClusterModel) TableName

func (EKSClusterModel) TableName() string

TableName sets EKSClusterModel's table name

type EKSLogTypes

type EKSLogTypes = JSONStringArray

type EKSSubnetModel

type EKSSubnetModel struct {
	ID               uint `gorm:"primary_key"`
	CreatedAt        time.Time
	EKSCluster       EKSClusterModel
	ClusterID        uint    `gorm:"index:idx_eks_subnets_cluster_id"`
	SubnetId         *string `gorm:"size:32"`
	Cidr             *string `gorm:"size:18"`
	AvailabilityZone *string `gorm:"size:25"`
}

EKSSubnetModel describes the model of subnets used for creating an EKS cluster

func (EKSSubnetModel) TableName

func (EKSSubnetModel) TableName() string

TableName sets database table name for EKSSubnetModel

type JSONStringArray

type JSONStringArray []string

JSONStringArray is a special type, that represents a JSON array of strings in SQL databases

func (*JSONStringArray) Scan

func (elt *JSONStringArray) Scan(src interface{}) error

Scan implements the sql.Scanner interface

func (JSONStringArray) Value

func (elt JSONStringArray) Value() (driver.Value, error)

Value implements the driver.Valuer interface

Jump to

Keyboard shortcuts

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