alibabacloud

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

README

Alibaba Cloud ECI

Alibaba Cloud ECI(Elastic Container Instance) is a service that allow you run containers without having to manage servers or clusters.

You can find more infomation via alibaba cloud ECI web portal

Alibaba Cloud ECI Virtual-Kubelet Provider

Alibaba ECI provider is an adapter to connect between k8s and ECI service to implement pod from k8s cluster on alibaba cloud platform

Prerequisites

To using ECI service on alibaba cloud, you may need open ECI service on web portal, and then the ECI service will be available

Deployment of the ECI provider in your cluster

configure and launch virtual kubelet

export ECI_REGION=cn-hangzhou
export ECI_SECURITY_GROUP=sg-123
export ECI_VSWITCH=vsw-123
export ECI_ACCESS_KEY=123
export ECI_SECRET_KEY=123

VKUBELET_TAINT_KEY=alibabacloud.com/eci virtual-kubelet --provider alibabacloud

confirm the virtual kubelet is connected to k8s cluster

$kubectl get node
NAME                                 STATUS                     ROLES     AGE       VERSION
cn-shanghai.i-uf69qodr5ntaxleqdhhk   Ready                      <none>    1d        v1.9.3
virtual-kubelet                      Ready                      agent     10s       v1.8.3

Schedule K8s Pod to ECI via virtual kubelet

You can assign pod to virtual kubelet via node-selector and toleration.

apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  nodeName: virtual-kubelet
  containers:
  - name: nginx
    image: nginx
  tolerations:
  - key: alibabacloud.com/eci
    operator: "Exists"
    effect: NoSchedule

Alibaba Cloud Serverless Kubernetes

Alibaba Cloud serverless kubernetes allows you to quickly create kubernetes container applications without having to manage and maintain clusters and servers. It is based on ECI and fully compatible with the Kuberentes API.

You can find more infomation via alibaba cloud serverless kubernetes product doc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 ECIProvider

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

ECIProvider implements the virtual-kubelet provider interface and communicates with Alibaba Cloud's ECI APIs.

func NewECIProvider

func NewECIProvider(config string, 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) CreatePod

func (p *ECIProvider) CreatePod(ctx context.Context, pod *v1.Pod) error

CreatePod accepts a Pod definition and creates an ECI deployment

func (*ECIProvider) DeletePod

func (p *ECIProvider) DeletePod(ctx context.Context, pod *v1.Pod) error

DeletePod deletes the specified pod out of ECI.

func (*ECIProvider) GetCgs

func (p *ECIProvider) GetCgs() []eci.ContainerGroup

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) GetPod

func (p *ECIProvider) GetPod(ctx context.Context, namespace, name string) (*v1.Pod, error)

GetPod returns a pod by name that is running inside ECI returns nil if a pod by that name is not found.

func (*ECIProvider) GetPodFullName

func (p *ECIProvider) GetPodFullName(namespace string, pod string) string

Get full pod name as defined in the provider context

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) GetPods

func (p *ECIProvider) GetPods(ctx context.Context) ([]*v1.Pod, error)

GetPods returns a list of all pods known to be running within ECI.

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 added in v0.10.0

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.

func (*ECIProvider) UpdatePod

func (p *ECIProvider) UpdatePod(ctx context.Context, pod *v1.Pod) error

UpdatePod is a noop, ECI currently does not support live updates of a pod.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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