
[程序员口语][K8s]The Illustrated Children‘s Guide to Kubernetes
给孩子解释的K8s
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.
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:
-
sidled 偷偷摸摸的
-
Kubernetes 舵手,驾驭者
-
paraphrase 解释意思的
-
orchestration 编排,作曲
-
scheduling 调度
-
workloads 工作量,负荷
-
illustrated 阐明
-
associate with 与…为伍
-
whale 鲸鱼
-
shrugged 耸耸肩
-
despair 绝望
-
rafts 木筏
-
lashed 被绑起来的
-
greek 极客的
-
cybernetic 控制论的
-
gubernatorial 统治的
-
slap 拍(贴)
-
stability 稳定性
-
coupled 耦合
-
arbitrary 任意的
-
benevolently 仁慈的
-
sniffled 抽鼻子
-
a degree of isolation 一定程度的隔离
We need the environment have a degree of isolation.
-
grand 盛大的
Source https://www.youtube.com/watch?v=4ht22ReBjno
更多推荐
所有评论(0)