Documentation ¶
Index ¶
- Constants
- Variables
- type AuthConfig
- type ConfigFileToPath
- type ContainerGroup
- type ContainerGroupResp
- type ContainerInfo
- type ContainerPort
- type ContainerState
- type CreateContainerGroup
- type DeleteContainerGroup
- type DescribeContainerGroupsRequest
- type DescribeContainerLogRequest
- type ECIProvider
- func (p *ECIProvider) Capacity(ctx context.Context) v1.ResourceList
- func (p *ECIProvider) CreatePod(ctx context.Context, pod *v1.Pod) error
- func (p *ECIProvider) DeletePod(ctx context.Context, pod *v1.Pod) error
- func (p *ECIProvider) GetCgs(ctx context.Context, namespace, name string) ([]ContainerGroup, int, error)
- func (p *ECIProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, ...) (io.ReadCloser, error)
- func (p *ECIProvider) GetPod(ctx context.Context, namespace, name string) (*v1.Pod, error)
- func (p *ECIProvider) GetPodByCondition(ctx context.Context, source, namespace, name string) (*v1.Pod, error)
- func (p *ECIProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
- func (p *ECIProvider) GetPods(ctx context.Context) ([]*v1.Pod, error)
- func (p *ECIProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
- func (p *ECIProvider) NodeConditions(ctx context.Context) []v1.NodeCondition
- func (p *ECIProvider) NodeDaemonEndpoints(ctx context.Context) *v1.NodeDaemonEndpoints
- func (p *ECIProvider) OperatingSystem() string
- func (p *ECIProvider) RunInContainer(ctx context.Context, namespace, podName, containerName string, cmd []string, ...) error
- func (p *ECIProvider) UpdatePod(ctx context.Context, pod *v1.Pod) error
- type EnvironmentVar
- type Event
- type ImageRegistryCredential
- type Volume
- type VolumeMount
Constants ¶
const ( VOL_TYPE_NFS = "NFSVolume" VOL_TYPE_EMPTYDIR = "EmptyDirVolume" VOL_TYPE_CONFIGFILEVOLUME = "ConfigFileVolume" )
const ( CreateContainerGroupAction = "CreateContainerGroup" DeleteContainerGroupAction = "DeleteContainerGroup" DescribeContainerGroupsAction = "DescribeContainerGroups" )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type AuthConfig ¶
type AuthConfig struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Auth string `json:"auth,omitempty"` Email string `json:"email,omitempty"` ServerAddress string `json:"serveraddress,omitempty"` IdentityToken string `json:"identitytoken,omitempty"` RegistryToken string `json:"registrytoken,omitempty"` }
AuthConfig is the secret returned from an ImageRegistryCredential
type ConfigFileToPath ¶
type ContainerGroup ¶
type ContainerGroup struct { ContainerGroupId string `json:"container_group_id"` ContainerGroupName string `json:"container_group_name"` TaskId string `json:"task_id"` TaskState string `json:"task_state"` PodName string `json:"pod_name"` Namespace string `json:"namespace"` SiteId string `json:"site_id"` Memory float64 `json:"memory"` Cpu float64 `json:"cpu"` PrivateId string `json:"private_id"` RestartPolicy string `json:"restart_policy"` IntranetIp string `json:"intranet_ip"` Status string `json:"status"` CreationTime string `json:"creation_time"` SucceededTime string `json:"succeeded_time"` Volumes []Volume `json:"volumes"` Events []Event `json:"events" ` Containers []ContainerInfo `json:"containers"` }
type ContainerGroupResp ¶
type ContainerGroupResp struct {
Eci []ContainerGroup `json:"eci"`
}
type ContainerInfo ¶
type ContainerInfo struct { Id string `json:"id,omitempty"` Name string `json:"name"` Image string `json:"image"` ImageVersion string `json:"version"` ImagePullPolicy string `json:"image_pull_policy"` WorkingDir string `json:"working_dir"` Arg []string `json:"arg"` Command []string `json:"command"` Memory float64 `json:"memory"` Cpu float64 `json:"cpu"` Ports []ContainerPort `json:"ports"` EnvironmentVars []EnvironmentVar `json:"environment_var"` VolumeMounts []VolumeMount `json:"volume_mounts"` RestartCount int `json:"restart_count,omitempty"` PreviousState *ContainerState `json:"previous_state,omitempty"` CurrentState *ContainerState `json:"current_state,omitempty"` }
type ContainerPort ¶
type ContainerState ¶
type CreateContainerGroup ¶
type CreateContainerGroup struct { SiteId string `json:"site_id"` ClusterId string `json:"cluster_id"` NodeId string `json:"node_id"` NodeName string `json:"node_name,omitempty"` Namespace string `json:"namespace"` BillMethod int `json:"bill_method"` OwnerReferences interface{} `json:"owner_references"` ContainerGroupName string `json:"name"` ContainerGroupInstanceType string `json:"container_groupInstance_type,omitempty"` PodName string `json:"pod_name"` Cpu float64 `json:"cpu"` Memory float64 `json:"memory"` RestartPolicy string `json:"restart_policy"` Amount int `json:"amount,omitempty"` StorageType string `json:"ephemeral_storage_type"` StorageSize int `json:"ephemeral_storage_size"` PublicIp []string `json:"public_ip,omitempty"` PrivateId string `json:"private_pipe_id"` Container []ContainerInfo `json:"container"` InitContainer []ContainerInfo `json:"init_container"` Volumes []Volume `json:"volumes"` ImageRegistryCredentials []ImageRegistryCredential `json:"image_registry_credential"` CreationTimestamp string `json:"creation_timestamp"` }
type DeleteContainerGroup ¶
type DeleteContainerGroup struct {
ContainerGroupId string `json:"container_group_id"`
}
type DescribeContainerGroupsRequest ¶
type DescribeContainerGroupsRequest struct { SiteId string `json:"site_id"` Limit int `json:"limit,omitempty"` NodeName string `json:"node_name,omitempty"` NodeId string `json:"node_id,omitempty"` ContainerGroupName string `json:"container_group_name,omitempty"` ContainerGroupId string `json:"container_group_id,omitempty"` Namespace string `json:"namespace,omitempty"` }
type DescribeContainerLogRequest ¶
type DescribeContainerLogRequest struct { }
type ECIProvider ¶
ECIProvider implements the virtual-kubelet provider interface and communicates with Alibaba Cloud's ECI APIs.
func NewECIProvider ¶
func NewECIProvider(rm *manager.ResourceManager, nodeName, operatingSystem string, internalIP string, daemonEndpointPort int32) (*ECIProvider, error)
NewECIProvider creates a new ECIProvider.
func (*ECIProvider) Capacity ¶
func (p *ECIProvider) Capacity(ctx context.Context) v1.ResourceList
Capacity returns a resource list containing the capacity limits set for ECI.
func (*ECIProvider) GetCgs ¶
func (p *ECIProvider) GetCgs(ctx context.Context, namespace, name string) ([]ContainerGroup, int, error)
func (*ECIProvider) GetContainerLogs ¶
func (p *ECIProvider) GetContainerLogs(ctx context.Context, namespace, podName, containerName string, opts api.ContainerLogOpts) (io.ReadCloser, error)
GetContainerLogs returns the logs of a pod by name that is running inside ECI.
func (*ECIProvider) GetPodByCondition ¶
func (*ECIProvider) GetPodStatus ¶
func (p *ECIProvider) GetPodStatus(ctx context.Context, namespace, name string) (*v1.PodStatus, error)
GetPodStatus returns the status of a pod by name that is running inside ECI returns nil if a pod by that name is not found.
func (*ECIProvider) NodeAddresses ¶
func (p *ECIProvider) NodeAddresses(ctx context.Context) []v1.NodeAddress
NodeAddresses returns a list of addresses for the node status within Kubernetes.
func (*ECIProvider) NodeConditions ¶
func (p *ECIProvider) NodeConditions(ctx context.Context) []v1.NodeCondition
NodeConditions returns a list of conditions (Ready, OutOfDisk, etc), for updates to the node status within Kubernetes.
func (*ECIProvider) NodeDaemonEndpoints ¶
func (p *ECIProvider) NodeDaemonEndpoints(ctx context.Context) *v1.NodeDaemonEndpoints
NodeDaemonEndpoints returns NodeDaemonEndpoints for the node status within Kubernetes.
func (*ECIProvider) OperatingSystem ¶
func (p *ECIProvider) OperatingSystem() string
OperatingSystem returns the operating system that was provided by the config.
func (*ECIProvider) RunInContainer ¶
func (p *ECIProvider) RunInContainer(ctx context.Context, namespace, podName, containerName string, cmd []string, attach api.AttachIO) error
RunInContainer executes a command in a container in the pod, copying data between in/out/err and the container's stdin/stdout/stderr.
type EnvironmentVar ¶
type ImageRegistryCredential ¶
type Volume ¶
type Volume struct { Type string `json:"type"` Name string `json:"name"` NfsVolumePath string `json:"nfs_volume_path"` NfsVolumeServer string `json:"nfs_volume_server"` NfsVolumeReadOnly bool `json:"nfs_volume_read_only"` EmptyDirVolumeEnable bool `json:"empty_dir_volume_enable"` ConfigFileToPaths []ConfigFileToPath `json:"config_file_to_paths"` }