Skip to content
Permalink
Browse files

Consolidate YAML files [part-11] (#9363)

This PR relocates some of the YAML files used by the administer cluster
topic. One yaml file not used is deleted.
  • Loading branch information...
tengqm authored and k8s-ci-robot committed Jul 3, 2018
1 parent 9b81aa7 commit 4962ffabbf4b8032b55dc07dbc7feba5eaa00a0d
Showing with 85 additions and 95 deletions.
  1. +12 −12 content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md
  2. +8 −8 content/en/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace.md
  3. +12 −12 content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md
  4. +8 −8 content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md
  5. +7 −7 content/en/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md
  6. +4 −4 content/en/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace.md
  7. +0 −11 content/en/docs/tasks/administer-cluster/manage-resources/quota-pvc-2.yaml
  8. +6 −6 content/en/docs/tasks/administer-cluster/quota-api-object.md
  9. 0 ...s/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-constraints-pod-2.yaml
  10. 0 ...s/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-constraints-pod-3.yaml
  11. 0 ...s/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-constraints-pod-4.yaml
  12. 0 ...ocs/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-constraints-pod.yaml
  13. 0 ...n/{docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-constraints.yaml
  14. 0 ...docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-defaults-pod-2.yaml
  15. 0 ...docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-defaults-pod-3.yaml
  16. 0 .../{docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-defaults-pod.yaml
  17. 0 ...t/en/{docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/cpu-defaults.yaml
  18. 0 ...asks/administer-cluster/manage-resources → examples/admin/resource}/memory-constraints-pod-2.yaml
  19. 0 ...asks/administer-cluster/manage-resources → examples/admin/resource}/memory-constraints-pod-3.yaml
  20. 0 ...asks/administer-cluster/manage-resources → examples/admin/resource}/memory-constraints-pod-4.yaml
  21. 0 .../tasks/administer-cluster/manage-resources → examples/admin/resource}/memory-constraints-pod.yaml
  22. 0 ...docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/memory-constraints.yaml
  23. 0 ...s/tasks/administer-cluster/manage-resources → examples/admin/resource}/memory-defaults-pod-2.yaml
  24. 0 ...s/tasks/administer-cluster/manage-resources → examples/admin/resource}/memory-defaults-pod-3.yaml
  25. 0 ...ocs/tasks/administer-cluster/manage-resources → examples/admin/resource}/memory-defaults-pod.yaml
  26. 0 ...n/{docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/memory-defaults.yaml
  27. 0 ...ocs/tasks/administer-cluster/manage-resources → examples/admin/resource}/quota-mem-cpu-pod-2.yaml
  28. 0 ...{docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/quota-mem-cpu-pod.yaml
  29. 0 .../en/{docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/quota-mem-cpu.yaml
  30. 0 ...ocs/tasks/administer-cluster/manage-resources → examples/admin/resource}/quota-objects-pvc-2.yaml
  31. 0 ...{docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/quota-objects-pvc.yaml
  32. 0 content/en/{docs/tasks/administer-cluster → examples/admin/resource}/quota-objects.yaml
  33. 0 ...cs/tasks/administer-cluster/manage-resources → examples/admin/resource}/quota-pod-deployment.yaml
  34. 0 content/en/{docs/tasks/administer-cluster/manage-resources → examples/admin/resource}/quota-pod.yaml
  35. +28 −27 test/examples_test.go
@@ -40,12 +40,12 @@ kubectl create namespace constraints-cpu-example

Here's the configuration file for a LimitRange:

{{< code file="cpu-constraints.yaml" >}}
{{< codenew file="admin/resource/cpu-constraints.yaml" >}}

Create the LimitRange:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-constraints.yaml --namespace=constraints-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-constraints.yaml --namespace=constraints-cpu-example
```

View detailed information about the LimitRange:
@@ -91,12 +91,12 @@ Here's the configuration file for a Pod that has one Container. The Container ma
specifies a CPU request of 500 millicpu and a CPU limit of 800 millicpu. These satisfy the
minimum and maximum CPU constraints imposed by the LimitRange.

{{< code file="cpu-constraints-pod.yaml" >}}
{{< codenew file="admin/resource/cpu-constraints-pod.yaml" >}}

Create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-constraints-pod.yaml --namespace=constraints-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-constraints-pod.yaml --namespace=constraints-cpu-example
```

Verify that the Pod's Container is running:
@@ -133,19 +133,19 @@ kubectl delete pod constraints-cpu-demo --namespace=constraints-cpu-example
Here's the configuration file for a Pod that has one Container. The Container specifies a
CPU request of 500 millicpu and a cpu limit of 1.5 cpu.

{{< code file="cpu-constraints-pod-2.yaml" >}}
{{< codenew file="admin/resource/cpu-constraints-pod-2.yaml" >}}

Attempt to create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-constraints-pod-2.yaml --namespace=constraints-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-constraints-pod-2.yaml --namespace=constraints-cpu-example
```

The output shows that the Pod does not get created, because the Container specifies a CPU limit that is
too large:

```
Error from server (Forbidden): error when creating "docs/tasks/administer-cluster/cpu-constraints-pod-2.yaml":
Error from server (Forbidden): error when creating "examples/admin/resource/cpu-constraints-pod-2.yaml":
pods "constraints-cpu-demo-2" is forbidden: maximum cpu usage per Container is 800m, but limit is 1500m.
```

@@ -154,19 +154,19 @@ pods "constraints-cpu-demo-2" is forbidden: maximum cpu usage per Container is 8
Here's the configuration file for a Pod that has one Container. The Container specifies a
CPU request of 100 millicpu and a CPU limit of 800 millicpu.

{{< code file="cpu-constraints-pod-3.yaml" >}}
{{< codenew file="admin/resource/cpu-constraints-pod-3.yaml" >}}

Attempt to create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-constraints-pod-3.yaml --namespace=constraints-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-constraints-pod-3.yaml --namespace=constraints-cpu-example
```

The output shows that the Pod does not get created, because the Container specifies a CPU
request that is too small:

```
Error from server (Forbidden): error when creating "docs/tasks/administer-cluster/cpu-constraints-pod-3.yaml":
Error from server (Forbidden): error when creating "examples/admin/resource/cpu-constraints-pod-3.yaml":
pods "constraints-cpu-demo-4" is forbidden: minimum cpu usage per Container is 200m, but request is 100m.
```

@@ -175,12 +175,12 @@ pods "constraints-cpu-demo-4" is forbidden: minimum cpu usage per Container is 2
Here's the configuration file for a Pod that has one Container. The Container does not
specify a CPU request, and it does not specify a CPU limit.

{{< code file="cpu-constraints-pod-4.yaml" >}}
{{< codenew file="admin/resource/cpu-constraints-pod-4.yaml" >}}

Create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-constraints-pod-4.yaml --namespace=constraints-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-constraints-pod-4.yaml --namespace=constraints-cpu-example
```

View detailed information about the Pod:
@@ -35,12 +35,12 @@ kubectl create namespace default-cpu-example
Here's the configuration file for a LimitRange object. The configuration specifies
a default CPU request and a default CPU limit.

{{< code file="cpu-defaults.yaml" >}}
{{< codenew file="admin/resource/cpu-defaults.yaml" >}}

Create the LimitRange in the default-cpu-example namespace:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-defaults.yaml --namespace=default-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-defaults.yaml --namespace=default-cpu-example
```

Now if a Container is created in the default-cpu-example namespace, and the
@@ -51,12 +51,12 @@ CPU limit of 1.
Here's the configuration file for a Pod that has one Container. The Container
does not specify a CPU request and limit.

{{< code file="cpu-defaults-pod.yaml" >}}
{{< codenew file="admin/resource/cpu-defaults-pod.yaml" >}}

Create the Pod.

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-defaults-pod.yaml --namespace=default-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-defaults-pod.yaml --namespace=default-cpu-example
```

View the Pod's specification:
@@ -85,13 +85,13 @@ containers:
Here's the configuration file for a Pod that has one Container. The Container
specifies a CPU limit, but not a request:

{{< code file="cpu-defaults-pod-2.yaml" >}}
{{< codenew file="admin/resource/cpu-defaults-pod-2.yaml" >}}

Create the Pod:


```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-defaults-pod-2.yaml --namespace=default-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-defaults-pod-2.yaml --namespace=default-cpu-example
```

View the Pod specification:
@@ -116,12 +116,12 @@ resources:
Here's the configuration file for a Pod that has one Container. The Container
specifies a CPU request, but not a limit:

{{< code file="cpu-defaults-pod-3.yaml" >}}
{{< codenew file="admin/resource/cpu-defaults-pod-3.yaml" >}}

Create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/cpu-defaults-pod-3.yaml --namespace=default-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/cpu-defaults-pod-3.yaml --namespace=default-cpu-example
```

View the Pod specification:
@@ -40,12 +40,12 @@ kubectl create namespace constraints-mem-example

Here's the configuration file for a LimitRange:

{{< code file="memory-constraints.yaml" >}}
{{< codenew file="admin/resource/memory-constraints.yaml" >}}

Create the LimitRange:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-constraints.yaml --namespace=constraints-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-constraints.yaml --namespace=constraints-mem-example
```

View detailed information about the LimitRange:
@@ -85,12 +85,12 @@ Here's the configuration file for a Pod that has one Container. The Container ma
specifies a memory request of 600 MiB and a memory limit of 800 MiB. These satisfy the
minimum and maximum memory constraints imposed by the LimitRange.

{{< code file="memory-constraints-pod.yaml" >}}
{{< codenew file="admin/resource/memory-constraints-pod.yaml" >}}

Create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-constraints-pod.yaml --namespace=constraints-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-constraints-pod.yaml --namespace=constraints-mem-example
```

Verify that the Pod's Container is running:
@@ -127,19 +127,19 @@ kubectl delete pod constraints-mem-demo --namespace=constraints-mem-example
Here's the configuration file for a Pod that has one Container. The Container specifies a
memory request of 800 MiB and a memory limit of 1.5 GiB.

{{< code file="memory-constraints-pod-2.yaml" >}}
{{< codenew file="admin/resource/memory-constraints-pod-2.yaml" >}}

Attempt to create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-constraints-pod-2.yaml --namespace=constraints-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-constraints-pod-2.yaml --namespace=constraints-mem-example
```

The output shows that the Pod does not get created, because the Container specifies a memory limit that is
too large:

```
Error from server (Forbidden): error when creating "docs/tasks/administer-cluster/memory-constraints-pod-2.yaml":
Error from server (Forbidden): error when creating "examples/admin/resource/memory-constraints-pod-2.yaml":
pods "constraints-mem-demo-2" is forbidden: maximum memory usage per Container is 1Gi, but limit is 1536Mi.
```

@@ -148,19 +148,19 @@ pods "constraints-mem-demo-2" is forbidden: maximum memory usage per Container i
Here's the configuration file for a Pod that has one Container. The Container specifies a
memory request of 200 MiB and a memory limit of 800 MiB.

{{< code file="memory-constraints-pod-3.yaml" >}}
{{< codenew file="admin/resource/memory-constraints-pod-3.yaml" >}}

Attempt to create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-constraints-pod-3.yaml --namespace=constraints-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-constraints-pod-3.yaml --namespace=constraints-mem-example
```

The output shows that the Pod does not get created, because the Container specifies a memory
request that is too small:

```
Error from server (Forbidden): error when creating "docs/tasks/administer-cluster/memory-constraints-pod-3.yaml":
Error from server (Forbidden): error when creating "examples/admin/resource/memory-constraints-pod-3.yaml":
pods "constraints-mem-demo-3" is forbidden: minimum memory usage per Container is 500Mi, but request is 100Mi.
```

@@ -171,12 +171,12 @@ pods "constraints-mem-demo-3" is forbidden: minimum memory usage per Container i
Here's the configuration file for a Pod that has one Container. The Container does not
specify a memory request, and it does not specify a memory limit.

{{< code file="memory-constraints-pod-4.yaml" >}}
{{< codenew file="admin/resource/memory-constraints-pod-4.yaml" >}}

Create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-constraints-pod-4.yaml --namespace=constraints-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-constraints-pod-4.yaml --namespace=constraints-mem-example
```

View detailed information about the Pod:
@@ -37,12 +37,12 @@ kubectl create namespace default-mem-example
Here's the configuration file for a LimitRange object. The configuration specifies
a default memory request and a default memory limit.

{{< code file="memory-defaults.yaml" >}}
{{< codenew file="admin/resource/memory-defaults.yaml" >}}

Create the LimitRange in the default-mem-example namespace:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-defaults.yaml --namespace=default-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-defaults.yaml --namespace=default-mem-example
```

Now if a Container is created in the default-mem-example namespace, and the
@@ -53,12 +53,12 @@ memory limit of 512 MiB.
Here's the configuration file for a Pod that has one Container. The Container
does not specify a memory request and limit.

{{< code file="memory-defaults-pod.yaml" >}}
{{< codenew file="admin/resource/memory-defaults-pod.yaml" >}}

Create the Pod.

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-defaults-pod.yaml --namespace=default-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-defaults-pod.yaml --namespace=default-mem-example
```

View detailed information about the Pod:
@@ -93,13 +93,13 @@ kubectl delete pod default-mem-demo --namespace=default-mem-example
Here's the configuration file for a Pod that has one Container. The Container
specifies a memory limit, but not a request:

{{< code file="memory-defaults-pod-2.yaml" >}}
{{< codenew file="admin/resource/memory-defaults-pod-2.yaml" >}}

Create the Pod:


```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-defaults-pod-2.yaml --namespace=default-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-defaults-pod-2.yaml --namespace=default-mem-example
```

View detailed information about the Pod:
@@ -124,12 +124,12 @@ resources:
Here's the configuration file for a Pod that has one Container. The Container
specifies a memory request, but not a limit:

{{< code file="memory-defaults-pod-3.yaml" >}}
{{< codenew file="admin/resource/memory-defaults-pod-3.yaml" >}}

Create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/memory-defaults-pod-3.yaml --namespace=default-mem-example
kubectl create -f https://k8s.io/examples/admin/resource/memory-defaults-pod-3.yaml --namespace=default-mem-example
```

View the Pod's specification:
@@ -39,12 +39,12 @@ kubectl create namespace quota-mem-cpu-example

Here is the configuration file for a ResourceQuota object:

{{< code file="quota-mem-cpu.yaml" >}}
{{< codenew file="admin/resource/quota-mem-cpu.yaml" >}}

Create the ResourceQuota:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/quota-mem-cpu.yaml --namespace=quota-mem-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/quota-mem-cpu.yaml --namespace=quota-mem-cpu-example
```

View detailed information about the ResourceQuota:
@@ -65,13 +65,13 @@ The ResourceQuota places these requirements on the quota-mem-cpu-example namespa

Here is the configuration file for a Pod:

{{< code file="quota-mem-cpu-pod.yaml" >}}
{{< codenew file="admin/resource/quota-mem-cpu-pod.yaml" >}}


Create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/quota-mem-cpu-pod.yaml --namespace=quota-mem-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/quota-mem-cpu-pod.yaml --namespace=quota-mem-cpu-example
```

Verify that the Pod's Container is running:
@@ -108,7 +108,7 @@ status:

Here is the configuration file for a second Pod:

{{< code file="quota-mem-cpu-pod-2.yaml" >}}
{{< codenew file="admin/resource/quota-mem-cpu-pod-2.yaml" >}}

In the configuration file, you can see that the Pod has a memory request of 700 MiB.
Notice that the sum of the used memory request and this new memory
@@ -117,14 +117,14 @@ request exceeds the memory request quota. 600 MiB + 700 MiB > 1 GiB.
Attempt to create the Pod:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/quota-mem-cpu-pod-2.yaml --namespace=quota-mem-cpu-example
kubectl create -f https://k8s.io/examples/admin/resource/quota-mem-cpu-pod-2.yaml --namespace=quota-mem-cpu-example
```

The second Pod does not get created. The output shows that creating the second Pod
would cause the memory request total to exceed the memory request quota.

```
Error from server (Forbidden): error when creating "docs/tasks/administer-cluster/quota-mem-cpu-pod-2.yaml":
Error from server (Forbidden): error when creating "examples/admin/resource/quota-mem-cpu-pod-2.yaml":
pods "quota-mem-cpu-demo-2" is forbidden: exceeded quota: mem-cpu-demo,
requested: requests.memory=700Mi,used: requests.memory=600Mi, limited: requests.memory=1Gi
```
@@ -37,12 +37,12 @@ kubectl create namespace quota-pod-example

Here is the configuration file for a ResourceQuota object:

{{< code file="quota-pod.yaml" >}}
{{< codenew file="admin/resource/quota-pod.yaml" >}}

Create the ResourceQuota:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/quota-pod.yaml --namespace=quota-pod-example
kubectl create -f https://k8s.io/examples/admin/resource/quota-pod.yaml --namespace=quota-pod-example
```

View detailed information about the ResourceQuota:
@@ -67,14 +67,14 @@ status:

Here is the configuration file for a Deployment:

{{< code file="quota-pod-deployment.yaml" >}}
{{< codenew file="admin/resource/quota-pod-deployment.yaml" >}}

In the configuration file, `replicas: 3` tells Kubernetes to attempt to create three Pods, all running the same application.

Create the Deployment:

```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/quota-pod-deployment.yaml --namespace=quota-pod-example
kubectl create -f https://k8s.io/examples/admin/resource/quota-pod-deployment.yaml --namespace=quota-pod-example
```

View detailed information about the Deployment:
Oops, something went wrong.

0 comments on commit 4962ffa

Please sign in to comment.
You can’t perform that action at this time.