Kubernetes architecture
-
Upload
janakiram-msv -
Category
Technology
-
view
322 -
download
0
Transcript of Kubernetes architecture
![Page 1: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/1.jpg)
Kubernetes ArchitectureJanakiram MSVAnalyst | Advisor | ArchitectJanakiram & AssociatesGoogle Developer Expert
![Page 2: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/2.jpg)
Announcing The Kubernetes Webinar Series
● Monthly webinar focused on helping you get started with Kubernetes● Delivered by the experts from the container ecosystem● Each webinar introduces a concept to accelerate your learning● No specific prerequisites
○ Basic understanding of Docker will help
● All attendees will get $100 Google Cloud Platform Credits● Win free annual and monthly subscriptions of MAPT eBook library● The recording of this webinar will be available at Kubernetes.live
![Page 3: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/3.jpg)
Objectives
● A closer look at Kubernetes cluster● Master components● Node components● Pods● Labels & Selectors● Replication Controllers● Services
![Page 4: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/4.jpg)
Kubernetes Architecture
KubernetesMaster
Node 1API
UI
CLI
Node 2
Node n
Node 3
Registry
![Page 5: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/5.jpg)
Kubernetes Master
API Server Scheduler Controller
etcd
API
UI
CLI
![Page 6: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/6.jpg)
Kubernetes Node
kube-proxyDocker kubelet
Supervisord
fluentd
PodPodPod
PodPod
Pod
Pod
Pod
KubernetesMaster
AddonsDNS UI
![Page 7: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/7.jpg)
A Simple Containerized Application
PythonWeb App
Redis Database
Client
![Page 8: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/8.jpg)
Kubernetes Pod
● Group of one or more containers that are always co-located, co-scheduled, and run in a shared context
● Containers in the same pod have the same hostname● Each pod is isolated by
○ Process ID (PID) namespace○ Network namespace○ Interprocess Communication (IPC) namespace○ Unix Time Sharing (UTS) namespace
● Alternative to a VM with multiple processes
![Page 9: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/9.jpg)
Labels & Selectors
● Key/value pairs associated with Kubernetes objects● Used to organize and select subsets of objects● Attached to objects at creation time but modified at any time.● Labels are the essential glue to associate one API object with other
○ Replication Controller -> Pods○ Service -> Pods○ Pods -> Nodes
![Page 10: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/10.jpg)
Deploying a Pod
Pod DefinitionMaster
kube-proxyDocker kubelet
Supervisord
fluentdWeb Pod
Node
DB Pod
Pod Definition
Python
Redis
![Page 11: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/11.jpg)
Services
● An abstraction to define a logical set of Pods bound by a policy by to access them
● Services are exposed through internal and external endpoints ● Services can also point to non-Kubernetes endpoints through a
Virtual-IP-Bridge● Supports TCP and UDP● Interfaces with kube-proxy to manipulate iptables● Service can be exposed internal or external to the cluster
![Page 12: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/12.jpg)
Exposing Services
DB PodWebPod
2
WebPod
1
WebPod
3
ClientNode Port
ClusterIP
![Page 13: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/13.jpg)
DemoCreating Pods & Services
Python Web App & Redis DB
![Page 14: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/14.jpg)
Replication Controller
● Ensures that a Pod or homogeneous set of Pods are always up and available
● Always maintains desired number of Pods○ If there are excess Pods, they get killed○ New pods are launched when they fail, get deleted, or terminated
● Creating a replication controller with a count of 1 ensures that a Pod is always available
● Replication Controller and Pods are associated through Labels
![Page 15: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/15.jpg)
kube-proxyDocker kubelet
Supervisord
fluentd
WebPod
1
Scaling Pods with Replication Controller
RC Definition
Master
Node
Web Pod
2
WebPod
3
3
DB Pod
![Page 16: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/16.jpg)
DemoScaling Pods with Replication Controller
![Page 17: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/17.jpg)
Summary
● Kubernetes Master runs the API, Scheduler and Controller services● Each Node is responsible for running one or more Pods● Pods are the unit of deployment in Kubernetes● Labels associate one Kubernetes object with the other ● Replication Controller ensures high availability of Pods● Services expose Pods to internal and external consumers
![Page 18: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/18.jpg)
Upcoming WebinarA Closer Look at Kubernetes Pods9 AM PST, 26th October
This session will discuss the best practices of creating, deploying, and managing Pods. We will take a closer look at the storage and networking architecture of containers running in the same Pod.
Register at kubernetes.live for the upcoming webinars
![Page 19: Kubernetes architecture](https://reader036.fdocuments.net/reader036/viewer/2022092623/587585dc1a28ab901c8b4bbf/html5/thumbnails/19.jpg)
Thank You!Send your Feedback / Questions / Comments [email protected]