Release 1.10 (#7818)

* Refreshing installation instructions (#7495)

* Refreshing installation instructions

Added conjure-up. Updated displays and juju versions to current versions.

* Updated anchors

* Fixed image value version typo (#7768)

Was inconsistent with other values

* Update flocker reference to the github repo (#7784)

* Fix typo in federation document (#7779)

* an user -> a user (#7778)

* Events are namespaced (#7767)

* fix 'monitoring' link lose efficacy problem' (#7764)

* docs/concepts/policy/pod-security-policy.md: minor fix. (#7659)

* Update downward-api-volume-expose-pod-information.md (#7771)

* Update downward-api-volume-expose-pod-information.md

The pod spec puts the downward api files into /etc/podinfo, not directly in /etc. Updated docs to reflect this fact.

* Update downward-api-volume-expose-pod-information.md

One more spot needed fixing.

* Update downward-api-volume-expose-pod-information.md

Yet another fix, in the container example.

* Add Amadeus Case Study (#7783)

* Add Amadeus Case Study

* add Amadeus logo

* Fixed Cyrillic с in 'kube-proxy-cm' (#7787)

There was a typo (wrong character) in kube-proxy-cm.yaml - Cyrillic с (UTF-8 0x0441) was used instead of Latin c.

* install-kubectl: choose one installation method (#7705)

The previous text layout suggested that all installations had to be done, one after another.

* Update install-kubeadm.md (#7781)

Add note to kubeadm install instruction to help install in other arch i.e. aarch64, ppc64le etc.

* repair failure link (#7788)

* repair failure link

* repair failure link

* do change as required

* Update k8s201.md (#7777)

* Update k8s201.md

Change instructions to download yams files directly from the website (as used in other pages.)

Added instructions to delete labeled pod to avoid warnings in the subsequent deployment step.

* Update k8s201.md

Added example of using the exposed host from the a node running Kubernetes. (This works on AWS with Weave; not able to test it on other variations...)

* Gramatical fix to kompose introduction (#7792)

The original wording didn't through very well. As much of the original sentence has been preserved as possible, primarily to ensure the kompose web address is see both in text and as a href link.

* update amadeus.html (#7800)

* Fix a missing word in endpoint reconciler section (#7804)

* Partners page updates (#7802)

* Partners page updates

* Update to ZTE link

* Make using sysctls a task instead of a concept (#6808)

Closes: #4505

* add a note when mount a configmap to pod (#7745)

* adjust a note format (#7812)

* Update docker-cli-to-kubectl.md (#7748)

* Update docker-cli-to-kubectl.md

Edited the document for adherence to the style guide and word usage.

* Update docker-cli-to-kubectl.md

* Incorporated the changes suggested.
This commit is contained in:
Jennifer Rondeau
2018-03-22 13:51:04 -07:00
committed by k8s-ci-robot
parent 08a88077f9
commit f7bccde73e
25 changed files with 253 additions and 136 deletions
@@ -0,0 +1,166 @@
---
title: Using Sysctls in a Kubernetes Cluster
reviewers:
- sttts
---
{% capture overview %}
This document describes how sysctls are used within a Kubernetes cluster.
{% endcapture %}
{% capture prerequisites %}
{% include task-tutorial-prereqs.md %}
{% endcapture %}
{% capture steps %}
## Listing all Sysctl Parameters
In Linux, the sysctl interface allows an administrator to modify kernel
parameters at runtime. Parameters are available via the `/proc/sys/` virtual
process file system. The parameters cover various subsystems such as:
- kernel (common prefix: `kernel.`)
- networking (common prefix: `net.`)
- virtual memory (common prefix: `vm.`)
- MDADM (common prefix: `dev.`)
- More subsystems are described in [Kernel docs](https://www.kernel.org/doc/Documentation/sysctl/README).
To get a list of all parameters, you can run
```shell
$ sudo sysctl -a
```
## Enabling Unsafe Sysctls
Sysctls are grouped into _safe_ and _unsafe_ sysctls. In addition to proper
namespacing a _safe_ sysctl must be properly _isolated_ between pods on the same
node. This means that setting a _safe_ sysctl for one pod
- must not have any influence on any other pod on the node
- must not allow to harm the node's health
- must not allow to gain CPU or memory resources outside of the resource limits
of a pod.
By far, most of the _namespaced_ sysctls are not necessarily considered _safe_.
The following sysctls are supported in the _safe_ set:
- `kernel.shm_rmid_forced`,
- `net.ipv4.ip_local_port_range`,
- `net.ipv4.tcp_syncookies`.
**Note**: The example `net.ipv4.tcp_syncookies` is not namespaced on Linux kernel version 4.4 or lower.
{: .note}
This list will be extended in future Kubernetes versions when the kubelet
supports better isolation mechanisms.
All _safe_ sysctls are enabled by default.
All _unsafe_ sysctls are disabled by default and must be allowed manually by the
cluster admin on a per-node basis. Pods with disabled unsafe sysctls will be
scheduled, but will fail to launch.
With the warning above in mind, the cluster admin can allow certain _unsafe_
sysctls for very special situations like e.g. high-performance or real-time
application tuning. _Unsafe_ sysctls are enabled on a node-by-node basis with a
flag of the kubelet, e.g.:
```shell
$ kubelet --experimental-allowed-unsafe-sysctls \
'kernel.msg*,net.ipv4.route.min_pmtu' ...
```
For minikube, this can be done via the `extra-config` flag:
```shell
$ minikube start --extra-config="kubelet.AllowedUnsafeSysctls=kernel.msg*,net.ipv4.route.min_pmtu"...
```
Only _namespaced_ sysctls can be enabled this way.
## Setting Sysctls for a Pod
A number of sysctls are _namespaced_ in today's Linux kernels. This means that
they can be set independently for each pod on a node. Being namespaced is a
requirement for sysctls to be accessible in a pod context within Kubernetes.
The following sysctls are known to be _namespaced_:
- `kernel.shm*`,
- `kernel.msg*`,
- `kernel.sem`,
- `fs.mqueue.*`,
- `net.*`.
Sysctls which are not namespaced are called _node-level_ and must be set
manually by the cluster admin, either by means of the underlying Linux
distribution of the nodes (e.g. via `/etc/sysctls.conf`) or using a DaemonSet
with privileged containers.
The sysctl feature is an alpha API. Therefore, sysctls are set using annotations
on pods. They apply to all containers in the same pod.
Here is an example, with different annotations for _safe_ and _unsafe_ sysctls:
```yaml
apiVersion: v1
kind: Pod
metadata:
name: sysctl-example
annotations:
security.alpha.kubernetes.io/sysctls: kernel.shm_rmid_forced=1
security.alpha.kubernetes.io/unsafe-sysctls: net.ipv4.route.min_pmtu=1000,kernel.msgmax=1 2 3
spec:
...
```
{% endcapture %}
{% capture discussion %}
**Warning**: Due to their nature of being _unsafe_, the use of _unsafe_ sysctls
is at-your-own-risk and can lead to severe problems like wrong behavior of
containers, resource shortage or complete breakage of a node.
{: .warning}
It is good practice to consider nodes with special sysctl settings as
_tainted_ within a cluster, and only schedule pods onto them which need those
sysctl settings. It is suggested to use the Kubernetes [_taints and toleration_
feature](/docs/user-guide/kubectl/{{page.version}}/#taint) to implement this.
A pod with the _unsafe_ sysctls will fail to launch on any node which has not
enabled those two _unsafe_ sysctls explicitly. As with _node-level_ sysctls it
is recommended to use
[_taints and toleration_ feature](/docs/user-guide/kubectl/{{page.version}}/#taint) or
[taints on nodes](/docs/concepts/configuration/taint-and-toleration/)
to schedule those pods onto the right nodes.
## PodSecurityPolicy Annotations
The use of sysctl in pods can be controlled via annotation on the PodSecurityPolicy.
Sysctl annotation represents a whitelist of allowed safe and unsafe sysctls
in a pod spec. It's a comma-separated list of plain sysctl names or sysctl patterns
(which end in `*`). The string `*` matches all sysctls.
Here is an example, it authorizes binding user creating pod with corresponding sysctls.
```yaml
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: sysctl-psp
annotations:
security.alpha.kubernetes.io/sysctls: 'net.ipv4.route.*,kernel.msg*'
spec:
...
```
{% endcapture %}
{% include templates/task.md %}
@@ -502,6 +502,9 @@ special.level
special.type
```
**Caution:** If there are some files in the `/etc/config/` directory, they will be deleted.
{: .caution}
### Add ConfigMap data to a specific path in the Volume
Use the `path` field to specify the desired file path for specific ConfigMap items.