Merge branch 'master' into patch-3
This commit is contained in:
@@ -11,9 +11,10 @@ weight: 10
|
|||||||
|
|
||||||
Kubernetes runs your workload by placing containers into Pods to run on _Nodes_.
|
Kubernetes runs your workload by placing containers into Pods to run on _Nodes_.
|
||||||
A node may be a virtual or physical machine, depending on the cluster. Each node
|
A node may be a virtual or physical machine, depending on the cluster. Each node
|
||||||
contains the services necessary to run
|
is managed by the
|
||||||
{{< glossary_tooltip text="Pods" term_id="pod" >}}, managed by the
|
{{< glossary_tooltip text="control plane" term_id="control-plane" >}}
|
||||||
{{< glossary_tooltip text="control plane" term_id="control-plane" >}}.
|
and contains the services necessary to run
|
||||||
|
{{< glossary_tooltip text="Pods" term_id="pod" >}}
|
||||||
|
|
||||||
Typically you have several nodes in a cluster; in a learning or resource-limited
|
Typically you have several nodes in a cluster; in a learning or resource-limited
|
||||||
environment, you might have just one.
|
environment, you might have just one.
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ Because `kubectl` outputs resource names in the same syntax it accepts, it's eas
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl get $(kubectl create -f docs/concepts/cluster-administration/nginx/ -o name | grep service)
|
kubectl get $(kubectl create -f docs/concepts/cluster-administration/nginx/ -o name | grep service)
|
||||||
|
kubectl create -f docs/concepts/cluster-administration/nginx/ -o name | grep service | xargs -i kubectl get {}
|
||||||
```
|
```
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ In this case, `0` means we have just created an empty Secret.
|
|||||||
A `kubernetes.io/service-account-token` type of Secret is used to store a
|
A `kubernetes.io/service-account-token` type of Secret is used to store a
|
||||||
token that identifies a service account. When using this Secret type, you need
|
token that identifies a service account. When using this Secret type, you need
|
||||||
to ensure that the `kubernetes.io/service-account.name` annotation is set to an
|
to ensure that the `kubernetes.io/service-account.name` annotation is set to an
|
||||||
existing service account name. An Kubernetes controller fills in some other
|
existing service account name. A Kubernetes controller fills in some other
|
||||||
fields such as the `kubernetes.io/service-account.uid` annotation and the
|
fields such as the `kubernetes.io/service-account.uid` annotation and the
|
||||||
`token` key in the `data` field set to actual token content.
|
`token` key in the `data` field set to actual token content.
|
||||||
|
|
||||||
|
|||||||
@@ -210,8 +210,8 @@ spec:
|
|||||||
|
|
||||||
The `CSIMigration` feature for Cinder, when enabled, redirects all plugin operations
|
The `CSIMigration` feature for Cinder, when enabled, redirects all plugin operations
|
||||||
from the existing in-tree plugin to the `cinder.csi.openstack.org` Container
|
from the existing in-tree plugin to the `cinder.csi.openstack.org` Container
|
||||||
Storage Interface (CSI) Driver. In order to use this feature, the [Openstack Cinder CSI
|
Storage Interface (CSI) Driver. In order to use this feature, the [OpenStack Cinder CSI
|
||||||
Driver](https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/using-cinder-csi-plugin.md)
|
Driver](https://github.com/kubernetes/cloud-provider-openstack/blob/master/docs/cinder-csi-plugin/using-cinder-csi-plugin.md)
|
||||||
must be installed on the cluster and the `CSIMigration` and `CSIMigrationOpenStack`
|
must be installed on the cluster and the `CSIMigration` and `CSIMigrationOpenStack`
|
||||||
beta features must be enabled.
|
beta features must be enabled.
|
||||||
|
|
||||||
|
|||||||
@@ -462,8 +462,6 @@ and the [example of Limit Range](/docs/tasks/administer-cluster/manage-resources
|
|||||||
|
|
||||||
### MutatingAdmissionWebhook {#mutatingadmissionwebhook}
|
### MutatingAdmissionWebhook {#mutatingadmissionwebhook}
|
||||||
|
|
||||||
{{< feature-state for_k8s_version="v1.13" state="beta" >}}
|
|
||||||
|
|
||||||
This admission controller calls any mutating webhooks which match the request. Matching
|
This admission controller calls any mutating webhooks which match the request. Matching
|
||||||
webhooks are called in serial; each one may modify the object if it desires.
|
webhooks are called in serial; each one may modify the object if it desires.
|
||||||
|
|
||||||
@@ -474,7 +472,7 @@ If a webhook called by this has side effects (for example, decrementing quota) i
|
|||||||
webhooks or validating admission controllers will permit the request to finish.
|
webhooks or validating admission controllers will permit the request to finish.
|
||||||
|
|
||||||
If you disable the MutatingAdmissionWebhook, you must also disable the
|
If you disable the MutatingAdmissionWebhook, you must also disable the
|
||||||
`MutatingWebhookConfiguration` object in the `admissionregistration.k8s.io/v1beta1`
|
`MutatingWebhookConfiguration` object in the `admissionregistration.k8s.io/v1`
|
||||||
group/version via the `--runtime-config` flag (both are on by default in
|
group/version via the `--runtime-config` flag (both are on by default in
|
||||||
versions >= 1.9).
|
versions >= 1.9).
|
||||||
|
|
||||||
@@ -486,8 +484,6 @@ versions >= 1.9).
|
|||||||
different when read back.
|
different when read back.
|
||||||
* Setting originally unset fields is less likely to cause problems than
|
* Setting originally unset fields is less likely to cause problems than
|
||||||
overwriting fields set in the original request. Avoid doing the latter.
|
overwriting fields set in the original request. Avoid doing the latter.
|
||||||
* This is a beta feature. Future versions of Kubernetes may restrict the types of
|
|
||||||
mutations these webhooks can make.
|
|
||||||
* Future changes to control loops for built-in resources or third-party resources
|
* Future changes to control loops for built-in resources or third-party resources
|
||||||
may break webhooks that work well today. Even when the webhook installation API
|
may break webhooks that work well today. Even when the webhook installation API
|
||||||
is finalized, not all possible webhook behaviors will be guaranteed to be supported
|
is finalized, not all possible webhook behaviors will be guaranteed to be supported
|
||||||
@@ -766,8 +762,6 @@ This admission controller {{< glossary_tooltip text="taints" term_id="taint" >}}
|
|||||||
|
|
||||||
### ValidatingAdmissionWebhook {#validatingadmissionwebhook}
|
### ValidatingAdmissionWebhook {#validatingadmissionwebhook}
|
||||||
|
|
||||||
{{< feature-state for_k8s_version="v1.13" state="beta" >}}
|
|
||||||
|
|
||||||
This admission controller calls any validating webhooks which match the request. Matching
|
This admission controller calls any validating webhooks which match the request. Matching
|
||||||
webhooks are called in parallel; if any of them rejects the request, the request
|
webhooks are called in parallel; if any of them rejects the request, the request
|
||||||
fails. This admission controller only runs in the validation phase; the webhooks it calls may not
|
fails. This admission controller only runs in the validation phase; the webhooks it calls may not
|
||||||
@@ -778,7 +772,7 @@ If a webhook called by this has side effects (for example, decrementing quota) i
|
|||||||
webhooks or other validating admission controllers will permit the request to finish.
|
webhooks or other validating admission controllers will permit the request to finish.
|
||||||
|
|
||||||
If you disable the ValidatingAdmissionWebhook, you must also disable the
|
If you disable the ValidatingAdmissionWebhook, you must also disable the
|
||||||
`ValidatingWebhookConfiguration` object in the `admissionregistration.k8s.io/v1beta1`
|
`ValidatingWebhookConfiguration` object in the `admissionregistration.k8s.io/v1`
|
||||||
group/version via the `--runtime-config` flag (both are on by default in
|
group/version via the `--runtime-config` flag (both are on by default in
|
||||||
versions 1.9 and later).
|
versions 1.9 and later).
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
title: API Group
|
title: API Group
|
||||||
id: api-group
|
id: api-group
|
||||||
date: 2019-09-02
|
date: 2019-09-02
|
||||||
full_link: /docs/concepts/overview/kubernetes-api/#api-groups
|
full_link: /docs/concepts/overview/kubernetes-api/#api-groups-and-versioning
|
||||||
short_description: >
|
short_description: >
|
||||||
A set of related paths in the Kubernetes API.
|
A set of related paths in the Kubernetes API.
|
||||||
|
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.ty
|
|||||||
&& kubectl get nodes -o jsonpath="$JSONPATH" | grep "Ready=True"
|
&& kubectl get nodes -o jsonpath="$JSONPATH" | grep "Ready=True"
|
||||||
|
|
||||||
# Output decoded secrets without external tools
|
# Output decoded secrets without external tools
|
||||||
kubectl get secret ${secret_name} -o go-template='{{range $k,$v := .data}}{{$k}}={{$v|base64decode}}{{"\n"}}{{end}}'
|
kubectl get secret my-secret -o go-template='{{range $k,$v := .data}}{{"### "}}{{$k}}{{"\n"}}{{$v|base64decode}}{{"\n\n"}}{{end}}'
|
||||||
|
|
||||||
# List all Secrets currently in use by a pod
|
# List all Secrets currently in use by a pod
|
||||||
kubectl get pods -o json | jq '.items[].spec.containers[].env[]?.valueFrom.secretKeyRef.name' | grep -v null | sort | uniq
|
kubectl get pods -o json | jq '.items[].spec.containers[].env[]?.valueFrom.secretKeyRef.name' | grep -v null | sort | uniq
|
||||||
@@ -337,7 +337,7 @@ kubectl taint nodes foo dedicated=special-user:NoSchedule
|
|||||||
|
|
||||||
### Resource types
|
### Resource types
|
||||||
|
|
||||||
List all supported resource types along with their shortnames, [API group](/docs/concepts/overview/kubernetes-api/#api-groups), whether they are [namespaced](/docs/concepts/overview/working-with-objects/namespaces), and [Kind](/docs/concepts/overview/working-with-objects/kubernetes-objects):
|
List all supported resource types along with their shortnames, [API group](/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning), whether they are [namespaced](/docs/concepts/overview/working-with-objects/namespaces), and [Kind](/docs/concepts/overview/working-with-objects/kubernetes-objects):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl api-resources
|
kubectl api-resources
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ weight: 30
|
|||||||
|
|
||||||
<!-- overview -->
|
<!-- overview -->
|
||||||
|
|
||||||
<img src="https://raw.githubusercontent.com/kubernetes/kubeadm/master/logos/stacked/color/kubeadm-stacked-color.png" align="right" width="150px">Creating a minimum viable Kubernetes cluster that conforms to best practices. In fact, you can use `kubeadm` to set up a cluster that will pass the [Kubernetes Conformance tests](https://kubernetes.io/blog/2017/10/software-conformance-certification).
|
<img src="https://raw.githubusercontent.com/kubernetes/kubeadm/master/logos/stacked/color/kubeadm-stacked-color.png" align="right" width="150px">Using `kubeadm`, you can create a minimum viable Kubernetes cluster that conforms to best practices. In fact, you can use `kubeadm` to set up a cluster that will pass the [Kubernetes Conformance tests](https://kubernetes.io/blog/2017/10/software-conformance-certification).
|
||||||
`kubeadm` also supports other cluster
|
`kubeadm` also supports other cluster
|
||||||
lifecycle functions, such as [bootstrap tokens](/docs/reference/access-authn-authz/bootstrap-tokens/) and cluster upgrades.
|
lifecycle functions, such as [bootstrap tokens](/docs/reference/access-authn-authz/bootstrap-tokens/) and cluster upgrades.
|
||||||
|
|
||||||
|
|||||||
@@ -236,8 +236,8 @@ curl -L "https://github.com/containernetworking/plugins/releases/download/${CNI_
|
|||||||
Define the directory to download command files
|
Define the directory to download command files
|
||||||
|
|
||||||
{{< note >}}
|
{{< note >}}
|
||||||
The DOWNLOAD_DIR variable must be set to a writable directory.
|
The `DOWNLOAD_DIR` variable must be set to a writable directory.
|
||||||
If you are running Flatcar Container Linux, set DOWNLOAD_DIR=/opt/bin.
|
If you are running Flatcar Container Linux, set `DOWNLOAD_DIR=/opt/bin`.
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
+1
-1
@@ -363,7 +363,7 @@ kubectl taint nodes NODE_NAME node-role.kubernetes.io/master:NoSchedule-
|
|||||||
|
|
||||||
## `/usr` is mounted read-only on nodes {#usr-mounted-read-only}
|
## `/usr` is mounted read-only on nodes {#usr-mounted-read-only}
|
||||||
|
|
||||||
On Linux distributions such as Fedora CoreOS, the directory `/usr` is mounted as a read-only filesystem.
|
On Linux distributions such as Fedora CoreOS or Flatcar Container Linux, the directory `/usr` is mounted as a read-only filesystem.
|
||||||
For [flex-volume support](https://github.com/kubernetes/community/blob/ab55d85/contributors/devel/sig-storage/flexvolume.md),
|
For [flex-volume support](https://github.com/kubernetes/community/blob/ab55d85/contributors/devel/sig-storage/flexvolume.md),
|
||||||
Kubernetes components like the kubelet and kube-controller-manager use the default path of
|
Kubernetes components like the kubelet and kube-controller-manager use the default path of
|
||||||
`/usr/libexec/kubernetes/kubelet-plugins/volume/exec/`, yet the flex-volume directory _must be writeable_
|
`/usr/libexec/kubernetes/kubelet-plugins/volume/exec/`, yet the flex-volume directory _must be writeable_
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ Once you have a Linux-based Kubernetes control-plane node you are ready to choos
|
|||||||
"Network": "10.244.0.0/16",
|
"Network": "10.244.0.0/16",
|
||||||
"Backend": {
|
"Backend": {
|
||||||
"Type": "vxlan",
|
"Type": "vxlan",
|
||||||
"VNI" : 4096,
|
"VNI": 4096,
|
||||||
"Port": 4789
|
"Port": 4789
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ dynamically, you need a strong understanding of how that change will affect your
|
|||||||
cluster's behavior. Always carefully test configuration changes on a small set
|
cluster's behavior. Always carefully test configuration changes on a small set
|
||||||
of nodes before rolling them out cluster-wide. Advice on configuring specific
|
of nodes before rolling them out cluster-wide. Advice on configuring specific
|
||||||
fields is available in the inline `KubeletConfiguration`
|
fields is available in the inline `KubeletConfiguration`
|
||||||
[type documentation](https://github.com/kubernetes/kubernetes/blob/release-1.11/pkg/kubelet/apis/kubeletconfig/v1beta1/types.go).
|
[type documentation (for v1.20)](https://github.com/kubernetes/kubernetes/blob/release-1.20/staging/src/k8s.io/kubelet/config/v1beta1/types.go).
|
||||||
{{< /warning >}}
|
{{< /warning >}}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -187,7 +187,7 @@ Where `YWRtaW5pc3RyYXRvcg==` decodes to `administrator`.
|
|||||||
To delete the Secret you have just created:
|
To delete the Secret you have just created:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl delete secret db-user-pass
|
kubectl delete secret mysecret
|
||||||
```
|
```
|
||||||
|
|
||||||
## {{% heading "whatsnext" %}}
|
## {{% heading "whatsnext" %}}
|
||||||
|
|||||||
@@ -221,9 +221,9 @@ the global HPA settings exposed as flags for the `kube-controller-manager` compo
|
|||||||
Starting from v1.12, a new algorithmic update removes the need for the
|
Starting from v1.12, a new algorithmic update removes the need for the
|
||||||
upscale delay.
|
upscale delay.
|
||||||
|
|
||||||
- `--horizontal-pod-autoscaler-downscale-stabilization`: The value for this option is a
|
- `--horizontal-pod-autoscaler-downscale-stabilization`: Specifies the duration of the
|
||||||
duration that specifies how long the autoscaler has to wait before another
|
downscale stabilization time window. Horizontal Pod Autoscaler remembers
|
||||||
downscale operation can be performed after the current one has completed.
|
the historical recommended sizes and only acts on the largest size within this time window.
|
||||||
The default value is 5 minutes (`5m0s`).
|
The default value is 5 minutes (`5m0s`).
|
||||||
|
|
||||||
{{< note >}}
|
{{< note >}}
|
||||||
|
|||||||
@@ -552,7 +552,7 @@ In another terminal, watch the Pods in the StatefulSet:
|
|||||||
```shell
|
```shell
|
||||||
kubectl get pod -l app=nginx -w
|
kubectl get pod -l app=nginx -w
|
||||||
```
|
```
|
||||||
The output is simular to:
|
The output is similar to:
|
||||||
```
|
```
|
||||||
NAME READY STATUS RESTARTS AGE
|
NAME READY STATUS RESTARTS AGE
|
||||||
web-0 1/1 Running 0 7m
|
web-0 1/1 Running 0 7m
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ cpu-demo 974m <something>
|
|||||||
Souvenez-vous qu'en réglant `-cpu "2"`, vous avez configuré le conteneur pour faire en sorte qu'il utilise 2 CPU, mais que le conteneur ne peut utiliser qu'environ 1 CPU. L'utilisation du CPU du conteneur est entravée, car le conteneur tente d'utiliser plus de ressources CPU que sa limite.
|
Souvenez-vous qu'en réglant `-cpu "2"`, vous avez configuré le conteneur pour faire en sorte qu'il utilise 2 CPU, mais que le conteneur ne peut utiliser qu'environ 1 CPU. L'utilisation du CPU du conteneur est entravée, car le conteneur tente d'utiliser plus de ressources CPU que sa limite.
|
||||||
|
|
||||||
{{< note >}}
|
{{< note >}}
|
||||||
Une autre explication possible de la la restriction du CPU est que le Nœud pourrait ne pas avoir
|
Une autre explication possible de la restriction du CPU est que le Nœud pourrait ne pas avoir
|
||||||
suffisamment de ressources CPU disponibles. Rappelons que les conditions préalables à cet exercice exigent que chacun de vos Nœuds doit avoir au moins 1 CPU.
|
suffisamment de ressources CPU disponibles. Rappelons que les conditions préalables à cet exercice exigent que chacun de vos Nœuds doit avoir au moins 1 CPU.
|
||||||
Si votre conteneur fonctionne sur un nœud qui n'a qu'un seul CPU, le conteneur ne peut pas utiliser plus que 1 CPU, quelle que soit la limite de CPU spécifiée pour le conteneur.
|
Si votre conteneur fonctionne sur un nœud qui n'a qu'un seul CPU, le conteneur ne peut pas utiliser plus que 1 CPU, quelle que soit la limite de CPU spécifiée pour le conteneur.
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ CNCF コミュニティ行動規範 v1.0
|
|||||||
|
|
||||||
Kubernetesで虐待的、嫌がらせ、または許されない行動があった場合には、<conduct@kubernetes.io>から[Kubernetes Code of Conduct Committee](https://git.k8s.io/community/committee-code-of-conduct)(行動規範委員会)にご連絡ください。その他のプロジェクトにつきましては、CNCFプロジェクト管理者または仲介者<mishi@linux.com>にご連絡ください。
|
Kubernetesで虐待的、嫌がらせ、または許されない行動があった場合には、<conduct@kubernetes.io>から[Kubernetes Code of Conduct Committee](https://git.k8s.io/community/committee-code-of-conduct)(行動規範委員会)にご連絡ください。その他のプロジェクトにつきましては、CNCFプロジェクト管理者または仲介者<mishi@linux.com>にご連絡ください。
|
||||||
|
|
||||||
本行動規範は、コントリビューターの合意 (http://contributor-covenant.org) バージョン 1.2.0 http://contributor-covenant.org/version/1/2/0/ から適応されています。
|
本行動規範は、コントリビューターの合意 (https://contributor-covenant.org) バージョン 1.2.0 https://contributor-covenant.org/version/1/2/0/ から適応されています。
|
||||||
|
|
||||||
### CNCF イベント行動規範
|
### CNCF イベント行動規範
|
||||||
|
|
||||||
|
|||||||
@@ -52,4 +52,4 @@ Kubernetesにおいてタイムスキューを避けるために、全てのNode
|
|||||||
|
|
||||||
* [Jobの自動クリーンアップ](/ja/docs/concepts/workloads/controllers/job/#clean-up-finished-jobs-automatically)
|
* [Jobの自動クリーンアップ](/ja/docs/concepts/workloads/controllers/job/#clean-up-finished-jobs-automatically)
|
||||||
|
|
||||||
* [設計ドキュメント](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/0026-ttl-after-finish.md)
|
* [設計ドキュメント](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/592-ttl-after-finish/README.md)
|
||||||
|
|||||||
+258
@@ -0,0 +1,258 @@
|
|||||||
|
---
|
||||||
|
title: Namespaceに対する最小および最大メモリー制約の構成
|
||||||
|
|
||||||
|
content_type: task
|
||||||
|
weight: 30
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
<!-- overview -->
|
||||||
|
|
||||||
|
このページでは、Namespaceで実行されるコンテナが使用するメモリーの最小値と最大値を設定する方法を説明します。
|
||||||
|
[LimitRange](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#limitrange-v1-core) で最小値と最大値のメモリー値を指定します。
|
||||||
|
PodがLimitRangeによって課される制約を満たさない場合、そのNamespaceではPodを作成できません。
|
||||||
|
|
||||||
|
|
||||||
|
## {{% heading "prerequisites" %}}
|
||||||
|
|
||||||
|
|
||||||
|
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
||||||
|
|
||||||
|
クラスター内の各ノードには、少なくとも1GiBのメモリーが必要です。
|
||||||
|
|
||||||
|
|
||||||
|
<!-- steps -->
|
||||||
|
|
||||||
|
## Namespaceの作成
|
||||||
|
|
||||||
|
この演習で作成したリソースがクラスターの他の部分から分離されるように、Namespaceを作成します。
|
||||||
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl create namespace constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
## LimitRangeとPodを作成
|
||||||
|
|
||||||
|
LimitRangeの設定ファイルです。
|
||||||
|
|
||||||
|
{{< codenew file="admin/resource/memory-constraints.yaml" >}}
|
||||||
|
|
||||||
|
LimitRangeを作成します。
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl apply -f https://k8s.io/examples/admin/resource/memory-constraints.yaml --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
LimitRangeの詳細情報を表示します。
|
||||||
|
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl get limitrange mem-min-max-demo-lr --namespace=constraints-mem-example --output=yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
出力されるのは、予想通りメモリー制約の最小値と最大値を示しています。
|
||||||
|
しかし、LimitRangeの設定ファイルでデフォルト値を指定していないにもかかわらず、
|
||||||
|
自動的に作成されていることに気づきます。
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
limits:
|
||||||
|
- default:
|
||||||
|
memory: 1Gi
|
||||||
|
defaultRequest:
|
||||||
|
memory: 1Gi
|
||||||
|
max:
|
||||||
|
memory: 1Gi
|
||||||
|
min:
|
||||||
|
memory: 500Mi
|
||||||
|
type: Container
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
constraints-mem-exampleNamespaceにコンテナが作成されるたびに、
|
||||||
|
Kubernetesは以下の手順を実行するようになっています。
|
||||||
|
|
||||||
|
* コンテナが独自のメモリー要求と制限を指定しない場合は、デフォルトのメモリー要求と制限をコンテナに割り当てます。
|
||||||
|
|
||||||
|
* コンテナに500MiB以上のメモリー要求があることを確認します。
|
||||||
|
|
||||||
|
* コンテナのメモリー制限が1GiB以下であることを確認します。
|
||||||
|
|
||||||
|
以下は、1つのコンテナを持つPodの設定ファイルです。設定ファイルのコンテナ(containers)では、600MiBのメモリー要求と800MiBのメモリー制限が指定されています。これらはLimitRangeによって課される最小と最大のメモリー制約を満たしています。
|
||||||
|
|
||||||
|
|
||||||
|
{{< codenew file="admin/resource/memory-constraints-pod.yaml" >}}
|
||||||
|
|
||||||
|
Podの作成
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl apply -f https://k8s.io/examples/admin/resource/memory-constraints-pod.yaml --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
Podのコンテナが実行されていることを確認します。
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl get pod constraints-mem-demo --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
Podの詳細情報を見ます
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl get pod constraints-mem-demo --output=yaml --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
出力は、コンテナが600MiBのメモリ要求と800MiBのメモリー制限になっていることを示しています。これらはLimitRangeによって課される制約を満たしています。
|
||||||
|
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 800Mi
|
||||||
|
requests:
|
||||||
|
memory: 600Mi
|
||||||
|
```
|
||||||
|
|
||||||
|
Podを消します。
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl delete pod constraints-mem-demo --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
## 最大メモリ制約を超えるPodの作成の試み
|
||||||
|
|
||||||
|
これは、1つのコンテナを持つPodの設定ファイルです。コンテナは800MiBのメモリー要求と1.5GiBのメモリー制限を指定しています。
|
||||||
|
|
||||||
|
|
||||||
|
{{< codenew file="admin/resource/memory-constraints-pod-2.yaml" >}}
|
||||||
|
|
||||||
|
Podを作成してみます。
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl apply -f https://k8s.io/examples/admin/resource/memory-constraints-pod-2.yaml --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
出力は、コンテナが大きすぎるメモリー制限を指定しているため、Podが作成されないことを示しています。
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
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.
|
||||||
|
```
|
||||||
|
|
||||||
|
## 最低限のメモリ要求を満たさないPodの作成の試み
|
||||||
|
|
||||||
|
|
||||||
|
これは、1つのコンテナを持つPodの設定ファイルです。コンテナは100MiBのメモリー要求と800MiBのメモリー制限を指定しています。
|
||||||
|
|
||||||
|
|
||||||
|
{{< codenew file="admin/resource/memory-constraints-pod-3.yaml" >}}
|
||||||
|
|
||||||
|
Podを作成してみます。
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl apply -f https://k8s.io/examples/admin/resource/memory-constraints-pod-3.yaml --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
出力は、コンテナが小さすぎるメモリー要求を指定しているため、Podが作成されないことを示しています。
|
||||||
|
|
||||||
|
```
|
||||||
|
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.
|
||||||
|
```
|
||||||
|
|
||||||
|
## メモリ要求や制限を指定しないPodの作成
|
||||||
|
|
||||||
|
|
||||||
|
これは、1つのコンテナを持つPodの設定ファイルです。コンテナはメモリー要求を指定しておらず、メモリー制限も指定していません。
|
||||||
|
|
||||||
|
{{< codenew file="admin/resource/memory-constraints-pod-4.yaml" >}}
|
||||||
|
|
||||||
|
Podを作成します。
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl apply -f https://k8s.io/examples/admin/resource/memory-constraints-pod-4.yaml --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
Podの詳細情報を見ます
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl get pod constraints-mem-demo-4 --namespace=constraints-mem-example --output=yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
出力を見ると、Podのコンテナのメモリ要求は1GiB、メモリー制限は1GiBであることがわかります。
|
||||||
|
コンテナはどのようにしてこれらの値を取得したのでしょうか?
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: 1Gi
|
||||||
|
requests:
|
||||||
|
memory: 1Gi
|
||||||
|
```
|
||||||
|
|
||||||
|
コンテナが独自のメモリー要求と制限を指定していなかったため、LimitRangeから与えられのです。
|
||||||
|
コンテナが独自のメモリー要求と制限を指定していなかったため、LimitRangeから[デフォルトのメモリー要求と制限](/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/)が与えられたのです。
|
||||||
|
|
||||||
|
この時点で、コンテナは起動しているかもしれませんし、起動していないかもしれません。このタスクの前提条件は、ノードが少なくとも1GiBのメモリーを持っていることであることを思い出してください。それぞれのノードが1GiBのメモリーしか持っていない場合、どのノードにも1GiBのメモリー要求に対応するのに十分な割り当て可能なメモリーがありません。たまたま2GiBのメモリーを持つノードを使用しているのであれば、おそらく1GiBのメモリーリクエストに対応するのに十分なスペースを持っていることになります。
|
||||||
|
|
||||||
|
|
||||||
|
Podを削除します。
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl delete pod constraints-mem-demo-4 --namespace=constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
## 最小および最大メモリー制約の強制
|
||||||
|
|
||||||
|
LimitRangeによってNamespaceに課される最大および最小のメモリー制約は、Podが作成または更新されたときにのみ適用されます。LimitRangeを変更しても、以前に作成されたPodには影響しません。
|
||||||
|
|
||||||
|
|
||||||
|
## 最小・最大メモリー制約の動機
|
||||||
|
|
||||||
|
|
||||||
|
クラスター管理者としては、Podが使用できるメモリー量に制限を課したいと思うかもしれません。
|
||||||
|
|
||||||
|
|
||||||
|
例:
|
||||||
|
|
||||||
|
* クラスター内の各ノードは2GBのメモリーを持っています。クラスタ内のどのノードもその要求をサポートできないため、2GB以上のメモリーを要求するPodは受け入れたくありません。
|
||||||
|
|
||||||
|
|
||||||
|
* クラスターは運用部門と開発部門で共有されています。 本番用のワークロードでは最大8GBのメモリーを消費しますが、開発用のワークロードでは512MBに制限したいとします。本番用と開発用に別々のNamespaceを作成し、それぞれのNamespaceにメモリー制限を適用します。
|
||||||
|
|
||||||
|
## クリーンアップ
|
||||||
|
|
||||||
|
Namespaceを削除します。
|
||||||
|
|
||||||
|
```shell
|
||||||
|
kubectl delete namespace constraints-mem-example
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## {{% heading "whatsnext" %}}
|
||||||
|
|
||||||
|
|
||||||
|
### クラスター管理者向け
|
||||||
|
|
||||||
|
* [名前空間に対するデフォルトのメモリー要求と制限の構成](/docs/tasks/administer-cluster/manage-resources/memory-default-namespace/)
|
||||||
|
|
||||||
|
* [名前空間に対するデフォルトのCPU要求と制限の構成](/docs/tasks/administer-cluster/manage-resources/cpu-default-namespace/)
|
||||||
|
|
||||||
|
* [名前空間に対する最小および最大CPU制約の構成](/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace/)
|
||||||
|
|
||||||
|
* [名前空間に対するメモリーとCPUのクォータの構成](/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/)
|
||||||
|
|
||||||
|
* [名前空間に対するPodクォータの設定](/docs/tasks/administer-cluster/manage-resources/quota-pod-namespace/)
|
||||||
|
|
||||||
|
* [APIオブジェクトのクォータの設定](/docs/tasks/administer-cluster/quota-api-object/)
|
||||||
|
|
||||||
|
### アプリケーション開発者向け
|
||||||
|
|
||||||
|
* [コンテナとPodへのメモリーリソースの割り当て](/docs/tasks/configure-pod-container/assign-memory-resource/)
|
||||||
|
|
||||||
|
* [コンテナとPodへのCPUリソースの割り当て](/docs/tasks/configure-pod-container/assign-cpu-resource/)
|
||||||
|
|
||||||
|
* [PodのQoS(サービス品質)を設定](/docs/tasks/configure-pod-container/quality-service-pod/)
|
||||||
@@ -69,7 +69,7 @@ VXLAN/오버레이 네트워킹을 사용하는 경우 [KB4489899](https://suppo
|
|||||||
"Network": "10.244.0.0/16",
|
"Network": "10.244.0.0/16",
|
||||||
"Backend": {
|
"Backend": {
|
||||||
"Type": "vxlan",
|
"Type": "vxlan",
|
||||||
"VNI" : 4096,
|
"VNI": 4096,
|
||||||
"Port": 4789
|
"Port": 4789
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -939,10 +939,10 @@ For background information on design details for API priority and fairness, see
|
|||||||
[enhancement proposal](https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190228-priority-and-fairness.md).
|
[enhancement proposal](https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190228-priority-and-fairness.md).
|
||||||
You can make suggestions and feature requests via
|
You can make suggestions and feature requests via
|
||||||
[SIG API Machinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery)
|
[SIG API Machinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery)
|
||||||
or the feature's [slack channel](http://kubernetes.slack.com/messages/api-priority-and-fairness).
|
or the feature's [slack channel](https://kubernetes.slack.com/messages/api-priority-and-fairness).
|
||||||
-->
|
-->
|
||||||
有关API优先级和公平性的设计细节的背景信息,
|
有关API优先级和公平性的设计细节的背景信息,
|
||||||
请参阅[增强建议](https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190228-priority-and-fairness.md)。
|
请参阅[增强建议](https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/20190228-priority-and-fairness.md)。
|
||||||
你可以通过 [SIG APIMachinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery)
|
你可以通过 [SIG APIMachinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery/)
|
||||||
或特性的 [Slack 频道](http://kubernetes.slack.com/messages/api-priority-and-fairness)
|
或特性的 [Slack 频道](https://kubernetes.slack.com/messages/api-priority-and-fairness/)
|
||||||
提出建议和特性请求。
|
提出建议和特性请求。
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ kubelet 在驱动程序上保持打开状态。这意味着为了执行基础结
|
|||||||
现在,收集加速器指标的责任属于供应商,而不是 kubelet。供应商必须提供一个收集指标的容器,
|
现在,收集加速器指标的责任属于供应商,而不是 kubelet。供应商必须提供一个收集指标的容器,
|
||||||
并将其公开给指标服务(例如 Prometheus)。
|
并将其公开给指标服务(例如 Prometheus)。
|
||||||
|
|
||||||
[`DisableAcceleratorUsageMetrics` 特性门控](/zh/docs/references/command-line-tools-reference/feature-gates/)
|
[`DisableAcceleratorUsageMetrics` 特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/)
|
||||||
禁止由 kubelet 收集的指标。
|
禁止由 kubelet 收集的指标。
|
||||||
关于[何时会在默认情况下启用此功能也有一定规划](https://github.com/kubernetes/enhancements/tree/411e51027db842355bd489691af897afc1a41a5e/keps/sig-node/1867-disable-accelerator-usage-metrics#graduation-criteria)。
|
关于[何时会在默认情况下启用此功能也有一定规划](https://github.com/kubernetes/enhancements/tree/411e51027db842355bd489691af897afc1a41a5e/keps/sig-node/1867-disable-accelerator-usage-metrics#graduation-criteria)。
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,6 @@ to disable the timeout restriction. This deprecated feature gate will be removed
|
|||||||
了解如何在自己的环境中启用聚合器。
|
了解如何在自己的环境中启用聚合器。
|
||||||
* 接下来,了解[安装扩展 API 服务器](/zh/docs/tasks/extend-kubernetes/setup-extension-api-server/),
|
* 接下来,了解[安装扩展 API 服务器](/zh/docs/tasks/extend-kubernetes/setup-extension-api-server/),
|
||||||
开始使用聚合层。
|
开始使用聚合层。
|
||||||
* 也可以学习怎样[使用自定义资源定义扩展 Kubernetes API](zh/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/)。
|
* 也可以学习怎样[使用自定义资源定义扩展 Kubernetes API](/zh/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/)。
|
||||||
* 阅读 [APIService](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#apiservice-v1-apiregistration-k8s-io) 的规范
|
* 阅读 [APIService](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#apiservice-v1-apiregistration-k8s-io) 的规范
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ Extensions are software components that extend and deeply integrate with Kuberne
|
|||||||
They adapt it to support new types and new kinds of hardware.
|
They adapt it to support new types and new kinds of hardware.
|
||||||
|
|
||||||
Most cluster administrators will use a hosted or distribution
|
Most cluster administrators will use a hosted or distribution
|
||||||
instance of Kubernetes. As a result, most Kubernetes users will need to
|
instance of Kubernetes. As a result, most Kubernetes users will not need to
|
||||||
install extensions and fewer will need to author new ones.
|
install extensions and fewer will need to author new ones.
|
||||||
-->
|
-->
|
||||||
## 扩展程序 {#extension}
|
## 扩展程序 {#extension}
|
||||||
@@ -105,7 +105,7 @@ install extensions and fewer will need to author new ones.
|
|||||||
扩展程序是指对 Kubernetes 进行扩展和深度集成的软件组件。它们适合用于支持新的类型和新型硬件。
|
扩展程序是指对 Kubernetes 进行扩展和深度集成的软件组件。它们适合用于支持新的类型和新型硬件。
|
||||||
|
|
||||||
大多数集群管理员会使用托管的或统一分发的 Kubernetes 实例。
|
大多数集群管理员会使用托管的或统一分发的 Kubernetes 实例。
|
||||||
因此,大多数 Kubernetes 用户需要安装扩展程序,而且还有少部分用户甚至需要编写新的扩展程序。
|
因此,大多数 Kubernetes 用户不需要安装扩展程序,而且还有少部分用户甚至需要编写新的扩展程序。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Extension Patterns
|
## Extension Patterns
|
||||||
@@ -145,21 +145,20 @@ failure.
|
|||||||
<!--
|
<!--
|
||||||
In the webhook model, Kubernetes makes a network request to a remote service.
|
In the webhook model, Kubernetes makes a network request to a remote service.
|
||||||
In the *Binary Plugin* model, Kubernetes executes a binary (program).
|
In the *Binary Plugin* model, Kubernetes executes a binary (program).
|
||||||
Binary plugins are used by the kubelet (e.g. [Flex Volume
|
Binary plugins are used by the kubelet (e.g.
|
||||||
Plugins](https://github.com/kubernetes/community/blob/master/contributors/devel/flexvolume.md)
|
[Flex Volume Plugins](/docs/concepts/storage/volumes/#flexvolume)
|
||||||
and [Network
|
and [Network Plugins](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/))
|
||||||
Plugins](/docs/concepts/cluster-administration/network-plugins/))
|
|
||||||
and by kubectl.
|
and by kubectl.
|
||||||
-->
|
-->
|
||||||
在 webhook 模型里,Kubernetes 向远程服务发送一个网络请求。
|
在 webhook 模型里,Kubernetes 向远程服务发送一个网络请求。
|
||||||
在 *可执行文件插件* 模型里,Kubernetes 执行一个可执行文件(程序)。
|
在 *可执行文件插件* 模型里,Kubernetes 执行一个可执行文件(程序)。
|
||||||
可执行文件插件被 kubelet(如
|
可执行文件插件被 kubelet(如
|
||||||
[Flex 卷插件](https://github.com/kubernetes/community/blob/master/contributors/devel/flexvolume.md)和
|
[Flex 卷插件](/zh/docs/concepts/storage/volumes/#flexvolume)
|
||||||
[网络插件](/zh/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)和
|
和[网络插件](/zh/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
|
||||||
`kubectl` 所使用。
|
和 `kubectl` 所使用。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Below is a diagram showing how the extensions points interact with the
|
Below is a diagram showing how the extension points interact with the
|
||||||
Kubernetes control plane.
|
Kubernetes control plane.
|
||||||
-->
|
-->
|
||||||
下图显示了扩展点如何与 Kubernetes 控制平面进行交互。
|
下图显示了扩展点如何与 Kubernetes 控制平面进行交互。
|
||||||
@@ -184,13 +183,14 @@ This diagram shows the extension points in a Kubernetes system.
|
|||||||
<!-- image source diagrams: https://docs.google.com/drawings/d/1k2YdJgNTtNfW7_A8moIIkij-DmVgEhNrn3y2OODwqQQ/view -->
|
<!-- image source diagrams: https://docs.google.com/drawings/d/1k2YdJgNTtNfW7_A8moIIkij-DmVgEhNrn3y2OODwqQQ/view -->
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
1. Users often interact with the Kubernetes API using `kubectl`. [Kubectl plugins](/docs/tasks/extend-kubectl/kubectl-plugins/) extend the kubectl binary. They only affect the individual user's local environment, and so cannot enforce site-wide policies.
|
1. Users often interact with the Kubernetes API using `kubectl`. [Kubectl plugins](/docs/tasks/extend-kubectl/kubectl-plugins/) extend the kubectl binary. They only affect the individual user's local environment, and so cannot enforce site-wide policies.
|
||||||
2. The apiserver handles all requests. Several types of extension points in the apiserver allow authenticating requests, or blocking them based on their content, editing content, and handling deletion. These are described in the [API Access Extensions](/docs/concepts/extend-kubernetes/#api-access-extensions) section.
|
2. The apiserver handles all requests. Several types of extension points in the apiserver allow authenticating requests, or blocking them based on their content, editing content, and handling deletion. These are described in the [API Access Extensions](/docs/concepts/extend-kubernetes/#api-access-extensions) section.
|
||||||
3. The apiserver serves various kinds of *resources*. *Built-in resource kinds*, like `pods`, are defined by the Kubernetes project and can't be changed. You can also add resources that you define, or that other projects have defined, called *Custom Resources*, as explained in the [Custom Resources](/docs/concepts/extend-kubernetes/#user-defined-types) section. Custom Resources are often used with API Access Extensions.
|
3. The apiserver serves various kinds of *resources*. *Built-in resource kinds*, like `pods`, are defined by the Kubernetes project and can't be changed. You can also add resources that you define, or that other projects have defined, called *Custom Resources*, as explained in the [Custom Resources](/docs/concepts/extend-kubernetes/#user-defined-types) section. Custom Resources are often used with API Access Extensions.
|
||||||
4. The Kubernetes scheduler decides which nodes to place pods on. There are several ways to extend scheduling. These are described in the [Scheduler Extensions](/docs/concepts/overview/extending#scheduler-extensions) section.
|
4. The Kubernetes scheduler decides which nodes to place pods on. There are several ways to extend scheduling. These are described in the [Scheduler Extensions](/docs/concepts/extend-kubernetes/#scheduler-extensions) section.
|
||||||
5. Much of the behavior of Kubernetes is implemented by programs called Controllers which are clients of the API-Server. Controllers are often used in conjunction with Custom Resources.
|
5. Much of the behavior of Kubernetes is implemented by programs called Controllers which are clients of the API-Server. Controllers are often used in conjunction with Custom Resources.
|
||||||
6. The kubelet runs on servers, and helps pods appear like virtual servers with their own IPs on the cluster network. [Network Plugins](/docs/concepts/overview/extending#network-plugins) allow for different implementations of pod networking.
|
6. The kubelet runs on servers, and helps pods appear like virtual servers with their own IPs on the cluster network. [Network Plugins](/docs/concepts/extend-kubernetes/#network-plugins) allow for different implementations of pod networking.
|
||||||
7. The kubelet also mounts and unmounts volumes for containers. New types of storage can be supported via [Storage Plugins](/docs/concepts/overview/extending#storage-plugins).
|
7. The kubelet also mounts and unmounts volumes for containers. New types of storage can be supported via [Storage Plugins](/docs/concepts/extend-kubernetes/#storage-plugins).
|
||||||
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
1. 用户通常使用 `kubectl` 与 Kubernetes API 进行交互。
|
1. 用户通常使用 `kubectl` 与 Kubernetes API 进行交互。
|
||||||
@@ -209,9 +209,9 @@ This diagram shows the extension points in a Kubernetes system.
|
|||||||
5. Kubernetes 的大部分行为都是由称为控制器(Controllers)的程序实现的,这些程序是 API 服务器的客户端。
|
5. Kubernetes 的大部分行为都是由称为控制器(Controllers)的程序实现的,这些程序是 API 服务器的客户端。
|
||||||
控制器通常与自定义资源一起使用。
|
控制器通常与自定义资源一起使用。
|
||||||
6. `kubelet` 在主机上运行,并帮助 Pod 看起来就像在集群网络上拥有自己的 IP 的虚拟服务器。
|
6. `kubelet` 在主机上运行,并帮助 Pod 看起来就像在集群网络上拥有自己的 IP 的虚拟服务器。
|
||||||
[网络插件](/zh/docs/concepts/extend-kubernetes/#network-plugins/)让你可以实现不同的 pod 网络。
|
[网络插件](/zh/docs/concepts/extend-kubernetes/#network-plugins)让你可以实现不同的 pod 网络。
|
||||||
7. `kubelet` 也负责为容器挂载和卸载卷。新的存储类型可以通过
|
7. `kubelet` 也负责为容器挂载和卸载卷。新的存储类型可以通过
|
||||||
[存储插件](/zh/docs/concepts/extend-kubernetes/#storage-plugins/)支持。
|
[存储插件](/zh/docs/concepts/extend-kubernetes/#storage-plugins)支持。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
If you are unsure where to start, this flowchart can help. Note that some solutions may involve several types of extensions.
|
If you are unsure where to start, this flowchart can help. Note that some solutions may involve several types of extensions.
|
||||||
@@ -230,7 +230,7 @@ Consider adding a Custom Resource to Kubernetes if you want to define new contro
|
|||||||
|
|
||||||
Do not use a Custom Resource as data storage for application, user, or monitoring data.
|
Do not use a Custom Resource as data storage for application, user, or monitoring data.
|
||||||
|
|
||||||
For more about Custom Resources, see the [Custom Resources concept guide](/docs/concepts/api-extension/custom-resources/).
|
For more about Custom Resources, see the [Custom Resources concept guide](/docs/concepts/extend-kubernetes/api-extension/custom-resources/).
|
||||||
-->
|
-->
|
||||||
## API 扩展 {#api-extensions}
|
## API 扩展 {#api-extensions}
|
||||||
|
|
||||||
@@ -343,24 +343,23 @@ After a request is authorized, if it is a write operation, it also goes through
|
|||||||
|
|
||||||
### Storage Plugins
|
### Storage Plugins
|
||||||
|
|
||||||
[Flex Volumes](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/flexvolume-deployment.md
|
[Flex Volumes](/docs/concepts/storage/volumes/#flexvolume)
|
||||||
) allow users to mount volume types without built-in support by having the
|
allow users to mount volume types without built-in support by having the
|
||||||
Kubelet call a Binary Plugin to mount the volume.
|
Kubelet call a Binary Plugin to mount the volume.
|
||||||
-->
|
-->
|
||||||
## 基础设施扩展
|
## 基础设施扩展
|
||||||
|
|
||||||
### 存储插件
|
### 存储插件
|
||||||
|
|
||||||
[Flex Volumes](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/flexvolume-deployment.md
|
[Flex Volumes](/zh/docs/concepts/storage/volumes/#flexvolume)
|
||||||
)
|
|
||||||
允许用户挂载无内置插件支持的卷类型,它通过 Kubelet 调用一个可执行文件插件来挂载卷。
|
允许用户挂载无内置插件支持的卷类型,它通过 Kubelet 调用一个可执行文件插件来挂载卷。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Device Plugins
|
### Device Plugins
|
||||||
|
|
||||||
Device plugins allow a node to discover new Node resources (in addition to the
|
Device plugins allow a node to discover new Node resources (in addition to the
|
||||||
builtin ones like cpu and memory) via a [Device
|
builtin ones like cpu and memory) via a
|
||||||
Plugin](/docs/concepts/cluster-administration/device-plugins/).
|
[Device Plugin](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/).
|
||||||
-->
|
-->
|
||||||
### 设备插件 {#device-plugins}
|
### 设备插件 {#device-plugins}
|
||||||
|
|
||||||
@@ -371,7 +370,8 @@ Plugin](/docs/concepts/cluster-administration/device-plugins/).
|
|||||||
<!--
|
<!--
|
||||||
### Network Plugins
|
### Network Plugins
|
||||||
|
|
||||||
Different networking fabrics can be supported via node-level [Network Plugins](/docs/admin/network-plugins/).
|
Different networking fabrics can be supported via node-level
|
||||||
|
[Network Plugins](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/).
|
||||||
-->
|
-->
|
||||||
### 网络插件 {#network-plugins}
|
### 网络插件 {#network-plugins}
|
||||||
|
|
||||||
@@ -408,17 +408,21 @@ the nodes chosen for a pod.
|
|||||||
[Webhook](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/scheduling/scheduler_extender.md),
|
[Webhook](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/scheduling/scheduler_extender.md),
|
||||||
它允许使用一个 Webhook 后端(调度器扩展程序)为 Pod 筛选节点和确定节点的优先级。
|
它允许使用一个 Webhook 后端(调度器扩展程序)为 Pod 筛选节点和确定节点的优先级。
|
||||||
|
|
||||||
## {{% heading "whatsnext" %}}
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
* Learn more about [Custom Resources](/docs/concepts/api-extension/custom-resources/)
|
## {{% heading "whatsnext" %}}
|
||||||
|
|
||||||
|
* Learn more about [Custom Resources](/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
|
||||||
* Learn about [Dynamic admission control](/docs/reference/access-authn-authz/extensible-admission-controllers/)
|
* Learn about [Dynamic admission control](/docs/reference/access-authn-authz/extensible-admission-controllers/)
|
||||||
* Learn more about Infrastructure extensions
|
* Learn more about Infrastructure extensions
|
||||||
* [Network Plugins](/docs/concepts/cluster-administration/network-plugins/)
|
* [Network Plugins](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
|
||||||
* [Device Plugins](/docs/concepts/cluster-administration/device-plugins/)
|
* [Device Plugins](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/)
|
||||||
* Learn about [kubectl plugins](/docs/tasks/extend-kubectl/kubectl-plugins/)
|
* Learn about [kubectl plugins](/docs/tasks/extend-kubectl/kubectl-plugins/)
|
||||||
* Learn about the [Operator pattern](/docs/concepts/extend-kubernetes/operator/)
|
* Learn about the [Operator pattern](/docs/concepts/extend-kubernetes/operator/)
|
||||||
-->
|
-->
|
||||||
|
## {{% heading "whatsnext" %}}
|
||||||
|
|
||||||
|
|
||||||
* 详细了解[自定义资源](/zh/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
|
* 详细了解[自定义资源](/zh/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
|
||||||
* 了解[动态准入控制](/zh/docs/reference/access-authn-authz/extensible-admission-controllers/)
|
* 了解[动态准入控制](/zh/docs/reference/access-authn-authz/extensible-admission-controllers/)
|
||||||
* 详细了解基础设施扩展
|
* 详细了解基础设施扩展
|
||||||
|
|||||||
@@ -1230,7 +1230,7 @@ By default, all safe sysctls are allowed.
|
|||||||
|
|
||||||
- Refer to [Pod Security Policy Reference](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy) for the api details.
|
- Refer to [Pod Security Policy Reference](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy) for the api details.
|
||||||
-->
|
-->
|
||||||
- 参阅[Pod 安全标准](zh/docs/concepts/security/pod-security-standards/)
|
- 参阅[Pod 安全标准](/zh/docs/concepts/security/pod-security-standards/)
|
||||||
了解策略建议。
|
了解策略建议。
|
||||||
- 阅读 [Pod 安全策略参考](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy)了解 API 细节。
|
- 阅读 [Pod 安全策略参考](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#podsecuritypolicy-v1beta1-policy)了解 API 细节。
|
||||||
|
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ The rest of this section will assume you have a Service with a long lived IP
|
|||||||
所以可以通过标准做法,使在集群中的任何 Pod 都能与该 Service 通信(例如:`gethostbyname()`)。
|
所以可以通过标准做法,使在集群中的任何 Pod 都能与该 Service 通信(例如:`gethostbyname()`)。
|
||||||
如果 CoreDNS 没有在运行,你可以参照
|
如果 CoreDNS 没有在运行,你可以参照
|
||||||
[CoreDNS README](https://github.com/coredns/deployment/tree/master/kubernetes) 或者
|
[CoreDNS README](https://github.com/coredns/deployment/tree/master/kubernetes) 或者
|
||||||
[安装 CoreDNS](/docs/tasks/administer-cluster/coredns/#installing-coredns) 来启用它。
|
[安装 CoreDNS](/zh/docs/tasks/administer-cluster/coredns/#installing-coredns) 来启用它。
|
||||||
让我们运行另一个 curl 应用来进行测试:
|
让我们运行另一个 curl 应用来进行测试:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
|||||||
@@ -63,28 +63,29 @@ Kubernetes 作为一个项目,目前支持和维护
|
|||||||
* [Citrix Ingress 控制器](https://github.com/citrix/citrix-k8s-ingress-controller#readme)
|
* [Citrix Ingress 控制器](https://github.com/citrix/citrix-k8s-ingress-controller#readme)
|
||||||
可以用来与 Citrix Application Delivery Controller 一起使用。
|
可以用来与 Citrix Application Delivery Controller 一起使用。
|
||||||
* [Contour](https://projectcontour.io/) 是一个基于 [Envoy](https://www.envoyproxy.io/) 的 Ingress 控制器。
|
* [Contour](https://projectcontour.io/) 是一个基于 [Envoy](https://www.envoyproxy.io/) 的 Ingress 控制器。
|
||||||
* [EnRoute](https://getenroute.io/) 是一个基于 [Envoy](https://www.envoyproxy.io) API 网关能够执行 Ingress 控制器。
|
* [EnRoute](https://getenroute.io/) 是一个基于 [Envoy](https://www.envoyproxy.io) API 网关,
|
||||||
|
可以作为 Ingress 控制器来执行。
|
||||||
<!--
|
<!--
|
||||||
* F5 BIG-IP [Container Ingress Services for Kubernetes](https://clouddocs.f5.com/containers/latest/userguide/kubernetes/)
|
* F5 BIG-IP [Container Ingress Services for Kubernetes](https://clouddocs.f5.com/containers/latest/userguide/kubernetes/)
|
||||||
lets you use an Ingress to configure F5 BIG-IP virtual servers.
|
lets you use an Ingress to configure F5 BIG-IP virtual servers.
|
||||||
* [Gloo](https://gloo.solo.io) is an open-source ingress controller based on [Envoy](https://www.envoyproxy.io),
|
* [Gloo](https://gloo.solo.io) is an open-source ingress controller based on [Envoy](https://www.envoyproxy.io),
|
||||||
which offers API gateway functionality.
|
which offers API gateway functionality.
|
||||||
* [HAProxy Ingress](https://haproxy-ingress.github.io/) is an ingress controller for
|
* [HAProxy Ingress](https://haproxy-ingress.github.io/) is an ingress controller for
|
||||||
[HAProxy](http://www.haproxy.org/#desc).
|
[HAProxy](https://www.haproxy.org/#desc).
|
||||||
* The [HAProxy Ingress Controller for Kubernetes](https://github.com/haproxytech/kubernetes-ingress#readme)
|
* The [HAProxy Ingress Controller for Kubernetes](https://github.com/haproxytech/kubernetes-ingress#readme)
|
||||||
is also an ingress controller for [HAProxy](http://www.haproxy.org/#desc).
|
is also an ingress controller for [HAProxy](https://www.haproxy.org/#desc).
|
||||||
* [Istio Ingress](https://istio.io/latest/docs/tasks/traffic-management/ingress/kubernetes-ingress/)
|
* [Istio Ingress](https://istio.io/latest/docs/tasks/traffic-management/ingress/kubernetes-ingress/)
|
||||||
is an [Istio](https://istio.io/) based ingress controller.
|
is an [Istio](https://istio.io/) based ingress controller.
|
||||||
-->
|
-->
|
||||||
* F5 BIG-IP 的
|
* F5 BIG-IP 的
|
||||||
[用于 Kubernetes 的容器 Ingress 服务](http://clouddocs.f5.com/products/connectors/k8s-bigip-ctlr/latest)
|
[用于 Kubernetes 的容器 Ingress 服务](https://clouddocs.f5.com/products/connectors/k8s-bigip-ctlr/latest)
|
||||||
让你能够使用 Ingress 来配置 F5 BIG-IP 虚拟服务器。
|
让你能够使用 Ingress 来配置 F5 BIG-IP 虚拟服务器。
|
||||||
* [Gloo](https://gloo.solo.io) 是一个开源的、基于 [Envoy](https://www.envoyproxy.io) 的
|
* [Gloo](https://gloo.solo.io) 是一个开源的、基于 [Envoy](https://www.envoyproxy.io) 的
|
||||||
Ingress 控制器,能够提供 API 网关功能,
|
Ingress 控制器,能够提供 API 网关功能,
|
||||||
* [HAProxy Ingress](https://haproxy-ingress.github.io/) 针对 [HAProxy](http://www.haproxy.org/#desc)
|
* [HAProxy Ingress](https://haproxy-ingress.github.io/) 针对 [HAProxy](https://www.haproxy.org/#desc)
|
||||||
的 Ingress 控制器。
|
的 Ingress 控制器。
|
||||||
* [用于 Kubernetes 的 HAProxy Ingress 控制器](https://github.com/haproxytech/kubernetes-ingress#readme)
|
* [用于 Kubernetes 的 HAProxy Ingress 控制器](https://github.com/haproxytech/kubernetes-ingress#readme)
|
||||||
也是一个针对 [HAProxy](http://www.haproxy.org/#desc) 的 Ingress 控制器。
|
也是一个针对 [HAProxy](https://www.haproxy.org/#desc) 的 Ingress 控制器。
|
||||||
* [Istio Ingress](https://istio.io/latest/docs/tasks/traffic-management/ingress/kubernetes-ingress/)
|
* [Istio Ingress](https://istio.io/latest/docs/tasks/traffic-management/ingress/kubernetes-ingress/)
|
||||||
是一个基于 [Istio](https://istio.io/) 的 Ingress 控制器。
|
是一个基于 [Istio](https://istio.io/) 的 Ingress 控制器。
|
||||||
<!--
|
<!--
|
||||||
@@ -96,7 +97,7 @@ Kubernetes 作为一个项目,目前支持和维护
|
|||||||
* The [Traefik Kubernetes Ingress provider](https://doc.traefik.io/traefik/providers/kubernetes-ingress/) is an
|
* The [Traefik Kubernetes Ingress provider](https://doc.traefik.io/traefik/providers/kubernetes-ingress/) is an
|
||||||
ingress controller for the [Traefik](https://traefik.io/traefik/) proxy.
|
ingress controller for the [Traefik](https://traefik.io/traefik/) proxy.
|
||||||
* [Voyager](https://appscode.com/products/voyager) is an ingress controller for
|
* [Voyager](https://appscode.com/products/voyager) is an ingress controller for
|
||||||
[HAProxy](http://www.haproxy.org/#desc).
|
[HAProxy](https://www.haproxy.org/#desc).
|
||||||
-->
|
-->
|
||||||
* [用于 Kubernetes 的 Kong Ingress 控制器](https://github.com/Kong/kubernetes-ingress-controller#readme)
|
* [用于 Kubernetes 的 Kong Ingress 控制器](https://github.com/Kong/kubernetes-ingress-controller#readme)
|
||||||
是一个用来驱动 [Kong Gateway](https://konghq.com/kong/) 的 Ingress 控制器。
|
是一个用来驱动 [Kong Gateway](https://konghq.com/kong/) 的 Ingress 控制器。
|
||||||
@@ -108,7 +109,7 @@ Kubernetes 作为一个项目,目前支持和维护
|
|||||||
设计用来作为构造你自己的定制代理的库。
|
设计用来作为构造你自己的定制代理的库。
|
||||||
* [Traefik Kubernetes Ingress 提供程序](https://doc.traefik.io/traefik/providers/kubernetes-ingress/)
|
* [Traefik Kubernetes Ingress 提供程序](https://doc.traefik.io/traefik/providers/kubernetes-ingress/)
|
||||||
是一个用于 [Traefik](https://traefik.io/traefik/) 代理的 Ingress 控制器。
|
是一个用于 [Traefik](https://traefik.io/traefik/) 代理的 Ingress 控制器。
|
||||||
* [Voyager](https://appscode.com/products/voyager) 是一个针对 [HAProxy](http://www.haproxy.org/#desc)
|
* [Voyager](https://appscode.com/products/voyager) 是一个针对 [HAProxy](https://www.haproxy.org/#desc)
|
||||||
的 Ingress 控制器。
|
的 Ingress 控制器。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@@ -348,7 +348,7 @@ each Service port. The value of this field is mirrored by the corresponding
|
|||||||
Endpoints and EndpointSlice objects.
|
Endpoints and EndpointSlice objects.
|
||||||
|
|
||||||
This field follows standard Kubernetes label syntax. Values should either be
|
This field follows standard Kubernetes label syntax. Values should either be
|
||||||
[IANA standard service names](http://www.iana.org/assignments/service-names) or
|
[IANA standard service names](https://www.iana.org/assignments/service-names) or
|
||||||
domain prefixed names such as `mycompany.com/my-custom-protocol`.
|
domain prefixed names such as `mycompany.com/my-custom-protocol`.
|
||||||
-->
|
-->
|
||||||
### 应用程序协议 {#application-protocol}
|
### 应用程序协议 {#application-protocol}
|
||||||
@@ -358,8 +358,8 @@ domain prefixed names such as `mycompany.com/my-custom-protocol`.
|
|||||||
此字段的取值会被映射到对应的 Endpoints 和 EndpointSlices 对象。
|
此字段的取值会被映射到对应的 Endpoints 和 EndpointSlices 对象。
|
||||||
|
|
||||||
该字段遵循标准的 Kubernetes 标签语法。
|
该字段遵循标准的 Kubernetes 标签语法。
|
||||||
其值可以是 [IANA 标准服务名称](http://www.iana.org/assignments/service-names)或以域名前缀的名称,
|
其值可以是 [IANA 标准服务名称](https://www.iana.org/assignments/service-names)
|
||||||
如 `mycompany.com/my-custom-protocol`。
|
或以域名为前缀的名称,如 `mycompany.com/my-custom-protocol`。
|
||||||
<!--
|
<!--
|
||||||
## Virtual IPs and service proxies
|
## Virtual IPs and service proxies
|
||||||
|
|
||||||
|
|||||||
@@ -691,7 +691,7 @@ vSphere 存储类有两种制备器
|
|||||||
[弃用](/blog/2019/12/09/kubernetes-1-17-feature-csi-migration-beta/#why-are-we-migrating-in-tree-plugins-to-csi)。
|
[弃用](/blog/2019/12/09/kubernetes-1-17-feature-csi-migration-beta/#why-are-we-migrating-in-tree-plugins-to-csi)。
|
||||||
更多关于 CSI 制备器的详情,请参阅
|
更多关于 CSI 制备器的详情,请参阅
|
||||||
[Kubernetes vSphere CSI 驱动](https://vsphere-csi-driver.sigs.k8s.io/)
|
[Kubernetes vSphere CSI 驱动](https://vsphere-csi-driver.sigs.k8s.io/)
|
||||||
和 [vSphereVolume CSI 迁移](/docs/concepts/storage/volumes/#csi-migration-5)。
|
和 [vSphereVolume CSI 迁移](/zh/docs/concepts/storage/volumes/#csi-migration-5)。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
#### CSI Provisioner {#vsphere-provisioner-csi}
|
#### CSI Provisioner {#vsphere-provisioner-csi}
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ due to a node hardware failure or a node reboot).
|
|||||||
|
|
||||||
You can also use a Job to run multiple Pods in parallel.
|
You can also use a Job to run multiple Pods in parallel.
|
||||||
-->
|
-->
|
||||||
Job 会创建一个或者多个 Pods,并会持续重试直到指定数量的 Pods 成功终止。
|
|
||||||
|
Job 会创建一个或者多个 Pods,并将继续重试 Pods 的执行,直到指定数量的 Pods 成功终止。
|
||||||
随着 Pods 成功结束,Job 跟踪记录成功完成的 Pods 个数。
|
随着 Pods 成功结束,Job 跟踪记录成功完成的 Pods 个数。
|
||||||
当数量达到指定的成功个数阈值时,任务(即 Job)结束。
|
当数量达到指定的成功个数阈值时,任务(即 Job)结束。
|
||||||
删除 Job 的操作会清除所创建的全部 Pods。
|
删除 Job 的操作会清除所创建的全部 Pods。
|
||||||
|
|||||||
@@ -320,6 +320,71 @@ To make such deployment secure, communication between etcd instances is authoriz
|
|||||||
为了允许 etcd 组建集群,需开放 etcd 实例之间通信所需的端口(用于集群内部通信)。
|
为了允许 etcd 组建集群,需开放 etcd 实例之间通信所需的端口(用于集群内部通信)。
|
||||||
为了使这种部署安全,etcd 实例之间的通信使用 SSL 进行鉴权。
|
为了使这种部署安全,etcd 实例之间的通信使用 SSL 进行鉴权。
|
||||||
|
|
||||||
|
<!--
|
||||||
|
### API server identity
|
||||||
|
-->
|
||||||
|
### API 服务器标识
|
||||||
|
|
||||||
|
{{< feature-state state="alpha" for_k8s_version="v1.20" >}}
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The API Server Identity feature is controlled by a
|
||||||
|
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
|
||||||
|
and is not enabled by default. You can activate API Server Identity by enabling
|
||||||
|
the feature gate named `APIServerIdentity` when you start the
|
||||||
|
{{< glossary_tooltip text="API Server" term_id="kube-apiserver" >}}:
|
||||||
|
-->
|
||||||
|
使用 API 服务器标识功能需要启用[特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/),
|
||||||
|
该功能默认不启用。
|
||||||
|
你可以在启动 {{< glossary_tooltip text="API 服务器" term_id="kube-apiserver" >}} 的时候启用特性门控 `APIServerIdentity` 来激活 API 服务器标识:
|
||||||
|
|
||||||
|
<!--
|
||||||
|
```shell
|
||||||
|
kube-apiserver \
|
||||||
|
--feature-gates=APIServerIdentity=true \
|
||||||
|
# …and other flags as usual
|
||||||
|
```
|
||||||
|
-->
|
||||||
|
```shell
|
||||||
|
kube-apiserver \
|
||||||
|
--feature-gates=APIServerIdentity=true \
|
||||||
|
# …其他标记照常
|
||||||
|
```
|
||||||
|
|
||||||
|
<!--
|
||||||
|
During bootstrap, each kube-apiserver assigns a unique ID to itself. The ID is
|
||||||
|
in the format of `kube-apiserver-{UUID}`. Each kube-apiserver creates a
|
||||||
|
[Lease](/docs/reference/generated/kubernetes-api/{{< param "version" >}}//#lease-v1-coordination-k8s-io)
|
||||||
|
in the _kube-system_ {{< glossary_tooltip text="namespaces" term_id="namespace">}}.
|
||||||
|
-->
|
||||||
|
在启动引导过程中,每个 kube-apiserver 会给自己分配一个唯一 ID。
|
||||||
|
该 ID 的格式是 `kube-apiserver-{UUID}`。
|
||||||
|
每个 kube-apiserver 会在 _kube-system_ {{< glossary_tooltip text="名字空间" term_id="namespace">}} 里创建一个 [`Lease` 对象](/docs/reference/generated/kubernetes-api/{{< param "version" >}}//#lease-v1-coordination-k8s-io)。
|
||||||
|
<!--
|
||||||
|
The Lease name is the unique ID for the kube-apiserver. The Lease contains a
|
||||||
|
label `k8s.io/component=kube-apiserver`. Each kube-apiserver refreshes its
|
||||||
|
Lease every `IdentityLeaseRenewIntervalSeconds` (defaults to 10s). Each
|
||||||
|
kube-apiserver also checks all the kube-apiserver identity Leases every
|
||||||
|
`IdentityLeaseDurationSeconds` (defaults to 3600s), and deletes Leases that
|
||||||
|
hasn't got refreshed for more than `IdentityLeaseDurationSeconds`.
|
||||||
|
`IdentityLeaseRenewIntervalSeconds` and `IdentityLeaseDurationSeconds` can be
|
||||||
|
configured by kube-apiserver flags `identity-lease-renew-interval-seconds`
|
||||||
|
and `identity-lease-duration-seconds`.
|
||||||
|
-->
|
||||||
|
`Lease` 对象的名字是 kube-apiserver 的唯一 ID。
|
||||||
|
`Lease` 对象包含一个标签 `k8s.io/component=kube-apiserver`。
|
||||||
|
每个 kube-apiserver 每过 `IdentityLeaseRenewIntervalSeconds`(默认是 10 秒)就会刷新它的 `Lease` 对象。
|
||||||
|
每个 kube-apiserver 每过 `IdentityLeaseDurationSeconds`(默认是 3600 秒)也会检查所有 kube-apiserver 的标识 `Lease` 对象,
|
||||||
|
并且会删除超过 `IdentityLeaseDurationSeconds` 时间还没被刷新的 `Lease` 对象。
|
||||||
|
可以在 kube-apiserver 的 `identity-lease-renew-interval-seconds`
|
||||||
|
和 `identity-lease-duration-seconds` 标记里配置 `IdentityLeaseRenewIntervalSeconds` 和 `IdentityLeaseDurationSeconds`。
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Enabling this feature is a prerequisite for using features that involve HA API
|
||||||
|
server coordination (for example, the `StorageVersionAPI` feature gate).
|
||||||
|
-->
|
||||||
|
启用该功能是使用 HA API 服务器协调相关功能(例如,`StorageVersionAPI` 特性门控)的前提条件。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Additional reading
|
## Additional reading
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ Once you have a Linux-based Kubernetes control-plane node you are ready to choos
|
|||||||
"Network": "10.244.0.0/16",
|
"Network": "10.244.0.0/16",
|
||||||
"Backend": {
|
"Backend": {
|
||||||
"Type": "vxlan",
|
"Type": "vxlan",
|
||||||
"VNI" : 4096,
|
"VNI": 4096,
|
||||||
"Port": 4789
|
"Port": 4789
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ Once you have a Linux-based Kubernetes control-plane node you are ready to choos
|
|||||||
"Network": "10.244.0.0/16",
|
"Network": "10.244.0.0/16",
|
||||||
"Backend": {
|
"Backend": {
|
||||||
"Type": "vxlan",
|
"Type": "vxlan",
|
||||||
"VNI" : 4096,
|
"VNI": 4096,
|
||||||
"Port": 4789
|
"Port": 4789
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ data:
|
|||||||
删除你刚才创建的 Secret:
|
删除你刚才创建的 Secret:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl delete secret db-user-pass
|
kubectl delete secret mysecret
|
||||||
```
|
```
|
||||||
|
|
||||||
## {{% heading "whatsnext" %}}
|
## {{% heading "whatsnext" %}}
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ of deploying Redis scalably and redundantly.
|
|||||||
<!--
|
<!--
|
||||||
You could also download the following files directly:
|
You could also download the following files directly:
|
||||||
-->
|
-->
|
||||||
你可以直接下载如下文件:
|
你也可以直接下载如下文件:
|
||||||
|
|
||||||
- [`redis-pod.yaml`](/examples/application/job/redis/redis-pod.yaml)
|
- [`redis-pod.yaml`](/examples/application/job/redis/redis-pod.yaml)
|
||||||
- [`redis-service.yaml`](/examples/application/job/redis/redis-service.yaml)
|
- [`redis-service.yaml`](/examples/application/job/redis/redis-service.yaml)
|
||||||
@@ -121,7 +121,7 @@ Now hit enter, start the redis CLI, and create a list with some work items in it
|
|||||||
-->
|
-->
|
||||||
现在按回车键,启动 redis 命令行界面,然后创建一个存在若干个工作项的列表。
|
现在按回车键,启动 redis 命令行界面,然后创建一个存在若干个工作项的列表。
|
||||||
|
|
||||||
```
|
```shell
|
||||||
# redis-cli -h redis
|
# redis-cli -h redis
|
||||||
redis:6379> rpush job2 "apple"
|
redis:6379> rpush job2 "apple"
|
||||||
(integer) 1
|
(integer) 1
|
||||||
@@ -214,7 +214,7 @@ your username and push to the Hub with the below commands. Replace
|
|||||||
### Push 镜像
|
### Push 镜像
|
||||||
|
|
||||||
对于 [Docker Hub](https://hub.docker.com/),请先用你的用户名给镜像打上标签,
|
对于 [Docker Hub](https://hub.docker.com/),请先用你的用户名给镜像打上标签,
|
||||||
然后使用下面的命令 push 你的镜像到仓库。请将 `<username>` 替换为你自己的用户名。
|
然后使用下面的命令 push 你的镜像到仓库。请将 `<username>` 替换为你自己的 Hub 用户名。
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker tag job-wq-2 <username>/job-wq-2
|
docker tag job-wq-2 <username>/job-wq-2
|
||||||
@@ -270,7 +270,7 @@ too.
|
|||||||
-->
|
-->
|
||||||
在这个例子中,每个 pod 处理了队列中的多个项目,直到队列中没有项目时便退出。
|
在这个例子中,每个 pod 处理了队列中的多个项目,直到队列中没有项目时便退出。
|
||||||
因为是由工作程序自行检测工作队列是否为空,并且 Job 控制器不知道工作队列的存在,
|
因为是由工作程序自行检测工作队列是否为空,并且 Job 控制器不知道工作队列的存在,
|
||||||
所以依赖于工作程序在完成工作时发出信号。
|
这依赖于工作程序在完成工作时发出信号。
|
||||||
工作程序以成功退出的形式发出信号表示工作队列已经为空。
|
工作程序以成功退出的形式发出信号表示工作队列已经为空。
|
||||||
所以,只要有任意一个工作程序成功退出,控制器就知道工作已经完成了,所有的 Pod 将很快会退出。
|
所以,只要有任意一个工作程序成功退出,控制器就知道工作已经完成了,所有的 Pod 将很快会退出。
|
||||||
因此,我们将 Job 的完成计数(Completion Count)设置为 1 。
|
因此,我们将 Job 的完成计数(Completion Count)设置为 1 。
|
||||||
@@ -360,11 +360,10 @@ want to consider one of the other [job patterns](/docs/concepts/jobs/run-to-comp
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
If you have a continuous stream of background processing work to run, then
|
If you have a continuous stream of background processing work to run, then
|
||||||
consider running your background workers with a `replicationController` instead,
|
consider running your background workers with a `ReplicaSet` instead,
|
||||||
and consider running a background processing library such as
|
and consider running a background processing library such as
|
||||||
[https://github.com/resque/resque](https://github.com/resque/resque).
|
[https://github.com/resque/resque](https://github.com/resque/resque).
|
||||||
-->
|
-->
|
||||||
如果你有连续的后台处理业务,那么可以考虑使用 `replicationController` 来运行你的后台业务,
|
如果你有持续的后台处理业务,那么可以考虑使用 `ReplicaSet` 来运行你的后台业务,
|
||||||
和运行一个类似 [https://github.com/resque/resque](https://github.com/resque/resque)
|
和运行一个类似 [https://github.com/resque/resque](https://github.com/resque/resque)
|
||||||
的后台处理库。
|
的后台处理库。
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ spec:
|
|||||||
- wget
|
- wget
|
||||||
- "-O"
|
- "-O"
|
||||||
- "/work-dir/index.html"
|
- "/work-dir/index.html"
|
||||||
- http://kubernetes.io
|
- http://info.cern.ch
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: workdir
|
- name: workdir
|
||||||
mountPath: "/work-dir"
|
mountPath: "/work-dir"
|
||||||
|
|||||||
Reference in New Issue
Block a user