build your serverless container cloud with openstack and ... · serverless means “clusterless”...

35
Build Your Serverless Container Cloud with OpenStack and Kubernetes Kevin Zhao Senior Software Engineer on Arm. OpenStack Zun Core Reviewer [email protected] 22.05.2018

Upload: others

Post on 21-May-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Build Your Serverless Container Cloud with OpenStack and Kubernetes

Kevin ZhaoSenior Software Engineer on Arm. OpenStack Zun Core [email protected]

22.05.2018

Page 2: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

What is Serverless Container Cloud

Zun and Container Capsule FAQ’s

Agenda

Build the Serverless Cloud

Demo

Page 3: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

What is Serverless Container Cloud

Page 4: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Traditional Container Cloud

• Provision the cluster first, pay much effort in cluster management

• Cluster level multi-tenant isolation

• Low resource utilization Cloud Infrastructure

Page 5: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Serverless Means “Clusterless”

Run container without managing servers or clusters.

Ability• Run container right way with one

command• Container level multiple tenant

support• Hypervisor level security isolation

Azure Container Instance

Page 6: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Build a cluster Just one command

Page 7: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Serverless container technology is coolBut I need to work with Kubernetes

Page 8: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Kubernetes control plane

Pod

Pod Pod

Kubelet

Pod Pod

Pod Pod

Kubelet

Pod

Deployment/Task

Application architecture

Infrastructure architecture

VM VM

Pod PodPod

Pod PodPod

Pod PodPod

Pod PodPod

Page 9: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Node1 Node2

OpenStack as a Virtual Kubelet Node

• For user, Kubernetes on top• OpenStack as a Virtual Kubelet node

• Deploy workloads on this virtual node use kubectl and the backend realization is Zun.

• For user, nothing different. User only needs to focus on the containers.

Page 10: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

For building serverless container cloud,what do you need initially

Standalone OpenStack and KubernetesNetwork connected

OpenStack provisioned Kubernetes

Page 11: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Zun and Container CapsuleZun Introduction

Wine container from Ancient China

Page 12: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

• Container Service of OpenStack

• Provide the ability of provisioning and managing

containers without caring underlying infrastructure.

Characteristics

• Container as the first class resource

• Individual IP Address/vCPU/Memory

Goal of Zun

• Make users focus on their application

• Pay just what they need(Clusterless)

Zun – Container Service

Page 13: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Zun – Container Service

Page 14: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Container inside OpenStack

Kuryr

Neutron(Network)Cinder

(Storage)Glance(Image)

Keystone(Authentication)

Zunprovisioning and

managing containers

Page 15: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Try Zun

Page 16: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

How to implement Pod in Zun

Page 17: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Zun and Container CapsuleContainer Capsule

Page 18: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Container Capsule

• One Sandbox container• Multiple containers• Multiple volumes

Component

• Basic unit in Zun• Co-Scheduled/Co-located• Share the network namespace• Share the resource limits

Characteristic

Page 19: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

NEUTRON KURYR

Unified OpenStack API

CinderUnified Block

Device

GlanceUnified Image

Repository

BM VM

Unified Network

KeystoneUnified

Authentication

Page 20: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Capsule Template

Support type:• Yaml• Json

Kubernetes friendly

Page 21: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Capsule API

POST /v1/capsules• zun capsule-create –f demo.yaml

GET /v1/capsules• Zun capsule-list

GET /v1/capsules/{uuid}• Zun capsule-describe <uuid>/<name>

DELETE /v1/capsules/{uuid}• Zun capsule-delete <uuid>/<name>

Page 22: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right
Page 23: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Build Serverless Container CloudKubernetes on top, Zun backend

Page 24: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Virtual-Kubelet

• Kubelet implementation,

masquerades container service as Kubelet node.

• Kubernetes on top, programmed back.

• Intermediary to map Kubernetes requests and resource to container service

Page 25: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Virtual-Kubelet Goal

Page 26: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Virtual-kubelet structure

Provider

Resource Manager

VkubeletMain

Process

Info Cache

CreatePod

K8s client

Record Pod info from K8s

Backend Driver

Gophercloud

Page 27: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

CreatePodUpdatePodDeletePod

GetPodGetPods

GetConfigMapGetSecrets

Sync Pod and Node:1. Watch pod requests from K8s. Update resource manager.2. Periodic task to update Node and Pod status from provider to K8s.

Virtual-kubelet Structure

Resource Manager

VkubeletMain

Process

Register Node

Sync Pod/Node

CreatePod

Register Node:1. Capacity(), get virtual node info.Fill into k8s node object.2. Call: k8sClient.CoreV1().Nodes().Create(node)

K8s client

Page 28: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Virtual-kubelet Structure

Provider

Resource Manager

VkubeletMain

Process

PodOperation

Node Operation

CreatePod

Reconcile

Pod:CreatePodUpdatePodDeletePod

GetPodGetPods

GetPodStatus

Node:Capacity

NodeCondition

Gophercloud

Reconcile:1. Create:GetPods from RM, GetPods from Provider,CreatePod if no DeletionTimeStamp2. Delete:GetPods from provider,Check into RM, if not exist, DeletePod from Provider

Page 29: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Virtual-kubelet Zun support

Communication:

1. Gophercloud for Zun

Capsule API support in Gophercloud

2. Virtual Kubelet Zun client

Connect Zun by Gophercloud

Resource Providing:

1. Capsule will be the backend realization of Pod

2. Provider essential functions for pod and node management

Page 30: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Pod Create Process

Kubectl

Create pod

VK pod watcher

Find pod request

ResourceManager

Add Pod toresource manager

VKReconcile

Get pod from ZunCompare with

resource manager

Provider

CreatePodRemap attribute

from pod to capsule

Provider

gophercloudcapsule create

Zun

Capsule create

Page 31: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Future

• Enhanced the virtual kubelet support for configmap and secret

• Enhanced Capsule implementation and operation

• Aligned with Kubernetes related attribute

• Cinder multiple attach for container

Page 32: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

Show me the demoTalk is cheap

Page 33: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right
Page 34: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

You are welcome to join us

Wiki: https://wiki.openstack.org/wiki/Zun

IRC: #openstack-zun

Integration of Openstack Zun with Kata

containers

May 23th, 2:40pm-3:20pm, Room 109

Zun Project Update

May 24th, 3:30pm-3:50pm, Room 212

Page 35: Build Your Serverless Container Cloud with OpenStack and ... · Serverless Means “Clusterless” Run container without managing servers or clusters. Ability •Run container right

@OpenStack

THANKS.Questions?

openstack openstack OpenStackFoundation