Documentation ¶
Index ¶
- Constants
- func Create(ctx context.Context, opts *CreateOptions, args ...string) (*kcclient.ServiceResponse[kcinstances.GetResponseItem], ...)
- func NewCmd() *cobra.Command
- func RolloutQualifierNames() []string
- func RolloutStrategyNames() []string
- type CreateOptions
- type RolloutQualifier
- type RolloutStrategy
Constants ¶
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. RolloutQualifierAll = RolloutQualifier("all") // The 'none' qualifier prevents matching any instances in the service. RolloutQualifierNone = RolloutQualifier("none") )
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 and starts the new instance(s). RolloutStrategyStop = RolloutStrategy("stop") // The 'stop' strategy stops the qualified existing instance(s) within the // same service and starts the new instance(s). RolloutStrategyRemove = RolloutStrategy("remove") // The 'keep' strategy keeps the existing qualified instance(s) within the // same service 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 Create ¶
func Create(ctx context.Context, opts *CreateOptions, args ...string) (*kcclient.ServiceResponse[kcinstances.GetResponseItem], *kcclient.ServiceResponse[kcservices.GetResponseItem], error)
Create a KraftCloud instance.
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"` Certificate []string `local:"true" long:"certificate" short:"c" usage:"Set the certificates to use for the service"` 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"` Entrypoint types.ShellCommand `local:"true" long:"entrypoint" usage:"Set the entrypoint for the instance"` Memory string `local:"true" long:"memory" short:"M" usage:"Specify the amount of memory to allocate (MiB increments)"` 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:"list"` 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 (ms/s/m/h)" default:"10s"` ServiceNameOrUUID string `local:"true" long:"service" short:"g" usage:"Attach this instance to an existing service"` Start bool `local:"true" long:"start" short:"S" usage:"Immediately start the instance after creation"` ScaleToZero *kcinstances.ScaleToZeroPolicy `noattribute:"true"` ScaleToZeroStateful *bool `local:"true" long:"scale-to-zero-stateful" usage:"Save state when scaling to zero"` ScaleToZeroCooldown time.Duration `local:"true" long:"scale-to-zero-cooldown" usage:"Cooldown period before scaling to zero (ms/s/m/h)"` 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 `` /* 129-byte string literal not displayed */ Services []kcservices.CreateRequestService `noattribute:"true"` }
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 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