Consolidate YAML files [part-10] (#9362)

* Consolidate YAML files [part-10]

This PR relocates the YAML files used by the pod configuration topic.

* Update examples_test.go

* Update examples_test.go

* Update examples_test.go

* Update examples_test.go

* Update examples_test.go
This commit is contained in:
Qiming
2018-07-04 04:31:20 +08:00
committed by k8s-ci-robot
parent 0f5f027aee
commit 9b81aa7ccd
43 changed files with 140 additions and 153 deletions
@@ -49,7 +49,7 @@ in the Pod specification. The `securityContext` field is a
The security settings that you specify for a Pod apply to all Containers in the Pod.
Here is a configuration file for a Pod that has a `securityContext` and an `emptyDir` volume:
{{< code file="security-context.yaml" >}}
{{< codenew file="pods/security/security-context.yaml" >}}
In the configuration file, the `runAsUser` field specifies that for any Containers in
the Pod, the first process runs with user ID 1000. The `fsGroup` field specifies that
@@ -60,7 +60,7 @@ volume.
Create the Pod:
```shell
kubectl create -f https://k8s.io/docs/tasks/configure-pod-container/security-context.yaml
kubectl create -f https://k8s.io/examples/pods/security/security-context.yaml
```
Verify that the Pod's Container is running:
@@ -141,12 +141,12 @@ there is overlap. Container settings do not affect the Pod's Volumes.
Here is the configuration file for a Pod that has one Container. Both the Pod
and the Container have a `securityContext` field:
{{< code file="security-context-2.yaml" >}}
{{< codenew file="pods/security/security-context-2.yaml" >}}
Create the Pod:
```shell
kubectl create -f https://k8s.io/docs/tasks/configure-pod-container/security-context-2.yaml
kubectl create -f https://k8s.io/examples/pods/security/security-context-2.yaml
```
Verify that the Pod's Container is running:
@@ -194,12 +194,12 @@ of the root user. To add or remove Linux capabilities for a Container, include t
First, see what happens when you don't include a `capabilities` field.
Here is configuration file that does not add or remove any Container capabilities:
{{< code file="security-context-3.yaml" >}}
{{< codenew file="pods/security/security-context-3.yaml" >}}
Create the Pod:
```shell
kubectl create -f https://k8s.io/docs/tasks/configure-pod-container/security-context-3.yaml
kubectl create -f https://k8s.io/examples/pods/security/security-context-3.yaml
```
Verify that the Pod's Container is running:
@@ -256,12 +256,12 @@ that it has additional capabilities set.
Here is the configuration file for a Pod that runs one Container. The configuration
adds the `CAP_NET_ADMIN` and `CAP_SYS_TIME` capabilities:
{{< code file="security-context-4.yaml" >}}
{{< codenew file="pods/security/security-context-4.yaml" >}}
Create the Pod:
```shell
kubectl create -f https://k8s.io/docs/tasks/configure-pod-container/security-context-4.yaml
kubectl create -f https://k8s.io/examples/pods/security/security-context-4.yaml
```
Get a shell into the running Container: