Documentation ¶
Index ¶
- func GetCurrentCni(network string) string
- type Cluster
- type ClusterSpec
- type ClusterSpecKubelet
- 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) GetClusterJSON(clusterName string) (*Cluster, error)
- func (c *Cmd) GetClusterSpecInfoFromJSON(name string, subData string) (string, error)
- func (c *Cmd) GetClustersJSON() (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) RollingUpdateClusterRequired(name string) (bool, error)
- func (c *Cmd) SetCluster(name, setValue string) error
- func (c *Cmd) SetInstanceGroup(clusterName, instanceGroupName, 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 InstanceGroupSpec
- type ResourceMetadata
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 Cluster ¶ added in v0.55.0
type Cluster struct { Metadata ResourceMetadata `json:"metadata"` Spec ClusterSpec `json:"spec"` }
Cluster is the configuration of a kops cluster.
type ClusterSpec ¶ added in v0.55.0
type ClusterSpec struct { Kubelet ClusterSpecKubelet `json:"kubelet"` NetworkID string `json:"networkID"` }
ClusterSpec is the spec configuration of a kops cluster.
type ClusterSpecKubelet ¶ added in v0.55.0
type ClusterSpecKubelet struct {
MaxPods int64 `json:"maxPods"`
}
ClusterSpecKubelet is the kubelet configuration of a kops cluster.
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) GetClusterJSON ¶ added in v0.55.0
GetClusterJSON invokes kops get instancegroup, using the context of the created Cmd, and returns the unmarshaled response as *Cluster.
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) GetClustersJSON ¶ added in v0.46.1
GetClustersJSON invokes kops get clusters, 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) RollingUpdateClusterRequired ¶ added in v0.70.0
RollingUpdateClusterRequired invokes kops rolling-update using the context of the cmd on the provided cluster name in dry-run mode to check if a rolling update is required or not. This is used to know if rotator needs to be enabled when performing cluster mutation operations.
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) SetInstanceGroup ¶ added in v0.60.0
SetInstanceGroup invokes kops set instancegroup, using the context of the created Cmd.
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 ResourceMetadata `json:"metadata"` Spec InstanceGroupSpec `json:"spec"` }
InstanceGroup is the configuration 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 configuration of a kops instance group.
type ResourceMetadata ¶ added in v0.55.0
type ResourceMetadata struct {
Name string `json:"name"`
}
ResourceMetadata is the metadata of a kops resource.