Documentation ¶
Index ¶
- Constants
- Variables
- type EIP
- type EIPOptions
- type LogWriter
- type UCloud
- func (p *UCloud) Archon() (cloudprovider.ArchonInterface, bool)
- func (p *UCloud) Clusters() (cp.Clusters, bool)
- func (p *UCloud) EnsureInstance(clusterName string, instance *cluster.Instance) (status *cluster.InstanceStatus, err error)
- func (p *UCloud) EnsureInstanceDeleted(clusterName string, instance *cluster.Instance) (err error)
- func (p *UCloud) EnsureNetwork(clusterName string, network *cluster.Network) (status *cluster.NetworkStatus, err error)
- func (p *UCloud) EnsureNetworkDeleted(clusterName string, network *cluster.Network) (err error)
- func (p *UCloud) EnsurePrivateIP(clusterName string, instance *cluster.Instance) (status *cluster.InstanceStatus, err error)
- func (p *UCloud) EnsurePrivateIPDeleted(clusterName string, instance *cluster.Instance) (err error)
- func (p *UCloud) EnsurePublicIP(clusterName string, instance *cluster.Instance) (status *cluster.InstanceStatus, err error)
- func (p *UCloud) EnsurePublicIPDeleted(clusterName string, instance *cluster.Instance) (err error)
- func (p *UCloud) GetInstance(clusterName string, instance *cluster.Instance) (status *cluster.InstanceStatus, err error)
- func (p *UCloud) Initialize(clientBuilder controller.ControllerClientBuilder)
- func (p *UCloud) Instances() (cp.Instances, bool)
- func (p *UCloud) ListInstances(clusterName string, network *cluster.Network, selector map[string]string) (names []string, statuses []*cluster.InstanceStatus, err error)
- func (p *UCloud) LoadBalancer() (cp.LoadBalancer, bool)
- func (p *UCloud) PrivateIP() (cloudprovider.PrivateIPInterface, bool)
- func (p *UCloud) ProviderName() string
- func (p *UCloud) PublicIP() (cloudprovider.PublicIPInterface, bool)
- func (p *UCloud) Routes() (cp.Routes, bool)
- func (p *UCloud) ScrubDNS(nameservers, searches []string) (nsOut, srchOut []string)
- func (p *UCloud) Zones() (cp.Zones, bool)
- type UCloudInstanceInitialized
- type UCloudInstanceOptions
- type UCloudInterface
- type UCloudNetwork
Constants ¶
View Source
const ( ResourceTypeUHost = "uhost" InstanceStateInitializing = "Initializing" InstanceStateStarting = "Starting" InstanceStateRunning = "Running" InstanceStateStopping = "Stopping" InstanceStateStopped = "Stopped" InstanceStateFailed = "Install Fail" InstanceStateRebooting = "Rebooting" InstanceLoginModePassword = "Password" InstanceIPTypePrivate = "Private" InstanceChargeTypeDynamic = "Dynamic" EIPStatusUsed = "used" EIPStatusFree = "free" EIPChargeTypeDynamic = "Dynamic" EIPPayModeTraffic = "Traffic" EIPPayModeBandwidth = "Bandwidth" EIPOperatorBGP = "Bgp" DefaultWaitTimeout = 2 * 60 // in seconds )
View Source
const ProviderName = "ucloud"
Variables ¶
View Source
var ( ErrorNotFound = fmt.Errorf("Instance is not found") CloudInitInterval = 5 * time.Second CloudInitTimeout = 3 * time.Minute // UCloud doesn't allow tag keys starting with "aliyun" InitializedTagKey = "instance." + UCloudAnnotationPrefix + "initialized" SSHUsernameMap = map[string]string{ "ubuntu": "ubuntu", "centos": "root", } StateMap = map[string]cluster.InstancePhase{ InstanceStateInitializing: cluster.InstancePending, InstanceStateStarting: cluster.InstancePending, InstanceStateRunning: cluster.InstanceRunning, InstanceStateStopping: cluster.InstanceFailed, InstanceStateStopped: cluster.InstanceFailed, InstanceStateFailed: cluster.InstanceFailed, InstanceStateRebooting: cluster.InstancePending, } )
View Source
var NameKey = UCloudAnnotationPrefix + "name"
Node name as a tag on uhost instance
View Source
var UCloudAnnotationPrefix = "ucloud." + cluster.AnnotationPrefix
Used in k8s annotations and labels
Functions ¶
This section is empty.
Types ¶
type EIPOptions ¶
type UCloud ¶
type UCloud struct {
// contains filtered or unexported fields
}
func (*UCloud) Archon ¶
func (p *UCloud) Archon() (cloudprovider.ArchonInterface, bool)
func (*UCloud) EnsureInstance ¶
func (*UCloud) EnsureInstanceDeleted ¶
func (*UCloud) EnsureNetwork ¶
func (*UCloud) EnsureNetworkDeleted ¶
func (*UCloud) EnsurePrivateIP ¶
func (*UCloud) EnsurePrivateIPDeleted ¶
func (*UCloud) EnsurePublicIP ¶
func (*UCloud) EnsurePublicIPDeleted ¶
func (*UCloud) GetInstance ¶
func (*UCloud) Initialize ¶
func (p *UCloud) Initialize(clientBuilder controller.ControllerClientBuilder)
func (*UCloud) ListInstances ¶
func (*UCloud) LoadBalancer ¶
func (p *UCloud) LoadBalancer() (cp.LoadBalancer, bool)
func (*UCloud) PrivateIP ¶
func (p *UCloud) PrivateIP() (cloudprovider.PrivateIPInterface, bool)
func (*UCloud) ProviderName ¶
func (*UCloud) PublicIP ¶
func (p *UCloud) PublicIP() (cloudprovider.PublicIPInterface, bool)
type UCloudInstanceInitialized ¶
type UCloudInstanceInitialized struct {
Initialized bool `k8s:"instance-initialized"`
}
type UCloudInstanceOptions ¶
type UCloudInterface ¶
type UCloudInterface interface { CreateInstance(*uhost.CreateUHostInstanceParams) (string, error) StopInstance(string, bool) error StartInstance(string) error DeleteInstance(string) error DescribeInstances(args *uhost.DescribeUHostInstanceParams) (instances []uhost.UHostSet, err error) DescribeInstanceAttribute(string) (*uhost.UHostSet, error) ReinstallInstance(string, string) error //AllocatePublicIpAddress(string) (string, error) AllocateEipAddress(*unet.AllocateEIPParams) (*unet.EIPSet, error) //WaitForEip(common.Region, string, uhost.EipStatus, int) error AssociateEipAddress(string, string) error DescribeEipAddress(string) (*unet.EIPSet, error) UnassociateEipAddress(string, string) error ReleaseEipAddress(string) error CreateSecurityGroup(*unet.CreateSecurityGroupParams) error DeleteSecurityGroup(int) error ModifyRemark(string, string) error WaitForInstance(id string, status string, timeout int) error }
type UCloudNetwork ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.