Commit 577f2fa0 authored by derekwaynecarr's avatar derekwaynecarr

LimitRange documentation should be under admin

parent ded48a37
...@@ -127,7 +127,7 @@ your Kubernetes deployment, you MUST use this plug-in to enforce those constrain ...@@ -127,7 +127,7 @@ your Kubernetes deployment, you MUST use this plug-in to enforce those constrain
be used to apply default resource requests to Pods that don't specify any; currently, the default LimitRanger be used to apply default resource requests to Pods that don't specify any; currently, the default LimitRanger
applies a 0.1 CPU requirement to all Pods in the `default` namespace. applies a 0.1 CPU requirement to all Pods in the `default` namespace.
See the [limitRange design doc](../design/admission_control_limit_range.md) and the [example of Limit Range](../user-guide/limitrange/) for more details. See the [limitRange design doc](../design/admission_control_limit_range.md) and the [example of Limit Range](limitrange/) for more details.
### NamespaceExists ### NamespaceExists
......
...@@ -20,7 +20,7 @@ refer to the docs that go with that version. ...@@ -20,7 +20,7 @@ refer to the docs that go with that version.
<strong> <strong>
The latest 1.0.x release of this document can be found The latest 1.0.x release of this document can be found
[here](http://releases.k8s.io/release-1.0/docs/user-guide/limitrange/README.md). [here](http://releases.k8s.io/release-1.0/docs/admin/limitrange/README.md).
Documentation for other releases can be found at Documentation for other releases can be found at
[releases.k8s.io](http://releases.k8s.io). [releases.k8s.io](http://releases.k8s.io).
...@@ -72,7 +72,7 @@ This example will work in a custom namespace to demonstrate the concepts involve ...@@ -72,7 +72,7 @@ This example will work in a custom namespace to demonstrate the concepts involve
Let's create a new namespace called limit-example: Let's create a new namespace called limit-example:
```console ```console
$ kubectl create -f docs/user-guide/limitrange/namespace.yaml $ kubectl create -f docs/admin/limitrange/namespace.yaml
namespaces/limit-example namespaces/limit-example
$ kubectl get namespaces $ kubectl get namespaces
NAME LABELS STATUS NAME LABELS STATUS
...@@ -85,7 +85,7 @@ Step 2: Apply a limit to the namespace ...@@ -85,7 +85,7 @@ Step 2: Apply a limit to the namespace
Let's create a simple limit in our namespace. Let's create a simple limit in our namespace.
```console ```console
$ kubectl create -f docs/user-guide/limitrange/limits.yaml --namespace=limit-example $ kubectl create -f docs/admin/limitrange/limits.yaml --namespace=limit-example
limitranges/mylimits limitranges/mylimits
``` ```
...@@ -153,14 +153,14 @@ Note that our nginx container has picked up the namespace default cpu and memory ...@@ -153,14 +153,14 @@ Note that our nginx container has picked up the namespace default cpu and memory
Let's create a pod that exceeds our allowed limits by having it have a container that requests 3 cpu cores. Let's create a pod that exceeds our allowed limits by having it have a container that requests 3 cpu cores.
```console ```console
$ kubectl create -f docs/user-guide/limitrange/invalid-pod.yaml --namespace=limit-example $ kubectl create -f docs/admin/limitrange/invalid-pod.yaml --namespace=limit-example
Error from server: Pod "invalid-pod" is forbidden: Maximum CPU usage per pod is 2, but requested 3 Error from server: Pod "invalid-pod" is forbidden: Maximum CPU usage per pod is 2, but requested 3
``` ```
Let's create a pod that falls within the allowed limit boundaries. Let's create a pod that falls within the allowed limit boundaries.
```console ```console
$ kubectl create -f docs/user-guide/limitrange/valid-pod.yaml --namespace=limit-example $ kubectl create -f docs/admin/limitrange/valid-pod.yaml --namespace=limit-example
pods/valid-pod pods/valid-pod
$ kubectl get pods valid-pod --namespace=limit-example -o yaml | grep -C 5 resources $ kubectl get pods valid-pod --namespace=limit-example -o yaml | grep -C 5 resources
``` ```
...@@ -201,6 +201,8 @@ the Kubernetes system is able to apply default resource limits if desired in ord ...@@ -201,6 +201,8 @@ the Kubernetes system is able to apply default resource limits if desired in ord
amount of resource a pod consumes on a node. amount of resource a pod consumes on a node.
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/limitrange/README.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/admin/limitrange/README.md?pixel)]()
<!-- END MUNGE: GENERATED_ANALYTICS --> <!-- END MUNGE: GENERATED_ANALYTICS -->
...@@ -142,7 +142,7 @@ For example, ...@@ -142,7 +142,7 @@ For example,
```console ```console
$ kubectl namespace myspace $ kubectl namespace myspace
$ kubectl create -f docs/user-guide/limitrange/limits.yaml $ kubectl create -f docs/admin/limitrange/limits.yaml
$ kubectl get limits $ kubectl get limits
NAME NAME
limits limits
...@@ -166,7 +166,7 @@ To make a **LimitRangeItem** more restrictive, we will intend to add these addit ...@@ -166,7 +166,7 @@ To make a **LimitRangeItem** more restrictive, we will intend to add these addit
## Example ## Example
See the [example of Limit Range](../user-guide/limitrange/) for more information. See the [example of Limit Range](../admin/limitrange/) for more information.
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
......
...@@ -247,7 +247,7 @@ More examples can be found in our [blog article](http://blog.kubernetes.io/2015/ ...@@ -247,7 +247,7 @@ More examples can be found in our [blog article](http://blog.kubernetes.io/2015/
Kubernetes’s scheduler will place applications only where they have adequate CPU and memory, but it can only do so if it knows how much [resources they require](compute-resources.md). The consequence of specifying too little CPU is that the containers could be starved of CPU if too many other containers were scheduled onto the same node. Similarly, containers could die unpredictably due to running out of memory if no memory were requested, which can be especially likely for large-memory applications. Kubernetes’s scheduler will place applications only where they have adequate CPU and memory, but it can only do so if it knows how much [resources they require](compute-resources.md). The consequence of specifying too little CPU is that the containers could be starved of CPU if too many other containers were scheduled onto the same node. Similarly, containers could die unpredictably due to running out of memory if no memory were requested, which can be especially likely for large-memory applications.
If no resource requirements are specified, a nominal amount of resources is assumed. (This default is applied via a [LimitRange](limitrange/) for the default [Namespace](namespaces.md). It can be viewed with `kubectl describe limitrange limits`.) You may explicitly specify the amount of resources required as follows: If no resource requirements are specified, a nominal amount of resources is assumed. (This default is applied via a [LimitRange](../admin/limitrange/) for the default [Namespace](namespaces.md). It can be viewed with `kubectl describe limitrange limits`.) You may explicitly specify the amount of resources required as follows:
```yaml ```yaml
apiVersion: v1 apiVersion: v1
......
...@@ -252,7 +252,7 @@ func TestExampleObjectSchemas(t *testing.T) { ...@@ -252,7 +252,7 @@ func TestExampleObjectSchemas(t *testing.T) {
"namespace-dev": &api.Namespace{}, "namespace-dev": &api.Namespace{},
"namespace-prod": &api.Namespace{}, "namespace-prod": &api.Namespace{},
}, },
"../docs/user-guide/limitrange": { "../docs/admin/limitrange": {
"invalid-pod": &api.Pod{}, "invalid-pod": &api.Pod{},
"limits": &api.LimitRange{}, "limits": &api.LimitRange{},
"namespace": &api.Namespace{}, "namespace": &api.Namespace{},
......
...@@ -227,7 +227,7 @@ runTests() { ...@@ -227,7 +227,7 @@ runTests() {
# Pre-condition: no POD is running # Pre-condition: no POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command # Command
kubectl create "${kube_flags[@]}" -f docs/user-guide/limitrange/valid-pod.yaml kubectl create "${kube_flags[@]}" -f docs/admin/limitrange/valid-pod.yaml
# Post-condition: valid-pod POD is running # Post-condition: valid-pod POD is running
kubectl get "${kube_flags[@]}" pods -o json kubectl get "${kube_flags[@]}" pods -o json
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
...@@ -260,7 +260,7 @@ runTests() { ...@@ -260,7 +260,7 @@ runTests() {
# Pre-condition: valid-pod POD is running # Pre-condition: valid-pod POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
# Command # Command
kubectl delete -f docs/user-guide/limitrange/valid-pod.yaml "${kube_flags[@]}" kubectl delete -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
# Post-condition: no POD is running # Post-condition: no POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
...@@ -268,7 +268,7 @@ runTests() { ...@@ -268,7 +268,7 @@ runTests() {
# Pre-condition: no POD is running # Pre-condition: no POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command # Command
kubectl create -f docs/user-guide/limitrange/valid-pod.yaml "${kube_flags[@]}" kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
# Post-condition: valid-pod POD is running # Post-condition: valid-pod POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
...@@ -284,7 +284,7 @@ runTests() { ...@@ -284,7 +284,7 @@ runTests() {
# Pre-condition: no POD is running # Pre-condition: no POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command # Command
kubectl create -f docs/user-guide/limitrange/valid-pod.yaml "${kube_flags[@]}" kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
# Post-condition: valid-pod POD is running # Post-condition: valid-pod POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
...@@ -316,7 +316,7 @@ runTests() { ...@@ -316,7 +316,7 @@ runTests() {
# Pre-condition: no POD is running # Pre-condition: no POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command # Command
kubectl create -f docs/user-guide/limitrange/valid-pod.yaml "${kube_flags[@]}" kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
kubectl create -f examples/redis/redis-proxy.yaml "${kube_flags[@]}" kubectl create -f examples/redis/redis-proxy.yaml "${kube_flags[@]}"
# Post-condition: valid-pod and redis-proxy PODs are running # Post-condition: valid-pod and redis-proxy PODs are running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-proxy:valid-pod:' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-proxy:valid-pod:'
...@@ -333,7 +333,7 @@ runTests() { ...@@ -333,7 +333,7 @@ runTests() {
# Pre-condition: no POD is running # Pre-condition: no POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command # Command
kubectl create -f docs/user-guide/limitrange/valid-pod.yaml "${kube_flags[@]}" kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
kubectl create -f examples/redis/redis-proxy.yaml "${kube_flags[@]}" kubectl create -f examples/redis/redis-proxy.yaml "${kube_flags[@]}"
# Post-condition: valid-pod and redis-proxy PODs are running # Post-condition: valid-pod and redis-proxy PODs are running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-proxy:valid-pod:' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'redis-proxy:valid-pod:'
...@@ -350,7 +350,7 @@ runTests() { ...@@ -350,7 +350,7 @@ runTests() {
# Pre-condition: no POD is running # Pre-condition: no POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command # Command
kubectl create -f docs/user-guide/limitrange/valid-pod.yaml "${kube_flags[@]}" kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
# Post-condition: valid-pod POD is running # Post-condition: valid-pod POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
...@@ -374,7 +374,7 @@ runTests() { ...@@ -374,7 +374,7 @@ runTests() {
# Pre-condition: no POD is running # Pre-condition: no POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
# Command # Command
kubectl create -f docs/user-guide/limitrange/valid-pod.yaml "${kube_flags[@]}" kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
# Post-condition: valid-pod POD is running # Post-condition: valid-pod POD is running
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
...@@ -440,7 +440,7 @@ runTests() { ...@@ -440,7 +440,7 @@ runTests() {
# Pre-condition: no POD is running # Pre-condition: no POD is running
kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" '' kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" ''
# Command # Command
kubectl create "${kube_flags[@]}" --namespace=other -f docs/user-guide/limitrange/valid-pod.yaml kubectl create "${kube_flags[@]}" --namespace=other -f docs/admin/limitrange/valid-pod.yaml
# Post-condition: valid-pod POD is running # Post-condition: valid-pod POD is running
kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:' kube::test::get_object_assert 'pods --namespace=other' "{{range.items}}{{$id_field}}:{{end}}" 'valid-pod:'
...@@ -640,7 +640,7 @@ __EOF__ ...@@ -640,7 +640,7 @@ __EOF__
# Post-condition: service exists and the port is unnamed # Post-condition: service exists and the port is unnamed
kube::test::get_object_assert 'service frontend-2' "{{$port_name}} {{$port_field}}" '<no value> 443' kube::test::get_object_assert 'service frontend-2' "{{$port_name}} {{$port_field}}" '<no value> 443'
# Command # Command
kubectl create -f docs/user-guide/limitrange/valid-pod.yaml "${kube_flags[@]}" kubectl create -f docs/admin/limitrange/valid-pod.yaml "${kube_flags[@]}"
kubectl expose pod valid-pod --port=444 --name=frontend-3 "${kube_flags[@]}" kubectl expose pod valid-pod --port=444 --name=frontend-3 "${kube_flags[@]}"
# Post-condition: service exists and the port is unnamed # Post-condition: service exists and the port is unnamed
kube::test::get_object_assert 'service frontend-3' "{{$port_name}} {{$port_field}}" '<no value> 444' kube::test::get_object_assert 'service frontend-3' "{{$port_name}} {{$port_field}}" '<no value> 444'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment