Documentation ¶
Index ¶
- func GetCurrentCni(network string) string
- type Cmd
- func (c *Cmd) Close() error
- func (c *Cmd) CreateCluster(name, cloud string, kopsRequest *model.KopsMetadataRequestedState, ...) error
- func (c *Cmd) DeleteCluster(name string) error
- func (c *Cmd) ExportKubecfg(name string) error
- func (c *Cmd) GetCluster(name string) (string, error)
- func (c *Cmd) GetClusterSpecInfoFromJSON(name string, subData string) (string, error)
- func (c *Cmd) GetInstanceGroupYAML(clusterName, igName string) (string, error)
- func (c *Cmd) GetInstanceGroupsJSON(clusterName string) ([]InstanceGroup, error)
- func (c *Cmd) GetKubeConfigPath() string
- func (c *Cmd) GetOutputDirectory() string
- func (c *Cmd) GetTempDir() string
- func (c *Cmd) Replace(name string) (string, error)
- func (c *Cmd) RollingUpdateCluster(name string) error
- func (c *Cmd) SetCluster(name, setValue string) error
- func (c *Cmd) SetLogger(logger log.FieldLogger)
- func (c *Cmd) UpdateCluster(name, dir string) error
- func (c *Cmd) UpdateMetadata(metadata *model.KopsMetadata) error
- func (c *Cmd) UpgradeCluster(name string) error
- func (c *Cmd) ValidateCluster(name string, silent bool) error
- func (c *Cmd) Version() (string, error)
- func (c *Cmd) WaitForKubernetesReadiness(dns string, timeout int) error
- type InstanceGroup
- type InstanceGroupMetadata
- type InstanceGroupSpec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCurrentCni ¶ added in v0.45.0
GetCurrentCni it get the current CNI value for the cluster
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) 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 ¶
DeleteCluster invokes kops delete cluster, using the context of the created Cmd.
func (*Cmd) ExportKubecfg ¶
ExportKubecfg invokes kops export kubecfg for the named cluster in the context of the created Cmd.
func (*Cmd) GetCluster ¶
GetCluster invokes kops get cluster, using the context of the created Cmd, and returns the stdout.
func (*Cmd) GetClusterSpecInfoFromJSON ¶ added in v0.44.0
GetClusterSpecInfoFromJSON invokes kops get cluster, using the context of the created Cmd, and returns the stdout.
func (*Cmd) GetInstanceGroupYAML ¶ added in v0.19.0
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 ¶
GetKubeConfigPath returns the temporary kubeconfig directory used by kops.
func (*Cmd) GetOutputDirectory ¶
GetOutputDirectory returns the temporary output directory used by kops.
func (*Cmd) GetTempDir ¶ added in v0.19.0
GetTempDir returns the root temporary directory used by kops.
func (*Cmd) Replace ¶ added in v0.19.0
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 ¶
RollingUpdateCluster invokes kops rolling-update cluster, using the context of the created Cmd.
func (*Cmd) SetCluster ¶ added in v0.9.0
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 ¶
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 ¶
UpgradeCluster invokes kops upgrade cluster, using the context of the created Cmd.
func (*Cmd) ValidateCluster ¶
ValidateCluster invokes kops validate cluster, using the context of the created Cmd.
func (*Cmd) Version ¶
Version invokes kops version, using the context of the created Cmd, and returns the stdout.
func (*Cmd) WaitForKubernetesReadiness ¶
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.