Deploy Virtual Nodes Quickly with Container Service for Kubernetes

Diverse Combinations of Containers and Serverless

Serverless Kubernetes

Kubernetes Virtual Nodes

Elastic Container Instance and Virtual Kubelet

ECI

  • Infrastructure management is not required to run containers.
  • Flexible on-demand usage scenarios and per-second billing are available.
  • The sandbox security technology ensures the application security.

Virtual Kubelet

Deploy Virtual Nodes in Alibaba Cloud Managed Kubernetes Clusters

1. Enable ECI

2. Create a Managed Kubernetes Cluster

3. Use kubectl to Deploy Virtual Nodes in One Click

# cat alicloud-virtual-nodes-eci.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: alicloud-virtual-nodes-eci
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: alicloud-virtual-nodes-eci
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: alicloud-virtual-nodes-eci
namespace: kube-system
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: alicloud-virtual-nodes-eci
namespace: kube-system
labels:
app: alicloud-virtual-nodes-eci
spec:
replicas: 1
selector:
matchLabels:
app: alicloud-virtual-nodes-eci
template:
metadata:
labels:
app: alicloud-virtual-nodes-eci
spec:
serviceAccount: alicloud-virtual-nodes-eci
containers:
- name: alicloud-virtual-kubelet
image: registry.cn-hangzhou.aliyuncs.com/ask/virtual-nodes-eci:v1.0.0.1-aliyun
imagePullPolicy: Always
args: ["--provider", "alibabacloud"]
env:
- name: KUBELET_PORT
value: "10250"
- name: VKUBELET_POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: VKUBELET_TAINT_KEY
value: "virtual-kubelet.io/provider"
- name: VKUBELET_TAINT_VALUE
value: "alibabacloud"
- name: VKUBELET_TAINT_EFFECT
value: "NoSchedule"
- name: ECI_REGION
value: "cn-hangzhou"
- name: ECI_VSWITCH
value: "xxx"
- name: ECI_SECURITY_GROUP
value: "xxx"
- name: ECI_ACCESS_KEY
value: "xxx"
- name: ECI_SECRET_KEY
value: "xxx"
# kubectl apply -f ./alicloud-virtual-nodes-eci.yaml
serviceaccount "alicloud-virtual-nodes-eci" created
clusterrolebinding "alicloud-virtual-nodes-eci" created
deployment "alicloud-virtual-nodes-eci" created
# kubectl -n kube-system get pod|grep virtual-nodes
alicloud-virtual-nodes-eci-54b748489c-gkcmn 1/1 Running 0 53s
# kubectl get node
NAME STATUS ROLES AGE VERSION
cn-hangzhou.i-bp19cyop0b1skne04djt Ready <none> 10m v1.11.2
cn-hangzhou.i-bp19cyop0b1skne04dju Ready <none> 10m v1.11.2
cn-hangzhou.i-bp19cyop0b1skne04djv Ready <none> 10m v1.11.2
virtual-kubelet Ready agent 55s v1.11.2

4. Deploy a Pod to the Virtual Node

# cat nginx.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- image: nginx
imagePullPolicy: Always
name: nginx
nodeSelector:
kubernetes.io/role: agent
beta.kubernetes.io/os: linux
type: virtual-kubelet
tolerations:
- key: virtual-kubelet.io/provider
operator: Exists
# kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx 1/1 Running 0 1m

Summary

Reference Links

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

5/14 box model (css)

nOS Report #2 — Pre-sale Requirements, Platform Updates, NEO Europe Tour

Crafting the User Experience

Your first Python package in 1 min

3 Beliefs I Abandoned After 3 Years of Professional Coding

Code on a laptop

Fighting Coronavirus: Freshippo Reveals 12 Key Technologies to Achieve 0 Faults over a Year (Part…

Integrating RazorPay in Your Flutter App: An Ultimate Guide [2021]

InterSystems Python Contest

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

Editing your github commits for Kubernetes contributors

Build and run microservices with Kubernetes, Helm and Skaffold locally

Real-time Notifications via PagerDuty

Photograph of aviation firefighters in training

K8’s on Laptop : First Proxy