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.
pull/9378/head
Qiming 2018-07-04 04:39:21 +08:00 committed by k8s-ci-robot
parent 9b81aa7ccd
commit 4962ffabbf
35 changed files with 85 additions and 95 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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:

View File

@ -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
```

View File

@ -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:

View File

@ -1,11 +0,0 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-quota-demo-2
spec:
storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 4Gi

View File

@ -38,12 +38,12 @@ kubectl create namespace quota-object-example
Here is the configuration file for a ResourceQuota object:
{{< code file="quota-objects.yaml" >}}
{{< codenew file="admin/resource/quota-objects.yaml" >}}
Create the ResourceQuota:
```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/quota-objects.yaml --namespace=quota-object-example
kubectl create -f https://k8s.io/examples/admin/resource/quota-objects.yaml --namespace=quota-object-example
```
View detailed information about the ResourceQuota:
@ -72,12 +72,12 @@ status:
Here is the configuration file for a PersistentVolumeClaim object:
{{< code file="quota-objects-pvc.yaml" >}}
{{< codenew file="admin/resource/quota-objects-pvc.yaml" >}}
Create the PersistentVolumeClaim:
```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/quota-objects-pvc.yaml --namespace=quota-object-example
kubectl create -f https://k8s.io/examples/admin/resource/quota-objects-pvc.yaml --namespace=quota-object-example
```
Verify that the PersistentVolumeClaim was created:
@ -97,12 +97,12 @@ pvc-quota-demo Pending
Here is the configuration file for a second PersistentVolumeClaim:
{{< code file="quota-objects-pvc-2.yaml" >}}
{{< codenew file="admin/resource/quota-objects-pvc-2.yaml" >}}
Attempt to create the second PersistentVolumeClaim:
```shell
kubectl create -f https://k8s.io/docs/tasks/administer-cluster/quota-objects-pvc-2.yaml --namespace=quota-object-example
kubectl create -f https://k8s.io/examples/admin/resource/quota-objects-pvc-2.yaml --namespace=quota-object-example
```
The output shows that the second PersistentVolumeClaim was not created,

View File

@ -343,25 +343,7 @@ func TestExampleObjectSchemas(t *testing.T) {
"docs/tasks/administer-cluster": {
"busybox": {&api.Pod{}},
"cloud-controller-manager-daemonset-example": {&api.ServiceAccount{}, &rbac.ClusterRoleBinding{}, &extensions.DaemonSet{}},
"cpu-constraints": {&api.LimitRange{}},
"cpu-constraints-pod": {&api.Pod{}},
"cpu-constraints-pod-2": {&api.Pod{}},
"cpu-constraints-pod-3": {&api.Pod{}},
"cpu-constraints-pod-4": {&api.Pod{}},
"cpu-defaults": {&api.LimitRange{}},
"cpu-defaults-pod": {&api.Pod{}},
"cpu-defaults-pod-2": {&api.Pod{}},
"cpu-defaults-pod-3": {&api.Pod{}},
"dns-horizontal-autoscaler": {&extensions.Deployment{}},
"memory-constraints": {&api.LimitRange{}},
"memory-constraints-pod": {&api.Pod{}},
"memory-constraints-pod-2": {&api.Pod{}},
"memory-constraints-pod-3": {&api.Pod{}},
"memory-constraints-pod-4": {&api.Pod{}},
"memory-defaults": {&api.LimitRange{}},
"memory-defaults-pod": {&api.Pod{}},
"memory-defaults-pod-2": {&api.Pod{}},
"memory-defaults-pod-3": {&api.Pod{}},
"my-scheduler": {&api.ServiceAccount{}, &rbac.ClusterRoleBinding{}, &extensions.Deployment{}},
"namespace-dev": {&api.Namespace{}},
"namespace-prod": {&api.Namespace{}},
@ -369,15 +351,6 @@ func TestExampleObjectSchemas(t *testing.T) {
"pod1": {&api.Pod{}},
"pod2": {&api.Pod{}},
"pod3": {&api.Pod{}},
"quota-mem-cpu": {&api.ResourceQuota{}},
"quota-mem-cpu-pod": {&api.Pod{}},
"quota-mem-cpu-pod-2": {&api.Pod{}},
"quota-objects": {&api.ResourceQuota{}},
"quota-objects-pvc": {&api.PersistentVolumeClaim{}},
"quota-objects-pvc-2": {&api.PersistentVolumeClaim{}},
"quota-pod": {&api.ResourceQuota{}},
"quota-pod-deployment": {&extensions.Deployment{}},
"quota-pvc-2": {&api.PersistentVolumeClaim{}},
},
// TODO: decide whether federation examples should be added
"docs/tasks/inject-data-application": {
@ -403,6 +376,34 @@ func TestExampleObjectSchemas(t *testing.T) {
"secret-envars-pod": {&api.Pod{}},
"secret-pod": {&api.Pod{}},
},
"examples/admin/resource": {
"cpu-constraints": {&api.LimitRange{}},
"cpu-constraints-pod": {&api.Pod{}},
"cpu-constraints-pod-2": {&api.Pod{}},
"cpu-constraints-pod-3": {&api.Pod{}},
"cpu-constraints-pod-4": {&api.Pod{}},
"cpu-defaults": {&api.LimitRange{}},
"cpu-defaults-pod": {&api.Pod{}},
"cpu-defaults-pod-2": {&api.Pod{}},
"cpu-defaults-pod-3": {&api.Pod{}},
"memory-constraints": {&api.LimitRange{}},
"memory-constraints-pod": {&api.Pod{}},
"memory-constraints-pod-2": {&api.Pod{}},
"memory-constraints-pod-3": {&api.Pod{}},
"memory-constraints-pod-4": {&api.Pod{}},
"memory-defaults": {&api.LimitRange{}},
"memory-defaults-pod": {&api.Pod{}},
"memory-defaults-pod-2": {&api.Pod{}},
"memory-defaults-pod-3": {&api.Pod{}},
"quota-mem-cpu": {&api.ResourceQuota{}},
"quota-mem-cpu-pod": {&api.Pod{}},
"quota-mem-cpu-pod-2": {&api.Pod{}},
"quota-objects": {&api.ResourceQuota{}},
"quota-objects-pvc": {&api.PersistentVolumeClaim{}},
"quota-objects-pvc-2": {&api.PersistentVolumeClaim{}},
"quota-pod": {&api.ResourceQuota{}},
"quota-pod-deployment": {&extensions.Deployment{}},
},
"examples/application/job": {
"job-tmpl": {&batch.Job{}},
"cronjob": {&batch.CronJob{}},