Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
wgj authored Sep 23, 2019
2 parents 77a4416 + 513199d commit 174f614
Show file tree
Hide file tree
Showing 241 changed files with 75,683 additions and 4,495 deletions.
40 changes: 20 additions & 20 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ time_format_blog = "Monday, January 02, 2006"
description = "Production-Grade Container Orchestration"
showedit = true

latest = "v1.15"
latest = "v1.16"

fullversion = "v1.15.0"
version = "v1.15"
fullversion = "v1.16.0"
version = "v1.16"
githubbranch = "master"
docsbranch = "master"
deprecated = false
Expand All @@ -84,10 +84,10 @@ announcement = false
announcement_message = "The Kubernetes Documentation team would like your feedback! Please take a <a href='https://www.surveymonkey.com/r/8R237FN' target='_blank'>short survey</a> so we can improve the Kubernetes online documentation."

[[params.versions]]
fullversion = "v1.15.0"
version = "v1.15"
githubbranch = "v1.15.0"
docsbranch = "release-1.15"
fullversion = "v1.16.0"
version = "v1.16"
githubbranch = "v1.16.0"
docsbranch = "release-1.16"
url = "https://kubernetes.io"

[params.pushAssets]
Expand All @@ -102,33 +102,33 @@ js = [
]

[[params.versions]]
fullversion = "v1.14.3"
fullversion = "v1.15.3"
version = "v1.15"
githubbranch = "v1.15.3"
docsbranch = "release-1.15"
url = "https://v1-15.docs.kubernetes.io"

[[params.versions]]
fullversion = "v1.14.6"
version = "v1.14"
githubbranch = "v1.14.3"
githubbranch = "v1.14.6"
docsbranch = "release-1.14"
url = "https://v1-14.docs.kubernetes.io"

[[params.versions]]
fullversion = "v1.13.7"
fullversion = "v1.13.10"
version = "v1.13"
githubbranch = "v1.13.7"
githubbranch = "v1.13.10"
docsbranch = "release-1.13"
url = "https://v1-13.docs.kubernetes.io"

[[params.versions]]
fullversion = "v1.12.9"
fullversion = "v1.12.10"
version = "v1.12"
githubbranch = "v1.12.9"
githubbranch = "v1.12.10"
docsbranch = "release-1.12"
url = "https://v1-12.docs.kubernetes.io"

[[params.versions]]
fullversion = "v1.11.10"
version = "v1.11"
githubbranch = "v1.11.10"
docsbranch = "release-1.11"
url = "https://v1-11.docs.kubernetes.io"

# Language definitions.

[languages]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
```
$ kubectl create -f app.yaml
The App "example-app" is invalid: []: Invalid value: map[string]interface {}{"apiVersion":"mygroup.example.com/v1", "kind":"App", "metadata":map[string]interface {}{"creationTimestamp":"2017-08-31T20:52:54Z", "uid":"5c674651-8e8e-11e7-86ad-f0761cb232d1", "selfLink":"", "clusterName":"", "name":"example-app", "namespace":"default", "deletionTimestamp":interface {}(nil), "deletionGracePeriodSeconds":(\*int64)(nil)}, "spec":map[string]interface {}{"replicas":15, "version":"v1.0.2"}}:
The App "example-app" is invalid: []: Invalid value: map[string]interface {}{"apiVersion":"mygroup.example.com/v1", "kind":"App", "metadata":map[string]interface {}{"creationTimestamp":"2017-08-31T20:52:54Z", "uid":"5c674651-8e8e-11e7-86ad-f0761cb232d1", "clusterName":"", "name":"example-app", "namespace":"default", "deletionTimestamp":interface {}(nil), "deletionGracePeriodSeconds":(\*int64)(nil)}, "spec":map[string]interface {}{"replicas":15, "version":"v1.0.2"}}:
validation failure list:
spec.replicas in body should be less than or equal to 10
spec.version in body should be one of [v1.0.0 v1.0.1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ items:
resourceVersion: "415852"
selfLink: /apis/mysql.orain.com/v1/namespaces/default/mysqlclusters/clustershard-c
uid: 6bb089bb-b56f-11e7-ae02-525400e717a6
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Also, while Kubernetes is guaranteed to deliver a block device to the container,

## How can I learn more?

Check out additional documentation on the snapshot feature here: /docs/concepts/storage/persistent-volumes/#raw-block-volume-support
Check out additional documentation on the snapshot feature here: [Raw Block Volume Support](/docs/concepts/storage/persistent-volumes/#raw-block-volume-support)

How do I get involved?

Expand Down

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions content/en/docs/concepts/architecture/nodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ includes all containers started by the kubelet, but not containers started direc
If you want to explicitly reserve resources for non-Pod processes, follow this tutorial to
[reserve resources for system daemons](/docs/tasks/administer-cluster/reserve-compute-resources/#system-reserved).

## Node topology

{{< feature-state state="alpha" >}}

If you have enabled the `TopologyManager`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/), then
the kubelet can use topology hints when making resource assignment decisions.

## API Object

Expand All @@ -298,3 +305,7 @@ API object can be found at:
[Node API object](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#node-v1-core).

{{% /capture %}}
{{% capture whatsnext %}}
* Read about [node components](https://kubernetes.io/docs/concepts/overview/components/#node-components)
* Read about node-level topology: [Control Topology Management Policies on a node](/docs/tasks/administer-cluster/topology-manager/)
{{% /capture %}}
4 changes: 4 additions & 0 deletions content/en/docs/concepts/configuration/assign-pod-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,4 +394,8 @@ The design documents for
[node affinity](https://git.k8s.io/community/contributors/design-proposals/scheduling/nodeaffinity.md)
and for [inter-pod affinity/anti-affinity](https://git.k8s.io/community/contributors/design-proposals/scheduling/podaffinity.md) contain extra background information about these features.

Once a Pod is assigned to a Node, the kubelet runs the Pod and allocates node-local resources.
The [topology manager](/docs/tasks/administer-cluster/topology-manager/) can take part in node-level
resource allocation decisions.

{{% /capture %}}
62 changes: 62 additions & 0 deletions content/en/docs/concepts/configuration/pod-overhead.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
reviewers:
- dchen1107
- egernst
- tallclair
title: Pod Overhead
content_template: templates/concept
weight: 20
---

{{% capture overview %}}

{{< feature-state for_k8s_version="v1.16" state="alpha" >}}


When you run a Pod on a Node, the Pod itself takes an amount of system resources. These
resources are additional to the resources needed to run the container(s) inside the Pod.
_Pod Overhead_ is a feature for accounting for the resources consumed by the pod infrastructure
on top of the container requests & limits.


{{% /capture %}}


{{% capture body %}}

## Pod Overhead

In Kubernetes, the pod's overhead is set at
[admission](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#what-are-admission-webhooks)
time according to the overhead associated with the pod's
[RuntimeClass](https://kubernetes.io/docs/concepts/containers/runtime-class/).

When Pod Overhead is enabled, the overhead is considered in addition to the sum of container
resource requests when scheduling a pod. Similarly, Kubelet will include the pod overhead when sizing
the pod cgroup, and when carrying out pod eviction ranking.

### Set Up

You need to make sure that the `PodOverhead`
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled (it is off by default)
across your cluster. This means:

- in {{< glossary_tooltip text="kube-scheduler" term_id="kube-scheduler" >}}
- in {{< glossary_tooltip text="kube-apiserver" term_id="kube-apiserver" >}}
- in the {{< glossary_tooltip text="kubelet" term_id="kubelet" >}} on each Node
- in any custom API servers that use feature gates

{{< note >}}
Users who can write to RuntimeClass resources are able to have cluster-wide impact on
workload performance. You can limit access to this ability using Kubernetes access controls.
See [Authorization Overview](/docs/reference/access-authn-authz/authorization/) for more details.
{{< /note >}}

{{% /capture %}}

{{% capture whatsnext %}}

* [RuntimeClass](/docs/concepts/containers/runtime-class/)
* [PodOverhead Design](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/20190226-pod-overhead.md)

{{% /capture %}}
197 changes: 197 additions & 0 deletions content/en/docs/concepts/configuration/resource-bin-packing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
---
reviewers:
- bsalamat
- k82cn
- ahg-g
title: Resource Bin Packing for Extended Resources
content_template: templates/concept
weight: 10
---

{{% capture overview %}}

{{< feature-state for_k8s_version="1.16" state="alpha" >}}

The kube-scheduler can be configured to enable bin packing of resources along with extended resources using `RequestedToCapacityRatioResourceAllocation` priority function. Priority functions can be used to fine-tune the kube-scheduler as per custom needs.

{{% /capture %}}

{{% capture body %}}

## Enabling Bin Packing using RequestedToCapacityRatioResourceAllocation

Before Kubernetes 1.15, Kube-scheduler used to allow scoring nodes based on the request to capacity ratio of primary resources like CPU and Memory. Kubernetes 1.16 added a new parameter to the priority function that allows the users to specify the resources along with weights for each resource to score nodes based on the request to capacity ratio. This allows users to bin pack extended resources by using appropriate parameters improves the utilization of scarce resources in large clusters. The behavior of the `RequestedToCapacityRatioResourceAllocation` priority function can be controlled by a configuration option called `requestedToCapacityRatioArguments`. This argument consists of two parameters `shape` and `resources`. Shape allows the user to tune the function as least requested or most requested based on `utilization` and `score` values. Resources
consists of `name` which specifies the resource to be considered during scoring and `weight` specify the weight of each resource.

Below is an example configuration that sets `requestedToCapacityRatioArguments` to bin packing behavior for extended resources `intel.com/foo` and `intel.com/bar`

```json
{
"kind" : "Policy",
"apiVersion" : "v1",

...

"priorities" : [

...

{
"name": "RequestedToCapacityRatioPriority",
"weight": 2,
"argument": {
"requestedToCapacityRatioArguments": {
"shape": [
{"utilization": 0, "score": 0},
{"utilization": 100, "score": 10}
],
"resources": [
{"name": "intel.com/foo", "weight": 3},
{"name": "intel.com/bar", "weight": 5}
]
}
}
}
],
}
```

**This feature is disabled by default**

### Tuning RequestedToCapacityRatioResourceAllocation Priority Function

`shape` is used to specify the behavior of the `RequestedToCapacityRatioPriority` function.

```yaml
{"utilization": 0, "score": 0},
{"utilization": 100, "score": 10}
```

The above arguments give the node a score of 0 if utilization is 0% and 10 for utilization 100%, thus enabling bin packing behavior. To enable least requested the score value must be reversed as follows.

```yaml
{"utilization": 0, "score": 100},
{"utilization": 100, "score": 0}
```

`resources` is an optional parameter which by defaults is set to:

``` yaml
"resources": [
{"name": "CPU", "weight": 1},
{"name": "Memory", "weight": 1}
]
```

It can be used to add extended resources as follows:

```yaml
"resources": [
{"name": "intel.com/foo", "weight": 5},
{"name": "CPU", "weight": 3},
{"name": "Memory", "weight": 1}
]
```

The weight parameter is optional and is set to 1 if not specified. Also, the weight cannot be set to a negative value.

### How the RequestedToCapacityRatioResourceAllocation Priority Function Scores Nodes

This section is intended for those who want to understand the internal details
of this feature.
Below is an example of how the node score is calculated for a given set of values.

```
Requested Resources
intel.com/foo : 2
Memory: 256MB
CPU: 2
Resource Weights
intel.com/foo : 5
Memory: 1
CPU: 3
FunctionShapePoint {{0, 0}, {100, 10}}
Node 1 Spec
Available:
intel.com/foo : 4
Memory : 1 GB
CPU: 8
Used:
intel.com/foo: 1
Memory: 256MB
CPU: 1
Node Score:
intel.com/foo = resourceScoringFunction((2+1),4)
= (100 - ((4-3)*100/4)
= (100 - 25)
= 75
= rawScoringFunction(75)
= 7
Memory = resourceScoringFunction((256+256),1024)
= (100 -((1024-512)*100/1024))
= 50
= rawScoringFunction(50)
= 5
CPU = resourceScoringFunction((2+1),8)
= (100 -((8-3)*100/8))
= 37.5
= rawScoringFunction(37.5)
= 3
NodeScore = (7 * 5) + (5 * 1) + (3 * 3) / (5 + 1 + 3)
= 5
Node 2 Spec
Available:
intel.com/foo: 8
Memory: 1GB
CPU: 8
Used:
intel.com/foo: 2
Memory: 512MB
CPU: 6
Node Score:
intel.com/foo = resourceScoringFunction((2+2),8)
= (100 - ((8-4)*100/8)
= (100 - 25)
= 50
= rawScoringFunction(50)
= 5
Memory = resourceScoringFunction((256+512),1024)
= (100 -((1024-768)*100/1024))
= 75
= rawScoringFunction(75)
= 7
CPU = resourceScoringFunction((2+6),8)
= (100 -((8-8)*100/8))
= 100
= rawScoringFunction(100)
= 10
NodeScore = (5 * 5) + (7 * 1) + (10 * 3) / (5 + 1 + 3)
= 7
```

{{% /capture %}}
Loading

0 comments on commit 174f614

Please sign in to comment.