Daily Exercise 001: How-Kubernetes-Works

Day 1 Script

Kubernetes is fundamentally about taking a bunch of virtual or physical machines and transforming them into a unified API surface. This allows developers to interact with containers and orchestrate their applications without thinking about the underlying machines. We often abbreviate Kubernetes as k8s because there are eight letters between the K and the S. The Kubernetes API presents several core pieces, including pods, services, and deployments. A pod is a collection of containers co-located on a single machine. A service acts as a load balancer to bring traffic to a collection of pods. Finally, a deployment uses a replica set to replicate a container multiple times for better availability and scale. Users generally interact with this JSON based API through the kube control command line tool or other similar tools.

Day 1 Translate

Japanese English
Kubernetesは、根本的には、開発者に可能にします、たくさんの仮想または物理マシンを統一されたAPIサーフェスへと変換することを Kubernetes fundamentally enables developers to transform a bunch of virtual or physical machines into a unified API surface.
これは許します、開発者がコンテナとやり取りし、基盤となるマシンを意識せずにアプリケーションをオーケストレートすることを This allows developers to interact with containers and orchestrate their applications without thinking about the underlying machines.
私たちはしばしばKubernetesをk8sと略します、なぜならKとSの間に8つの文字があるからです We often abbreviate Kubernetes as k8s because there are eight letters between the K and the S.
Kubernetes APIはいくつかの核心となる部品を提示します、ポッド、サービス、およびデプロイメントを含む The Kubernetes API presents several core pieces, including pods, services, and deployments.
ポッドは、単一のマシン上に共同配置されたコンテナの集まりです A pod is a collection of containers co-located on a single machine.
ユーザーは通常、このJSONベースのAPIとやり取りします、kube controlコマンドラインツールや他の同様のツールを通じて Users generally interact with this JSON based API through the kube control command line tool or other similar tools.

Day 2 Script

Let's look at how we put these pieces together to build a real application. Suppose I have a simple web app packaged as a container image. To run this application on the Kubernetes API, I need to create pods. I do this by creating a deployment, which is typically represented as a YAML file. For example, I might create a file named deploy yaml and use the kube control apply command to send it to the API server. If I specify three replicas in that file, the API server will create three pods. The scheduler then places these three containers onto the virtual machines that act as hosts for the service. This is just the beginning, as the deployment object manages and ensures that the requested number of replicas is always running.

Day 2 Translate

Japanese English
これらの要素をどのように組み合わせて実際のアプリケーションを構築するか見てみましょう Let's look at how we put these pieces together to build a real application.
コンテナイメージとしてパッケージ化されたシンプルなウェブアプリがあると仮定しましょう Suppose I have a simple web app packaged as a container image.
このアプリケーションをKubernetes API上で実行するために、私はポッドを作成する必要があります To run this application on the Kubernetes API, I need to create pods.
私はこれを行います、デプロイメントを作成することによって、それは通常YAMLファイルとして表現されます I do this by creating a deployment, which is typically represented as a YAML file.
もしそのファイルで3つのレプリカを指定すれば、APIサーバーは3つのポッドを作成します If I specify three replicas in that file, the API server will create three pods.
デプロイメントオブジェクトは管理し、保証します、要求された数のレプリカが常に実行されていることを The deployment object manages and ensures that the requested number of replicas is always running.

Day 3 Script

Once the application is up and running, I need to expose it so that users can consume it. To do this, I create a service. A service is a load balancer that knows how to take traffic from the outside world or from another service inside the cluster. It then load balances that traffic down to the containers. If I want, I can attach this service to an external load balancer. When I do this, Kubernetes is responsible for talking to the cloud and requesting that a load balancer be created. This process generates an IP address that is mapped to the cloud load balancer. This IP address is then connected to the service and all of its associated traffic.

Day 3 Translate

Japanese English
ひとたびアプリケーションが起動して動き始めると、ユーザーがそれを利用できるように公開する必要があります Once the application is up and running, I need to expose it so that users can consume it.
サービスはロードバランサーです、外部の世界やクラスター内の他のサービスからのトラフィックを受け取る方法を知っている A service is a load balancer that knows how to take traffic from the outside world or from another service inside the cluster.
それはその後、そのトラフィックをコンテナに負荷分散します It then load balances that traffic down to the containers.
もし望むなら、私はこのサービスを外部ロードバランサーにアタッチできます If I want, I can attach this service to an external load balancer.
Kubernetesは責任を負います、クラウドと対話し、ロードバランサーが作成されるよう要求することに Kubernetes is responsible for talking to the cloud and requesting that a load balancer be created.
このプロセスは、クラウドロードバランサーにマッピングされたIPアドレスを生成します This process generates an IP address that is mapped to the cloud load balancer.

Day 4 Script

When an end user accesses the application, they talk to the external IP address. The traffic flows through the cloud load balancer to the service, which then distributes it to all the containers. This setup highlights the declarative and self healing nature of Kubernetes. For example, if I change the number of replicas in the deployment from three to four, Kubernetes will notice the discrepancy. It will realize only three replicas exist and automatically create a fourth one. Traffic will then start flowing from the load balancer to this new replica. The end user does not even notice that the application has been scaled up. This reliability is one of the main reasons why Kubernetes is so effective for modern applications.

Day 4 Translate

Japanese English
エンドユーザーがアプリケーションにアクセスするとき、彼らは外部IPアドレスと話します When an end user accesses the application, they talk to the external IP address.
トラフィックはクラウドロードバランサーを介してサービスに流れ、サービスはそれをすべてのコンテナに分配します The traffic flows through the cloud load balancer to the service, which then distributes it to all the containers.
この構成は強調しています、Kubernetesの宣言的で自己修復的な性質を This setup highlights the declarative and self healing nature of Kubernetes.
例えば、もしデプロイメントのレプリカ数を3から4に変更すれば、Kubernetesはその不一致に気づきます For example, if I change the number of replicas in the deployment from three to four, Kubernetes will notice the discrepancy.
それは3つのレプリカしか存在しないことを認識し、自動的に4つ目を作成します It will realize only three replicas exist and automatically create a fourth one.
エンドユーザーは、アプリケーションがスケールアップされたことにさえ気づきません The end user does not even notice that the application has been scaled up.

Day 5 Script

Kubernetes provides a great way to deploy reliable and scalable applications without affecting end users. In addition to scaling, you can also perform a rolling deployment. This allows you to move from version one of your container to version two in place. During this process, the end user will not notice any interruption at all. The system manages the transition smoothly by replacing old containers with new ones gradually. This ensures that the application remains available throughout the update process. We will dive deeper into the technical details of how rolling deployments work in the next episode. For now, it is important to understand how these core components work together to provide a seamless experience for both developers and users.

Day 5 Translate

Japanese English
Kubernetesはすごい方法を提供します、信頼性が高くスケーラブルなアプリケーションをデプロイするための、エンドユーザーに影響を与えずに Kubernetes provides a great way to deploy reliable and scalable applications without affecting end users.
スケーリングに加えて、ローリングデプロイメントを実行することもできます In addition to scaling, you can also perform a rolling deployment.
これは可能にします、コンテナのバージョン1からバージョン2へその場で移行することを This allows you to move from version one of your container to version two in place.
このプロセス中、エンドユーザーはいかなる中断にも全く気づきません During this process, the end user will not notice any interruption at all.
システムは移行をスムーズに管理します、古いコンテナを徐々に新しいものに置き換えることによって The system manages the transition smoothly by replacing old containers with new ones gradually.
これは保証します、更新プロセスを通じてアプリケーションが利用可能なままであることを This ensures that the application remains available throughout the update process.