Reduce heading levels by 1.
This commit is contained in:
@@ -19,7 +19,7 @@ in a Kubernetes Pod.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Assigning CPU and RAM resources to a container
|
||||
## Assigning CPU and RAM resources to a container
|
||||
|
||||
When you create a Pod, you can request CPU and RAM resources for the containers
|
||||
that run in the Pod. You can also set limits for CPU and RAM resources. To
|
||||
@@ -64,7 +64,7 @@ for the `Pod`:
|
||||
cpu: 250m
|
||||
memory: 64Mi
|
||||
|
||||
### Understanding CPU and RAM units
|
||||
## Understanding CPU and RAM units
|
||||
|
||||
The CPU resource is measured in *cpu*s. Fractional values are allowed. You can
|
||||
use the suffix *m* to mean mili. For example 100m cpu is 100 milicpu, and is
|
||||
@@ -89,7 +89,7 @@ If you specify a request, a Pod is guaranteed to be able to use that much
|
||||
of the resource. See
|
||||
[Resource QoS](https://github.com/kubernetes/kubernetes/blob/{{page.githubbranch}}/docs/design/resource-qos.md) for the difference between resource limits and requests.
|
||||
|
||||
### If you don't specify limits or requests
|
||||
## If you don't specify limits or requests
|
||||
|
||||
If you don't specify a RAM limit, Kubernetes places no upper bound on the
|
||||
amount of RAM a Container can use. A Container could use all the RAM
|
||||
|
||||
@@ -21,7 +21,7 @@ Container is terminated.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Defining postStart and preStop handlers
|
||||
## Defining postStart and preStop handlers
|
||||
|
||||
In this exercise, you create a Pod that has one Container. The Container has handlers
|
||||
for the postStart and preStop events.
|
||||
@@ -60,7 +60,7 @@ The output shows the text written by the postStart handler:
|
||||
|
||||
{% capture discussion %}
|
||||
|
||||
### Discussion
|
||||
## Discussion
|
||||
|
||||
Kubernetes sends the postStart event immediately after the Container is created.
|
||||
There is no guarantee, however, that the postStart handler is called before
|
||||
@@ -83,7 +83,7 @@ unless the Pod's grace period expires. For more details, see
|
||||
* Learn more about the [lifecycle of a Pod](https://kubernetes.io/docs/user-guide/pod-states/).
|
||||
|
||||
|
||||
#### Reference
|
||||
### Reference
|
||||
|
||||
* [Lifecycle](https://kubernetes.io/docs/resources-reference/1_5/#lifecycle-v1)
|
||||
* [Container](https://kubernetes.io/docs/resources-reference/1_5/#container-v1)
|
||||
|
||||
@@ -19,7 +19,7 @@ in the same Pod.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Creating a Pod that runs two Containers
|
||||
## Creating a Pod that runs two Containers
|
||||
|
||||
In this exercise, you create a Pod that runs two Containers. The two containers
|
||||
share a Volume that they can use to communicate. Here is the configuration file
|
||||
@@ -111,7 +111,7 @@ The output shows that nginx serves a web page written by the debian container:
|
||||
|
||||
{% capture discussion %}
|
||||
|
||||
### Discussion
|
||||
## Discussion
|
||||
|
||||
The primary reason that Pods can have multiple containers is to support
|
||||
helper applications that assist a primary application. Typical examples of
|
||||
|
||||
@@ -30,7 +30,7 @@ When a Pod is not ready, it is removed from Service load balancers.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Defining a liveness command
|
||||
## Defining a liveness command
|
||||
|
||||
Many applications running for long periods of time eventually transition to
|
||||
broken states, and cannot recover except by being restarted. Kubernetes provides
|
||||
@@ -117,7 +117,7 @@ NAME READY STATUS RESTARTS AGE
|
||||
liveness-exec 1/1 Running 1 1m
|
||||
```
|
||||
|
||||
### Defining a liveness HTTP request
|
||||
## Defining a liveness HTTP request
|
||||
|
||||
Another kind of liveness probe uses an HTTP GET request. Here is the configuration
|
||||
file for a Pod that runs a container based on the `gcr.io/google_containers/liveness`
|
||||
@@ -173,7 +173,7 @@ the Container has been restarted:
|
||||
kubectl describe pod liveness-http
|
||||
```
|
||||
|
||||
### Using a named port
|
||||
## Using a named port
|
||||
|
||||
You can use a named
|
||||
[ContainerPort](/docs/api-reference/v1/definitions/#_v1_containerport)
|
||||
@@ -191,7 +191,7 @@ livenessProbe:
|
||||
port: liveness-port
|
||||
```
|
||||
|
||||
### Defining readiness probes
|
||||
## Defining readiness probes
|
||||
|
||||
Sometimes, applications are temporarily unable to serve traffic.
|
||||
For example, an application might need to load large data or configuration
|
||||
@@ -219,7 +219,7 @@ readinessProbe:
|
||||
|
||||
{% capture discussion %}
|
||||
|
||||
### Discussion
|
||||
## Discussion
|
||||
|
||||
{% comment %}
|
||||
Eventually, some of this Discussion section could be moved to a concept topic.
|
||||
@@ -260,7 +260,7 @@ In addition to command probes and HTTP probes, Kubenetes supports
|
||||
* Learn more about
|
||||
[Health Checking section](/docs/user-guide/walkthrough/k8s201/#health-checking).
|
||||
|
||||
#### Reference
|
||||
### Reference
|
||||
|
||||
* [Pod](http://kubernetes.io/docs/api-reference/v1/definitions#_v1_pod)
|
||||
* [Container](/docs/api-reference/v1/definitions/#_v1_container)
|
||||
|
||||
@@ -16,7 +16,7 @@ application Container runs.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Creating a Pod that has an init Container
|
||||
## Creating a Pod that has an init Container
|
||||
|
||||
In this exercise you create a Pod that has one application Container and one
|
||||
init Container. The init Container runs to completion before the application
|
||||
|
||||
@@ -23,7 +23,7 @@ key-value cache and store.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Configuring a volume for a Pod
|
||||
## Configuring a volume for a Pod
|
||||
|
||||
In this exercise, you create a Pod that runs one Container. This Pod has a
|
||||
Volume of type
|
||||
|
||||
@@ -19,7 +19,7 @@ in a Kubernetes Pod.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Defining a command and arguments when you create a Pod
|
||||
## Defining a command and arguments when you create a Pod
|
||||
|
||||
When you create a Pod, you can define a command and arguments for the
|
||||
containers that run in the Pod. To define a command, include the `command`
|
||||
@@ -60,7 +60,7 @@ from the Pod:
|
||||
command-demo
|
||||
tcp://10.3.240.1:443
|
||||
|
||||
### Using environment variables to define arguments
|
||||
## Using environment variables to define arguments
|
||||
|
||||
In the preceding example, you defined the arguments directly by
|
||||
providing strings. As an alternative to providing strings directly,
|
||||
@@ -81,7 +81,7 @@ and
|
||||
NOTE: The environment variable appears in parentheses, `"$(VAR)"`. This is
|
||||
required for the variable to be expanded in the `command` or `args` field.
|
||||
|
||||
### Running a command in a shell
|
||||
## Running a command in a shell
|
||||
|
||||
In some cases, you need your command to run in a shell. For example, your
|
||||
command might consist of several commands piped together, or it might be a shell
|
||||
|
||||
@@ -19,7 +19,7 @@ in a Kubernetes Pod.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Defining an environment variable for a container
|
||||
## Defining an environment variable for a container
|
||||
|
||||
When you create a Pod, you can set environment variables for the containers
|
||||
that run in the Pod. To set environment variables, include the `env` field in
|
||||
|
||||
@@ -15,7 +15,7 @@ encryption keys, into Pods.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Converting your secret data to a base-64 representation
|
||||
## Converting your secret data to a base-64 representation
|
||||
|
||||
Suppose you want to have two pieces of secret data: a username `my-app` and a password
|
||||
`39528$vdg7Jb`. First, use [Base64 encoding](https://www.base64encode.org/) to
|
||||
@@ -28,7 +28,7 @@ example:
|
||||
The output shows that the base-64 representation of your username is `bXktYXBwCg==`,
|
||||
and the base-64 representation of your password is `Mzk1MjgkdmRnN0piCg==`.
|
||||
|
||||
### Creating a Secret
|
||||
## Creating a Secret
|
||||
|
||||
Here is a configuration file you can use to create a Secret that holds your
|
||||
username and password:
|
||||
@@ -72,7 +72,7 @@ username and password:
|
||||
password: 13 bytes
|
||||
username: 7 bytes
|
||||
|
||||
### Creating a Pod that has access to the secret data through a Volume
|
||||
## Creating a Pod that has access to the secret data through a Volume
|
||||
|
||||
Here is a configuration file you can use to create a Pod:
|
||||
|
||||
@@ -119,7 +119,7 @@ is exposed:
|
||||
my-app
|
||||
39528$vdg7Jb
|
||||
|
||||
### Creating a Pod that has access to the secret data through environment variables
|
||||
## Creating a Pod that has access to the secret data through environment variables
|
||||
|
||||
Here is a configuration file you can use to create a Pod:
|
||||
|
||||
@@ -160,7 +160,7 @@ Here is a configuration file you can use to create a Pod:
|
||||
* Learn more about [Secrets](/docs/user-guide/secrets/).
|
||||
* Learn about [Volumes](/docs/user-guide/volumes/).
|
||||
|
||||
#### Reference
|
||||
### Reference
|
||||
|
||||
* [Secret](docs/api-reference/v1/definitions/#_v1_secret)
|
||||
* [Volume](docs/api-reference/v1/definitions/#_v1_volume)
|
||||
|
||||
@@ -20,7 +20,7 @@ private Docker registry or repository.
|
||||
|
||||
{% capture steps %}
|
||||
|
||||
### Logging in to Docker
|
||||
## Logging in to Docker
|
||||
|
||||
docker login
|
||||
|
||||
@@ -43,7 +43,7 @@ The output contains a section similar to this:
|
||||
}
|
||||
}
|
||||
|
||||
### Creating a Secret that holds your authorization token
|
||||
## Creating a Secret that holds your authorization token
|
||||
|
||||
Create a Secret named `regsecret`:
|
||||
|
||||
@@ -55,7 +55,7 @@ where:
|
||||
* `<your-pword>` is your Docker password.
|
||||
* `<your-email>` is your Docker email.
|
||||
|
||||
### Understanding your Secret
|
||||
## Understanding your Secret
|
||||
|
||||
To understand what's in the Secret you just created, start by viewing the
|
||||
Secret in YAML format:
|
||||
@@ -92,7 +92,7 @@ The output is similar to this:
|
||||
Notice that the secret data contains the authorization token from your
|
||||
`config.json` file.
|
||||
|
||||
### Creating a Pod that uses your Secret
|
||||
## Creating a Pod that uses your Secret
|
||||
|
||||
Here is a configuration file for a Pod that needs access to your secret data:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user