kops

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

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

Cmd is the kops command to execute.

func New

func New(s3StateStore string, logger log.FieldLogger) (*Cmd, error)

New creates a new instance of Cmd through which to execute kops.

func (*Cmd) Close

func (c *Cmd) Close() error

Close cleans up the temporary output directory used by kops.

func (*Cmd) CreateCluster

func (c *Cmd) CreateCluster(name, cloud string, kopsRequest *model.KopsMetadataRequestedState, zones, privateSubnetIds, publicSubnetIds, masterSecurityGroups, workerSecurityGroups, allowSSHCIDRS []string) error

CreateCluster invokes kops create cluster, using the context of the created Cmd.

func (*Cmd) DeleteCluster

func (c *Cmd) DeleteCluster(name string) error

DeleteCluster invokes kops delete cluster, using the context of the created Cmd.

func (*Cmd) ExportKubecfg

func (c *Cmd) ExportKubecfg(name string) error

ExportKubecfg invokes kops export kubecfg for the named cluster in the context of the created Cmd.

func (*Cmd) GetCluster

func (c *Cmd) GetCluster(name string) (string, error)

GetCluster invokes kops get cluster, using the context of the created Cmd, and returns the stdout.

func (*Cmd) GetInstanceGroupYAML added in v0.19.0

func (c *Cmd) GetInstanceGroupYAML(clusterName, igName string) (string, error)

GetInstanceGroupYAML invokes kops get instancegroup, using the context of the created Cmd, and returns the YAML stdout.

func (*Cmd) GetInstanceGroupsJSON added in v0.20.0

func (c *Cmd) GetInstanceGroupsJSON(clusterName string) ([]InstanceGroup, error)

GetInstanceGroupsJSON invokes kops get instancegroup, using the context of the created Cmd, and returns the unmarshaled response as []InstanceGroup.

func (*Cmd) GetKubeConfigPath

func (c *Cmd) GetKubeConfigPath() string

GetKubeConfigPath returns the temporary kubeconfig directory used by kops.

func (*Cmd) GetOutputDirectory

func (c *Cmd) GetOutputDirectory() string

GetOutputDirectory returns the temporary output directory used by kops.

func (*Cmd) GetTempDir added in v0.19.0

func (c *Cmd) GetTempDir() string

GetTempDir returns the root temporary directory used by kops.

func (*Cmd) Replace added in v0.19.0

func (c *Cmd) Replace(name string) (string, error)

Replace invokes kops replace, using the context of the created Cmd, and returns the stdout. The filename passed in is expected to be in the root temp dir of this kops command.

func (*Cmd) RollingUpdateCluster

func (c *Cmd) RollingUpdateCluster(name string) error

RollingUpdateCluster invokes kops rolling-update cluster, using the context of the created Cmd.

func (*Cmd) SetCluster added in v0.9.0

func (c *Cmd) SetCluster(name, setValue string) error

SetCluster invokes kops set cluster, using the context of the created Cmd. Example setValue: spec.kubernetesVersion=1.10.0

func (*Cmd) SetLogger added in v0.37.0

func (c *Cmd) SetLogger(logger log.FieldLogger)

SetLogger sets a new logger for kops commands.

func (*Cmd) UpdateCluster

func (c *Cmd) UpdateCluster(name, dir string) error

UpdateCluster invokes kops update cluster, using the context of the created Cmd.

func (*Cmd) UpdateMetadata added in v0.21.0

func (c *Cmd) UpdateMetadata(metadata *model.KopsMetadata) error

UpdateMetadata updates KopsMetadata with the current values from kops state store. This can be a bit tricky. We are attempting to correlate multiple kops instance groups into a simplified set of metadata information. To do so, we assume and check the following: - There is one worker node instance group. - There is one or more master instance groups. - All of the cluster hosts are running the same AMI. - All of the master nodes are running the same instance type. Note: If any violations are found, we don't return an error as that is beyond the scope of updating the metadata. Instead, warnings for each violation are returned and stored.

func (*Cmd) UpgradeCluster

func (c *Cmd) UpgradeCluster(name string) error

UpgradeCluster invokes kops upgrade cluster, using the context of the created Cmd.

func (*Cmd) ValidateCluster

func (c *Cmd) ValidateCluster(name string, silent bool) error

ValidateCluster invokes kops validate cluster, using the context of the created Cmd.

func (*Cmd) Version

func (c *Cmd) Version() (string, error)

Version invokes kops version, using the context of the created Cmd, and returns the stdout.

func (*Cmd) WaitForKubernetesReadiness

func (c *Cmd) WaitForKubernetesReadiness(dns string, timeout int) error

WaitForKubernetesReadiness will poll a given kubernetes cluster at a regular interval for it to become ready. If the cluster fails to become ready before the provided timeout then an error will be returned.

type InstanceGroup added in v0.20.0

type InstanceGroup struct {
	Metadata InstanceGroupMetadata `json:"metadata"`
	Spec     InstanceGroupSpec     `json:"spec"`
}

InstanceGroup is a kops instance group.

type InstanceGroupMetadata added in v0.20.0

type InstanceGroupMetadata struct {
	Name string `json:"name"`
}

InstanceGroupMetadata is the metadata of a kops instance group.

type InstanceGroupSpec added in v0.20.0

type InstanceGroupSpec struct {
	Role        string `json:"role"`
	Image       string `json:"image"`
	MachineType string `json:"machineType"`
	MinSize     int64  `json:"minSize"`
	MaxSize     int64  `json:"maxSize"`
}

InstanceGroupSpec is the spec of a kops instance group.

Jump to

Keyboard shortcuts

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