[程序员口语][K8s]The Illustrated Children‘s Guide to Kubernetes

The Illustrated Children’s Guide to Kubernetes

The other day my daughter sidled into my office and asked me, “dearest father”, whose knowledge is incomparable, “what is Kubernetes”?

Right, that’s a little bit of a paraphrase but you get the idea, and I responded, "Kubernetes is an open source orchestration

system for docker containers.It handles scheduling onto nodes in a compute cluster and actively manages workloads to

ensure that their state matches the user’s declared intensions. Using the concept of labels and pods, it groups the containers which make up an application into logical units for easy management and discovery"

And my daughter said to me huh…

And so I give you the illustrated children’s guide to kubernetes

Once upon a time, there was an app named fibby and she was a simple app, She was written in PHP and had just one page

在这里插入图片描述

She lived on a hosting provider and she shared her environment with scary other apps that she didn’t know and didn’t care to associate with.

She hope she have her own environment just her and a web server she could call home.

An app has an environment that is relies upon to run. for a PHP app that environment might include a web server, a readable file system and the PHP engine itself.

One day, a kindly whale came along, he suggested that little fibby might be happier living in a container and so the app moved.
在这里插入图片描述
The container was nice but it was a little bit like having a fancy living room floating in the middle of the ocean.

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-RbGpzHn4-1643023877015)(/Users/fengyiling/Library/Application Support/typora-user-images/image-20220124191726455.png)]
A container provides an isolated context in which an app together with its environment can run.

But those isolated containers often need to be managed and connected to the external world, shared the file systems, networking, scheduling, load balancing and distribution are all challenges.

The whale shrugged his shoulders, “sorry kid”, he said and disappeared beneath the ocean’s surface, but before fibby could even begin to despair a captain appeared on the horizon piloting a gigantic ship

在这里插入图片描述
The ship was made of dozens of rafts all lashed together but from the outside it looked like one giant boat, “hello, there friend PHP app, my name is captain kuby”, said the wise old captain.

Kubernetes is the greek word for a ship captain. we get the word cybernetic and gubernatorial from it.

Led by google the Kubernetes project focuses on building a robust platform for running thousands of containers in production.
在这里插入图片描述

“I am fibby”, said the little app. “Nice to make your acquaintance”, said the captain as he slapped a nametag on her.

Kubernetes uses lables as name tags to identify things and it can query based on these labels.

Labels are open-ended you can use them to indicated roles stability or other important attributes.
在这里插入图片描述
Captain kuby suggested that the app might like to move her container into a pod aboard the ship

Fibby happily moved to kube’s giant boat and it felt like home
在这里插入图片描述
In kubernetes, a pod represents a runnable unit of work usually you run a single container inside of a pod, but for cases where a few containers are tightly coupled you may opt to run more than one container inside the same pod.

Kubernetes takes on the work of connecting your pod to the network and the rest of the kubernetes ecosystem.
在这里插入图片描述

Fibby had some unusual interests she was really into genetics and sheep

So she asked the captain, “um, what if I want to clone myself on-demand, any number of times?”

“Well, that’s easy”, said the captain and he introduced her to the replication controllers.

Replication controllers provide a method for managing and arbitrary number of pods

a replication controller contains a pod template which can be replicated any number of times

Through the replication controller, kubernetes will manage your pod’s life cycle including scaling up and down, rolling deployments and monitoring.

For many days and nights, the little app was happy with her pod and happy with her replicas.
在这里插入图片描述
but only have yourself for company is not all the cracked up(Not sure) to be, even if it is and copies of yourself.

Captain kuby smiled benevolently, “I have just the thing”, he said, no sooner had he spoken that a tunnel opened between fibbers replication controller and the rest of the ship with a hearty laugh captain kuby said, “even when your clones come and go, this tunnel will stay here, so you can discover other pods and they can discover you”.
在这里插入图片描述

A service tells the rest of kubernetes in environment including other pods and replication controllers what services your application provides.

While pods may come and go, the IP address and ports of your service remain the same, and other applications can find your service through kubernetes as service discovery

Thanks to the services fibby began to explore the rest of the ship. It was long before fibby met Goldie and they became the best of friends.
在这里插入图片描述

One day, Goldie did something extraordinary, She gave fibby a present, fibby took one look and the saddest of sad tears escaped her eyes.

‘why are you so sad?’ asked goldie.

“Oh, I love the present but have nowhere to put it”, Sniffled fibby but goldie knew what to do

“why not put it in a volume?”.
在这里插入图片描述
A volume represents a location where containers can access and store information for the application.

The volume appears as part of the local file system but volumes may be backed by local storage, SEF, cluster, elastic blob storage and the number of other storage backends.

Fibby loved life aboard captain kuby’s ship and she enjoyed the company of her new friends

Every replicated pod of Goldie was equally delightful.
在这里插入图片描述
But as she thought back to her days on the scary hosted provide she began to wonder if perhaps she could also have a little privacy.

“Sounds like what you need”, said captain kuby, “is a name space.”
在这里插入图片描述

a namespace function is grouping mechanism inside the kubernetes.

Services, pods, replication controllers and volumes can easily cooperate within a namespace, but a namespace provides a degree of isolation from the other parts of the cluster.
在这里插入图片描述
Together with her new friends, fibby sailed the seas on captain kuby’s great boat.

She had many grand adventures but most importantly fibby have found her home, and so fibby lived happily ever after

the end!

Reference:

  1. sidled 偷偷摸摸的

  2. Kubernetes 舵手,驾驭者

  3. paraphrase 解释意思的

  4. orchestration 编排,作曲

  5. scheduling 调度

  6. workloads 工作量,负荷

  7. illustrated 阐明

  8. associate with 与…为伍

  9. whale 鲸鱼

  10. shrugged 耸耸肩

  11. despair 绝望

  12. rafts 木筏

  13. lashed 被绑起来的

  14. greek 极客的

  15. cybernetic 控制论的

  16. gubernatorial 统治的

  17. slap 拍(贴)

  18. stability 稳定性

  19. coupled 耦合

  20. arbitrary 任意的

  21. benevolently 仁慈的

  22. sniffled 抽鼻子

  23. a degree of isolation 一定程度的隔离

    We need the environment have a degree of isolation.

  24. grand 盛大的

Source https://www.youtube.com/watch?v=4ht22ReBjno

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值