install

package
v0.0.0-...-3bfe646 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 69 Imported by: 3

Documentation

Overview

Copyright 2019 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2019 Gravitational, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const NumParallel = 10

NumParallel limits the number of parallel phases that can be run during install

Variables

This section is empty.

Functions

func ClientCredentials

func ClientCredentials(packages pack.PackageService) (credentials.TransportCredentials, error)

ClientCredentials returns the contents of the default RPC credentials package

func DefaultFSMSpec

func DefaultFSMSpec(config FSMConfig) fsm.FSMSpecFunc

DefaultFSMSpec returns a function that returns the default install FSM spec for the provided install FSM config.

func EnsureServiceUserAndBinary

func EnsureServiceUserAndBinary(userID, groupID string) (*systeminfo.User, error)

EnsureServiceUserAndBinary ensures that the specified user exists on host (creating it if it does not). It also installs the system binary into the proper binary location depending on the OS distribution. Returns the new or existing service user as a result

func ExecuteOperation

func ExecuteOperation(ctx context.Context, machine *fsm.FSM, progress utils.Progress, logger log.FieldLogger) error

ExecuteOperation executes the operation specified with machine to completion

func FetchCloudMetadata

func FetchCloudMetadata(cloudProvider string, config *pb.RuntimeConfig) error

FetchCloudMetadata fetches the metadata for the specified cloud provider

func FormatAbortError

func FormatAbortError(err error) string

FormatAbortError formats the specified error for output by the installer client. Output will contain error message for err as well as any error it wraps.

func GetApp

func GetApp(service app.Applications) (*app.Application, error)

GetApp finds the user app in the provided service and returns it

func GetAppPackage

func GetAppPackage(service app.Applications) (*loc.Locator, error)

GetAppPackage finds the user app in the provided service and returns its locator

func GetOrCreateServiceUser

func GetOrCreateServiceUser(uid, gid string) (user *systeminfo.User, err error)

GetOrCreateServiceUser returns the user to use for container services.

If the specified ID is empty, a new service user and service group (named defaults.ServiceUser/defaults.ServiceGroup) will be created with system-allocated IDs.

If the specified ID is not empty, the user is expected to exist.

func GetServerUpdateRequest

func GetServerUpdateRequest(op ops.SiteOperation, servers []checks.ServerInfo) (*ops.OperationUpdateRequest, error)

GetServerUpdateRequest returns a request to update servers in given operation's state based on specified list of servers

func GetServiceUser

func GetServiceUser(uid string) (user *systeminfo.User, err error)

GetServiceUser retrieves the service user by ID. If the specified user ID is empty, the function looks up the user by name (defaults.ServiceUser).

func InitProcess

func InitProcess(ctx context.Context, gravityConfig processconfig.Config, newProcess process.NewGravityProcess) (process.GravityProcess, error)

InitProcess initializes and starts a gravity process

func InstallBinary

func InstallBinary(uid, gid int, logger log.FieldLogger) (err error)

InstallBinary places the system binary into the proper binary directory depending on the distribution. The specified uid/gid pair is used to set user/group permissions on the resulting binary

func InstallBinaryInto

func InstallBinaryInto(targetPath string, logger log.FieldLogger, opts ...utils.FileOption) error

InstallBinaryInto installs this gravity binary into targetPath using given file options.

func InstallBinaryIntoDefaultLocation

func InstallBinaryIntoDefaultLocation(logger log.FieldLogger, opts ...utils.FileOption) (path string, err error)

InstallBinaryIntoDefaultLocation installs the gravity binary into one of the default locations based on the distribution. Returns the path of the binary if installed successfully

func LoadRPCCredentials

func LoadRPCCredentials(ctx context.Context, packages pack.PackageService) (*rpcserver.Credentials, error)

LoadRPCCredentials loads and validates the contents of the default RPC credentials package

func NewAgent

func NewAgent(config AgentConfig) (*rpcserver.PeerServer, error)

NewAgent returns a new unstarted agent instance

func NewClusterFactory

func NewClusterFactory(config Config) engine.ClusterFactory

NewClusterFactory returns a factory for creating cluster requests

func NewFSM

func NewFSM(config FSMConfig) (*fsm.FSM, error)

NewFSM returns a new install FSM instance

func NewFSMFactory

func NewFSMFactory(config Config) engine.FSMFactory

NewFSMFactory returns a new state machine factory

func NewProcessConfig

func NewProcessConfig(config ProcessConfig) (*processconfig.Config, error)

NewProcessConfig creates a gravity process config from installer config

func ServerRequirements

func ServerRequirements(flavor schema.Flavor) map[string]storage.ServerProfileRequest

ServerRequirements computes server requirements based on the selected flavor

func UpdateOperationState

func UpdateOperationState(operator ops.Operator, operation ops.SiteOperation, report ops.AgentReport) error

UpdateOperationState updates the operation data according to the agent report

Types

type AgentConfig

type AgentConfig struct {
	log.FieldLogger
	rpcserver.Credentials
	*rpcserver.ReconnectStrategy
	CloudProvider string
	// AdvertiseAddr is the IP address to advertise
	AdvertiseAddr string
	// ServerAddr specifies the address of the agent server
	ServerAddr string
	// RuntimeConfig specifies runtime configuration
	pb.RuntimeConfig
	// WatchCh specifies the channel to receive peer reconnect updates
	WatchCh chan rpcserver.WatchEvent
	// StopHandler specifies an optional handler for when the agent is stopped.
	// completed indicates whether this is the result of a successfully completed operation
	StopHandler func(ctx context.Context, completed bool) error
	// AbortHandler specifies an optional handler for abort requests
	AbortHandler func(context.Context) error
}

AgentConfig describes configuration for a stateless agent

type Config

type Config struct {
	// FieldLogger is used for logging
	log.FieldLogger
	// Printer specifies the output sink for progress messages
	utils.Printer
	// AdvertiseAddr is advertise address of this server
	AdvertiseAddr string
	// Token specifies the agent validation token used during the operation
	Token storage.InstallToken
	// CloudProvider is optional cloud provider
	CloudProvider string
	// StateDir is directory with local installer state
	StateDir string
	// WriteStateDir is installer write layer
	WriteStateDir string
	// UserLogFile is the log file where user-facing operation logs go
	UserLogFile string
	// SiteDomain is the name of the cluster
	SiteDomain string
	// Flavor is installation flavor
	Flavor schema.Flavor
	// DisabledWebUI specifies whether OpsCenter and WebInstallWizard are disabled
	DisabledWebUI bool
	// Role is server role
	Role string
	// App is the application being installed
	App app.Application
	// RuntimeResources specifies optional Kubernetes resources to create
	RuntimeResources []runtime.Object
	// ClusterResources specifies optional cluster resources to create
	// TODO(dmitri): externalize the ClusterConfiguration resource and create
	// default provider-specific cloud-config on Gravity side
	ClusterResources []storage.UnknownResource
	// SystemDevice is a device for gravity data
	SystemDevice string
	// Mounts is a list of mount points (name -> source pairs)
	Mounts map[string]string
	// DNSOverrides contains installer node DNS overrides
	DNSOverrides storage.DNSOverrides
	// VxlanPort is the overlay network port
	VxlanPort int
	// DNSConfig overrides the local cluster DNS configuration
	DNSConfig storage.DNSConfig
	// Docker specifies docker configuration
	Docker storage.DockerConfig
	// Insecure allows to turn off cert validation
	Insecure bool
	// Process is the gravity process running inside the installer
	Process process.GravityProcess
	// LocalPackages is the machine-local package service
	LocalPackages *localpack.PackageServer
	// LocalApps is the machine-local application service
	LocalApps app.Applications
	// LocalBackend is the machine-local backend
	LocalBackend storage.LocalBackend
	// ServiceUser specifies the user to use as a service user in planet
	// and for unprivileged kubernetes services
	ServiceUser systeminfo.User
	// GCENodeTags specifies additional VM instance tags on GCE
	GCENodeTags []string
	// LocalClusterClient is a factory for creating client to the installed cluster
	LocalClusterClient func(...httplib.ClientOption) (*opsclient.Client, error)
	// Operator specifies the wizard's operator service
	Operator ops.Operator
	// Apps specifies the wizard's application service
	Apps app.Applications
	// Packages specifies the wizard's package service
	Packages pack.PackageService
	// LocalAgent specifies whether the installer will also run an agent
	LocalAgent bool
	// Values are helm values in marshaled yaml format
	Values []byte
	// SELinux specifies whether the installer runs with SELinux support.
	// This makes the installer run in its own domain
	SELinux bool
}

Config is installer configuration

func (*Config) GetPlanBuilder

func (c *Config) GetPlanBuilder(operator ops.Operator, cluster ops.Site, op ops.SiteOperation) (*PlanBuilder, error)

GetPlanBuilder returns a new plan builder for this installer and provided operation that can be used to build operation plan phases

func (*Config) GetWizardAddr

func (c *Config) GetWizardAddr() (addr string)

GetWizardAddr returns the advertise address of the wizard process

type Engine

type Engine interface {
	// Execute executes the steps to install a cluster.
	// If the method returns with an error, the installer will continue
	// running until it receives a shutdown signal.
	//
	// The method is expected to be re-entrant as the service might be re-started
	// multiple times before the operation is complete.
	//
	// installer is the reference to the installer.
	// config specifies the configuration for the operation
	Execute(ctx context.Context, installer Interface, config Config) (dispatcher.Status, error)
}

Engine implements the process of cluster installation

type ExecResult

type ExecResult struct {
	// CompletionEvent specifies the optional completion
	// event to send to a client
	CompletionEvent *dispatcher.Event
	// Error specifies the optional execution error
	Error error
}

ExecResult describes the result of execution an operation (step). An optional completion event can describe the completion outcome to the client

type FSMConfig

type FSMConfig struct {
	// OperationKey is the install operation key
	OperationKey ops.SiteOperationKey
	// Packages is authenticated installer pack client
	Packages pack.PackageService
	// Apps is authenticated installer apps client
	Apps app.Applications
	// Operator is authenticated installer ops client
	Operator ops.Operator
	// LocalClusterClient is a factory for creating a client to the installed cluster.
	LocalClusterClient func(...httplib.ClientOption) (*opsclient.Client, error)
	// LocalPackages is the machine-local pack service
	LocalPackages *localpack.PackageServer
	// LocalApps is the machine-local apps service
	LocalApps app.Applications
	// LocalBackend is the machine-local backend
	LocalBackend storage.LocalBackend
	// Spec is the FSM spec
	Spec fsm.FSMSpecFunc
	// Credentials is the credentials for gRPC agents
	Credentials credentials.TransportCredentials
	// Insecure allows to turn off cert validation in dev mode
	Insecure bool
	// UserLogFile is the user-friendly install log file
	UserLogFile string
	// ReportProgress controls whether engine should report progress to Operator
	ReportProgress bool
	// DNSConfig specifies the DNS configuration to use
	DNSConfig storage.DNSConfig
}

FSMConfig is the install FSM config

func NewFSMConfig

func NewFSMConfig(operator ops.Operator, operationKey ops.SiteOperationKey, config Config) FSMConfig

NewFSMConfig returns state machine configiration

func (*FSMConfig) CheckAndSetDefaults

func (c *FSMConfig) CheckAndSetDefaults() (err error)

CheckAndSetDefaults validates install FSM config and sets some defaults

type FSMSpecFunc

type FSMSpecFunc func(FSMConfig) fsm.FSMSpecFunc

FSMSpecFunc defines a function that returns install FSM spec based on the config.

var FSMSpec FSMSpecFunc = DefaultFSMSpec

FSMSpec is the install FSM spec.

It may be overridden by external implementations to support additional install operation phases (e.g. by the enterprise version).

type Installer

type Installer struct {
	// FieldLogger specifies the installer's logger
	log.FieldLogger
	// contains filtered or unexported fields
}

Installer manages the installation process

func New

func New(ctx context.Context, config RuntimeConfig) (installer *Installer, err error)

New returns a new instance of the unstarted installer server. ctx is only used for the duration of this call and is not stored beyond that. Use Serve to start server operation

func (*Installer) Complete

func (i *Installer) Complete(ctx context.Context, key ops.SiteOperationKey) error

Complete manually completes the operation given with key. Implements server.Executor

func (*Installer) CompleteFinalInstallStep

func (i *Installer) CompleteFinalInstallStep(key ops.SiteOperationKey, delay time.Duration) error

CompleteFinalInstallStep marks the final install step as completed unless the application has a custom install step - in which case it does nothing because it will be completed by user later. Implements Interface

func (*Installer) CompleteOperation

func (i *Installer) CompleteOperation(operation ops.SiteOperation) error

CompleteOperation executes additional steps after the installation has completed. Implements Interface

func (*Installer) Execute

Execute executes the install operation using the configured engine. Implements server.Executor

func (*Installer) ExecuteOperation

func (i *Installer) ExecuteOperation(operationKey ops.SiteOperationKey) error

ExecuteOperation executes the specified operation to completion. Implements Interface

func (*Installer) GenerateDebugReport

func (i *Installer) GenerateDebugReport(ctx context.Context, path string) error

GenerateDebugReport captures the state of the operation to the file given with path. Implements server.DebugReporter

func (*Installer) HandleAborted

func (i *Installer) HandleAborted(ctx context.Context) error

HandleAborted completes the operation by running the list of registered abort handlers Implements server.Completer

func (*Installer) HandleCompleted

func (i *Installer) HandleCompleted(ctx context.Context) error

HandleCompleted completes the operation by running the list of registered completion handlers Implements server.Completer

func (*Installer) HandleStopped

func (i *Installer) HandleStopped(ctx context.Context) error

HandleStopped executes the list of registered stoppers before the service is shut down. Implements server.Completer

func (*Installer) NewCluster

func (i *Installer) NewCluster() ops.NewSiteRequest

NewCluster returns a new cluster create request. Implements engine.ClusterFactory

func (*Installer) NotifyOperationAvailable

func (i *Installer) NotifyOperationAvailable(op ops.SiteOperation) error

NotifyOperationAvailable is invoked by the engine to notify the server that the operation has been created. Implements Interface

func (*Installer) PrintStep

func (i *Installer) PrintStep(format string, args ...interface{})

PrintStep publishes a progress entry described with (format, args) tuple to the client. Implements Interface

func (*Installer) Run

func (i *Installer) Run(listener net.Listener) error

Run runs the server operation

func (*Installer) SetPhase

func (i *Installer) SetPhase(req *installpb.SetStateRequest) error

SetPhase sets phase state without executing it.

func (*Installer) Stop

func (i *Installer) Stop(ctx context.Context) error

Stop stops the server and releases resources allocated by the installer. Implements signals.Stopper

type Interface

type Interface interface {
	engine.ClusterFactory
	// ExecuteOperation executes the specified operation to completion
	ExecuteOperation(ops.SiteOperationKey) error
	// NotifyOperationAvailable is invoked by the engine to notify the server
	// that the operation has been created
	NotifyOperationAvailable(ops.SiteOperation) error
	// CompleteOperation executes additional steps common to all workflows after the
	// installation has completed
	CompleteOperation(operation ops.SiteOperation) error
	// CompleteFinalInstallStep marks the final install step as completed unless
	// the application has a custom install step. In case of the custom step,
	// the user completes the final installer step
	CompleteFinalInstallStep(key ops.SiteOperationKey, delay time.Duration) error
	// PrintStep publishes a progress entry described with (format, args)
	PrintStep(format string, args ...interface{})
}

Interface defines the interface of the installer as presented to engine

type PlanBuilder

type PlanBuilder struct {
	// Cluster is the cluster being installed
	Cluster storage.Site
	// Operation is the operation the builder is for
	Operation ops.SiteOperation
	// Application is the app being installed
	Application app.Application
	// Runtime is the Runtime of the app being installed
	Runtime app.Application
	// TeleportPackage is the runtime teleport package
	TeleportPackage loc.Locator
	// RBACPackage is the runtime rbac app package
	RBACPackage loc.Locator
	// GravitySitePackage is the gravity-site app package
	GravitySitePackage loc.Locator
	// GravityPackage is the gravity binary package
	GravityPackage loc.Locator
	// DNSAppPackage is the dns-app app package
	DNSAppPackage loc.Locator
	// Masters is the list of master nodes
	Masters []storage.Server
	// Nodes is the list of regular nodes
	Nodes []storage.Server
	// Master is one of the master nodes
	Master storage.Server
	// AdminAgent is the cluster agent with admin privileges
	AdminAgent storage.LoginEntry
	// RegularAgent is the cluster agent with non-admin privileges
	RegularAgent storage.LoginEntry
	// ServiceUser is the cluster system user
	ServiceUser storage.OSUser

	// InstallerTrustedCluster represents the trusted cluster for installer process
	InstallerTrustedCluster storage.TrustedCluster
	// PersistentStorage is persistent storage resource optionally provided by
	// user at install time.
	PersistentStorage storage.PersistentStorage
	// contains filtered or unexported fields
}

PlanBuilder builds operation plan phases

func (*PlanBuilder) AddApplicationPhase

func (b *PlanBuilder) AddApplicationPhase(plan *storage.OperationPlan) error

AddApplicationPhase appends user application installation phase to the provided plan

func (*PlanBuilder) AddBootstrapPhase

func (b *PlanBuilder) AddBootstrapPhase(plan *storage.OperationPlan)

AddBootstrapPhase appends nodes bootstrap phase to the provided plan

func (*PlanBuilder) AddBootstrapSELinuxPhase

func (b *PlanBuilder) AddBootstrapSELinuxPhase(plan *storage.OperationPlan)

AddBootstrapSELinuxPhase appends the phase to configure SELinux on a node

func (*PlanBuilder) AddChecksPhase

func (b *PlanBuilder) AddChecksPhase(plan *storage.OperationPlan)

AddChecksPhase appends preflight checks phase to the provided plan

func (*PlanBuilder) AddConfigurePhase

func (b *PlanBuilder) AddConfigurePhase(plan *storage.OperationPlan)

AddConfigurePhase appends package configuration phase to the provided plan

func (*PlanBuilder) AddConnectInstallerPhase

func (b *PlanBuilder) AddConnectInstallerPhase(plan *storage.OperationPlan) error

AddConnectInstallerPhase appends installer/cluster connection phase

func (*PlanBuilder) AddCorednsPhase

func (b *PlanBuilder) AddCorednsPhase(plan *storage.OperationPlan)

AddCorednsPhase generates default coredns configuration for the cluster

func (*PlanBuilder) AddEnableElectionPhase

func (b *PlanBuilder) AddEnableElectionPhase(plan *storage.OperationPlan)

AddEnableElectionPhase appends leader election enabling phase to the provided plan

func (*PlanBuilder) AddExportPhase

func (b *PlanBuilder) AddExportPhase(plan *storage.OperationPlan)

AddExportPhase appends Docker images export phase to the provided plan

func (*PlanBuilder) AddGravityResourcesPhase

func (b *PlanBuilder) AddGravityResourcesPhase(plan *storage.OperationPlan)

AddGravityResourcesPhase appends Gravity resources initialization phase to the provided plan

func (*PlanBuilder) AddHealthPhase

func (b *PlanBuilder) AddHealthPhase(plan *storage.OperationPlan)

AddHealthPhase appends phase that waits for the cluster to become healthy

func (*PlanBuilder) AddInitPhase

func (b *PlanBuilder) AddInitPhase(plan *storage.OperationPlan)

AddInitPhase appends initialization phase to the provided plan

func (*PlanBuilder) AddInstallOverlayPhase

func (b *PlanBuilder) AddInstallOverlayPhase(plan *storage.OperationPlan, locator *loc.Locator)

AddInstallOverlayPhase appends a phase to install a non-flannel overlay network

func (*PlanBuilder) AddMastersPhase

func (b *PlanBuilder) AddMastersPhase(plan *storage.OperationPlan) error

AddMastersPhase appends master nodes system installation phase to the provided plan

func (*PlanBuilder) AddNodesPhase

func (b *PlanBuilder) AddNodesPhase(plan *storage.OperationPlan) error

AddNodesPhase appends regular nodes system installation phase to the provided plan

func (*PlanBuilder) AddOpenEBSPhase

func (b *PlanBuilder) AddOpenEBSPhase(plan *storage.OperationPlan) (err error)

AddOpenEBSPhase appends phase that creates OpenEBS configuration.

func (*PlanBuilder) AddPullPhase

func (b *PlanBuilder) AddPullPhase(plan *storage.OperationPlan) error

AddPullPhase appends package download phase to the provided plan

func (*PlanBuilder) AddRBACPhase

func (b *PlanBuilder) AddRBACPhase(plan *storage.OperationPlan)

AddRBACPhase appends K8s RBAC initialization phase to the provided plan

func (*PlanBuilder) AddRuntimePhase

func (b *PlanBuilder) AddRuntimePhase(plan *storage.OperationPlan) error

AddRuntimePhase appends system applications installation phase to the provided plan

func (*PlanBuilder) AddSystemResourcesPhase

func (b *PlanBuilder) AddSystemResourcesPhase(plan *storage.OperationPlan)

AddSystemResourcesPhase appends phase that creates system Kubernetes resources to the provided plan.

func (*PlanBuilder) AddUserResourcesPhase

func (b *PlanBuilder) AddUserResourcesPhase(plan *storage.OperationPlan)

AddUserResourcesPhase appends K8s resources initialization phase to the provided plan

func (*PlanBuilder) AddWaitPhase

func (b *PlanBuilder) AddWaitPhase(plan *storage.OperationPlan)

AddWaitPhase appends planet startup wait phase to the provided plan

type PlanBuilderGetter

type PlanBuilderGetter interface {
	// GetPlanBuilder returns a new plan builder for the specified cluster and operation
	GetPlanBuilder(operator ops.Operator, cluster ops.Site, operation ops.SiteOperation) (*PlanBuilder, error)
}

PlanBuilderGetter is a factory for plan builders

type PlanSuite

type PlanSuite struct {
	// contains filtered or unexported fields
}

func (*PlanSuite) Cluster

func (s *PlanSuite) Cluster() *ops.Site

func (*PlanSuite) Master

func (s *PlanSuite) Master() storage.Server

func (*PlanSuite) Operation

func (s *PlanSuite) Operation(c *check.C) ops.SiteOperation

func (*PlanSuite) Package

func (s *PlanSuite) Package() *loc.Locator

func (*PlanSuite) PlanBuilderGetter

func (s *PlanSuite) PlanBuilderGetter() PlanBuilderGetter

func (*PlanSuite) Services

func (s *PlanSuite) Services() opsservice.TestServices

func (*PlanSuite) SetUpSuite

func (s *PlanSuite) SetUpSuite(c *check.C)

func (*PlanSuite) TeleportPackage

func (s *PlanSuite) TeleportPackage() *loc.Locator

func (*PlanSuite) TestPlan

func (s *PlanSuite) TestPlan(c *check.C)

func (*PlanSuite) TestSplitServers

func (s *PlanSuite) TestSplitServers(c *check.C)

func (*PlanSuite) VerifyAppPhase

func (s *PlanSuite) VerifyAppPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyBootstrapPhase

func (s *PlanSuite) VerifyBootstrapPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyChecksPhase

func (s *PlanSuite) VerifyChecksPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyConfigurePhase

func (s *PlanSuite) VerifyConfigurePhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyConnectInstallerPhase

func (s *PlanSuite) VerifyConnectInstallerPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyCorednsPhase

func (s *PlanSuite) VerifyCorednsPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyEnableElectionPhase

func (s *PlanSuite) VerifyEnableElectionPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyExportPhase

func (s *PlanSuite) VerifyExportPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyGravityResourcesPhase

func (s *PlanSuite) VerifyGravityResourcesPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyHealthPhase

func (s *PlanSuite) VerifyHealthPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyInitPhase

func (s *PlanSuite) VerifyInitPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyInstallOverlayPhase

func (s *PlanSuite) VerifyInstallOverlayPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyMastersPhase

func (s *PlanSuite) VerifyMastersPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyNodesPhase

func (s *PlanSuite) VerifyNodesPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyPullPhase

func (s *PlanSuite) VerifyPullPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyRBACPhase

func (s *PlanSuite) VerifyRBACPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyRuntimePhase

func (s *PlanSuite) VerifyRuntimePhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifySystemResourcesPhase

func (s *PlanSuite) VerifySystemResourcesPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyUserResourcesPhase

func (s *PlanSuite) VerifyUserResourcesPhase(c *check.C, phase storage.OperationPhase)

func (*PlanSuite) VerifyWaitPhase

func (s *PlanSuite) VerifyWaitPhase(c *check.C, phase storage.OperationPhase)

type Planner

type Planner struct {
	PlanBuilderGetter
	// contains filtered or unexported fields
}

Planner builds an install operation plan

func NewPlanner

func NewPlanner(preflightChecks bool, builderGetter PlanBuilderGetter) *Planner

NewPlanner returns a new instance of Planner with the specified builder getter

func (*Planner) GetOperationPlan

func (r *Planner) GetOperationPlan(operator ops.Operator, cluster ops.Site, operation ops.SiteOperation) (*storage.OperationPlan, error)

GetOperationPlan builds a plan for the provided operation

type ProcessConfig

type ProcessConfig struct {
	// AdvertiseAddr specifies the advertise address for the wizard process
	AdvertiseAddr string
	// StateDir specifies the read-only state directory for the wizard process
	StateDir string
	// WriteStateDir specifies the state directory for the wizard process
	WriteStateDir string
	// ServiceUser specifies the service user selected for the operation
	ServiceUser systeminfo.User
	// ClusterName specifies the name of the cluster to create
	ClusterName string
	// Devmode specifies whether the development mode is on
	Devmode bool
	// LogFile specifies the path to the operation log file
	LogFile string
	// Token specifies the token the wizard will use to authenticate joining agents.
	Token string
}

ProcessConfig defines the configuration for generating process configuration

type ProgressPoller

type ProgressPoller struct {
	log.FieldLogger
	Operator     ops.Operator
	OperationKey ops.SiteOperationKey
	Dispatcher   eventDispatcher
}

ProgressPoller is a progress message poller

func (ProgressPoller) Run

func (r ProgressPoller) Run(ctx context.Context) error

Run runs progress loop for the specified operation until the operation is complete or context is cancelled.

type RuntimeConfig

type RuntimeConfig struct {
	// Config is the main configuration for the installer
	Config
	// FSMFactory specifies the state machine factory to use
	FSMFactory engine.FSMFactory
	// ClusterFactory specifies the cluster request factory to use
	ClusterFactory engine.ClusterFactory
	// Planner specifies the plan generator
	Planner engine.Planner
	// Engine specifies the installer flow engine
	Engine Engine
}

RuntimeConfig specifies installer configuration not exposed to the engine

Directories

Path Synopsis
buffered
package buffered implements an event dispatcher with buffering semantics
package buffered implements an event dispatcher with buffering semantics
direct
package direct implements a synchronous event dispatcher
package direct implements a synchronous event dispatcher
cli
package cli implements command line installer workflow
package cli implements command line installer workflow
interactive
package interactive implements wizard-based installation workflow
package interactive implements wizard-based installation workflow

Jump to

Keyboard shortcuts

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