00-Introduction
00-Introduction
Richard T. B. Ma
School of Computing
National University of Singapore
About Your Lecturer
q Email: 𝑡𝑏𝑚𝑎@𝑐𝑜𝑚𝑝. 𝑛𝑢𝑠. 𝑒𝑑𝑢. 𝑠𝑔
q Research areas:
v Computer Networks
v Distributed Systems
2
About Your TA
q Yancan MAO
3
Schedule: Online
4
Schedule: On-Campus
5
Tentative Topics of This Course
q Lecture 0: Introduction to Cloud Computing
v Concepts and principles of cloud computing
v Cloud computing service (delivery) models
v Virtualization technology
7
Course Project
q This course is a project-based workshop
v besides lectures, students will spend more time
on projects, which will be graded
v learn from hands-on experiences
v every 4 students form a group
v poster, presentation and report
q Project content
v open-ended project with your preference
v must apply cloud-native designs of your app
v may use big data frameworks
8
Prerequisites and Resources
q Prerequisites
v Programming Languages, e.g., Python, Java, Go
v Operating Systems, i.e., Linux
v Computer Networks, e.g., L2 and L3 networking
q Cloud Resources
v Trial on real production cloud: Amazon EC2
v Each student will receive US$100 credits for
the use of AWS services; available in July
v Credit card tie-in not required
9
Roadmap
q General Concepts of Cloud Computing
v Cloud and cloud computing
v Service models
q Virtualization Technologies
v Virtual Machines
v Containers
q Container Orchestration
v Introduction to Kubernetes
10
What is a Cloud?
q A cloud is a network that
delivers requested virtual
resources as a service
[IBM’s definition]
11
Datacenter
v Commodity
servers are
organized in
racks
v Racks are
connected by
high-speed
network links
12
A More Complete View of a Datacenter
Peter Mell and Tim Grance, “The NIST Definition of Cloud Computing”, 2011
14
Cloud Computing: Key Characteristics
1. On-demand self-service
v driven by user requests; no human interaction with the cloud
2. Ubiquitous network access
v deliver services anytime, anywhere, providing a secure,
“always-on” computing infrastructure
3. Resource pooling
v share resources among several clients, providing everyone
with a different set of services per their requirements
4. Elasticity
v resources can be rapidly and elastically scaled up or down,
based on the workload requirements & usage characteristics
5. Measured service
v metered for usage and charged for through pricing models;
service level agreements (SLAs) for quality of service 15
Cloud Computing: Service Models
16
One Trend: Serverless Computing
18
Successful Cases
q Clouds in Market
v Amazon: EC2 (Elastic Compute Cloud)
v Google: Gmail, Google Maps, Google Calendar, …
v Microsoft: Azure
v IBM: Blue Cloud
v Salesforce: Sales Cloud, Service Cloud, Custom Cloud
v Yahoo: Yahoo Cloud Computing
v Byte Dance: ByteHouse
v Alibaba: Aliyun,
v Baidu: Baiduyun
19
Roadmap
q General Concepts of Cloud Computing
v Cloud and cloud computing
v Service models
q Virtualization Technologies
v Virtual Machines
v Containers
q Container Orchestration
v Introduction to Kubernetes
20
Virtualization and Virtual Machines
q general concept
v an example
21
KVM and QEMU
q KVM
v a hypervisor for
Linux on the
“x86” hardware
v has a kernel
module kvm.ko
q QEMU
v a virtualizer and
machine emulator
v run in user space
22
Two problems of VM
q Cost Problem
v Each VM needs an OS
v Each OS has overhead
q Deployment Problem
v Apps need a development environment
• configurations
• other software components
• OS-dependent Bins/Libs
v Deploying an app to VM needs/is
• dependencies on the guest OS
• time consuming and error prone
23
Solution: Container
q Sharing a single OS
v Each container runs its own
isolated environment
v Each container is portable
24
Docker Architecture
q Docker registry
v Docker Hub
v Trusted Registry
q Docker includes v Private Registry
v Docker client v Local Registry
v Docker daemon
25
Dockerfile
q How to create Images?
26
Layered Architecture of Images
27
Docker Engine
q How to create a container runtime?
https://tarangsharma.hashnode.dev/docker-engine-architecture
28
Secrets of container runtime & image
29
q Open Standards on
v Image specification
v Runtime specification
v Distribution specification
https://opencontainers.org
30
Summary: Containers vs VMs
q Containers q Virtual Machines
v Run on execution engine v Run on hypervisor
v Share the host OS v Each VM runs own OS
v OS-level virtualization v HW-level virtualization
v Process-level isolation; v Fully isolated; more
less secure secure
Ø Lightweight Ø Heavyweight
Ø Startup in millisecs Ø Startup in minutes
Ø No memory isolation Ø Allocated memory
Ø Native performance Ø Limited performance
31
Roadmap
q General Concepts of Cloud Computing
v Cloud and cloud computing
v Service models
q Virtualization Technologies
v Virtual Machines
v Containers
q Container Orchestration
v Introduction to Kubernetes
32
Architectures for application development
33
Container Orchestration
36
Pros and Cons
https://blog.bytebytego.com/p/kubernetes-when-and-how-to-apply 37
Cloud Native Computing Foundation
https://www.cncf.io
Kubernetes Architecture
https://kubernetes.io/docs/concepts/architecture/
39
40
What is a Pod?
q A pod is a group of container(s)
41
Kubernetes Architecture
https://devopscube.com/kubernetes-architecture-explained/ 42
43
How can I try Kubernetes?
q Minikube
v https://minikube.sigs.k8s.io/docs/start/
q Kubernetes playgrounds
v https://labs.play-with-k8s.com
v https://killercoda.com/playgrounds/scenario/kubernetes
v https://labs.iximiuz.com/playgrounds?category=kubernetes
44
Kubectl Commands
q Check the cluster
$kubectl get nodes
$kubectl get componentstatuses
q Create/delete a pod (not recommended)
$kubectl run mypod --image=$user/$image
$kubectl delete mypod
q Check a pod
$kubectl describe pod mypod
q Remote access to a pod
$kubectl exec mypod –stdin –tty -- /bin/bash
45
Declarative Paradigm
q Create/update a pod
$kubectl apply –f mypod.yaml
q Delete a pod
$kubectl delete –f mypod.yaml
46
Docker vs Kubernetes
47