Documentation ¶
Overview ¶
package cellprovider contains logic to create and manage groups of servers
Index ¶
- type AdvanceDeploymentResult
- type BuildImageOptions
- type BuildxBuilder
- type BuildxNode
- type CellProvider
- type CreateCellOptions
- type DeploymentLogsOption
- type DeploymentLogsOptions
- type DeploymentLogsResult
- type ErrDeploymentIdMismatch
- type LogEntry
- type NodeInfo
- type NodeLabelInfo
- type ServerStats
- type ServerStatsResult
- type TalosClusterCellProvider
- func (p *TalosClusterCellProvider) AdvanceDeployment(ctx context.Context, cellId string, deployment *store.Deployment) (*AdvanceDeploymentResult, error)
- func (c *TalosClusterCellProvider) BuildImage(ctx context.Context, opts BuildImageOptions) (*store.ImageArtifact, error)
- func (p *TalosClusterCellProvider) CreateCell(ctx context.Context, opts CreateCellOptions) (*store.Cell, error)
- func (p *TalosClusterCellProvider) DeploymentLogs(ctx context.Context, cellId string, deployment *store.Deployment, ...) ([]LogEntry, error)
- func (p *TalosClusterCellProvider) DeploymentLogsStream(ctx context.Context, cellId string, deployment *store.Deployment, ...) <-chan DeploymentLogsResult
- func (p *TalosClusterCellProvider) DestroyDeployments(ctx context.Context, cellId string, deployments []store.Deployment) error
- func (p *TalosClusterCellProvider) Janitor(ctx context.Context, cellId string) error
- func (p *TalosClusterCellProvider) ServerStats(ctx context.Context, cellId string) ([]ServerStats, error)
- func (p *TalosClusterCellProvider) ServerStatsStream(ctx context.Context, cellId string, interval time.Duration) <-chan ServerStatsResult
- type TalosClusterCellProviderOption
- func WithCellStore(cellStore store.CellStore) TalosClusterCellProviderOption
- func WithDnsProvider(dnsProvider dnsprovider.DNSProvider) TalosClusterCellProviderOption
- func WithServerStore(serverStore store.ServerStore) TalosClusterCellProviderOption
- func WithTmpDirRoot(tmpDirRoot string) TalosClusterCellProviderOption
- func WithTracerProvider(tp *trace.TracerProvider) TalosClusterCellProviderOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvanceDeploymentResult ¶
type AdvanceDeploymentResult struct { Status store.DeploymentStatus StatusReason string }
type BuildImageOptions ¶
type BuildImageOptions struct { // CellId is the id of the cell to build the image on. CellId string `validate:"required"` // BuildDir is the directory containing the build context. This is where docker commands will be run. BuildDir string `validate:"required"` // AppName is the name of the application to build AppName string `validate:"required"` // BuildId is the id of the build BuildId string `validate:"required"` // Stderr is the writer to write stderr output to (the build process will exec some docker commands). Stderr io.Writer // Stdout is the writer to write stdout output to (the build process will exec some docker commands). Stdout io.Writer }
type BuildxBuilder ¶
type BuildxBuilder struct { Name string Driver string LastActivity time.Time `json:",omitempty"` Dynamic bool Nodes []BuildxNode }
BuildxBuilder is the output of docker buildx ls --format json. If the Builder type in github.com/docker/buildx/builder adds an unmarshaljson method, we can remove this.
type BuildxNode ¶
type CellProvider ¶
type CellProvider interface { CreateCell(ctx context.Context, opts CreateCellOptions) (*store.Cell, error) Janitor(ctx context.Context, cellId string) error ServerStats(ctx context.Context, cellId string) ([]ServerStats, error) ServerStatsStream(ctx context.Context, cellId string, interval time.Duration) <-chan ServerStatsResult AdvanceDeployment(ctx context.Context, cellId string, deployment *store.Deployment) (*AdvanceDeploymentResult, error) DestroyDeployments(ctx context.Context, cellId string, deployments []store.Deployment) error DeploymentLogs(ctx context.Context, cellId string, deployment *store.Deployment, opts ...DeploymentLogsOption) ([]LogEntry, error) DeploymentLogsStream(ctx context.Context, cellId string, deployment *store.Deployment, opts ...DeploymentLogsOption) <-chan DeploymentLogsResult BuildImage(ctx context.Context, opts BuildImageOptions) (*store.ImageArtifact, error) }
type CreateCellOptions ¶
type CreateCellOptions struct { Name string `valid:"required, matches(^[a-z-]+$)"` TeamId string `valid:"required"` TeamName string `valid:"required"` TeamAgePrivateKey string `valid:"required, matches(^AGE-SECRET-KEY.*$)"` DnsZoneId string `valid:"required"` FirstServer store.Server `valid:"required"` }
type DeploymentLogsOption ¶
type DeploymentLogsOption func(*DeploymentLogsOptions)
DeploymentLogsOption is a function that modifies DeploymentLogsOptions
func WithSince ¶
func WithSince(duration time.Duration) DeploymentLogsOption
WithSince sets the Since option for deployment logs
type DeploymentLogsOptions ¶
DeploymentLogsOptions defines options for fetching deployment logs
type DeploymentLogsResult ¶
type ErrDeploymentIdMismatch ¶
func (ErrDeploymentIdMismatch) Error ¶
func (e ErrDeploymentIdMismatch) Error() string
type NodeInfo ¶
type NodeInfo struct { Ipv4 string NodeLabelInfo }
NodeInfo represents the information of a node including its external IP and labels.
type NodeLabelInfo ¶
type ServerStats ¶
type ServerStatsResult ¶
type ServerStatsResult struct { Stats []ServerStats Error error }
type TalosClusterCellProvider ¶
type TalosClusterCellProvider struct {
// contains filtered or unexported fields
}
TalosClusterCellProvider creates a talos k8s cluster using cloudflare for DNS
func NewTalosClusterCellProvider ¶
func NewTalosClusterCellProvider(opts ...TalosClusterCellProviderOption) (*TalosClusterCellProvider, error)
func (*TalosClusterCellProvider) AdvanceDeployment ¶
func (p *TalosClusterCellProvider) AdvanceDeployment(ctx context.Context, cellId string, deployment *store.Deployment) (*AdvanceDeploymentResult, error)
func (*TalosClusterCellProvider) BuildImage ¶
func (c *TalosClusterCellProvider) BuildImage(ctx context.Context, opts BuildImageOptions) (*store.ImageArtifact, error)
func (*TalosClusterCellProvider) CreateCell ¶
func (p *TalosClusterCellProvider) CreateCell(ctx context.Context, opts CreateCellOptions) (*store.Cell, error)
CreateCell for a talos cluster creates a single-node talos cluster.
func (*TalosClusterCellProvider) DeploymentLogs ¶
func (p *TalosClusterCellProvider) DeploymentLogs(ctx context.Context, cellId string, deployment *store.Deployment, opts ...DeploymentLogsOption) ([]LogEntry, error)
func (*TalosClusterCellProvider) DeploymentLogsStream ¶
func (p *TalosClusterCellProvider) DeploymentLogsStream(ctx context.Context, cellId string, deployment *store.Deployment, opts ...DeploymentLogsOption) <-chan DeploymentLogsResult
func (*TalosClusterCellProvider) DestroyDeployments ¶
func (p *TalosClusterCellProvider) DestroyDeployments(ctx context.Context, cellId string, deployments []store.Deployment) error
func (*TalosClusterCellProvider) Janitor ¶
func (p *TalosClusterCellProvider) Janitor(ctx context.Context, cellId string) error
func (*TalosClusterCellProvider) ServerStats ¶
func (p *TalosClusterCellProvider) ServerStats(ctx context.Context, cellId string) ([]ServerStats, error)
func (*TalosClusterCellProvider) ServerStatsStream ¶
func (p *TalosClusterCellProvider) ServerStatsStream(ctx context.Context, cellId string, interval time.Duration) <-chan ServerStatsResult
ServerStatsStream streams ServerStats at the specified interval
type TalosClusterCellProviderOption ¶
type TalosClusterCellProviderOption func(*TalosClusterCellProvider)
func WithCellStore ¶
func WithCellStore(cellStore store.CellStore) TalosClusterCellProviderOption
func WithDnsProvider ¶
func WithDnsProvider(dnsProvider dnsprovider.DNSProvider) TalosClusterCellProviderOption
func WithServerStore ¶
func WithServerStore(serverStore store.ServerStore) TalosClusterCellProviderOption
func WithTmpDirRoot ¶
func WithTmpDirRoot(tmpDirRoot string) TalosClusterCellProviderOption
func WithTracerProvider ¶
func WithTracerProvider(tp *trace.TracerProvider) TalosClusterCellProviderOption