From 7adb4352fe4954f5a8d4b47b89ca7f301e691c3d Mon Sep 17 00:00:00 2001 From: Dmitry Shurupov Date: Fri, 11 Aug 2023 21:05:11 +0700 Subject: [PATCH] Tiny fixes for deploy & scale tutorials --- .../deploy-app/deploy-intro.html | 20 +++++++++---------- .../kubernetes-basics/scale/scale-intro.html | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/content/en/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.html b/content/en/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.html index dfc4bf31e2..764c785d7a 100644 --- a/content/en/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.html +++ b/content/en/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro.html @@ -37,7 +37,7 @@ description: |-

Once the application instances are created, a Kubernetes Deployment controller continuously monitors those instances. If the Node hosting an instance goes down or is deleted, the Deployment controller replaces the instance with an instance on another Node in the cluster. This provides a self-healing mechanism to address machine failure or maintenance.

-

In a pre-orchestration world, installation scripts would often be used to start applications, but they did not allow recovery from machine failure. By both creating your application instances and keeping them running across Nodes, Kubernetes Deployments provide a fundamentally different approach to application management.

+

In a pre-orchestration world, installation scripts would often be used to start applications, but they did not allow recovery from machine failure. By both creating your application instances and keeping them running across Nodes, Kubernetes Deployments provide a fundamentally different approach to application management.

@@ -74,7 +74,7 @@ description: |-
-

You can create and manage a Deployment by using the Kubernetes command line interface, kubectl. Kubectl uses the Kubernetes API to interact with the cluster. In this module, you'll learn the most common Kubectl commands needed to create Deployments that run your applications on a Kubernetes cluster.

+

You can create and manage a Deployment by using the Kubernetes command line interface, kubectl. Kubectl uses the Kubernetes API to interact with the cluster. In this module, you'll learn the most common kubectl commands needed to create Deployments that run your applications on a Kubernetes cluster.

When you create a Deployment, you'll need to specify the container image for your application and the number of replicas that you want to run. You can change that information later by updating your Deployment; Modules 5 and 6 of the bootcamp discuss how you can scale and update your Deployments.

@@ -103,7 +103,7 @@ description: |-

kubectl basics

The common format of a kubectl command is: kubectl action resource

-

This performs the specified action (like create, describe or delete) on the specified resource (like node or deployment). You can use --help after the subcommand to get additional info about possible parameters (for example: kubectl get nodes --help).

+

This performs the specified action (like create, describe or delete) on the specified resource (like node or deployment). You can use --help after the subcommand to get additional info about possible parameters (for example: kubectl get nodes --help).

Check that kubectl is configured to talk to your cluster, by running the kubectl version command.

Check that kubectl is installed and you can see both the client and the server versions.

To view the nodes in the cluster, run the kubectl get nodes command.

@@ -114,7 +114,7 @@ description: |-

Deploy an app

-

Let’s deploy our first app on Kubernetes with the kubectl create deployment command. We need to provide the deployment name and app image location (include the full repository url for images hosted outside Docker hub).

+

Let’s deploy our first app on Kubernetes with the kubectl create deployment command. We need to provide the deployment name and app image location (include the full repository url for images hosted outside Docker Hub).

kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1

Great! You just deployed your first application by creating a deployment. This performed a few things for you:

    @@ -131,23 +131,23 @@ description: |-

    View the app

    Pods that are running inside Kubernetes are running on a private, isolated network. - By default they are visible from other pods and services within the same kubernetes cluster, but not outside that network. + By default they are visible from other pods and services within the same Kubernetes cluster, but not outside that network. When we use kubectl, we're interacting through an API endpoint to communicate with our application.

    -

    We will cover other options on how to expose your application outside the kubernetes cluster in Module 4.

    -

    The kubectl command can create a proxy that will forward communications into the cluster-wide, private network. The proxy can be terminated by pressing control-C and won't show any output while its running.

    +

    We will cover other options on how to expose your application outside the Kubernetes cluster later, in Module 4.

    +

    The kubectl proxy command can create a proxy that will forward communications into the cluster-wide, private network. The proxy can be terminated by pressing control-C and won't show any output while its running.

    You need to open a second terminal window to run the proxy.

    kubectl proxy -

    We now have a connection between our host (the online terminal) and the Kubernetes cluster. The proxy enables direct access to the API from these terminals.

    +

    We now have a connection between our host (the terminal) and the Kubernetes cluster. The proxy enables direct access to the API from these terminals.

    You can see all those APIs hosted through the proxy endpoint. For example, we can query the version directly through the API using the curl command:

    curl http://localhost:8001/version

    - +

    The API server will automatically create an endpoint for each pod, based on the pod name, that is also accessible through the proxy.

    First we need to get the Pod name, and we'll store in the environment variable POD_NAME:

    export POD_NAME=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}')
    echo Name of the Pod: $POD_NAME

    You can access the Pod through the proxied API, by running:

    curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/

    -

    In order for the new Deployment to be accessible without using the proxy, a Service is required which will be explained in the next modules.

    +

    In order for the new Deployment to be accessible without using the proxy, a Service is required which will be explained in Module 4.

diff --git a/content/en/docs/tutorials/kubernetes-basics/scale/scale-intro.html b/content/en/docs/tutorials/kubernetes-basics/scale/scale-intro.html index 7341cb0ab0..52ca1cced6 100644 --- a/content/en/docs/tutorials/kubernetes-basics/scale/scale-intro.html +++ b/content/en/docs/tutorials/kubernetes-basics/scale/scale-intro.html @@ -103,14 +103,14 @@ description: |-
-

Once you have multiple instances of an application running, you would be able to do Rolling updates without downtime. We'll cover that in the next section of the tutorial. Now, let's go to the online terminal and scale our application.

+

Once you have multiple instances of an application running, you would be able to do Rolling updates without downtime. We'll cover that in the next section of the tutorial. Now, let's go to the terminal and scale our application.

-

Scaling a deployment

-

To list your deployments use the get deployments subcommand: +

Scaling a Deployment

+

To list your Deployments use the get deployments subcommand: kubectl get deployments

The output should be similar to:

@@ -133,7 +133,7 @@ description: |-
                
  • DESIRED displays the desired number of replicas of the application, which you define when you create the Deployment. This is the desired state.
  • CURRENT displays how many replicas are currently running.
  • -

    Next, let’s scale the Deployment to 4 replicas. We’ll use the kubectl scale command, followed by the deployment type, name and desired number of instances:

    +

    Next, let’s scale the Deployment to 4 replicas. We’ll use the kubectl scale command, followed by the Deployment type, name and desired number of instances:

    kubectl scale deployments/kubernetes-bootcamp --replicas=4

    To list your Deployments once again, use get deployments:

    kubectl get deployments