From 8a573f4ebce7b345b1b744bbf95f755c243fb5f3 Mon Sep 17 00:00:00 2001 From: Marcelo Giles Date: Mon, 18 Nov 2024 20:50:24 -0800 Subject: [PATCH] Add images css and alert boxes --- .../tutorials/kubernetes-basics/_index.md | 30 +++++------ .../create-cluster/cluster-intro.md | 21 ++++---- .../deploy-app/deploy-intro.md | 9 ++++ .../explore/explore-intro.md | 14 +++++- .../kubernetes-basics/expose/expose-intro.md | 6 ++- .../kubernetes-basics/scale/scale-intro.md | 34 ++++++------- .../kubernetes-basics/update/update-intro.md | 50 +++++++++---------- static/css/style_tutorials.css | 2 +- 8 files changed, 92 insertions(+), 74 deletions(-) diff --git a/content/en/docs/tutorials/kubernetes-basics/_index.md b/content/en/docs/tutorials/kubernetes-basics/_index.md index 86c2a94320..0885da9b50 100644 --- a/content/en/docs/tutorials/kubernetes-basics/_index.md +++ b/content/en/docs/tutorials/kubernetes-basics/_index.md @@ -35,41 +35,43 @@ container orchestration, combined with best-of-breed ideas from the community. ## Kubernetes Basics Modules - -
-
+ + + +
+ -
+ -
+ -
+ -
+ -
+ diff --git a/content/en/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro.md b/content/en/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro.md index cecce2310a..e11d89dcc6 100644 --- a/content/en/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro.md +++ b/content/en/docs/tutorials/kubernetes-basics/create-cluster/cluster-intro.md @@ -11,13 +11,11 @@ weight: 10 ## Kubernetes Clusters -
-
-

Kubernetes is a production-grade, open-source platform that orchestrates - the placement (scheduling) and execution of application containers - within and across computer clusters.

-
-
+{{% alert %}} +_Kubernetes is a production-grade, open-source platform that orchestrates +the placement (scheduling) and execution of application containers +within and across computer clusters._ +{{% /alert %}} **Kubernetes coordinates a highly available cluster of computers that are connected to work as a single unit.** The abstractions in Kubernetes allow you to deploy @@ -43,11 +41,10 @@ A Kubernetes cluster consists of two types of resources: coordinates all activities in your cluster, such as scheduling applications, maintaining applications' desired state, scaling applications, and rolling out new updates. -
-
-

Control Planes manage the cluster and the nodes that are used to host the running applications.

-
-
+{{% alert %}} +_Control Planes manage the cluster and the nodes that are used to host the running +applications._ +{{% /alert %}} **A node is a VM or a physical computer that serves as a worker machine in a Kubernetes cluster.** Each node has a Kubelet, which is an agent for managing the node and diff --git a/content/en/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.md b/content/en/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.md index dac7f28081..1a93ae5bac 100644 --- a/content/en/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.md +++ b/content/en/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.md @@ -10,6 +10,10 @@ weight: 10 ## Kubernetes Deployments +{{% alert %}} +_A Deployment is responsible for creating and updating instances of your application._ +{{% /alert %}} + {{< note >}} This tutorial uses a container that requires the AMD64 architecture. If you are using minikube on a computer with a different CPU architecture, you could try using minikube with @@ -36,6 +40,11 @@ provide a fundamentally different approach to application management. ## Deploying your first app on Kubernetes +{{% alert %}} +_Applications need to be packaged into one of the supported container formats in +order to be deployed on Kubernetes._ +{{% /alert %}} + {{< figure src="/docs/tutorials/kubernetes-basics/public/images/module_02_first_app.svg" class="diagram-medium" >}} You can create and manage a Deployment by using the Kubernetes command line interface, diff --git a/content/en/docs/tutorials/kubernetes-basics/explore/explore-intro.md b/content/en/docs/tutorials/kubernetes-basics/explore/explore-intro.md index 00e588b2c9..db8e94691a 100644 --- a/content/en/docs/tutorials/kubernetes-basics/explore/explore-intro.md +++ b/content/en/docs/tutorials/kubernetes-basics/explore/explore-intro.md @@ -11,6 +11,11 @@ weight: 10 ## Kubernetes Pods +{{% alert %}} +_A Pod is a group of one or more application containers (such as Docker) and includes +shared storage (volumes), IP address and information about how to run them._ +{{% /alert %}} + When you created a Deployment in [Module 2](/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro/), Kubernetes created a **Pod** to host your application instance. A Pod is a Kubernetes abstraction that represents a group of one or more application containers (such as Docker), @@ -39,6 +44,11 @@ the cluster. {{< figure src="/docs/tutorials/kubernetes-basics/public/images/module_03_pods.svg" class="diagram-medium" >}} +{{% alert %}} +_Containers should only be scheduled together in a single Pod if they are tightly +coupled and need to share resources such as disk._ +{{% /alert %}} + ## Nodes A Pod always runs on a **Node**. A Node is a worker machine in Kubernetes and may @@ -75,8 +85,8 @@ operations can be done with the following kubectl subcommands: You can use these commands to see when applications were deployed, what their current statuses are, where they are running and what their configurations are. -Now that we know more about our cluster components and the command line, let's explore -our application. +Now that we know more about our cluster components and the command line, let's +explore our application. ### Check application configuration diff --git a/content/en/docs/tutorials/kubernetes-basics/expose/expose-intro.md b/content/en/docs/tutorials/kubernetes-basics/expose/expose-intro.md index 060bf41b29..2c3dc45758 100644 --- a/content/en/docs/tutorials/kubernetes-basics/expose/expose-intro.md +++ b/content/en/docs/tutorials/kubernetes-basics/expose/expose-intro.md @@ -22,6 +22,11 @@ each Pod in a Kubernetes cluster has a unique IP address, even Pods on the same so there needs to be a way of automatically reconciling changes among Pods so that your applications continue to function. +{{% alert %}} +_A Kubernetes Service is an abstraction layer which defines a logical set of Pods and +enables external traffic exposure, load balancing and service discovery for those Pods._ +{{% /alert %}} + A [Service](/docs/concepts/services-networking/service/) in Kubernetes is an abstraction which defines a logical set of Pods and a policy by which to access them. Services enable a loose coupling between dependent Pods. A Service is defined using YAML or JSON, @@ -146,7 +151,6 @@ Then use the given URL to access the app: ```shell curl 127.0.0.1:51082 ``` - {{< /note >}} And we get a response from the server. The Service is exposed. diff --git a/content/en/docs/tutorials/kubernetes-basics/scale/scale-intro.md b/content/en/docs/tutorials/kubernetes-basics/scale/scale-intro.md index 209308c320..2b2f5b65b6 100644 --- a/content/en/docs/tutorials/kubernetes-basics/scale/scale-intro.md +++ b/content/en/docs/tutorials/kubernetes-basics/scale/scale-intro.md @@ -9,6 +9,11 @@ weight: 10 ## Scaling an application +{{% alert %}} +_You can create from the start a Deployment with multiple instances using the --replicas +parameter for the kubectl create deployment command._ +{{% /alert %}} + Previously we created a [Deployment](/docs/concepts/workloads/controllers/deployment/), and then exposed it publicly via a [Service](/docs/concepts/services-networking/service/). The Deployment created only one Pod for running our application. When traffic increases, @@ -34,7 +39,6 @@ with its `type` set to `LoadBalancer`: ```shell kubectl expose deployment/kubernetes-bootcamp --type="LoadBalancer" --port 8080 ``` - {{< /note >}} ## Scaling overview @@ -42,27 +46,21 @@ kubectl expose deployment/kubernetes-bootcamp --type="LoadBalancer" --port 8080
+{{% alert %}} +_Scaling is accomplished by changing the number of replicas in a Deployment._ +{{% /alert %}} + Scaling out a Deployment will ensure new Pods are created and scheduled to Nodes with available resources. Scaling will increase the number of Pods to the new desired state. Kubernetes also supports [autoscaling](/docs/tasks/run-application/horizontal-pod-autoscale/) diff --git a/content/en/docs/tutorials/kubernetes-basics/update/update-intro.md b/content/en/docs/tutorials/kubernetes-basics/update/update-intro.md index 3b94f8c9a5..4ac55d9387 100644 --- a/content/en/docs/tutorials/kubernetes-basics/update/update-intro.md +++ b/content/en/docs/tutorials/kubernetes-basics/update/update-intro.md @@ -9,6 +9,11 @@ Perform a rolling update using kubectl. ## Updating an application +{{% alert %}} +_Rolling updates allow Deployments' update to take place with zero downtime by +incrementally updating Pods instances with new ones._ +{{% /alert %}} + Users expect applications to be available all the time, and developers are expected to deploy new versions of them several times a day. In Kubernetes this is done with rolling updates. A **rolling update** allows a Deployment update to take place with @@ -28,35 +33,28 @@ versioned and any Deployment update can be reverted to a previous (stable) versi
+{{% alert %}} +_If a Deployment is exposed publicly, the Service will load-balance the traffic +only to available Pods during the update._ +{{% /alert %}} + Similar to application Scaling, if a Deployment is exposed publicly, the Service will load-balance the traffic only to available Pods during the update. An available Pod is an instance that is available to the users of the application. @@ -206,7 +204,7 @@ kubectl describe pods The Deployment is once again using a stable version of the app (`v2`). The rollback was successful. -Remember to clean up your local cluster +Remember to clean up your local cluster. ```shell kubectl delete deployments/kubernetes-bootcamp services/kubernetes-bootcamp diff --git a/static/css/style_tutorials.css b/static/css/style_tutorials.css index 199e403e11..278e378383 100644 --- a/static/css/style_tutorials.css +++ b/static/css/style_tutorials.css @@ -1,4 +1,4 @@ -/* styles for kubernetes-basics tutorials */ +/* kubernetes-basics tutorials */ .tutorials-modules { display: flex; flex-wrap: wrap;