From 4962ffabbf4b8032b55dc07dbc7feba5eaa00a0d Mon Sep 17 00:00:00 2001 From: Qiming Date: Wed, 4 Jul 2018 04:39:21 +0800 Subject: [PATCH] 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. --- .../cpu-constraint-namespace.md | 24 ++++---- .../manage-resources/cpu-default-namespace.md | 16 +++--- .../memory-constraint-namespace.md | 24 ++++---- .../memory-default-namespace.md | 16 +++--- .../quota-memory-cpu-namespace.md | 14 ++--- .../manage-resources/quota-pod-namespace.md | 8 +-- .../manage-resources/quota-pvc-2.yaml | 11 ---- .../administer-cluster/quota-api-object.md | 12 ++-- .../resource}/cpu-constraints-pod-2.yaml | 0 .../resource}/cpu-constraints-pod-3.yaml | 0 .../resource}/cpu-constraints-pod-4.yaml | 0 .../admin/resource}/cpu-constraints-pod.yaml | 0 .../admin/resource}/cpu-constraints.yaml | 0 .../admin/resource}/cpu-defaults-pod-2.yaml | 0 .../admin/resource}/cpu-defaults-pod-3.yaml | 0 .../admin/resource}/cpu-defaults-pod.yaml | 0 .../admin/resource}/cpu-defaults.yaml | 0 .../resource}/memory-constraints-pod-2.yaml | 0 .../resource}/memory-constraints-pod-3.yaml | 0 .../resource}/memory-constraints-pod-4.yaml | 0 .../resource}/memory-constraints-pod.yaml | 0 .../admin/resource}/memory-constraints.yaml | 0 .../resource}/memory-defaults-pod-2.yaml | 0 .../resource}/memory-defaults-pod-3.yaml | 0 .../admin/resource}/memory-defaults-pod.yaml | 0 .../admin/resource}/memory-defaults.yaml | 0 .../admin/resource}/quota-mem-cpu-pod-2.yaml | 0 .../admin/resource}/quota-mem-cpu-pod.yaml | 0 .../admin/resource}/quota-mem-cpu.yaml | 0 .../admin/resource}/quota-objects-pvc-2.yaml | 0 .../admin/resource}/quota-objects-pvc.yaml | 0 .../admin/resource}/quota-objects.yaml | 0 .../admin/resource}/quota-pod-deployment.yaml | 0 .../admin/resource}/quota-pod.yaml | 0 test/examples_test.go | 55 ++++++++++--------- 35 files changed, 85 insertions(+), 95 deletions(-) delete mode 100644 content/en/docs/tasks/administer-cluster/manage-resources/quota-pvc-2.yaml rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-constraints-pod-2.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-constraints-pod-3.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-constraints-pod-4.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-constraints-pod.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-constraints.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-defaults-pod-2.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-defaults-pod-3.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-defaults-pod.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/cpu-defaults.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-constraints-pod-2.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-constraints-pod-3.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-constraints-pod-4.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-constraints-pod.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-constraints.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-defaults-pod-2.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-defaults-pod-3.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-defaults-pod.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/memory-defaults.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/quota-mem-cpu-pod-2.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/quota-mem-cpu-pod.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/quota-mem-cpu.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/quota-objects-pvc-2.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/quota-objects-pvc.yaml (100%) rename content/en/{docs/tasks/administer-cluster => examples/admin/resource}/quota-objects.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/quota-pod-deployment.yaml (100%) rename content/en/{docs/tasks/administer-cluster/manage-resources => examples/admin/resource}/quota-pod.yaml (100%) diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md index 3b615f0d869..d840b61371f 100644 --- a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md +++ b/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md @@ -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: diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace.md index c701a8eddd4..725083d6887 100644 --- a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace.md +++ b/content/en/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace.md @@ -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: diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md index d6e7e685512..80480ee00f3 100644 --- a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md +++ b/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraint-namespace.md @@ -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: diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md index 75bcfdc5552..ab43f8a34cf 100644 --- a/content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md +++ b/content/en/docs/tasks/administer-cluster/manage-resources/memory-default-namespace.md @@ -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: diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md index 01d0a81d6c5..4bdc646742f 100644 --- a/content/en/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md +++ b/content/en/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace.md @@ -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 ``` diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace.md b/content/en/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace.md index 5c68391880f..1cad0ee7bd5 100644 --- a/content/en/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace.md +++ b/content/en/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace.md @@ -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: diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-pvc-2.yaml b/content/en/docs/tasks/administer-cluster/manage-resources/quota-pvc-2.yaml deleted file mode 100644 index 88c165d144d..00000000000 --- a/content/en/docs/tasks/administer-cluster/manage-resources/quota-pvc-2.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: pvc-quota-demo-2 -spec: - storageClassName: manual - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 4Gi diff --git a/content/en/docs/tasks/administer-cluster/quota-api-object.md b/content/en/docs/tasks/administer-cluster/quota-api-object.md index b8e17450726..971a4901eb0 100644 --- a/content/en/docs/tasks/administer-cluster/quota-api-object.md +++ b/content/en/docs/tasks/administer-cluster/quota-api-object.md @@ -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, diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints-pod-2.yaml b/content/en/examples/admin/resource/cpu-constraints-pod-2.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints-pod-2.yaml rename to content/en/examples/admin/resource/cpu-constraints-pod-2.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints-pod-3.yaml b/content/en/examples/admin/resource/cpu-constraints-pod-3.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints-pod-3.yaml rename to content/en/examples/admin/resource/cpu-constraints-pod-3.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints-pod-4.yaml b/content/en/examples/admin/resource/cpu-constraints-pod-4.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints-pod-4.yaml rename to content/en/examples/admin/resource/cpu-constraints-pod-4.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints-pod.yaml b/content/en/examples/admin/resource/cpu-constraints-pod.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints-pod.yaml rename to content/en/examples/admin/resource/cpu-constraints-pod.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints.yaml b/content/en/examples/admin/resource/cpu-constraints.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-constraints.yaml rename to content/en/examples/admin/resource/cpu-constraints.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-defaults-pod-2.yaml b/content/en/examples/admin/resource/cpu-defaults-pod-2.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-defaults-pod-2.yaml rename to content/en/examples/admin/resource/cpu-defaults-pod-2.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-defaults-pod-3.yaml b/content/en/examples/admin/resource/cpu-defaults-pod-3.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-defaults-pod-3.yaml rename to content/en/examples/admin/resource/cpu-defaults-pod-3.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-defaults-pod.yaml b/content/en/examples/admin/resource/cpu-defaults-pod.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-defaults-pod.yaml rename to content/en/examples/admin/resource/cpu-defaults-pod.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/cpu-defaults.yaml b/content/en/examples/admin/resource/cpu-defaults.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/cpu-defaults.yaml rename to content/en/examples/admin/resource/cpu-defaults.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints-pod-2.yaml b/content/en/examples/admin/resource/memory-constraints-pod-2.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints-pod-2.yaml rename to content/en/examples/admin/resource/memory-constraints-pod-2.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints-pod-3.yaml b/content/en/examples/admin/resource/memory-constraints-pod-3.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints-pod-3.yaml rename to content/en/examples/admin/resource/memory-constraints-pod-3.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints-pod-4.yaml b/content/en/examples/admin/resource/memory-constraints-pod-4.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints-pod-4.yaml rename to content/en/examples/admin/resource/memory-constraints-pod-4.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints-pod.yaml b/content/en/examples/admin/resource/memory-constraints-pod.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints-pod.yaml rename to content/en/examples/admin/resource/memory-constraints-pod.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints.yaml b/content/en/examples/admin/resource/memory-constraints.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-constraints.yaml rename to content/en/examples/admin/resource/memory-constraints.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-defaults-pod-2.yaml b/content/en/examples/admin/resource/memory-defaults-pod-2.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-defaults-pod-2.yaml rename to content/en/examples/admin/resource/memory-defaults-pod-2.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-defaults-pod-3.yaml b/content/en/examples/admin/resource/memory-defaults-pod-3.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-defaults-pod-3.yaml rename to content/en/examples/admin/resource/memory-defaults-pod-3.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-defaults-pod.yaml b/content/en/examples/admin/resource/memory-defaults-pod.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-defaults-pod.yaml rename to content/en/examples/admin/resource/memory-defaults-pod.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/memory-defaults.yaml b/content/en/examples/admin/resource/memory-defaults.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/memory-defaults.yaml rename to content/en/examples/admin/resource/memory-defaults.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-mem-cpu-pod-2.yaml b/content/en/examples/admin/resource/quota-mem-cpu-pod-2.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/quota-mem-cpu-pod-2.yaml rename to content/en/examples/admin/resource/quota-mem-cpu-pod-2.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-mem-cpu-pod.yaml b/content/en/examples/admin/resource/quota-mem-cpu-pod.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/quota-mem-cpu-pod.yaml rename to content/en/examples/admin/resource/quota-mem-cpu-pod.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-mem-cpu.yaml b/content/en/examples/admin/resource/quota-mem-cpu.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/quota-mem-cpu.yaml rename to content/en/examples/admin/resource/quota-mem-cpu.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-objects-pvc-2.yaml b/content/en/examples/admin/resource/quota-objects-pvc-2.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/quota-objects-pvc-2.yaml rename to content/en/examples/admin/resource/quota-objects-pvc-2.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-objects-pvc.yaml b/content/en/examples/admin/resource/quota-objects-pvc.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/quota-objects-pvc.yaml rename to content/en/examples/admin/resource/quota-objects-pvc.yaml diff --git a/content/en/docs/tasks/administer-cluster/quota-objects.yaml b/content/en/examples/admin/resource/quota-objects.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/quota-objects.yaml rename to content/en/examples/admin/resource/quota-objects.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-pod-deployment.yaml b/content/en/examples/admin/resource/quota-pod-deployment.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/quota-pod-deployment.yaml rename to content/en/examples/admin/resource/quota-pod-deployment.yaml diff --git a/content/en/docs/tasks/administer-cluster/manage-resources/quota-pod.yaml b/content/en/examples/admin/resource/quota-pod.yaml similarity index 100% rename from content/en/docs/tasks/administer-cluster/manage-resources/quota-pod.yaml rename to content/en/examples/admin/resource/quota-pod.yaml diff --git a/test/examples_test.go b/test/examples_test.go index 32b2cac3aa3..bbeb694352a 100644 --- a/test/examples_test.go +++ b/test/examples_test.go @@ -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{}},