create

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The 'image' qualifier is used to capture instances which have the same
	// image (ignoring digest).
	RolloutQualifierImageName = RolloutQualifier("image")

	// The 'name' qualifier is used to capture instances which have the same name.
	RolloutQualifierInstanceName = RolloutQualifier("name")

	// The 'all' qualifier matches all instances in the service group.
	RolloutQualifierAll = RolloutQualifier("all")

	// The 'none' qualifier prevents matching any instances in the service group.
	RolloutQualifierNone = RolloutQualifier("none")
)
View Source
const (
	// The 'exit' strategy is used to error-out and indicate that no strategy was
	// provided and that further operations cannot be completed.
	RolloutStrategyExit = RolloutStrategy("exit")

	// The 'stop' strategy stops the qualified existing instance(s) within the
	// same service group and starts the new instance(s).
	RolloutStrategyStop = RolloutStrategy("stop")

	// The 'stop' strategy stops the qualified existing instance(s) within the
	// same service group and starts the new instance(s).
	RolloutStrategyRemove = RolloutStrategy("remove")

	// The 'keep' strategy keeps the existing qualified instance(s) within the
	// same service group and starts the new instance(s).
	RolloutStrategyKeep = RolloutStrategy("keep")

	// The 'prompt' strategy is an "unlisted" strategy that's used in TTY contexts
	// where the user is given the opportunity to decide the rollout strategy
	// before the rollout operation is performed.  The result of this decision
	// should yield one of the above rollout strategies.
	StrategyPrompt = RolloutStrategy("prompt")
)

Variables

This section is empty.

Functions

func NewCmd

func NewCmd() *cobra.Command

func RolloutQualifierNames added in v0.8.2

func RolloutQualifierNames() []string

RolloutQualifierNames returns the string representation of all possible rollout qualifiers.

func RolloutStrategyNames added in v0.8.2

func RolloutStrategyNames() []string

RolloutStrategyNames returns the string representation of all possible rollout strategies.

Types

type CreateOptions

type CreateOptions struct {
	Auth                   *config.AuthConfig        `noattribute:"true"`
	Client                 kraftcloud.KraftCloud     `noattribute:"true"`
	Env                    []string                  `local:"true" long:"env" short:"e" usage:"Environmental variables"`
	Features               []string                  `local:"true" long:"feature" short:"f" usage:"List of features to enable"`
	Domain                 []string                  `local:"true" long:"domain" short:"d" usage:"The domain names to use for the service"`
	Image                  string                    `noattribute:"true"`
	Memory                 uint                      `local:"true" long:"memory" short:"M" usage:"Specify the amount of memory to allocate (MiB)"`
	Metro                  string                    `noattribute:"true"`
	Name                   string                    `local:"true" long:"name" short:"n" usage:"Specify the name of the instance"`
	Output                 string                    `local:"true" long:"output" short:"o" usage:"Set output format. Options: table,yaml,json,list" default:"table"`
	Ports                  []string                  `local:"true" long:"port" short:"p" usage:"Specify the port mapping between external to internal"`
	RestartPolicy          kcinstances.RestartPolicy `noattribute:"true"`
	Replicas               uint                      `local:"true" long:"replicas" short:"R" usage:"Number of replicas of the instance" default:"0"`
	Rollout                RolloutStrategy           `noattribute:"true"`
	RolloutQualifier       RolloutQualifier          `noattribute:"true"`
	RolloutWait            time.Duration             `local:"true" long:"rollout-wait" usage:"Time to wait before performing rolling out action" default:"10s"`
	ServiceGroupNameOrUUID string                    `local:"true" long:"service-group" short:"g" usage:"Attach this instance to an existing service group"`
	Start                  bool                      `local:"true" long:"start" short:"S" usage:"Immediately start the instance after creation"`
	ScaleToZero            bool                      `local:"true" long:"scale-to-zero" short:"0" usage:"Scale the instance to zero after deployment"`
	SubDomain              []string                  `local:"true" long:"subdomain" short:"s" usage:"Set the subdomains to use when creating the service"`
	Token                  string                    `noattribute:"true"`
	Volumes                []string                  `local:"true" long:"volumes" short:"v" usage:"List of volumes to attach instance to"`
	WaitForImage           bool                      `local:"true" long:"wait-for-image" short:"w" usage:"Wait for the image to be available before creating the instance"`
	WaitForImageTimeout    time.Duration             `local:"true" long:"wait-for-image-timeout" usage:"Time to wait before timing out when waiting for image" default:"60s"`
}

func (*CreateOptions) Pre

func (opts *CreateOptions) Pre(cmd *cobra.Command, _ []string) error

func (*CreateOptions) Run

func (opts *CreateOptions) Run(ctx context.Context, args []string) error

type RolloutQualifier added in v0.8.2

type RolloutQualifier string

RolloutQualifier is the detection mechanism used to determine whether the specific instance should be affected by the rollout strategy.

func RolloutQualifiers added in v0.8.2

func RolloutQualifiers() []RolloutQualifier

RolloutQualifiers returns the list of possible rollout qualifier.

func (RolloutQualifier) String added in v0.8.2

func (strategy RolloutQualifier) String() string

String implements fmt.Stringer

type RolloutStrategy added in v0.8.2

type RolloutStrategy string

RolloutStrategy is the mechanism to describe how to approach managing existing instances part of an existing service group during deployment.

func RolloutStrategies added in v0.8.2

func RolloutStrategies() []RolloutStrategy

RolloutStrategies returns the list of possible rollout strategies.

func (RolloutStrategy) String added in v0.8.2

func (strategy RolloutStrategy) String() string

String implements fmt.Stringer

Jump to

Keyboard shortcuts

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