From 4b35d4d401e6f637815d3421fabe0dc0dc0917c3 Mon Sep 17 00:00:00 2001 From: Karen Bradshaw Date: Mon, 1 Jun 2020 09:23:39 -0400 Subject: [PATCH] add zh pages --- content/zh/docs/concepts/_index.md | 17 +++++----- .../concepts/architecture/cloud-controller.md | 12 +++---- .../docs/concepts/architecture/controller.md | 15 +++++---- .../zh/docs/concepts/architecture/nodes.md | 17 +++++----- .../concepts/cluster-administration/addons.md | 10 +++--- .../cluster-administration/certificates.md | 10 +++--- .../cluster-administration/cloud-providers.md | 12 +++---- .../cluster-administration-overview.md | 10 +++--- .../controller-metrics.md | 12 +++---- .../cluster-administration/federation.md | 15 +++++---- .../kubelet-garbage-collection.md | 17 +++++----- .../cluster-administration/logging.md | 10 +++--- .../manage-deployment.md | 15 +++++---- .../cluster-administration/monitoring.md | 15 +++++---- .../cluster-administration/networking.md | 15 +++++---- .../cluster-administration/proxies.md | 10 +++--- .../concepts/configuration/assign-pod-node.md | 17 +++++----- .../docs/concepts/configuration/configmap.md | 15 +++++---- .../manage-compute-resources-container.md | 17 +++++----- .../organize-cluster-access-kubeconfig.md | 17 +++++----- .../docs/concepts/configuration/overview.md | 12 +++---- .../concepts/configuration/pod-overhead.md | 15 +++++---- .../configuration/resource-bin-packing.md | 12 +++---- .../zh/docs/concepts/configuration/secret.md | 13 ++++---- .../configuration/taint-and-toleration.md | 8 ++--- .../container-environment-variables.md | 15 +++++---- .../containers/container-environment.md | 15 +++++---- .../containers/container-lifecycle-hooks.md | 17 +++++----- content/zh/docs/concepts/containers/images.md | 12 +++---- .../zh/docs/concepts/containers/overview.md | 15 +++++---- .../docs/concepts/containers/runtime-class.md | 15 +++++---- .../docs/concepts/example-concept-template.md | 17 +++++----- .../api-extension/apiserver-aggregation.md | 17 +++++----- .../compute-storage-net/device-plugins.md | 15 +++++---- .../compute-storage-net/network-plugins.md | 17 +++++----- .../extend-kubernetes/extend-cluster.md | 17 +++++----- .../concepts/extend-kubernetes/operator.md | 17 +++++----- .../extend-kubernetes/service-catalog.md | 17 +++++----- .../zh/docs/concepts/overview/components.md | 17 +++++----- .../docs/concepts/overview/kubernetes-api.md | 10 +++--- .../concepts/overview/what-is-kubernetes.md | 17 +++++----- .../working-with-objects/annotations.md | 17 +++++----- .../working-with-objects/common-labels.md | 12 +++---- .../kubernetes-objects.md | 17 +++++----- .../overview/working-with-objects/labels.md | 12 +++---- .../overview/working-with-objects/names.md | 15 +++++---- .../working-with-objects/namespaces.md | 17 +++++----- .../working-with-objects/object-management.md | 15 +++++---- .../zh/docs/concepts/policy/limit-range.md | 15 +++++---- .../docs/concepts/policy/resource-quotas.md | 17 +++++----- .../scheduling-eviction/kube-scheduler.md | 17 +++++----- .../scheduler-perf-tuning.md | 12 +++---- .../scheduling-framework.md | 12 +++---- ...ries-to-pod-etc-hosts-with-host-aliases.md | 10 +++--- .../connect-applications-service.md | 14 ++++---- .../services-networking/dns-pod-service.md | 15 +++++---- .../services-networking/dual-stack.md | 17 +++++----- .../services-networking/endpoint-slices.md | 17 +++++----- .../ingress-controllers.md | 17 +++++----- .../concepts/services-networking/ingress.md | 17 +++++----- .../services-networking/network-policies.md | 17 +++++----- .../services-networking/service-topology.md | 15 +++++---- .../concepts/services-networking/service.md | 17 +++++----- .../concepts/storage/dynamic-provisioning.md | 12 +++---- .../docs/concepts/storage/storage-classes.md | 10 +++--- .../docs/concepts/storage/storage-limits.md | 12 +++---- .../concepts/storage/volume-pvc-datasource.md | 12 +++---- .../storage/volume-snapshot-classes.md | 10 +++--- .../docs/concepts/storage/volume-snapshots.md | 12 +++---- content/zh/docs/concepts/storage/volumes.md | 15 +++++---- .../workloads/controllers/cron-jobs.md | 13 ++++---- .../workloads/controllers/daemonset.md | 12 +++---- .../workloads/controllers/deployment.md | 10 +++--- .../controllers/garbage-collection.md | 17 +++++----- .../workloads/controllers/replicaset.md | 10 +++--- .../controllers/replicationcontroller.md | 12 +++---- .../workloads/controllers/statefulset.md | 17 +++++----- .../workloads/controllers/ttlafterfinished.md | 17 +++++----- .../concepts/workloads/pods/disruptions.md | 17 +++++----- .../workloads/pods/ephemeral-containers.md | 12 +++---- .../workloads/pods/init-containers.md | 15 +++++---- .../concepts/workloads/pods/pod-lifecycle.md | 10 +++--- .../concepts/workloads/pods/pod-overview.md | 17 +++++----- .../pods/pod-topology-spread-constraints.md | 12 +++---- .../zh/docs/concepts/workloads/pods/pod.md | 12 +++---- .../docs/concepts/workloads/pods/podpreset.md | 17 +++++----- content/zh/docs/contribute/_index.md | 12 +++---- content/zh/docs/contribute/advanced.md | 12 +++---- .../generate-ref-docs/contribute-upstream.md | 22 +++++++------ .../contribute/generate-ref-docs/kubectl.md | 21 ++++++------ .../generate-ref-docs/kubernetes-api.md | 21 ++++++------ .../kubernetes-components.md | 21 ++++++------ content/zh/docs/contribute/intermediate.md | 17 +++++----- content/zh/docs/contribute/localization.md | 17 +++++----- content/zh/docs/contribute/participating.md | 15 +++++---- content/zh/docs/contribute/start.md | 17 +++++----- .../contribute/style/content-organization.md | 17 +++++----- .../contribute/style/hugo-shortcodes/index.md | 17 +++++----- .../docs/contribute/style/page-templates.md | 29 +++++++++-------- .../docs/contribute/style/write-new-topic.md | 22 +++++++------ .../zh/docs/home/supported-doc-versions.md | 10 +++--- content/zh/docs/reference/_index.md | 12 +++---- .../docs/reference/access-authn-authz/abac.md | 12 +++---- .../admission-controllers.md | 12 +++---- .../access-authn-authz/authorization.md | 14 ++++---- .../extensible-admission-controllers.md | 12 +++---- .../docs/reference/access-authn-authz/node.md | 12 +++---- .../docs/reference/access-authn-authz/rbac.md | 12 +++---- .../reference/access-authn-authz/webhook.md | 12 +++---- .../feature-gates.md | 17 +++++----- .../kube-proxy.md | 10 +++--- .../kube-scheduler.md | 10 +++--- .../command-line-tools-reference/kubelet.md | 10 +++--- .../reference/issues-security/security.md | 12 +++---- .../zh/docs/reference/kubectl/cheatsheet.md | 17 +++++----- .../zh/docs/reference/kubectl/conventions.md | 12 +++---- .../kubectl/docker-cli-to-kubectl.md | 12 +++---- content/zh/docs/reference/kubectl/jsonpath.md | 12 +++---- content/zh/docs/reference/kubectl/kubectl.md | 15 +++++---- content/zh/docs/reference/kubectl/overview.md | 17 +++++----- .../labels-annotations-taints.md | 10 +++--- .../setup-tools/kubeadm/kubeadm-config.md | 15 +++++---- .../setup-tools/kubeadm/kubeadm-init.md | 17 +++++----- .../setup-tools/kubeadm/kubeadm-join.md | 15 +++++---- .../setup-tools/kubeadm/kubeadm-reset.md | 17 +++++----- .../setup-tools/kubeadm/kubeadm-token.md | 17 +++++----- .../setup-tools/kubeadm/kubeadm-upgrade.md | 17 +++++----- .../setup-tools/kubeadm/kubeadm-version.md | 10 +++--- content/zh/docs/reference/tools.md | 12 +++---- .../docs/reference/using-api/api-overview.md | 12 +++---- .../reference/using-api/client-libraries.md | 12 +++---- content/zh/docs/setup/_index.md | 12 +++---- .../docs/setup/best-practices/certificates.md | 12 +++---- .../independent/create-cluster-kubeadm.md | 15 +++++---- .../setup/learning-environment/minikube.md | 12 +++---- .../container-runtimes.md | 12 +++---- .../on-premises-vm/dcos.md | 12 +++---- .../on-premises-vm/ovirt.md | 12 +++---- .../production-environment/tools/kops.md | 17 +++++----- .../tools/kubeadm/control-plane-flags.md | 12 +++---- .../tools/kubeadm/ha-topology.md | 17 +++++----- .../tools/kubeadm/high-availability.md | 17 +++++----- .../tools/kubeadm/install-kubeadm.md | 20 ++++++------ .../tools/kubeadm/kubelet-integration.md | 12 +++---- .../tools/kubeadm/self-hosting.md | 12 +++---- .../kubeadm/setup-ha-etcd-with-kubeadm.md | 22 +++++++------ .../tools/kubeadm/troubleshooting-kubeadm.md | 12 +++---- .../production-environment/turnkey/aws.md | 17 +++++----- .../windows/user-guide-windows-containers.md | 12 +++---- .../docs/setup/release/version-skew-policy.md | 8 ++--- content/zh/docs/tasks/_index.md | 17 +++++----- .../access-cluster.md | 12 +++---- ...icate-containers-same-pod-shared-volume.md | 24 +++++++------- .../configure-access-multiple-clusters.md | 20 ++++++------ .../configure-cloud-provider-firewall.md | 15 +++++---- .../configure-dns-cluster.md | 12 +++---- .../connecting-frontend-backend.md | 25 ++++++++------- .../create-external-load-balancer.md | 17 +++++----- .../list-all-running-container-images.md | 26 ++++++++------- ...port-forward-access-application-cluster.md | 26 ++++++++------- .../service-access-application-cluster.md | 32 +++++++++++-------- .../web-ui-dashboard.md | 17 +++++----- .../configure-aggregation-layer.md | 22 +++++++------ .../custom-resource-definition-versioning.md | 17 +++++----- .../http-proxy-access-api.md | 22 +++++++------ .../setup-extension-api-server.md | 27 +++++++++------- .../administer-cluster/access-cluster-api.md | 17 +++++----- .../access-cluster-services.md | 15 +++++---- .../change-default-storage-class.md | 20 ++++++------ .../change-pv-reclaim-policy.md | 20 ++++++------ .../configure-multiple-schedulers.md | 21 ++++++------ .../configure-upgrade-etcd.md | 17 +++++----- .../docs/tasks/administer-cluster/coredns.md | 22 +++++++------ .../cpu-management-policies.md | 17 +++++----- .../declare-network-policy.md | 15 +++++---- .../developing-cloud-controller-manager.md | 12 +++---- .../dns-custom-nameservers.md | 21 ++++++------ .../dns-debugging-resolution.md | 28 ++++++++-------- .../dns-horizontal-autoscaling.md | 26 ++++++++------- .../enabling-endpointslices.md | 15 +++++---- .../tasks/administer-cluster/encrypt-data.md | 22 +++++++------ .../extended-resource-node.md | 22 +++++++------ ...aranteed-scheduling-critical-addon-pods.md | 10 +++--- .../highly-available-master.md | 21 ++++++------ .../tasks/administer-cluster/ip-masq-agent.md | 21 ++++++------ .../tasks/administer-cluster/kms-provider.md | 17 +++++----- .../kubeadm/kubeadm-certs.md | 16 +++++----- .../kubeadm/kubeadm-upgrade.md | 17 +++++----- .../administer-cluster/kubelet-config-file.md | 21 ++++++------ .../limit-storage-consumption.md | 21 ++++++------ .../cpu-constraint-namespace.md | 22 +++++++------ .../manage-resources/cpu-default-namespace.md | 22 +++++++------ .../memory-constraint-namespace.md | 22 +++++++------ .../memory-default-namespace.md | 22 +++++++------ .../quota-memory-cpu-namespace.md | 22 +++++++------ .../manage-resources/quota-pod-namespace.md | 20 ++++++------ .../namespaces-walkthrough.md | 17 +++++----- .../tasks/administer-cluster/namespaces.md | 26 ++++++++------- .../calico-network-policy.md | 20 ++++++------ .../cilium-network-policy.md | 24 +++++++------- .../kube-router-network-policy.md | 20 ++++++------ .../romana-network-policy.md | 20 ++++++------ .../weave-network-policy.md | 20 ++++++------ .../tasks/administer-cluster/nodelocaldns.md | 17 +++++----- .../administer-cluster/out-of-resource.md | 12 +++---- .../administer-cluster/quota-api-object.md | 22 +++++++------ .../administer-cluster/reconfigure-kubelet.md | 21 ++++++------ .../reserve-compute-resources.md | 21 ++++++------ .../running-cloud-controller.md | 11 +++---- .../administer-cluster/securing-a-cluster.md | 17 +++++----- .../administer-cluster/sysctl-cluster.md | 21 ++++++------ .../administer-cluster/topology-manager.md | 17 +++++----- .../assign-cpu-resource.md | 22 +++++++------ .../assign-memory-resource.md | 22 +++++++------ .../assign-pods-nodes.md | 22 +++++++------ .../attach-handler-lifecycle-event.md | 26 ++++++++------- ...igure-liveness-readiness-startup-probes.md | 20 ++++++------ .../configure-persistent-volume-storage.md | 26 ++++++++------- .../configure-pod-configmap.md | 26 ++++++++------- .../configure-pod-initialization.md | 22 +++++++------ .../configure-projected-volume-storage.md | 22 +++++++------ .../configure-runasusername.md | 18 ++++++----- .../configure-service-account.md | 17 +++++----- .../configure-volume-storage.md | 22 +++++++------ .../extended-resource.md | 22 +++++++------ .../pull-image-private-registry.md | 22 +++++++------ .../quality-service-pod.md | 22 +++++++------ .../share-process-namespace.md | 21 ++++++------ .../configure-pod-container/static-pod.md | 15 +++++---- .../translate-compose-kubernetes.md | 21 ++++++------ .../tasks/debug-application-cluster/audit.md | 10 +++--- .../tasks/debug-application-cluster/crictl.md | 21 ++++++------ .../debug-application-introspection.md | 15 +++++---- .../debug-init-containers.md | 21 ++++++------ .../debug-pod-replication-controller.md | 17 +++++----- .../debug-service.md | 17 +++++----- .../debug-stateful-set.md | 20 ++++++------ .../determine-reason-pod-failure.md | 22 +++++++------ .../events-stackdriver.md | 12 +++---- .../tasks/debug-application-cluster/falco.md | 12 +++---- .../get-shell-running-container.md | 26 ++++++++------- .../local-debugging.md | 22 +++++++------ .../logging-elasticsearch-kibana.md | 17 +++++----- .../monitor-node-health.md | 21 ++++++------ .../resource-metrics-pipeline.md | 12 +++---- .../resource-usage-monitoring.md | 12 +++---- .../troubleshooting.md | 12 +++---- .../zh/docs/tasks/example-task-template.md | 26 ++++++++------- .../tasks/extend-kubectl/kubectl-plugins.md | 20 ++++++------ .../administer-federation/configmap.md | 17 +++++----- .../administer-federation/daemonset.md | 17 +++++----- .../administer-federation/deployment.md | 17 +++++----- .../administer-federation/events.md | 12 +++---- .../federation/administer-federation/job.md | 17 +++++----- .../administer-federation/namespaces.md | 17 +++++----- .../administer-federation/replicaset.md | 17 +++++----- .../administer-federation/secret.md | 12 +++---- .../federation-service-discovery.md | 21 ++++++------ .../set-up-coredns-provider-federation.md | 22 +++++++------ .../set-up-placement-policies-federation.md | 17 +++++----- .../define-command-argument-container.md | 22 +++++++------ .../define-environment-variable-container.md | 22 +++++++------ .../distribute-credentials-secure.md | 20 ++++++------ ...nward-api-volume-expose-pod-information.md | 24 +++++++------- ...ronment-variable-expose-pod-information.md | 20 ++++++------ .../job/automated-tasks-with-cron-jobs.md | 17 +++++----- .../coarse-parallel-processing-work-queue.md | 21 ++++++------ .../fine-parallel-processing-work-queue.md | 25 ++++++++------- .../job/parallel-processing-expansion.md | 12 +++---- .../manage-daemon/rollback-daemon-set.md | 19 +++++------ .../tasks/manage-daemon/update-daemon-set.md | 22 +++++++------ .../docs/tasks/manage-gpus/scheduling-gpus.md | 10 +++--- .../manage-hugepages/scheduling-hugepages.md | 17 +++++----- .../imperative-config.md | 22 +++++++------ .../docs/tasks/network/validate-dual-stack.md | 17 +++++----- .../tasks/run-application/configure-pdb.md | 21 ++++++------ .../run-application/delete-stateful-set.md | 20 ++++++------ .../force-delete-stateful-set-pod.md | 22 +++++++------ .../horizontal-pod-autoscale-walkthrough.md | 19 +++++------ .../horizontal-pod-autoscale.md | 15 +++++---- .../rolling-update-replication-controller.md | 4 +-- .../run-replicated-stateful-application.md | 32 +++++++++++-------- ...un-single-instance-stateful-application.md | 25 ++++++++------- .../run-stateless-application-deployment.md | 25 ++++++++------- .../run-application/scale-stateful-set.md | 20 ++++++------ .../update-api-object-kubectl-patch.md | 22 +++++++------ .../install-service-catalog-using-helm.md | 22 +++++++------ .../install-service-catalog-using-sc.md | 22 +++++++------ .../zh/docs/tasks/tls/certificate-rotation.md | 15 +++++---- .../tasks/tls/managing-tls-in-a-cluster.md | 17 +++++----- .../zh/docs/tasks/tools/install-kubectl.md | 22 +++++++------ .../zh/docs/tasks/tools/install-minikube.md | 22 +++++++------ content/zh/docs/tutorials/_index.md | 17 +++++----- .../zh/docs/tutorials/clusters/apparmor.md | 27 +++++++++------- .../configure-redis-using-configmap.md | 25 ++++++++------- content/zh/docs/tutorials/hello-minikube.md | 27 +++++++++------- .../tutorials/online-training/overview.md | 12 +++---- .../zh/docs/tutorials/services/source-ip.md | 30 +++++++++-------- .../basic-stateful-set.md | 25 ++++++++------- .../mysql-wordpress-persistent-volume.md | 30 +++++++++-------- .../stateful-application/zookeeper.md | 25 ++++++++------- .../expose-external-ip-address.md | 32 +++++++++++-------- .../stateless-application/guestbook.md | 32 +++++++++++-------- 303 files changed, 2764 insertions(+), 2439 deletions(-) diff --git a/content/zh/docs/concepts/_index.md b/content/zh/docs/concepts/_index.md index 8e5c1413bf..90e2d6b4f1 100644 --- a/content/zh/docs/concepts/_index.md +++ b/content/zh/docs/concepts/_index.md @@ -1,18 +1,18 @@ --- title: 概念 main_menu: true -content_template: templates/concept +content_type: concept weight: 40 --- -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + 节点是 Kubernetes REST API 的顶级资源。更多关于 API 对象的细节可以在这里找到:[节点 API 对象](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#node-v1-core)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 了解有关[节点组件](https://kubernetes.io/docs/concepts/overview/components/#node-components)的信息。 * 阅读有关节点级拓扑的信息:[控制节点上的拓扑管理策略](/docs/tasks/administer-cluster/topology-manager/)。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/cluster-administration/addons.md b/content/zh/docs/concepts/cluster-administration/addons.md index 9aa9b8a348..10eb8adb08 100644 --- a/content/zh/docs/concepts/cluster-administration/addons.md +++ b/content/zh/docs/concepts/cluster-administration/addons.md @@ -1,10 +1,10 @@ --- title: 安装扩展(Addons) -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + ### easyrsa @@ -473,4 +473,4 @@ x509 certificates to use for authentication as documented 您可以按照[这里](/docs/tasks/tls/managing-tls-in-a-cluster)记录的方式, 使用 `certificates.k8s.io` API 来准备 x509 证书,用于认证。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/cluster-administration/cloud-providers.md b/content/zh/docs/concepts/cluster-administration/cloud-providers.md index 4b6f6a36e1..f568c57304 100644 --- a/content/zh/docs/concepts/cluster-administration/cloud-providers.md +++ b/content/zh/docs/concepts/cluster-administration/cloud-providers.md @@ -1,26 +1,26 @@ --- title: 云驱动 -content_template: templates/concept +content_type: concept weight: 30 --- -{{% capture overview %}} + 本文介绍了如何管理运行在特定云驱动上的 Kubernetes 集群。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 本页面阐明了为何以及如何使用联邦创建Kubernetes集群。 -{{% /capture %}} -{{% capture body %}} + + ## 为何使用联邦 联邦可以使多个集群的管理简单化。它提供了两个主要构件模块: @@ -105,13 +105,14 @@ Kubernetes集群数量选择也许是一个相对静止的选择,因为对其 最后,如果你的集群需求超过一个Kubernetes集群推荐的最大节点数,那么你可能需要更多的集群。Kubernetes1.3版本支持多达1000个节点的集群规模。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 进一步学习[联邦提案](https://github.com/kubernetes/community/blob/{{< param "githubbranch" >}}/contributors/design-proposals/multicluster/federation.md)。 * 集群联邦参考该[配置指导](/docs/tutorials/federation/set-up-cluster-federation-kubefed/)。 * 查看[Kubecon2016浅谈联邦](https://www.youtube.com/watch?v=pq9lbkmxpS8) -{{% /capture %}} + diff --git a/content/zh/docs/concepts/cluster-administration/kubelet-garbage-collection.md b/content/zh/docs/concepts/cluster-administration/kubelet-garbage-collection.md index ca25be40df..d9ffdaeb01 100644 --- a/content/zh/docs/concepts/cluster-administration/kubelet-garbage-collection.md +++ b/content/zh/docs/concepts/cluster-administration/kubelet-garbage-collection.md @@ -1,18 +1,18 @@ --- title: 配置 kubelet 垃圾回收策略 -content_template: templates/concept +content_type: concept weight: 70 --- -{{% capture overview %}} + 垃圾回收是 kubelet 的一个有用功能,它将清理未使用的镜像和容器。 @@ -32,10 +32,10 @@ Kubelet will perform garbage collection for containers every minute and garbage External garbage collection tools are not recommended as these tools can potentially break the behavior of kubelet by removing containers expected to exist. --> -{{% /capture %}} -{{% capture body %}} + + ## 镜像回收 @@ -202,9 +202,10 @@ Including: | `--outofdisk-transition-frequency` | `--eviction-pressure-transition-period` | eviction generalizes disk pressure transition to other resources | --> -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 查阅 [配置驱逐回收资源的策略](/docs/tasks/administer-cluster/out-of-resource/) 获取更多细节。 @@ -212,4 +213,4 @@ Including: See [Configuring Out Of Resource Handling](/docs/tasks/administer-cluster/out-of-resource/) for more details. --> -{{% /capture %}} + diff --git a/content/zh/docs/concepts/cluster-administration/logging.md b/content/zh/docs/concepts/cluster-administration/logging.md index da727e4113..349f408109 100755 --- a/content/zh/docs/concepts/cluster-administration/logging.md +++ b/content/zh/docs/concepts/cluster-administration/logging.md @@ -3,11 +3,11 @@ reviewers: - piosz - x13n title: 日志架构 -content_template: templates/concept +content_type: concept weight: 60 --- -{{% capture overview %}} + 但是,由容器引擎或 runtime 提供的原生功能通常不足以满足完整的日志记录方案。例如,如果发生容器崩溃、pod 被逐出或节点宕机等情况,您仍然想访问到应用日志。因此,日志应该具有独立的存储和生命周期,与节点、pod 或容器的生命周期相独立。这个概念叫 _集群级的日志_ 。集群级日志方案需要一个独立的后台来存储、分析和查询日志。Kubernetes 没有为日志数据提供原生存储方案,但是您可以集成许多现有的日志解决方案到 Kubernetes 集群中。 -{{% /capture %}} -{{% capture body %}} + + 通过暴露或推送每个应用的日志,您可以实现集群级日志记录;然而,这种日志记录机制的实现已超出 Kubernetes 的范围。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/cluster-administration/manage-deployment.md b/content/zh/docs/concepts/cluster-administration/manage-deployment.md index a7d90c8bd7..f67f7f9487 100644 --- a/content/zh/docs/concepts/cluster-administration/manage-deployment.md +++ b/content/zh/docs/concepts/cluster-administration/manage-deployment.md @@ -1,20 +1,20 @@ --- title: 管理资源 -content_template: templates/concept +content_type: concept weight: 40 --- -{{% capture overview %}} + 您已经部署了应用并通过服务暴露它。然后呢?Kubernetes 提供了一些工具来帮助管理您的应用部署,包括缩扩容和更新。我们将更深入讨论的特性包括[配置文件](/docs/concepts/configuration/overview/)和[标签](/docs/concepts/overview/working-with-objects/labels/)。 -{{% /capture %}} -{{% capture body %}} + + 没错,就是这样!Deployment 将在后台逐步更新已经部署的 nginx 应用。它确保在更新过程中,只有一定数量的旧副本被开闭,并且只有一定基于所需 pod 数量的新副本被创建。想要了解更多细节,请参考 [Deployment](/docs/concepts/workloads/controllers/deployment/)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 本文讲述了 Kubernetes 中所使用的代理。 -{{% /capture %}} -{{% capture body %}} + + ## 代理 @@ -59,4 +59,4 @@ Kubernetes 用户通常只需要关心前两种类型的代理,集群管理员 代理已经取代重定向功能,重定向已被弃用。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/configuration/assign-pod-node.md b/content/zh/docs/concepts/configuration/assign-pod-node.md index fbe7a56764..92d26f57cf 100644 --- a/content/zh/docs/concepts/configuration/assign-pod-node.md +++ b/content/zh/docs/concepts/configuration/assign-pod-node.md @@ -1,6 +1,6 @@ --- title: 将 Pod 分配给节点 -content_template: templates/concept +content_type: concept weight: 50 --- @@ -11,13 +11,13 @@ reviewers: - kevin-wangzefeng - bsalamat title: Assigning Pods to Nodes -content_template: templates/concept +content_type: concept weight: 50 --- --> -{{% capture overview %}} + ## nodeSelector @@ -664,9 +664,10 @@ The above pod will run on the node kube-01. 上面的 pod 将运行在 kube-01 节点上。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + {{< glossary_definition term_id="configmap" prepend="ConfigMap 是" length="all" >}} @@ -18,9 +18,9 @@ or use additional (third party) tools to keep your data private. ConfigMap 并不提供保密或者加密功能。如果你想存储的数据是机密的,请使用 {{< glossary_tooltip text="Secret" term_id="secret" >}} ,或者使用其他第三方工具来保证你的数据的私密性,而不是用 ConfigMap。 {{< /caution >}} -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 当您定义 [Pod](/docs/user-guide/pods) 的时候可以选择为每个容器指定需要的 CPU 和内存(RAM)大小。当为容器指定了资源请求后,调度器就能够更好的判断出将容器调度到哪个节点上。如果您还为容器指定了资源限制,Kubernetes 就可以按照指定的方式来处理节点上的资源竞争。关于资源请求和限制的不同点和更多资料请参考 [Resource QoS](https://git.k8s.io/community/contributors/design-proposals/resource-qos.md)。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 有关创建和指定 kubeconfig 文件的分步说明,请参阅[配置对多集群的访问](/docs/tasks/access-application-cluster/configure-access-multiple-clusters)。 -{{% /capture %}} -{{% capture body %}} + + kubeconfig 文件中的文件和路径引用是相对于 kubeconfig 文件的位置。命令行上的文件引用是相当对于当前工作目录的。在 `$HOME/.kube/config` 中,相对路径按相对路径存储,绝对路径按绝对路径存储。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * [配置对多集群的访问](/docs/tasks/access-application-cluster/configure-access-multiple-clusters/) * [`kubectl config`](/docs/reference/generated/kubectl/kubectl-commands#config) -{{% /capture %}} + diff --git a/content/zh/docs/concepts/configuration/overview.md b/content/zh/docs/concepts/configuration/overview.md index 04a56b5425..da540c0a89 100644 --- a/content/zh/docs/concepts/configuration/overview.md +++ b/content/zh/docs/concepts/configuration/overview.md @@ -2,7 +2,7 @@ reviewers: - mikedanese title: 配置最佳实践 -content_template: templates/concept +content_type: concept weight: 10 --- -{{% capture overview %}} + @@ -26,9 +26,9 @@ This is a living document. If you think of something that is not on this list bu --> 这是一份活文件。 如果您认为某些内容不在此列表中但可能对其他人有用,请不要犹豫,提交问题或提交 PR。 -{{% /capture %}} -{{% capture body %}} + + @@ -264,4 +264,4 @@ The caching semantics of the underlying image provider make even `imagePullPolic - 使用`kubectl run`和`kubectl expose`来快速创建单容器部署和服务。 有关示例,请参阅[使用服务访问集群中的应用程序](/docs/tasks/access-application-cluster/service-access-application-cluster/)。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/configuration/pod-overhead.md b/content/zh/docs/concepts/configuration/pod-overhead.md index 85a3bc3f57..3c81b3607a 100644 --- a/content/zh/docs/concepts/configuration/pod-overhead.md +++ b/content/zh/docs/concepts/configuration/pod-overhead.md @@ -1,10 +1,10 @@ --- title: Pod 开销 -content_template: templates/concept +content_type: concept weight: 20 --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.18" state="beta" >}} @@ -18,10 +18,10 @@ on top of the container requests & limits. 在节点上运行 Pod 时,Pod 本身占用大量系统资源。这些资源是运行 Pod 内容器所需资源的附加资源。 _POD 开销_ 是一个特性,用于计算 Pod 基础设施在容器请求和限制之上消耗的资源。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + {{< feature-state for_k8s_version="1.16" state="alpha" >}} @@ -29,9 +29,9 @@ The kube-scheduler can be configured to enable bin packing of resources along wi 可以将 kube-scheduler 配置为使用 `RequestedToCapacityRatioResourceAllocation` 优先级函数启用资源箱打包以及扩展资源。 优先级函数可用于根据自定义需求微调 kube-scheduler 。 -{{% /capture %}} -{{% capture body %}} + + Taint 和 toleration 相互配合,可以用来避免 pod 被分配到不合适的节点上。每个节点上都可以应用一个或多个 taint ,这表示对于那些不能容忍这些 taint 的 pod,是不会被该节点接受的。如果将 toleration 应用于 pod 上,则表示这些 pod 可以(但不要求)被调度到具有匹配 taint 的节点上。 -{{% /capture %}} -{{% capture body %}} + + 本文介绍容器环境中对容器可用的资源。 -{{% /capture %}} + {{< toc >}} -{{% capture body %}} + ## 容器环境 @@ -50,13 +50,14 @@ FOO_SERVICE_PORT=<服务所启用的端口> 服务具有专用 IP 地址,如果启用了 [DNS 插件](http://releases.k8s.io/{{< param "githubbranch" >}}/cluster/addons/dns/),还可以在容器中通过 DNS 进行访问。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 查看[容器生命周期挂钩(hooks)](/docs/concepts/containers/container-lifecycle-hooks/)了解更多。 * 获取[为容器生命周期事件附加处理程序](/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/)的实践经验。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/containers/container-environment.md b/content/zh/docs/concepts/containers/container-environment.md index 26d599f9fd..777f746f67 100644 --- a/content/zh/docs/concepts/containers/container-environment.md +++ b/content/zh/docs/concepts/containers/container-environment.md @@ -1,20 +1,20 @@ --- title: 容器环境 -content_template: templates/concept +content_type: concept weight: 20 --- -{{% capture overview %}} + 本页描述了在容器环境里容器可用的资源。 -{{% /capture %}} -{{% capture body %}} + + Service 具有专用的 IP 地址。如果启用了 [DNS插件](http://releases.k8s.io/{{< param "githubbranch" >}}/cluster/addons/dns/),就可以在容器中通过 DNS 来访问。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + 这个页面描述了 kubelet 管理的容器如何使用容器生命周期钩子框架来运行在其管理生命周期中由事件触发的代码。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + * 阅读有关[容器镜像](/docs/concepts/containers/images/) * 阅读有关 [Pods](/docs/concepts/workloads/pods/) -{{% /capture %}} + diff --git a/content/zh/docs/concepts/containers/runtime-class.md b/content/zh/docs/concepts/containers/runtime-class.md index 6229009612..693e156cc3 100644 --- a/content/zh/docs/concepts/containers/runtime-class.md +++ b/content/zh/docs/concepts/containers/runtime-class.md @@ -3,11 +3,11 @@ reviewers: - tallclair - dchen1107 title: 容器运行时类(Runtime Class) -content_template: templates/concept +content_type: concept weight: 20 --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.14" state="beta" >}} @@ -22,10 +22,10 @@ configuration is used to run a Pod's containers. --> RuntimeClass 是一个用于选择容器运行时配置的特性,容器运行时配置用于运行 Pod 中的容器。 -{{% /capture %}} -{{% capture body %}} + + Pod 开销通过 RuntimeClass 的 `overhead` 字段定义。通过使用这些字段,你可以指定使用该 RuntimeClass 运行 Pod 时的开销并确保 Kubernetes 将这些开销计算在内。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + 使用 ... -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + 聚合层允许 Kubernetes 通过额外的 API 进行扩展,而不局限于 Kubernetes 核心 API 提供的功能。 -{{% /capture %}} -{{% capture body %}} + + {{< feature-state for_k8s_version="v1.10" state="beta" >}} ## 注册设备插件 @@ -339,8 +339,9 @@ Here are some examples of device plugin implementations: * [SR-IOV Network device plugin](https://github.com/intel/sriov-network-device-plugin) * [Xilinx FPGA device plugins](https://github.com/Xilinx/FPGA_as_a_Service/tree/master/k8s-fpga-device-plugin/trunk) -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + {{< feature-state state="alpha" >}} -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + {{< glossary_definition term_id="service-catalog" length="all" prepend="" >}} -{{% capture overview %}} + 当你部署完 Kubernetes, 即拥有了一个完整的集群。 {{< glossary_definition term_id="cluster" length="all" prepend="一个 Kubernetes 集群包含">}} @@ -40,9 +40,9 @@ Here's the diagram of a Kubernetes cluster with all the components tied together ![Components of Kubernetes](/images/docs/components-of-kubernetes.png) -{{% /capture %}} -{{% capture body %}} + + @@ -222,8 +222,9 @@ saving container logs to a central log store with search/browsing interface. --> [集群层面日志](/docs/concepts/cluster-administration/logging/) 机制负责将容器的日志数据保存到一个集中的日志存储中,该存储能够提供搜索和浏览接口。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + 此页面是 Kubernetes 的概述。 -{{% /capture %}} -{{% capture body %}} + + @@ -205,13 +205,14 @@ Kubernetes: * Kubernetes 不提供也不采用任何全面的机器配置、维护、管理或自我修复系统。 * 此外,Kubernetes 不仅仅是一个编排系统,实际上它消除了编排的需要。编排的技术定义是执行已定义的工作流程:首先执行 A,然后执行 B,再执行 C。相比之下,Kubernetes 包含一组独立的、可组合的控制过程,这些过程连续地将当前状态驱动到所提供的所需状态。从 A 到 C 的方式无关紧要,也不需要集中控制,这使得系统更易于使用且功能更强大、健壮、弹性和可扩展性。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 查阅 [Kubernetes 组件](/docs/concepts/overview/components/) * 开始 [Kubernetes 入门](/docs/setup/)? -{{% /capture %}} + diff --git a/content/zh/docs/concepts/overview/working-with-objects/annotations.md b/content/zh/docs/concepts/overview/working-with-objects/annotations.md index 9480250faa..8e8b0f3f5b 100644 --- a/content/zh/docs/concepts/overview/working-with-objects/annotations.md +++ b/content/zh/docs/concepts/overview/working-with-objects/annotations.md @@ -1,27 +1,27 @@ --- title: 注解 -content_template: templates/concept +content_type: concept weight: 50 --- -{{% capture overview %}} + 你可以使用 Kubernetes 注解为对象附加任意的非标识的元数据。客户端程序(例如工具和库)能够获取这些元数据信息。 -{{% /capture %}} -{{% capture body %}} + + ## 为对象附加元数据 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/overview/working-with-objects/common-labels.md b/content/zh/docs/concepts/overview/working-with-objects/common-labels.md index 9e7334bab8..be60e6f10f 100644 --- a/content/zh/docs/concepts/overview/working-with-objects/common-labels.md +++ b/content/zh/docs/concepts/overview/working-with-objects/common-labels.md @@ -1,15 +1,15 @@ --- title: 推荐使用的标签 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + 除了支持工具外,推荐的标签还以一种可以查询的方式描述了应用程序。 -{{% /capture %}} -{{% capture body %}} + + 使用 MySQL `StatefulSet` 和 `Service`,您会注意到有关 MySQL 和 Wordpress 的信息,包括更广泛的应用程序。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/overview/working-with-objects/kubernetes-objects.md b/content/zh/docs/concepts/overview/working-with-objects/kubernetes-objects.md index 156fa61d56..f340841e19 100644 --- a/content/zh/docs/concepts/overview/working-with-objects/kubernetes-objects.md +++ b/content/zh/docs/concepts/overview/working-with-objects/kubernetes-objects.md @@ -1,6 +1,6 @@ --- title: 理解 Kubernetes 对象 -content_template: templates/concept +content_type: concept weight: 10 card: name: 概念 @@ -9,21 +9,21 @@ card: -{{% capture overview %}} + 本页说明了 Kubernetes 对象在 Kubernetes API 中是如何表示的,以及如何在 `.yaml` 格式的文件中表示。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + -{{% capture overview %}} + `kubectl` 命令行工具支持多种不同的方式来创建和管理 Kubernetes 对象。本文档概述了不同的方法。阅读 [Kubectl book](https://kubectl.docs.kubernetes.io) 来了解 kubectl 管理对象的详细信息。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 资源配额是帮助管理员解决这一问题的工具。 -{{% /capture %}} -{{% capture body %}} + + 查看[如何使用资源配额的详细示例](/docs/tasks/administer-cluster/quota-api-object/)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 查看[资源配额设计文档](https://git.k8s.io/community/contributors/design-proposals/resource-management/admission_control_resource_quota.md)了解更多信息。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/scheduling-eviction/kube-scheduler.md b/content/zh/docs/concepts/scheduling-eviction/kube-scheduler.md index cc1bbda060..7d0e65d619 100644 --- a/content/zh/docs/concepts/scheduling-eviction/kube-scheduler.md +++ b/content/zh/docs/concepts/scheduling-eviction/kube-scheduler.md @@ -1,17 +1,17 @@ --- title: Kubernetes 调度器 -content_template: templates/concept +content_type: concept weight: 50 --- -{{% capture overview %}} + @@ -148,8 +148,9 @@ of the scheduler: 1. [调度策略](/docs/reference/scheduling/policies) 允许你配置过滤的 _谓词(Predicates)_ 和打分的 _优先级(Priorities)_ 。 2. [调度配置](/docs/reference/scheduling/profiles) 允许你配置实现不同调度阶段的插件,包括:`QueueSort`, `Filter`, `Score`, `Bind`, `Reserve`, `Permit` 等等。你也可以配置 kube-scheduler 运行不同的配置文件。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + {{< feature-state for_k8s_version="1.14" state="beta" >}} @@ -40,9 +40,9 @@ large Kubernetes clusters. --> 这篇文章将会介绍一些在大规模 Kubernetes 集群下调度器性能优化的方式。 -{{% /capture %}} -{{% capture body %}} + + 在评估完所有 Node 后,将会返回到 Node 1,从头开始。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/scheduling-eviction/scheduling-framework.md b/content/zh/docs/concepts/scheduling-eviction/scheduling-framework.md index bebea8d02e..d62f206d76 100644 --- a/content/zh/docs/concepts/scheduling-eviction/scheduling-framework.md +++ b/content/zh/docs/concepts/scheduling-eviction/scheduling-framework.md @@ -2,7 +2,7 @@ reviewers: - ahg-g title: 调度框架 -content_template: templates/concept +content_type: concept weight: 60 --- @@ -11,12 +11,12 @@ weight: 60 reviewers: - ahg-g title: Scheduling Framework -content_template: templates/concept +content_type: concept weight: 60 --- --> -{{% capture overview %}} + {{< feature-state for_k8s_version="1.15" state="alpha" >}} @@ -34,9 +34,9 @@ framework. [kep]: https://github.com/kubernetes/enhancements/blob/master/keps/sig-scheduling/20180409-scheduling-framework.md -{{% /capture %}} -{{% capture body %}} + + 该页面概述了Kubernetes对DNS的支持。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.16" state="alpha" >}} @@ -39,9 +39,9 @@ If you enable IPv4/IPv6 dual-stack networking for your Kubernetes cluster, the c --> 如果你为 Kubernetes 集群启用了 IPv4/IPv6 双协议栈网络,则该集群将支持同时分配 IPv4 和 IPv6 地址。 -{{% /capture %}} -{{% capture body %}} + + * Kubenet 强制 IPv4,IPv6 的 IPs 位置报告 (--cluster-cidr) -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * [验证 IPv4/IPv6 双协议栈](/docs/tasks/network/validate-dual-stack)网络 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/services-networking/endpoint-slices.md b/content/zh/docs/concepts/services-networking/endpoint-slices.md index 4777c92d3d..8a71b19b3c 100644 --- a/content/zh/docs/concepts/services-networking/endpoint-slices.md +++ b/content/zh/docs/concepts/services-networking/endpoint-slices.md @@ -7,7 +7,7 @@ feature: description: > Kubernetes 集群中网络端点的可扩展跟踪。 -content_template: templates/concept +content_type: concept weight: 10 --- @@ -21,12 +21,12 @@ feature: description: > Scalable tracking of network endpoints in a Kubernetes cluster. -content_template: templates/concept +content_type: concept weight: 10 --- --> -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.17" state="beta" >}} @@ -37,9 +37,9 @@ Endpoints. --> _Endpoint Slices_ 提供了一种简单的方法来跟踪 Kubernetes 集群中的网络端点(network endpoints)。它们为 Endpoints 提供了一种可伸缩和可拓展的替代方案。 -{{% /capture %}} -{{% capture body %}} + + * [启用 Endpoint Slices](/docs/tasks/administer-cluster/enabling-endpoint-slices) * 阅读 [Connecting Applications with Services](/docs/concepts/services-networking/connect-applications-service/) -{{% /capture %}} + diff --git a/content/zh/docs/concepts/services-networking/ingress-controllers.md b/content/zh/docs/concepts/services-networking/ingress-controllers.md index c6bdeccd00..46d166d9d9 100644 --- a/content/zh/docs/concepts/services-networking/ingress-controllers.md +++ b/content/zh/docs/concepts/services-networking/ingress-controllers.md @@ -1,6 +1,6 @@ --- title: Ingress 控制器 -content_template: templates/concept +content_type: concept weight: 40 --- @@ -8,12 +8,12 @@ weight: 40 --- title: Ingress Controllers reviewers: -content_template: templates/concept +content_type: concept weight: 40 --- --> -{{% capture overview %}} + * 进一步了解 [Ingress](/docs/concepts/services-networking/ingress/)。 * [在 Minikube 上使用 NGINX 控制器安装 Ingress](/docs/tasks/access-application-cluster/ingress-minikube)。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/services-networking/ingress.md b/content/zh/docs/concepts/services-networking/ingress.md index 3d5e922b22..24b2acd5dc 100644 --- a/content/zh/docs/concepts/services-networking/ingress.md +++ b/content/zh/docs/concepts/services-networking/ingress.md @@ -1,6 +1,6 @@ --- title: Ingress -content_template: templates/concept +content_type: concept weight: 40 --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.1" state="beta" >}} {{< glossary_definition term_id="ingress" length="all" >}} -{{% /capture %}} -{{% capture body %}} + + {{< toc >}} -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.17" state="alpha" >}} @@ -26,9 +26,9 @@ in the same availability zone. `Service` 拓扑可以让一个服务基于集群的 `Node` 拓扑进行流量路由。例如,一个服务可以指定流量是被优先路由到一个和客户端在同一个 `Node` 或者在同一可用区域的端点。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + {{< glossary_definition term_id="service" length="short" >}} @@ -38,9 +38,9 @@ and can load-balance across them. 使用Kubernetes,您无需修改应用程序即可使用不熟悉的服务发现机制。 Kubernetes为Pods提供自己的IP地址和一组Pod的单个DNS名称,并且可以在它们之间进行负载平衡。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 延迟卷绑定使得调度器在为 PersistentVolumeClaim 选择一个合适的 PersistentVolume 时能考虑到所有 pod 的调度限制。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/storage/storage-limits.md b/content/zh/docs/concepts/storage/storage-limits.md index 7b5f8e63be..14ffd377a6 100644 --- a/content/zh/docs/concepts/storage/storage-limits.md +++ b/content/zh/docs/concepts/storage/storage-limits.md @@ -1,6 +1,6 @@ --- title: 特定于节点的卷数限制 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + @@ -30,9 +30,9 @@ Kubernetes 需要尊重这些限制。 否则,在节点上调度的 Pod 可能 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 本文档描述了 Kubernetes 中 `VolumeSnapshotClass` 的概念。 建议熟悉[卷快照(Volume Snapshots)](/docs/concepts/storage/volume-snapshots/)和[存储类(Storage Class)](/docs/concepts/storage/storage-classes)。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + {{< feature-state for_k8s_version="1.17" state="beta" >}} @@ -28,9 +28,9 @@ In Kubernetes, a _VolumeSnapshot_ represents a snapshot of a volume on a storage --> 在 Kubernetes 中,卷快照是一个存储系统上卷的快照,本文假设你已经熟悉了 Kubernetes 的 [持久卷](/docs/concepts/storage/persistent-volumes/)。 -{{% /capture %}} -{{% capture body %}} + + 更多详细信息,请参阅 [卷快照和从快照还原卷](/docs/concepts/storage/persistent-volumes/#volume-snapshot-and-restore-volume-from-snapshot-support)。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/storage/volumes.md b/content/zh/docs/concepts/storage/volumes.md index ab64093e3a..aaf0a48f74 100644 --- a/content/zh/docs/concepts/storage/volumes.md +++ b/content/zh/docs/concepts/storage/volumes.md @@ -5,11 +5,11 @@ reviewers: - thockin - msau42 title: Volumes -content_template: templates/concept +content_type: concept weight: 10 --- -{{% capture overview %}} + -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.8" state="beta" >}} @@ -62,10 +62,10 @@ For instructions on creating and working with cron jobs, and for an example of a 有关创建和使用 CronJob 的说明及规范文件的示例,请参见[使用 CronJob 运行自动化任务](/docs/tasks/job/automated-tasks-with-cron-jobs)。 -{{% /capture %}} -{{% capture body %}} + + CronJob 仅负责创建与其调度时间相匹配的 Job,而 Job 又负责管理其代表的 Pod。 -{{% /capture %}} + + diff --git a/content/zh/docs/concepts/workloads/controllers/daemonset.md b/content/zh/docs/concepts/workloads/controllers/daemonset.md index 308779134d..edcbc29399 100644 --- a/content/zh/docs/concepts/workloads/controllers/daemonset.md +++ b/content/zh/docs/concepts/workloads/controllers/daemonset.md @@ -1,6 +1,6 @@ --- title: DaemonSet -content_template: templates/concept +content_type: concept weight: 50 --- @@ -13,12 +13,12 @@ reviewers: - janetkuo - kow3ns title: DaemonSet -content_template: templates/concept +content_type: concept weight: 50 --- ---> -{{% capture overview %}} + Kubernetes 会逐步推出针对应用或其配置的更改,确保在监视应用程序运行状况的同时,不会终止所有实例。如果出现问题,Kubernetes 会为您回滚更改。充分利用不断成长的部署解决方案生态系统。 -content_template: templates/concept +content_type: concept weight: 30 --- -{{% capture overview %}} + You describe a _desired state_ in a Deployment, and the Deployment controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments. @@ -2197,4 +2197,4 @@ additional features, such as rolling back to any previous revision even after th --> [`kubectl rolling update`](/docs/reference/generated/kubectl/kubectl-commands#rolling-update)更新 Pods 和副本控制器的方式类似。但是,建议采取 Deployments 的方式来更新,因为它们是声明性的,在服务器端,并且具有其他功能,例如,即使在滚动更新完成后,也会回滚到以前的任何修改版本。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/workloads/controllers/garbage-collection.md b/content/zh/docs/concepts/workloads/controllers/garbage-collection.md index 9d6f98dc9f..7e7802999e 100644 --- a/content/zh/docs/concepts/workloads/controllers/garbage-collection.md +++ b/content/zh/docs/concepts/workloads/controllers/garbage-collection.md @@ -1,18 +1,18 @@ --- title: 垃圾收集 -content_template: templates/concept +content_type: concept weight: 60 --- -{{% capture overview %}} + -{{% capture overview %}} + _ReplicationController_ 确保在任何时候都有特定数量的 pod 副本处于运行状态。 换句话说,ReplicationController 确保一个 pod 或一组同类的 pod 总是可用的。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.12" state="alpha" >}} @@ -33,10 +33,10 @@ Alpha Disclaimer: this feature is currently alpha, and can be enabled with both --> Alpha 免责声明:此功能目前是 alpha 版,并且可以通过 kube-apiserver 和 kube-controller-manager [特性开关](/docs/reference/command-line-tools-reference/feature-gates/) `TTLAfterFinished` 启用。 -{{% /capture %}} -{{% capture body %}} + + 在 Kubernetes 中,需要在所有节点上运行 NTP(参见 [#6159](https://github.com/kubernetes/kubernetes/issues/6159#issuecomment-93844058))以避免时间偏差。时钟并不总是如此正确,但差异应该很小。设置非零 TTL 时请注意避免这种风险。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + [设计文档](https://github.com/kubernetes/enhancements/blob/master/keps/sig-apps/0026-ttl-after-finish.md) -{{% /capture %}} + diff --git a/content/zh/docs/concepts/workloads/pods/disruptions.md b/content/zh/docs/concepts/workloads/pods/disruptions.md index 1dba6de60c..7c53f556bd 100644 --- a/content/zh/docs/concepts/workloads/pods/disruptions.md +++ b/content/zh/docs/concepts/workloads/pods/disruptions.md @@ -1,6 +1,6 @@ --- title: 干扰 -content_template: templates/concept +content_type: concept weight: 60 --- @@ -11,12 +11,12 @@ reviewers: - foxish - davidopp title: Disruptions -content_template: templates/concept +content_type: concept weight: 60 --- --> -{{% capture overview %}} + -{{% capture overview %}} + {{< feature-state state="alpha" for_k8s_version="v1.16" >}} @@ -40,9 +40,9 @@ feature could change significantly in the future or be removed entirely. 临时容器处于早期的 alpha 阶段,不适用于生产环境集群。应该预料到临时容器在某些情况下不起作用,例如在定位容器的命名空间时。根据 [Kubernetes 弃用政策](/docs/reference/using-api/deprecation-policy/),该 alpha 功能将来可能发生重大变化或完全删除。 {{< /warning >}} -{{% /capture %}} -{{% capture body %}} + + 本页提供了 Init 容器的概览,它是一种专用的容器,在{{< glossary_tooltip text="Pod" term_id="pod" >}}内的应用容器启动之前运行,并包括一些应用镜像中不存在的实用工具和安装脚本。 -{{% /capture %}} + 你可以在Pod的规格信息中与containers数组同级的位置指定 Init 容器。 -{{% capture body %}} + {{< comment >}}Updated: 4/14/2015{{< /comment >}} {{< comment >}}Edited and moved to Concepts section: 2/2/17{{< /comment >}} 该页面将描述 Pod 的生命周期。 -{{% /capture %}} -{{% capture body %}} + + ## Pod phase @@ -174,7 +174,7 @@ spec: - 节点控制器将 Pod `phase` 设置为 Failed。 - 如果是用控制器来运行,Pod 将在别处重建。 -{{% /capture %}} + diff --git a/content/zh/docs/concepts/workloads/pods/pod-overview.md b/content/zh/docs/concepts/workloads/pods/pod-overview.md index adccc41e94..d9c8423450 100644 --- a/content/zh/docs/concepts/workloads/pods/pod-overview.md +++ b/content/zh/docs/concepts/workloads/pods/pod-overview.md @@ -1,6 +1,6 @@ --- title: Pod 概览 -content_template: templates/concept +content_type: concept weight: 10 card: name: 概念 @@ -12,7 +12,7 @@ card: reviewers: - erictune title: Pod Overview -content_template: templates/concept +content_type: concept weight: 10 card: name: concepts @@ -23,12 +23,12 @@ card: -{{% capture overview %}} + 本节提供了 `Pod` 的概览信息,`Pod` 是最小可部署的 Kubernetes 对象模型。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture whatsnext %}} +## {{% heading "whatsnext" %}} + * 详细了解 [Pod](/docs/concepts/workloads/pods/pod/) * 了解有关 Pod 行为的更多信息: * [Pod 的终止](/docs/concepts/workloads/pods/pod/#termination-of-pods) * [Pod 的生命周期](/docs/concepts/workloads/pods/pod-lifecycle/) -{{% /capture %}} + diff --git a/content/zh/docs/concepts/workloads/pods/pod-topology-spread-constraints.md b/content/zh/docs/concepts/workloads/pods/pod-topology-spread-constraints.md index 96200f706e..826ca5bd78 100644 --- a/content/zh/docs/concepts/workloads/pods/pod-topology-spread-constraints.md +++ b/content/zh/docs/concepts/workloads/pods/pod-topology-spread-constraints.md @@ -1,20 +1,20 @@ --- title: Pod 拓扑扩展约束 -content_template: templates/concept +content_type: concept weight: 50 --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.16" state="alpha" >}} @@ -24,9 +24,9 @@ You can use _topology spread constraints_ to control how {{< glossary_tooltip te 可以使用*拓扑扩展约束*来控制 {{< glossary_tooltip text="Pods" term_id="Pod" >}} 在集群内故障域(例如地区,区域,节点和其他用户自定义拓扑域)之间的分布。这可以帮助实现高可用以及提升资源利用率。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + @@ -19,12 +19,12 @@ This page provides an overview of PodPresets, which are objects for injecting certain information into pods at creation time. The information can include secrets, volumes, volume mounts, and environment variables. --> -{{% capture overview %}} + 本文提供了 PodPreset 的概述。 在 Pod 创建时,用户可以使用 PodPreset 对象将特定信息注入 Pod 中,这些信息可以包括 secret、 卷、卷挂载和环境变量。 -{{% /capture %}} -{{% capture body %}} + + * [使用 PodPreset 将信息注入 Pod](/docs/tasks/inject-data-application/podpreset/) -{{% /capture %}} + diff --git a/content/zh/docs/contribute/_index.md b/content/zh/docs/contribute/_index.md index 426e6a773a..d826160593 100644 --- a/content/zh/docs/contribute/_index.md +++ b/content/zh/docs/contribute/_index.md @@ -1,5 +1,5 @@ --- -content_template: templates/concept +content_type: concept title: 为 Kubernetes 文档做贡献 linktitle: 贡献 main_menu: true @@ -8,7 +8,7 @@ weight: 80 -{{% capture overview %}} + -{{% capture overview %}} + 如果你已经阅读并掌握[开始贡献](/docs/contribute/start/)和[中级贡献](/docs/contribute/intermediate/),并准备了解更多贡献的途径,请阅读此文。您需要使用 Git 命令行工具和其他工具做这些工作。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + 你需要知道如何在一个 GitHub 项目仓库中创建一个 PR。一般来说,这涉及到创建仓库的 fork 分支。想了解更多信息,请参见[创建一个文档 PR](/docs/contribute/start/) 和 [GitHub 标准 Fork & PR 工作流](https://gist.github.com/Chaser324/ce0505fbed06b947d962)。 -{{% /capture %}} -{{% capture steps %}} + + 将您的更改[创建 PR](/docs/contribute/start/) 提交到 [kubernetes/website](https://github.com/kubernetes/website) 仓库。监视您提交的 PR,并根据需要回复 reviewer 的评论。继续监视您的 PR,直到合并为止。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + -{{% capture overview %}} + 如果您熟悉本主题中讨论的所有任务,并且想与 Kubernetes 文档小组进行更深入的接触, 请阅读[文档高级贡献者](/docs/contribute/advanced/)主题。 -{{% /capture %}} + diff --git a/content/zh/docs/contribute/localization.md b/content/zh/docs/contribute/localization.md index ed6181e989..bad833c974 100644 --- a/content/zh/docs/contribute/localization.md +++ b/content/zh/docs/contribute/localization.md @@ -1,6 +1,6 @@ --- title: 本地化 Kubernetes 文档 -content_template: templates/concept +content_type: concept card: name: contribute weight: 30 @@ -9,7 +9,7 @@ card: -{{% capture overview %}} + 此页面显示了如何为其他语言的文档提供[本地化](https://blog.mozilla.org/l10n/2011/12/14/i18n-vs-l10n-whats-the-diff/)。 -{{% /capture %}} -{{% capture body %}} + + 您还可以向现有本地化添加或改进内容提供帮助。加入 [Slack 频道](https://kubernetes.slack.com/messages/C1J0BPD2M/)进行本地化,然后开始新建 PR 来提供帮助。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 结合 OWNERS 文件及扉页可以给 PR 作者提供向谁请求检视的建议。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + 当您对本主题中讨论的所有任务感到满意,并且您希望以更深入的方式与 Kubernetes 文档团队合作,请阅读[中级贡献者指南](/docs/contribute/intermediate/)。 -{{% /capture %}} + diff --git a/content/zh/docs/contribute/style/content-organization.md b/content/zh/docs/contribute/style/content-organization.md index 3ce7964655..b8976252fc 100644 --- a/content/zh/docs/contribute/style/content-organization.md +++ b/content/zh/docs/contribute/style/content-organization.md @@ -1,19 +1,19 @@ --- title: 内容组织 -content_template: templates/concept +content_type: concept weight: 40 --- -{{% capture overview %}} + {{% note %}} -{{% capture overview %}} + 本页面将介绍定制 Hugo 短代码,可以用于 Kubernetes markdown 文档书写。 更多关于短代码参见 [Hugo 文档](https://gohugo.io/content-management/shortcodes)。 -{{% /capture %}} -{{% capture body %}} + + ## 功能状态 @@ -256,9 +256,10 @@ println "This is tab 2." {{< /tabs >}} -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + -- 在页面的 YAML 头部,设置 `content_template: templates/concept`。 +- 在页面的 YAML 头部,设置 `content_type: concept`。 - 在页面的 body 中,设置所需的 `capture` 变量和所有想要包含的变量: | 变量 | 必需? | @@ -153,12 +153,12 @@ To write a new task page, create a Markdown file in a subdirectory of the 要编写新的任务页面,请在 `/content/en/docs/tasks` 目录的子目录中创建一个 Markdown 文件,其特点如下: -- 在页面的 YAML 头部,设置 `content_template: templates/task`。 +- 在页面的 YAML 头部,设置 `content_type: task`。 - 在页面的 body 中,设置所需的 `capture` 变量和所有想要包含的变量: | 变量 | 必需? | @@ -253,12 +253,12 @@ To write a new tutorial page, create a Markdown file in a subdirectory of the 要编写新的教程页面,请在 `/content/en/docs/tutorials` 目录的子目录中创建一个 Markdown 文件,其特点如下: -- 在页面的 YAML 头部,设置 `content_template: templates/tutorial`。 +- 在页面的 YAML 头部,设置 `content_type: tutorial`。 - 在页面的 body 中,设置所需的 `capture` 变量和所有想要包含的变量: | 变量 | 必需? | @@ -337,9 +337,10 @@ An example of a published topic that uses the tutorial template is 使用教程模板的已发布主题的一个示例是[使用部署运行无状态应用程序](/docs/tutorials/stateless-application/run-stateless-application-deployment/)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + 本页面展示如何为 Kubernetes 文档库创建新主题。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 如[开始贡献](/docs/contribute/start/)中所述,创建 Kubernetes 文档库的分支。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture whatsnext %}} +## {{% heading "whatsnext" %}} + * 学习[使用页面模板](/docs/home/contribute/page-templates/)。 * 学习[展示你的修改](/docs/home/contribute/stage-documentation-changes/)。 * 学习[创建一个拉取请求](/docs/home/contribute/create-pull-request/)。 -{{% /capture %}} + diff --git a/content/zh/docs/home/supported-doc-versions.md b/content/zh/docs/home/supported-doc-versions.md index 986155dc0f..31c3831690 100644 --- a/content/zh/docs/home/supported-doc-versions.md +++ b/content/zh/docs/home/supported-doc-versions.md @@ -1,19 +1,19 @@ --- title: Kubernetes 文档支持的版本 -content_template: templates/concept +content_type: concept card: name: about weight: 10 title: Kubernetes 文档支持的版本 --- -{{% capture overview %}} + 本网站包含当前版本和之前四个版本的 Kubernetes 文档。 -{{% /capture %}} -{{% capture body %}} + + ## 当前版本 @@ -24,6 +24,6 @@ card: {{< versions-other >}} -{{% /capture %}} + diff --git a/content/zh/docs/reference/_index.md b/content/zh/docs/reference/_index.md index d6e4af5a77..2c49c689d1 100644 --- a/content/zh/docs/reference/_index.md +++ b/content/zh/docs/reference/_index.md @@ -3,7 +3,7 @@ title: 参考 linkTitle: "参考" main_menu: true weight: 70 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + 这是 Kubernetes 文档的参考部分。 -{{% /capture %}} -{{% capture body %}} + + ## API 参考 @@ -122,4 +122,4 @@ Kubernetes 功能的设计文档归档,不妨考虑从 [Kubernetes 架构](htt An archive of the design docs for Kubernetes functionality. Good starting points are [Kubernetes Architecture](https://git.k8s.io/community/contributors/design-proposals/architecture/architecture.md) and [Kubernetes Design Overview](https://git.k8s.io/community/contributors/design-proposals). --> -{{% /capture %}} + diff --git a/content/zh/docs/reference/access-authn-authz/abac.md b/content/zh/docs/reference/access-authn-authz/abac.md index b39aa418f3..7274053412 100644 --- a/content/zh/docs/reference/access-authn-authz/abac.md +++ b/content/zh/docs/reference/access-authn-authz/abac.md @@ -5,7 +5,7 @@ approvers: - deads2k - liggitt title: 使用 ABAC 鉴权 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + 基于属性的访问控制(Attribute-based access control - ABAC)定义了访问控制范例,其中通过使用将属性组合在一起的策略来向用户授予访问权限。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 此页面概述了准入控制器。 -{{% /capture %}} -{{% capture body %}} + + 对于更早期版本,没有验证和变更的概念,并且准入控制器按照指定的确切顺序运行。 -{{% /capture %}} + diff --git a/content/zh/docs/reference/access-authn-authz/authorization.md b/content/zh/docs/reference/access-authn-authz/authorization.md index a7366e92d5..3c2a08a817 100644 --- a/content/zh/docs/reference/access-authn-authz/authorization.md +++ b/content/zh/docs/reference/access-authn-authz/authorization.md @@ -8,17 +8,17 @@ cnapprove: - fatalc title: 授权概述 -content_template: templates/concept +content_type: concept weight: 60 --- -{{% capture overview %}} + 了解有关 Kubernetes 授权的更多信息,包括使用支持的授权模块创建策略的详细信息。 -{{% /capture %}} -{{% capture body %}} + + * 要了解有关身份验证的更多信息,请参阅 **身份验证** [控制对 Kubernetes API 的访问](/docs/reference/access-authn-authz/controlling-access/)。 * 要了解有关准入控制的更多信息,请参阅 [使用准入控制器](/docs/reference/access-authn-authz/admission-controllers/)。 -{{% /capture %}} \ No newline at end of file diff --git a/content/zh/docs/reference/access-authn-authz/extensible-admission-controllers.md b/content/zh/docs/reference/access-authn-authz/extensible-admission-controllers.md index 9f0df8dd7a..e1782b0419 100644 --- a/content/zh/docs/reference/access-authn-authz/extensible-admission-controllers.md +++ b/content/zh/docs/reference/access-authn-authz/extensible-admission-controllers.md @@ -1,18 +1,18 @@ --- title: 动态准入控制 -content_template: templates/concept +content_type: concept weight: 40 --- -{{% capture overview %}} + 除了[内置的 admission 插件](/docs/reference/access-authn-authz/admission-controllers/),admission 插件可以作为扩展独立开发,并以运行时所配置的 webhook 的形式运行。 此页面描述了如何构建、配置、使用和监视 admission webhook。 -{{% /capture %}} -{{% capture body %}} + + @@ -2174,4 +2174,4 @@ plane, exclude the `kube-system` namespace from being intercepted using a 意外更改或拒绝 `kube-system` 命名空间中的请求可能会导致控制平面组件停止运行或者导致未知行为发生。 如果您的 admission webhook 不想修改 Kubernetes 控制平面的行为,请使用 [`namespaceSelector`](#matching-requests-namespaceselector) 避免拦截 `kube-system` 命名空间。 -{{% /capture %}} + diff --git a/content/zh/docs/reference/access-authn-authz/node.md b/content/zh/docs/reference/access-authn-authz/node.md index c3d149f61e..2f0654dd00 100644 --- a/content/zh/docs/reference/access-authn-authz/node.md +++ b/content/zh/docs/reference/access-authn-authz/node.md @@ -1,6 +1,6 @@ --- title: 使用 Node 鉴权 -content_template: templates/concept +content_type: concept weight: 90 --- -{{% capture overview %}} + 节点鉴权是一种特殊用途的鉴权模式,专门对 kubelet 发出的 API 请求进行鉴权。 -{{% /capture %}} -{{% capture body %}} + + ## 概述 -{{% /capture %}} + diff --git a/content/zh/docs/reference/access-authn-authz/rbac.md b/content/zh/docs/reference/access-authn-authz/rbac.md index 5f3adb0190..3d35e4e8bb 100644 --- a/content/zh/docs/reference/access-authn-authz/rbac.md +++ b/content/zh/docs/reference/access-authn-authz/rbac.md @@ -1,6 +1,6 @@ --- title: 使用 RBAC 鉴权 -content_template: templates/concept +content_type: concept weight: 70 --- @@ -11,19 +11,19 @@ reviewers: - deads2k - liggitt title: Using RBAC Authorization -content_template: templates/concept +content_type: concept weight: 70 --- --> -{{% capture overview %}} + 基于角色(Role)的访问控制(RBAC)是一种基于企业中用户的角色来调节控制对计算机或网络资源的访问方法。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + WebHook 是一种 HTTP 回调:某些条件下触发的 HTTP POST 请求;通过 HTTP POST 发送的简单事件通知。一个基于 web 应用实现的 WebHook 会在特定事件发生时把消息发送给特定的 URL。 -{{% /capture %}} -{{% capture body %}} + + 更多信息可以参考 authorization.v1beta1 API 对象和[webhook.go](https://github.com/kubernetes/kubernetes/blob/{{< param "githubbranch" >}}/staging/src/k8s.io/apiserver/plugin/pkg/authorizer/webhook/webhook.go)。 -{{% /capture %}} + diff --git a/content/zh/docs/reference/command-line-tools-reference/feature-gates.md b/content/zh/docs/reference/command-line-tools-reference/feature-gates.md index ff51d2549c..b91c41bc79 100644 --- a/content/zh/docs/reference/command-line-tools-reference/feature-gates.md +++ b/content/zh/docs/reference/command-line-tools-reference/feature-gates.md @@ -1,18 +1,18 @@ --- weight: 10 title: 特性门控 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + -{{% capture synopsis %}} +## {{% heading "synopsis" %}} + -{{% capture synopsis %}} +## {{% heading "synopsis" %}} + -{{% capture overview %}} + 本页面介绍 Kubernetes 安全和信息披露相关的内容。 -{{% /capture %}} -{{% capture body %}} + + @@ -135,4 +135,4 @@ It is reasonable to delay disclosure when the bug or the fix is not yet fully un The timeframe for disclosure is from immediate (especially if it's already publicly known) to a few weeks. As a basic default, we expect report date to disclosure date to be on the order of 7 days. The Kubernetes product security team holds the final say when setting a disclosure date. --> 信息披露的时间范围从即时(尤其是已经公开的)到几周。作为一个基本的约定,我们希望报告日期到披露日期的间隔是 7 天。在设置披露日期时,Kubernetes 产品安全团队拥有最终决定权。 -{{% /capture %}} + diff --git a/content/zh/docs/reference/kubectl/cheatsheet.md b/content/zh/docs/reference/kubectl/cheatsheet.md index 43ded7f976..4ef61cac63 100644 --- a/content/zh/docs/reference/kubectl/cheatsheet.md +++ b/content/zh/docs/reference/kubectl/cheatsheet.md @@ -4,7 +4,7 @@ reviewers: - erictune - krousey - clove -content_template: templates/concept +content_type: concept card: name: reference weight: 30 @@ -15,13 +15,13 @@ reviewers: - erictune - krousey - clove -content_template: templates/concept +content_type: concept card: name: reference weight: 30 --- --> -{{% capture overview %}} + 也可以看下: [Kubectl 概述](/docs/reference/kubectl/overview/) 和 [JsonPath 指南](/docs/reference/kubectl/jsonpath)。 @@ -29,9 +29,9 @@ card: 本页面是 `kubectl` 命令的概述。 -{{% /capture %}} -{{% capture body %}} + + ## kubectl - 备忘单 @@ -657,9 +657,10 @@ Kubectl 日志输出详细程度是通过 `-v` 或者 `--v` 来控制的,参 `--v=8` | 显示 HTTP 请求内容。 `--v=9` | 显示 HTTP 请求内容而不截断内容。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + `kubectl` 的推荐用法约定 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 您可以使用 Kubernetes 命令行工具 kubectl 与 API 服务器进行交互。如果您熟悉 Docker 命令行工具,则使用 kubectl 非常简单。但是,docker 命令和 kubectl 命令之间有一些区别。以下显示了 docker 子命令,并描述了等效的 kubectl 命令。 -{{% /capture %}} -{{% capture body %}} + + ## docker run -{{% capture overview %}} + Kubectl 支持 JSONPath 模板。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture synopsis %}} +## {{% heading "synopsis" %}} + -{{% capture overview %}} + 本文概述了 `kubectl` 语法和命令操作描述,并提供了常见的示例。有关每个命令的详细信息,包括所有受支持的参数和子命令,请参阅 [kubectl](/docs/reference/generated/kubectl/kubectl-commands/) 参考文档。有关安装说明,请参见 [安装 kubectl](/docs/tasks/kubectl/install/) 。 -{{% /capture %}} -{{% capture body %}} + + 要了解关于插件的更多信息,请查看[示例 cli 插件](https://github.com/kubernetes/sample-cli-plugin)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 开始使用 [kubectl](/docs/reference/generated/kubectl/kubectl-commands/) 命令。 -{{% /capture %}} + diff --git a/content/zh/docs/reference/kubernetes-api/labels-annotations-taints.md b/content/zh/docs/reference/kubernetes-api/labels-annotations-taints.md index 4ed29847fd..e271e1885e 100644 --- a/content/zh/docs/reference/kubernetes-api/labels-annotations-taints.md +++ b/content/zh/docs/reference/kubernetes-api/labels-annotations-taints.md @@ -1,10 +1,10 @@ --- title: 知名标签(Label)、注解(Annotation)和 Taints -content_template: templates/concept +content_type: concept weight: 60 --- -{{% capture overview %}} + ## kubernetes.io/arch @@ -272,4 +272,4 @@ adding the labels manually (or adding support for `PersistentVolumeLabel`). With 如果 `PersistentVolumeLabel` 准入控制器不支持自动为 PersistentVolume 打标签,且用户希望防止 pod 跨区域进行卷的挂载, 应考虑手动打标签 (或对 `PersistentVolumeLabel` 增加支持)。如果用户的基础设施没有这种约束,则不需要为卷添加区域标签。 -{{% /capture %}} + diff --git a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-config.md b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-config.md index 7d04b8d5c8..d36201165e 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-config.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-config.md @@ -1,10 +1,10 @@ --- title: kubeadm config -content_template: templates/concept +content_type: concept weight: 50 --- -{{% capture overview %}} + ## kubeadm config upload from-file {#cmd-config-from-file} ## kubeadm config view {#cmd-config-view} @@ -56,14 +56,15 @@ to list and pull the images that kubeadm requires. ## kubeadm config images pull {#cmd-config-images-pull} {{< include "generated/kubeadm_config_images_pull.md" >}} -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * [kubeadm upgrade](/docs/reference/setup-tools/kubeadm/kubeadm-upgrade/) 将 Kubernetes 集群升级到更新版本 [kubeadm upgrade] -{{% /capture %}} + diff --git a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-init.md b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-init.md index 4a0e252414..b975d3df60 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-init.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-init.md @@ -1,6 +1,6 @@ --- title: kubeadm init -content_template: templates/concept +content_type: concept weight: 20 --- @@ -11,18 +11,18 @@ reviewers: - luxas - jbeda title: kubeadm init -content_template: templates/concept +content_type: concept weight: 20 --- --> -{{% capture overview %}} + 此命令初始化一个 Kubernetes 控制平面节点。 -{{% /capture %}} -{{% capture body %}} + + {{< include "generated/kubeadm_init.md" >}} @@ -461,9 +461,10 @@ provisioned). For details, see the [kubeadm join](/docs/reference/setup-tools/ku --> 注意这种搭建集群的方式在安全保证上会有一些宽松,因为这种方式不允许使用 `--discovery-token-ca-cert-hash` 来验证根 CA 的哈希值(因为当配置节点的时候,它还没有被生成)。获取需更多信息请参阅[kubeadm join](/docs/reference/setup-tools/kubeadm/kubeadm-join/)文档。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 此命令用来初始化 Kubernetes 工作节点并将其加入集群。 -{{% /capture %}} -{{% capture body %}} + + {{< include "generated/kubeadm_join.md" >}} 要了解 `JoinConfiguration` 中各个字段的详细信息请参考 [godoc](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm#JoinConfiguration)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + 该命令尽力还原由 `kubeadm init` 或 `kubeadm join` 所做的更改。 -{{% /capture %}} -{{% capture body %}} + + {{< include "generated/kubeadm_reset.md" >}} @@ -52,11 +52,12 @@ etcdctl del "" --prefix 更多详情请参考 [etcd 文档](https://github.com/coreos/etcd/tree/master/etcdctl)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 参考 [kubeadm init](/docs/reference/setup-tools/kubeadm/kubeadm-init/) 来初始化 Kubernetes 主节点。 * 参考 [kubeadm join](/docs/reference/setup-tools/kubeadm/kubeadm-join/) 来初始化 Kubernetes 工作节点并加入集群。 -{{% /capture %}} + diff --git a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-token.md b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-token.md index 37e4cbcfca..ba49bc9834 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-token.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-token.md @@ -1,6 +1,6 @@ --- title: kubeadm 令牌 -content_template: templates/concept +content_type: concept weight: 70 --- @@ -11,12 +11,12 @@ reviewers: - luxas - jbeda title: kubeadm token -content_template: templates/concept +content_type: concept weight: 70 --- --> -{{% capture overview %}} + ## kubeadm token create {#cmd-token-create} {{< include "generated/kubeadm_token_create.md" >}} @@ -45,11 +45,12 @@ such a token and also to create and manage new ones. ## kubeadm token list {#cmd-token-list} {{< include "generated/kubeadm_token_list.md" >}} -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * [kubeadm join](/docs/reference/setup-tools/kubeadm/kubeadm-join/) 引导 Kubernetes 工作节点并将其加入群集 -{{% /capture %}} + diff --git a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-upgrade.md b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-upgrade.md index 6fb5d8828e..f387963503 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-upgrade.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-upgrade.md @@ -1,6 +1,6 @@ --- title: kubeadm upgrade -content_template: templates/concept +content_type: concept weight: 40 --- -{{% capture overview %}} + `kubeadm upgrade` 是一个对用户友好的命令,它将复杂的升级逻辑包装在一个命令后面,支持升级的规划和实际执行。 -{{% /capture %}} -{{% capture body %}} + + * 如果您使用 kubeadm v1.7.x 或更低版本初始化集群,则可以参考[kubeadm 配置](/docs/reference/setup-tools/kubeadm/kubeadm-config/)配置集群用于 `kubeadm upgrade`。 -{{% /capture %}} + diff --git a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-version.md b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-version.md index d139966055..b2afa2124b 100644 --- a/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-version.md +++ b/content/zh/docs/reference/setup-tools/kubeadm/kubeadm-version.md @@ -4,19 +4,19 @@ reviewers: - luxas - jbeda title: kubeadm version -content_template: templates/concept +content_type: concept weight: 80 --- -{{% capture overview %}} + 此命令用来查询 kubeadm 的版本。 -{{% /capture %}} -{{% capture body %}} + + {{< include "generated/kubeadm_version.md" >}} -{{% /capture %}} + diff --git a/content/zh/docs/reference/tools.md b/content/zh/docs/reference/tools.md index ae97a3ea74..fa41dcaf8c 100644 --- a/content/zh/docs/reference/tools.md +++ b/content/zh/docs/reference/tools.md @@ -2,7 +2,7 @@ reviewers: - janetkuo title: 工具 -content_template: templates/concept +content_type: concept --- @@ -19,11 +19,11 @@ content_template: templates/concept -{{% capture overview %}} + Kubernetes 包含一些内置工具,可以帮助用户更好的使用 Kubernetes 系统。 -{{% /capture %}} -{{% capture body %}} + + ## Kubectl -{{% capture overview %}} + 此页提供 Kubernetes API 的总览 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 本页面包含基于各种编程语言使用 Kubernetes API 的客户端库概述。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 更简单地说,可以在学习和生产环境中创建一个 Kubernetes 集群。 -{{% /capture %}} -{{% capture body %}} + + [Kubernetes 合作伙伴](https://kubernetes.io/partners/#conformance) 包括一个 [已认证的 Kubernetes](https://github.com/cncf/k8s-conformance/#certified-kubernetes) 提供商列表。 -{{% /capture %}} + diff --git a/content/zh/docs/setup/best-practices/certificates.md b/content/zh/docs/setup/best-practices/certificates.md index 6ea5228ba2..40a9da84a1 100644 --- a/content/zh/docs/setup/best-practices/certificates.md +++ b/content/zh/docs/setup/best-practices/certificates.md @@ -2,7 +2,7 @@ title: PKI 证书和要求 reviewers: - sig-cluster-lifecycle -content_template: templates/concept +content_type: concept weight: 40 --- -{{% capture overview %}} + Kubernetes 需要 PKI 证书才能进行基于 TLS 的身份验证。如果您是使用 [kubeadm](/docs/reference/setup-tools/kubeadm/kubeadm/) 安装的 Kubernetes,则会自动生成集群所需的证书。您还可以生成自己的证书。例如,不将私钥存储在 API 服务器上,可以让私钥更加安全。此页面说明了集群必需的证书。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + @@ -126,9 +126,10 @@ Kubernetes 发布的版本通常只维护支持九个月,在维护周期内, | v1.11.x | 2018 年 6 月 | 2019 年 3 月 | | v1.12.x | 2018 年 9 月 | 2019 年 6 月 | -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + -{{% capture overview %}} + Minikube 是一种可以让您在本地轻松运行 Kubernetes 的工具。Minikube 在笔记本电脑上的虚拟机(VM)中运行单节点 Kubernetes 集群,供那些希望尝试 Kubernetes 或进行日常开发的用户使用。 -{{% /capture %}} -{{% capture body %}} + + 我们欢迎您向社区提交贡献、提出问题以及参与评论!Minikube 开发人员可以在 [Slack](https://kubernetes.slack.com) 的 #minikube 频道上互动交流(点击[这里](http://slack.kubernetes.io/)获得邀请)。我们还有 [kubernetes-dev Google Groups 邮件列表](https://groups.google.com/forum/#!forum/kubernetes-dev)。如果您要发信到列表中,请在主题前加上 "minikube: "。 -{{% /capture %}} + diff --git a/content/zh/docs/setup/production-environment/container-runtimes.md b/content/zh/docs/setup/production-environment/container-runtimes.md index a9a7c4fbd5..fb3dde5428 100644 --- a/content/zh/docs/setup/production-environment/container-runtimes.md +++ b/content/zh/docs/setup/production-environment/container-runtimes.md @@ -3,7 +3,7 @@ reviewers: - vincepri - bart0sh title: 容器运行时 -content_template: templates/concept +content_type: concept weight: 10 --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.6" state="stable" >}} {{< caution >}} -{{% capture overview %}} + DC/OS 入门的正式来源位于[quickstart 仓库](https://github.com/mesosphere/dcos-kubernetes-quickstart)中。 -{{% /capture %}} + diff --git a/content/zh/docs/setup/production-environment/on-premises-vm/ovirt.md b/content/zh/docs/setup/production-environment/on-premises-vm/ovirt.md index 8be64713e9..ea8790f452 100644 --- a/content/zh/docs/setup/production-environment/on-premises-vm/ovirt.md +++ b/content/zh/docs/setup/production-environment/on-premises-vm/ovirt.md @@ -1,6 +1,6 @@ --- title: oVirt -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + -{{% capture overview %}} + 如果您有不同的观点,您可能更喜欢使用 [kubeadm](/docs/admin/kubeadm/) 作为构建工具来构建自己的集群。kops 建立在 kubeadm 工作的基础上。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + {{< feature-state for_k8s_version="1.12" state="stable" >}} @@ -55,9 +55,9 @@ You can generate a `ClusterConfiguration` object with default values by running 您可以通过运行 `kubeadm config print init-defaults` 并将输出保存到您选择的文件中,以默认值形式生成 `ClusterConfiguration` 对象。 {{< /note >}} -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + ![外部 etcd 拓扑](/images/kubeadm/kubeadm-ha-topology-external-etcd.svg) -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + - [使用 kubeadm 设置高可用集群](/docs/setup/production-environment/tools/kubeadm/high-availability/) -{{% /capture %}} + diff --git a/content/zh/docs/setup/production-environment/tools/kubeadm/high-availability.md b/content/zh/docs/setup/production-environment/tools/kubeadm/high-availability.md index 7b6fd2fd2d..3703563d4b 100644 --- a/content/zh/docs/setup/production-environment/tools/kubeadm/high-availability.md +++ b/content/zh/docs/setup/production-environment/tools/kubeadm/high-availability.md @@ -2,7 +2,7 @@ reviewers: - sig-cluster-lifecycle title: 利用 kubeadm 创建高可用集群 -content_template: templates/task +content_type: task weight: 60 --- @@ -11,12 +11,12 @@ weight: 60 reviewers: - sig-cluster-lifecycle title: Creating Highly Available clusters with kubeadm -content_template: templates/task +content_type: task weight: 60 --- --> -{{% capture overview %}} + ## 这两种方法的第一步 @@ -731,4 +732,4 @@ the creation of additional nodes could fail due to a lack of required SANs. mv /home/${USER}/etcd-ca.key /etc/kubernetes/pki/etcd/ca.key ``` -{{% /capture %}} + diff --git a/content/zh/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md b/content/zh/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md index 9b2a62318a..accb3a5b43 100644 --- a/content/zh/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md +++ b/content/zh/docs/setup/production-environment/tools/kubeadm/install-kubeadm.md @@ -1,6 +1,6 @@ --- title: 安装 kubeadm -content_template: templates/task +content_type: task weight: 10 card: name: setup @@ -10,7 +10,7 @@ card: -{{% capture overview %}} + * [使用 kubeadm 创建集群](/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/) -{{% /capture %}} + diff --git a/content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md b/content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md index 6618de8e48..e10bafa969 100644 --- a/content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md +++ b/content/zh/docs/setup/production-environment/tools/kubeadm/kubelet-integration.md @@ -2,7 +2,7 @@ reviewers: - sig-cluster-lifecycle title: 使用 kubeadm 配置集群中的每个 kubelet -content_template: templates/concept +content_type: concept weight: 80 --- -{{% capture overview %}} + {{< feature-state for_k8s_version="1.11" state="stable" >}} @@ -46,9 +46,9 @@ kubeadm CLI 工具的生命周期与 [kubelet](/docs/reference/command-line-tool 集群中涉及的所有 kubelet 的一些配置细节都必须相同,而其他配置方面则需要基于每个 kubelet 进行设置,以适应给定机器的不同特性,例如操作系统、存储和网络。 您可以手动地管理 kubelet 的配置,但是 [kubeadm 现在提供一种 `KubeletConfiguration` API 类型,用于集中管理 kubelet 的配置](#configure-kubelets-using-kubeadm)。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + 要创建自托管集群,请参见 [kubeadm alpha 自托管枢纽](/docs/reference/setup-tools/kubeadm/kubeadm-alpha/#cmd-selfhosting) 命令。 -{{% /capture %}} -{{% capture body %}} + + 1. 当原始静态控制平面停止时,新的自托管控制平面能够绑定到侦听端口并变为活动状态。 -{{% /capture %}} + diff --git a/content/zh/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md b/content/zh/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md index a3e4420e35..e79718b204 100644 --- a/content/zh/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md +++ b/content/zh/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md @@ -1,6 +1,6 @@ --- title: 使用 kubeadm 创建一个高可用 etcd 集群 -content_template: templates/task +content_type: task weight: 70 --- @@ -9,12 +9,12 @@ weight: 70 reviewers: - sig-cluster-lifecycle title: Set up a High Availability etcd cluster with kubeadm -content_template: templates/task +content_type: task weight: 70 --- --> -{{% capture overview %}} + {{< note >}} 默认情况下,kubeadm 运行单成员的 etcd 集群,该集群由控制面节点上的 kubelet 以静态 Pod 的方式进行管理。由于 etcd 集群只包含一个成员且不能在任一成员不可用时保持运行,所以这不是一种高可用设置。本任务,将告诉您如何在使用 kubeadm 创建一个 kubernetes 集群时创建一个外部 etcd:有三个成员的高可用 etcd 集群。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + [工具箱]: /docs/setup/production-environment/tools/kubeadm/install-kubeadm/ -{{% /capture %}} -{{% capture steps %}} + + - 将 `${HOST0}` 设置为要测试的主机的 IP 地址 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 一旦拥有了一个正常工作的 3 成员的 etcd 集群,你就可以基于[使用 kubeadm 的外部 etcd 方法](/docs/setup/independent/high-availability/),继续部署一个高可用的控制平面。 -{{% /capture %}} + diff --git a/content/zh/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md b/content/zh/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md index 1e3ab441b4..e00a71127c 100644 --- a/content/zh/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md +++ b/content/zh/docs/setup/production-environment/tools/kubeadm/troubleshooting-kubeadm.md @@ -1,17 +1,17 @@ --- title: 对 kubeadm 进行故障排查 -content_template: templates/concept +content_type: concept weight: 20 --- -{{% capture overview %}} + -{{% capture overview %}} + 本页面介绍了如何在 AWS 上安装 Kubernetes 集群。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + @@ -61,9 +62,9 @@ To create a Kubernetes cluster on AWS, you will need an Access Key ID and a Secr --> * [KubeOne](https://github.com/kubermatic/kubeone) 是一个开源集群生命周期管理工具,它可用于创建,升级和管理高可用 Kubernetes 集群。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + Windows 应用程序构成了许多组织中运行的服务和应用程序的很大一部分。本指南将引导您完成在 Kubernetes 中配置和部署 Windows 容器的步骤。 -{{% /capture %}} -{{% capture body %}} + + 本文描述 Kubernetes 各组件之间版本倾斜支持策略。 特定的集群部署工具可能会有额外的限制。 -{{% /capture %}} -{{% capture body %}} + + ## Supported versions diff --git a/content/zh/docs/tasks/_index.md b/content/zh/docs/tasks/_index.md index 0be5747945..892ea33b1e 100644 --- a/content/zh/docs/tasks/_index.md +++ b/content/zh/docs/tasks/_index.md @@ -2,20 +2,20 @@ title: 任务 main_menu: true weight: 50 -content_template: templates/concept +content_type: concept --- {{< toc >}} -{{% capture overview %}} + Kubernetes 文档这一部分包含的一些页面展示如何去做单个任务。一个任务页面展示了如何执行操作单一的项目,通常是通过给出若干步骤。 -{{% /capture %}} -{{% capture body %}} + + ## Web 用户界面 (Dashboard) @@ -178,9 +178,10 @@ Configure and schedule NVIDIA GPUs for use as a resource by nodes in a cluster. Configure and schedule huge pages as a schedulable resource in a cluster. --> -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 如果您想编写任务页面,请参阅[创建文档提取请求](/docs/home/contribute/create-pull-request/)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-application-cluster/access-cluster.md b/content/zh/docs/tasks/access-application-cluster/access-cluster.md index d0b41d4a6f..c839c2951f 100644 --- a/content/zh/docs/tasks/access-application-cluster/access-cluster.md +++ b/content/zh/docs/tasks/access-application-cluster/access-cluster.md @@ -1,29 +1,29 @@ --- title: 访问集群 weight: 20 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + 本文阐述多种与集群交互的方法。 -{{% /capture %}} + {{< toc >}} -{{% capture body %}} + 本文旨在说明如何让一个 Pod 内的两个容器使用一个卷(Volume)进行通信。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 创建一个包含两个容器的 Pod @@ -111,10 +112,10 @@ Pod 的配置文件如下: Hello from the debian container -{{% /capture %}} -{{% capture discussion %}} + + ## 讨论 @@ -137,10 +138,11 @@ Pod 能有多个容器的主要原因是为了支持辅助应用(helper applic 在本练习中的卷为 Pod 生命周期中的容器相互通信提供了一种方法。如果 Pod 被删除或者重建了, 任何共享卷中的数据都会丢失。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + @@ -161,7 +163,7 @@ Pod 能有多个容器的主要原因是为了支持辅助应用(helper applic * 参见 [Pod](/docs/api-reference/{{< param "version" >}}/#pod-v1-core). -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-application-cluster/configure-access-multiple-clusters.md b/content/zh/docs/tasks/access-application-cluster/configure-access-multiple-clusters.md index 219e1b4ee8..d577256a6e 100644 --- a/content/zh/docs/tasks/access-application-cluster/configure-access-multiple-clusters.md +++ b/content/zh/docs/tasks/access-application-cluster/configure-access-multiple-clusters.md @@ -1,10 +1,10 @@ --- title: 配置对多集群的访问 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本文展示如何使用配置文件来配置对多个集群的访问。 在将集群、用户和上下文定义在一个或多个配置文件中之后,用户可以使用 `kubectl config use-context` 命令快速地在集群之间进行切换。 @@ -13,15 +13,16 @@ content_template: templates/task 这是一种引用配置文件的通用方式,并不意味着存在一个名为 `kubeconfig` 的文件。 {{< /note >}} -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 需要安装 [`kubectl`](/docs/tasks/tools/install-kubectl/) 命令行工具。 -{{% /capture %}} -{{% capture steps %}} + + ## 定义集群、用户和上下文 @@ -305,14 +306,15 @@ kubectl config view export KUBECONFIG=$KUBECONFIG_SAVED ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * [使用 kubeconfig 文件组织集群访问](/docs/concepts/configuration/organize-cluster-access-kubeconfig/) * [kubectl 配置](/docs/user-guide/kubectl/{{< param "version" >}}/) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-application-cluster/configure-cloud-provider-firewall.md b/content/zh/docs/tasks/access-application-cluster/configure-cloud-provider-firewall.md index a23cea7633..a6cee8c2d0 100644 --- a/content/zh/docs/tasks/access-application-cluster/configure-cloud-provider-firewall.md +++ b/content/zh/docs/tasks/access-application-cluster/configure-cloud-provider-firewall.md @@ -3,11 +3,11 @@ reviewers: - bprashanth - davidopp title: 配置你的云平台防火墙 -content_template: templates/task +content_type: task weight: 90 --- -{{% capture overview %}} + @@ -159,4 +160,4 @@ the wilds of the internet. {{< /note >}} -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-application-cluster/configure-dns-cluster.md b/content/zh/docs/tasks/access-application-cluster/configure-dns-cluster.md index 0142302759..8d8520cb18 100644 --- a/content/zh/docs/tasks/access-application-cluster/configure-dns-cluster.md +++ b/content/zh/docs/tasks/access-application-cluster/configure-dns-cluster.md @@ -1,27 +1,27 @@ --- title: 为集群配置 DNS weight: 120 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + Kubernetes 提供 DNS 集群插件,大多数支持的环境默认情况下都会启用。 -{{% /capture %}} -{{% capture body %}} + + 有关如何为 Kubernetes 集群配置 DNS 的详细信息,请参阅 [Kubernetes DNS 插件示例.](https://github.com/kubernetes/kubernetes/tree/release-1.5/examples/cluster-dns) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-application-cluster/connecting-frontend-backend.md b/content/zh/docs/tasks/access-application-cluster/connecting-frontend-backend.md index 9833f284d8..2c91610128 100644 --- a/content/zh/docs/tasks/access-application-cluster/connecting-frontend-backend.md +++ b/content/zh/docs/tasks/access-application-cluster/connecting-frontend-backend.md @@ -1,10 +1,10 @@ --- title: 使用 Service 把前端连接到后端 -content_template: templates/tutorial +content_type: tutorial --- -{{% capture overview %}} + @@ -12,10 +12,11 @@ content_template: templates/tutorial 本任务会描述如何创建前端微服务和后端微服务。后端微服务是一个 hello 欢迎程序。 前端和后端的连接是通过 Kubernetes 服务对象(Service object)完成的。 -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + @@ -24,10 +25,11 @@ content_template: templates/tutorial * 从后端将流量路由到前端 * 使用服务对象把前端应用连接到后端应用 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -36,10 +38,10 @@ content_template: templates/tutorial 所以需要对应的可支持此功能的环境。如果你的环境不能支持,你可以使用 [NodePort](/docs/user-guide/services/#type-nodeport) 类型的服务代替。 -{{% /capture %}} -{{% capture lessoncontent %}} + + ### 使用部署对象(Deployment)创建后端 @@ -180,16 +182,17 @@ curl http:// {"message":"Hello"} ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 了解更多 [Services](/docs/concepts/services-networking/service/) * 了解更多 [ConfigMaps](/docs/tasks/configure-pod-container/configure-pod-configmap/) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-application-cluster/create-external-load-balancer.md b/content/zh/docs/tasks/access-application-cluster/create-external-load-balancer.md index ab0cd5ace6..86d83cd34b 100644 --- a/content/zh/docs/tasks/access-application-cluster/create-external-load-balancer.md +++ b/content/zh/docs/tasks/access-application-cluster/create-external-load-balancer.md @@ -1,18 +1,18 @@ --- title: 创建一个外部负载均衡器 -content_template: templates/task +content_type: task weight: 80 --- -{{% capture overview %}} + 有关如何配置和使用 Ingress 资源为服务提供外部可访问的 URL、负载均衡流量、终止 SSL 等功能,请查看 [Ingress](/docs/concepts/services-networking/ingress/) 文档。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + 本文展示如何使用 kubectl 来列出集群中所有运行 pod 的容器的镜像 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + + + + +## {{% heading "whatsnext" %}} -{{% capture whatsnext %}} -{{% capture overview %}} + 本文展示如何使用 `kubectl port-forward` 连接到在 Kubernetes 集群中运行的 Redis 服务。这种类型的连接对数据库调试很有用。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -32,10 +33,10 @@ for database debugging. --> * 安装 [redis-cli](http://redis.io/topics/rediscli)。 -{{% /capture %}} -{{% capture steps %}} + + 成功的 ping 请求应该返回 PONG。 -{{% /capture %}} -{{% capture discussion %}} + + 学习更多关于 [kubectl port-forward](/docs/reference/generated/kubectl/kubectl-commands/#port-forward)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-application-cluster/service-access-application-cluster.md b/content/zh/docs/tasks/access-application-cluster/service-access-application-cluster.md index 56dc9ec216..454773b100 100644 --- a/content/zh/docs/tasks/access-application-cluster/service-access-application-cluster.md +++ b/content/zh/docs/tasks/access-application-cluster/service-access-application-cluster.md @@ -1,18 +1,18 @@ --- title: 使用服务来访问集群中的应用 -content_template: templates/tutorial +content_type: tutorial weight: 60 --- -{{% capture overview %}} + 本文展示如何创建一个 Kubernetes 服务对象,能让外部客户端访问在集群中运行的应用。该服务为一个应用的两个运行实例提供负载均衡。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + 学习更多关于如何 [通过服务连接应用](/docs/concepts/services-networking/connect-applications-service/)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-application-cluster/web-ui-dashboard.md b/content/zh/docs/tasks/access-application-cluster/web-ui-dashboard.md index d9b2638c01..6096d7febe 100644 --- a/content/zh/docs/tasks/access-application-cluster/web-ui-dashboard.md +++ b/content/zh/docs/tasks/access-application-cluster/web-ui-dashboard.md @@ -4,7 +4,7 @@ reviewers: - mikedanese - rf232 title: 网页界面 (Dashboard) -content_template: templates/concept +content_type: concept weight: 10 card: name: tasks @@ -18,7 +18,7 @@ reviewers: - mikedanese - rf232 title: Web UI (Dashboard) -content_template: templates/concept +content_type: concept weight: 10 card: name: tasks @@ -27,7 +27,7 @@ card: --- --> -{{% capture overview %}} + ![日志浏览](/images/docs/ui-dashboard-logs-view.png) -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + 本文说明如何使用 HTTP 代理访问 Kubernetes API。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -33,9 +34,9 @@ This page shows how to use an HTTP proxy to access the Kubernetes API. kubectl run node-hello --image=gcr.io/google-samples/node-hello:1.0 --port=8080 ``` -{{% /capture %}} -{{% capture steps %}} + + 想了解更多信息,请参阅 [kubectl 代理](/docs/reference/generated/kubectl/kubectl-commands#proxy)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/access-kubernetes-api/setup-extension-api-server.md b/content/zh/docs/tasks/access-kubernetes-api/setup-extension-api-server.md index d6dca73746..bd3c600296 100644 --- a/content/zh/docs/tasks/access-kubernetes-api/setup-extension-api-server.md +++ b/content/zh/docs/tasks/access-kubernetes-api/setup-extension-api-server.md @@ -4,7 +4,7 @@ reviewers: - lavalamp - cheftako - chenopis -content_template: templates/task +content_type: task weight: 15 --- @@ -15,21 +15,22 @@ reviewers: - lavalamp - cheftako - chenopis -content_template: templates/task +content_type: task weight: 15 --- --> -{{% capture overview %}} + 设置一个扩展的 API server 来使用聚合层以让 Kubernetes apiserver 使用其它 API 进行扩展,这些 API 不是核心 Kubernetes API 的一部分。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + -{{% capture overview %}} + 本页展示了如何使用 Kubernetes API 访问集群 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + @@ -349,4 +350,4 @@ securely with the API server. --> 在每种情况下,Pod 的服务账号凭证被用于与 API 服务器的安全通信。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/access-cluster-services.md b/content/zh/docs/tasks/administer-cluster/access-cluster-services.md index 82253e0c32..cb03264553 100644 --- a/content/zh/docs/tasks/administer-cluster/access-cluster-services.md +++ b/content/zh/docs/tasks/administer-cluster/access-cluster-services.md @@ -1,20 +1,21 @@ --- title: 访问集群上运行的服务 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本文展示了如何连接 Kubernetes 集群上运行的服务。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 访问集群上运行的服务 @@ -103,6 +104,6 @@ $ kubectl cluster-info - Web 服务器不总是能够传递令牌,所以你可能需要使用基本(密码)认证。 Apiserver 可以配置为接受基本认证,但你的集群可能并没有这样配置。 - 某些 web 应用可能不能工作,特别是那些使用客户端侧 javascript 的应用,它们构造 url 的方式可能不能理解代理路径前缀。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/change-default-storage-class.md b/content/zh/docs/tasks/administer-cluster/change-default-storage-class.md index 0dbfb7c8ee..8685c3ca12 100644 --- a/content/zh/docs/tasks/administer-cluster/change-default-storage-class.md +++ b/content/zh/docs/tasks/administer-cluster/change-default-storage-class.md @@ -1,22 +1,23 @@ --- title: 改变默认 StorageClass -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本文展示了如何改变默认的 Storage Class,它用于为没有特殊需求的 PersistentVolumeClaims 配置 volumes。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 为什么要改变默认 storage class? @@ -92,11 +93,12 @@ content_template: templates/task gold (default) kubernetes.io/gce-pd 1d ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 了解更多关于 [StorageClasses](/docs/concepts/storage/persistent-volumes/)。 - {{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/change-pv-reclaim-policy.md b/content/zh/docs/tasks/administer-cluster/change-pv-reclaim-policy.md index 428845923c..d36686c38a 100644 --- a/content/zh/docs/tasks/administer-cluster/change-pv-reclaim-policy.md +++ b/content/zh/docs/tasks/administer-cluster/change-pv-reclaim-policy.md @@ -1,21 +1,22 @@ --- title: 更改 PersistentVolume 的回收策略 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本文展示了如何更改 Kubernetes PersistentVolume 的回收策略。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 为什么要更改 PersistentVolume 的回收策略 @@ -66,9 +67,10 @@ content_template: templates/task 在前面的输出中,你可以看到绑定到 claim `default/claim3` 的 volume 拥有的回收策略为 `Retain`。当用户删除 claim `default/claim3` 时,它不会被自动删除。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 了解更多关于 [PersistentVolumes](/docs/concepts/storage/persistent-volumes/)的信息。 * 了解更多关于 [PersistentVolumeClaims](/docs/user-guide/persistent-volumes/#persistentvolumeclaims) 的信息。 @@ -80,6 +82,6 @@ content_template: templates/task * [PersistentVolumeClaim](/docs/api-reference/{{< param "version" >}}/#persistentvolumeclaim-v1-core) * 查阅 [PersistentVolumeSpec](/docs/api-reference/{{< param "version" >}}/#persistentvolumeclaim-v1-core) 的 `persistentVolumeReclaimPolicy` 字段。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/configure-multiple-schedulers.md b/content/zh/docs/tasks/administer-cluster/configure-multiple-schedulers.md index 479151b213..7f2b41da33 100644 --- a/content/zh/docs/tasks/administer-cluster/configure-multiple-schedulers.md +++ b/content/zh/docs/tasks/administer-cluster/configure-multiple-schedulers.md @@ -1,6 +1,6 @@ --- title: 配置多个调度器 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + -{{% capture overview %}} + {{< glossary_definition term_id="etcd" length="all" prepend="etcd 是一个">}} -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + 此页面介绍了 CoreDNS 升级过程以及如何安装 CoreDNS 而不是 kube-dns。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + 当涉及到资源利用时,优化内核的配置可能是有用的。有关详细信息,请参阅 [关于扩展 CoreDNS 的文档](https://github.com/coredns/deployment/blob/master/kubernetes/Scaling_CoreDNS.md)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 您可以通过修改 `Corefile` 来配置 [CoreDNS](https://coredns.io),以支持比 ku-dns 更多的用例。有关更多信息,请参考 [CoreDNS 网站](https://coredns.io/2017/05/08/custom-dns-entries-for-kubernetes/)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/cpu-management-policies.md b/content/zh/docs/tasks/administer-cluster/cpu-management-policies.md index 964121940a..c3960f1c28 100644 --- a/content/zh/docs/tasks/administer-cluster/cpu-management-policies.md +++ b/content/zh/docs/tasks/administer-cluster/cpu-management-policies.md @@ -4,7 +4,7 @@ reviewers: - sjenning - ConnorDoyle - balajismaniam -content_template: templates/task +content_type: task --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.12" state="beta" >}} @@ -31,15 +31,16 @@ directives. 按照设计,Kubernetes 对 pod 执行相关的很多方面进行了抽象,使得用户不必关心。然 而,为了正常运行,有些工作负载要求在延迟和/或性能方面有更强的保证。 为此,kubelet 提供方法来实现更复杂的负载放置策略,同时保持抽象,避免显式的放置指令。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + 该 pod 属于 `Guaranteed` QoS 类型,因其指定了 `limits` 值,同时当未显式指定时,`requests` 值被设置为与 `limits` 值相等。同时,容器对 CPU 资源的限制值是一个大于或等于 1 的整数值。所以,该 `nginx` 容器被赋予 2 个独占 CPU。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/declare-network-policy.md b/content/zh/docs/tasks/administer-cluster/declare-network-policy.md index 30798bb20b..594162909b 100644 --- a/content/zh/docs/tasks/administer-cluster/declare-network-policy.md +++ b/content/zh/docs/tasks/administer-cluster/declare-network-policy.md @@ -3,17 +3,18 @@ approvers: - caseydavenport - danwinship title: 声明网络策略 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本文可以帮助您开始使用 Kubernetes 的 [NetworkPolicy API](/docs/concepts/services-networking/network-policies/) 声明网络策略去管理 Pod 之间的通信 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 您首先需要有一个支持网络策略的 Kubernetes 集群。已经有许多支持 NetworkPolicy 的网络提供商,包括: @@ -25,9 +26,9 @@ content_template: templates/task **注意**:以上列表是根据产品名称按字母顺序排序,而不是按推荐或偏好排序。下面示例对于使用了上面任何提供商的 Kubernetes 集群都是有效的 -{{% /capture %}} -{{% capture steps %}} + + ## 创建一个`nginx` deployment 并且通过服务将其暴露 @@ -143,6 +144,6 @@ Hit enter for command prompt Connecting to nginx (10.100.0.16:80) / # ``` -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/developing-cloud-controller-manager.md b/content/zh/docs/tasks/administer-cluster/developing-cloud-controller-manager.md index 09dc35a528..82710c17d8 100644 --- a/content/zh/docs/tasks/administer-cluster/developing-cloud-controller-manager.md +++ b/content/zh/docs/tasks/administer-cluster/developing-cloud-controller-manager.md @@ -4,7 +4,7 @@ reviewers: - thockin - wlan0 title: 开发云控制器管理器 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.11" state="beta" >}} 为了深入了解实施细节,所有云控制器管理器都将从 Kubernetes 核心导入依赖包,唯一的区别是每个项目都会通过调用 [cloudprovider.RegisterCloudProvider](https://github.com/kubernetes/cloud-provider/blob/master/plugins.go#L56-L66) 来注册自己的驱动,更新可用驱动的全局变量。 -{{% /capture %}} -{{% capture body %}} + + 对于 in-tree 驱动,您可以将 in-tree 云控制器管理器作为群集中的 [Daemonset](/examples/admin/cloud/ccm-example.yaml) 运行。有关详细信息,请参阅 [运行的云控制器管理器文档](/docs/tasks/administer-cluster/running-cloud-controller.md)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/dns-custom-nameservers.md b/content/zh/docs/tasks/administer-cluster/dns-custom-nameservers.md index 4795bface2..5667dc1a41 100644 --- a/content/zh/docs/tasks/administer-cluster/dns-custom-nameservers.md +++ b/content/zh/docs/tasks/administer-cluster/dns-custom-nameservers.md @@ -3,7 +3,7 @@ reviewers: - bowei - zihongz title: 自定义 DNS 服务 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + This page provides hints on diagnosing DNS problems. -{{% /capture %}} + --> -{{% capture overview %}} + 这篇文章提供了一些关于 DNS 问题诊断的方法。 -{{% /capture %}} + --> -{{% capture prerequisites %}} +## {{% heading "prerequisites" %}} + - {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} - Kubernetes 1.6 或者以上版本。 - 集群必须使用了 `coredns` (或者 `kube-dns`)插件。 - {{% /capture %}} + -{{% capture steps %}} + @@ -595,7 +597,7 @@ for more details on Cluster Federation and multi-site support. - [集群里自动伸缩 DNS Service](/docs/tasks/administer-cluster/dns-horizontal-autoscaling/). -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/dns-horizontal-autoscaling.md b/content/zh/docs/tasks/administer-cluster/dns-horizontal-autoscaling.md index 8fc387c92e..698a58bf7e 100644 --- a/content/zh/docs/tasks/administer-cluster/dns-horizontal-autoscaling.md +++ b/content/zh/docs/tasks/administer-cluster/dns-horizontal-autoscaling.md @@ -1,23 +1,24 @@ --- title: 集群 DNS 服务自动伸缩 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本页展示了如何在集群中启用和配置 DNS 服务的自动伸缩功能。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -34,9 +35,9 @@ Kubernetes cluster. * 建议使用 Kubernetes 1.4.0 或更高版本。 -{{% /capture %}} -{{% capture steps %}} + + * 了解更多关于 [cluster-proportional-autoscaler 实现](https://github.com/kubernetes-incubator/cluster-proportional-autoscaler)的相关信息。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/enabling-endpointslices.md b/content/zh/docs/tasks/administer-cluster/enabling-endpointslices.md index 671ee47032..4e6bd67307 100644 --- a/content/zh/docs/tasks/administer-cluster/enabling-endpointslices.md +++ b/content/zh/docs/tasks/administer-cluster/enabling-endpointslices.md @@ -3,7 +3,7 @@ reviewers: - bowei - freehan title: 启用端点切片 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本页提供启用 Kubernetes 端点切片的总览 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + 本文展示如何启用和配置静态 Secret 数据的加密 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -38,17 +39,18 @@ This page shows how to enable and configure encryption of secret data at rest. * 静态数据加密在 1.7.0 中仍然是 alpha 版本,这意味着它可能会在没有通知的情况下进行更改。在升级到 1.8.0 之前,用户可能需要解密他们的数据。 -{{% /capture %}} + {{< toc >}} -{{% capture prerequisites %}} +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + 并重新启动所有 `kube-apiserver` 进程。然后运行命令 `kubectl get secrets --all-namespaces -o json | kubectl replace -f -` 强制解密所有 secret。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/extended-resource-node.md b/content/zh/docs/tasks/administer-cluster/extended-resource-node.md index 0418e4065c..9a73d35278 100644 --- a/content/zh/docs/tasks/administer-cluster/extended-resource-node.md +++ b/content/zh/docs/tasks/administer-cluster/extended-resource-node.md @@ -1,15 +1,15 @@ --- title: 为节点发布扩展资源 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + -{{% capture overview %}} + {{< feature-state for_k8s_version="1.5" state="alpha" >}} -{{% capture overview %}} + 此页面展示如何配置和启用 ip-masq-agent。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture discussion %}} + + @@ -124,9 +125,9 @@ By default, in GCE/Google Kubernetes Engine starting with Kubernetes version 1.7 --> 默认情况下,从 Kubernetes 1.7.0 版本开始的 GCE/Google Kubernetes Engine 中,如果启用了网络策略,或者您使用的集群 CIDR 不在 10.0.0.0/8 范围内,则 ip-masq-agent 将在您的集群中运行。如果您在其他环境中运行,则可以将 ip-masq-agent [DaemonSet](/docs/concepts/workloads/controllers/daemonset/) 添加到您的集群: -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + 本页展示了如何配置秘钥管理服务—— Key Management Service (KMS) 提供商和插件以启用数据加密。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -31,9 +32,9 @@ content_template: templates/task {{< feature-state for_k8s_version="v1.12" state="beta" >}} -{{% /capture %}} -{{% capture steps %}} + + @@ -278,6 +279,6 @@ resources: kubectl get secrets --all-namespaces -o json | kubectl replace -f - ``` -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md b/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md index a3403ebe1b..664381d24b 100644 --- a/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md +++ b/content/zh/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md @@ -2,18 +2,18 @@ reviewers: - sig-cluster-lifecycle title: 使用 kubeadm 进行证书管理 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.15" state="stable" >}} @@ -23,9 +23,10 @@ Client certificates generated by [kubeadm](/docs/reference/setup-tools/kubeadm/k 由 [kubeadm](/docs/reference/setup-tools/kubeadm/kubeadm/) 生成的客户端证书在 1 年后到期。 本页说明如何使用 kubeadm 管理证书续订。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 您应该熟悉[Kubernetes 中的 PKI 证书和要求](/docs/setup/best-practices/certificates/)。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + `STATUS` 应显示所有节点为 `Ready` 状态,并且版本号已经被更新。 -{{% /capture %}} + -{{% capture overview %}} + {{< feature-state state="beta" >}} 建议通过配置文件的方式提供参数,因为这样可以简化节点部署和配置管理。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + - 需要安装 1.10 或更高版本的 Kubelet 二进制文件,才能实现 beta 功能。 -{{% /capture %}} -{{% capture steps %}} + + 请注意,命令行参数和 Kubelet 配置文件的某些默认值不同。如果设置了 `--config`,并且没有通过命令行指定值,则 `KubeletConfiguration` 版本的默认值生效。在上面的例子中,version 是 `kubelet.config.k8s.io/v1beta1`。 -{{% /capture %}} -{{% capture discussion %}} + + 如果您正在使用 [动态 Kubelet 配置](/docs/tasks/administer-cluster/reconfigure-kubelet) 特性,那么自动回滚机制将认为是 "最后已知正常(last known good)" 的配置,通过 `--config` 提供的配置与覆盖这些值的任何参数的结合。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/limit-storage-consumption.md b/content/zh/docs/tasks/administer-cluster/limit-storage-consumption.md index e8cadbd4b2..29070a748f 100644 --- a/content/zh/docs/tasks/administer-cluster/limit-storage-consumption.md +++ b/content/zh/docs/tasks/administer-cluster/limit-storage-consumption.md @@ -1,16 +1,16 @@ --- title: 限制存储消耗 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 演示中用到了以下资源:[ResourceQuota](/docs/concepts/policy/resource-quotas/),[LimitRange](/docs/tasks/administer-cluster/memory-default-namespace/) 和 [PersistentVolumeClaim](/docs/concepts/storage/persistent-volumes/)。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + 限制范围对象可以用来设置可请求的存储量上限,而资源配额对象则可以通过申领计数和累计存储容量有效地限制命名空间耗用的存储量。这两种机制使得集群管理员能够规划其集群存储预算而不会发生任一项目超量分配的风险。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md b/content/zh/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md index 8607d283b6..de2cb0f12d 100644 --- a/content/zh/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md +++ b/content/zh/docs/tasks/administer-cluster/manage-resources/cpu-constraint-namespace.md @@ -1,18 +1,18 @@ --- title: 为命名空间配置CPU最小和最大限制 -content_template: templates/task +content_type: task weight: 40 --- -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + 本文主要描述如何配置一个命名空间下可运行的pod总数。资源配额详细信息可查看:[资源配额](/docs/api-reference/v1.7/#resourcequota-v1-core) 。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 创建一个命名空间 @@ -102,9 +103,10 @@ lastUpdateTime: 2017-07-07T20:57:05Z kubectl delete namespace quota-pod-example ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + ### 对于集群管理 @@ -128,7 +130,7 @@ kubectl delete namespace quota-pod-example * [配置pod的QoS](/docs/tasks/configure-pod-container/quality-service-pod/) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/namespaces-walkthrough.md b/content/zh/docs/tasks/administer-cluster/namespaces-walkthrough.md index 51fc980a06..5564bec734 100644 --- a/content/zh/docs/tasks/administer-cluster/namespaces-walkthrough.md +++ b/content/zh/docs/tasks/administer-cluster/namespaces-walkthrough.md @@ -3,17 +3,17 @@ reviewers: - derekwaynecarr - janetkuo title: 命名空间演练 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + @@ -38,16 +38,17 @@ Kubernetes {{< glossary_tooltip text="命名空间" term_id="namespace" >}} 此示例演示了如何使用 Kubernetes 命名空间细分群集。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + @@ -383,4 +384,4 @@ authorization rules for each namespace. --> 随着 Kubernetes 中的策略支持的发展,我们将扩展此场景,以展示如何为每个命名空间提供不同的授权规则。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/namespaces.md b/content/zh/docs/tasks/administer-cluster/namespaces.md index 5d25fe0f6d..f2e63f5d48 100644 --- a/content/zh/docs/tasks/administer-cluster/namespaces.md +++ b/content/zh/docs/tasks/administer-cluster/namespaces.md @@ -3,33 +3,34 @@ reviewers: - derekwaynecarr - janetkuo title: 通过命名空间共享集群 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本页展示了如何查看、使用和删除{{< glossary_tooltip text="namespaces" term_id="namespace" >}}。本页同时展示了如何使用 Kubernetes 命名空间去细分集群。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * 您已拥有一个 [配置好的 Kubernetes 集群](/docs/setup/). * 您已对 Kubernetes 的 _[Pods](/docs/concepts/workloads/pods/pod/)_, _[Services](/docs/concepts/services-networking/service/)_, 和 _[Deployments](/docs/concepts/workloads/controllers/deployment/)_ 有基本理解。 -{{% /capture %}} -{{% capture steps %}} + + @@ -460,9 +461,9 @@ authorization rules for each namespace. --> 随着 Kubernetes 中的策略支持的发展,我们将扩展此场景,以展示如何为每个命名空间提供不同的授权规则。 -{{% /capture %}} -{{% capture discussion %}} + + @@ -552,9 +553,10 @@ across namespaces, you need to use the fully qualified domain name (FQDN). --> 当您创建 [Service](/docs/concepts/services-networking/service/) 时,它会创建相应的 [DNS 条目](/docs/concepts/services-networking/dns-pod-service/)。此条目的格式为 ` .svc.cluster.local`,这意味着如果容器只使用 ``,它将解析为本地服务到命名空间。 这对于在多个命名空间(如开发,暂存和生产)中使用相同的配置非常有用。 如果要跨命名空间访问,则需要使用完全限定的域名(FQDN)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + @@ -564,6 +566,6 @@ across namespaces, you need to use the fully qualified domain name (FQDN). --> * 了解更多 [设置请求的命名空间](/docs/concepts/overview/working-with-objects/namespaces/#setting-the-namespace-for-a-request) 的内容。 * 参见 [命名空间设计](https://github.com/kubernetes/community/blob/{{< param "githubbranch" >}}/contributors/design-proposals/architecture/namespaces.md)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy.md b/content/zh/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy.md index dd94193b7c..4abb9ad1b9 100644 --- a/content/zh/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy.md +++ b/content/zh/docs/tasks/administer-cluster/network-policy-provider/calico-network-policy.md @@ -2,22 +2,23 @@ reviewers: - caseydavenport title: 使用 Calico 作为 NetworkPolicy -content_template: templates/task +content_type: task weight: 10 --- -{{% capture overview %}} + 本页展示了两种在 Kubernetes 上快速创建 Calico 集群的方法。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 决定您想部署一个[云](#在-Google-Kubernetes-Engine-GKE-上创建一个-Calico-集群) 还是 [本地](#使用-kubeadm-创建一个本地-Calico-集群) 集群。 -{{% /capture %}} -{{% capture steps %}} + + 集群运行后,您可以按照 [声明 Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) 去尝试使用 Kubernetes NetworkPolicy。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/network-policy-provider/cilium-network-policy.md b/content/zh/docs/tasks/administer-cluster/network-policy-provider/cilium-network-policy.md index 400e3c03ad..151985e4bc 100644 --- a/content/zh/docs/tasks/administer-cluster/network-policy-provider/cilium-network-policy.md +++ b/content/zh/docs/tasks/administer-cluster/network-policy-provider/cilium-network-policy.md @@ -2,11 +2,11 @@ reviewers: - danwent title: 使用 Cilium 作为 NetworkPolicy -content_template: templates/task +content_type: task weight: 20 --- -{{% capture overview %}} + @@ -15,15 +15,16 @@ For background on Cilium, read the [Introduction to Cilium](https://cilium.readt 关于 Cilium 的背景知识,请阅读 [Cilium 介绍](https://cilium.readthedocs.io/en/latest/intro)。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + 本页展示了如何使用 [Kube-router](https://github.com/cloudnativelabs/kube-router) 作为 NetworkPolicy。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 您需要拥有一个正在运行的 Kubernetes 集群。如果您还没有集群,可以使用任意的集群安装器如 Kops,Bootkube,Kubeadm 等创建一个。 -{{% /capture %}} -{{% capture steps %}} + + ## 安装 Kube-router 插件 Kube-router 插件自带一个Network Policy 控制器,监视来自于Kubernetes API server 的 NetworkPolicy 和 pods 的变化,根据策略指示配置 iptables 规则和 ipsets 来允许或阻止流量。请根据 [尝试通过集群安装器使用 Kube-router](https://www.kube-router.io/docs/user-guide/#try-kube-router-with-cluster-installers) 指南安装 Kube-router 插件。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 在您安装 Kube-router 插件后,可以根据 [声明 Network Policy](/docs/tasks/administer-cluster/declare-network-policy/) 去尝试使用 Kubernetes NetworkPolicy。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/network-policy-provider/romana-network-policy.md b/content/zh/docs/tasks/administer-cluster/network-policy-provider/romana-network-policy.md index 28bb1641df..e355e9c547 100644 --- a/content/zh/docs/tasks/administer-cluster/network-policy-provider/romana-network-policy.md +++ b/content/zh/docs/tasks/administer-cluster/network-policy-provider/romana-network-policy.md @@ -2,25 +2,26 @@ reviewers: - chrismarino title: 使用 Romana 作为 NetworkPolicy -content_template: templates/task +content_type: task weight: 40 --- -{{% capture overview %}} + 本页展示如何使用 Romana 作为 NetworkPolicy。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 完成[kubeadm 入门指南](/docs/getting-started-guides/kubeadm/)中的1、2、3步。 -{{% /capture %}} -{{% capture steps %}} + + Romana 安装完成后,您可以按照[声明 Network Policy](/docs/tasks/administer-cluster/declare-network-policy/)去尝试使用 Kubernetes NetworkPolicy。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/network-policy-provider/weave-network-policy.md b/content/zh/docs/tasks/administer-cluster/network-policy-provider/weave-network-policy.md index ff3ede466f..5e7b4baaba 100644 --- a/content/zh/docs/tasks/administer-cluster/network-policy-provider/weave-network-policy.md +++ b/content/zh/docs/tasks/administer-cluster/network-policy-provider/weave-network-policy.md @@ -2,26 +2,27 @@ reviewers: - bboreham title: 使用 Weave Net 作为 NetworkPolicy -content_template: templates/task +content_type: task weight: 50 --- -{{% capture overview %}} + 本页展示了如何使用使用 Weave Net 作为 NetworkPolicy。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 您需要拥有一个 Kubernetes 集群。按照[kubeadm 入门指南](/docs/getting-started-guides/kubeadm/)来引导一个。 -{{% /capture %}} -{{% capture steps %}} + + 每个 Node 都有一个 weave Pod,所有 Pod 都是`Running`和`2/2 READY`。(`2/2`表示每个Pod都有`weave`和`weave-npc`。) -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 安装Weave Net插件后,您可以按照[声明网络策略](/docs/tasks/administration-cluster/declare-network-policy/)来试用 Kubernetes NetworkPolicy。 如果您有任何疑问,请联系我们[#weave-community on Slack 或 Weave User Group](https://github.com/weaveworks/weave#getting-help)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/nodelocaldns.md b/content/zh/docs/tasks/administer-cluster/nodelocaldns.md index 8c50aa56ca..8654e98818 100644 --- a/content/zh/docs/tasks/administer-cluster/nodelocaldns.md +++ b/content/zh/docs/tasks/administer-cluster/nodelocaldns.md @@ -3,7 +3,7 @@ reviewers: - bowei - zihongz title: 在 Kubernetes 集群中使用 NodeLocal DNSCache -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本页概述了 Kubernetes 中的 NodeLocal DNSCache 功能。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} - {{% capture steps %}} + + -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.11" state="beta" >}} @@ -42,9 +42,10 @@ fields is available in the inline `KubeletConfiguration` [类型文档](https://github.com/kubernetes/kubernetes/blob/release-1.11/pkg/kubelet/apis/kubeletconfig/v1beta1/types.go)。 {{< /warning >}} -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + ## 在你集群中的一个实时节点上配置Kubelet @@ -529,9 +530,9 @@ error is reported. 在删除此字段后,`Node.Status.Config` 最终变成空,所有配置源都已重置为 `nil`,这表示 本地默认配置是`assigned`,`active` 和 `lastKnownGood`这三个参数,没有报告错误。 -{{% /capture %}} -{{% capture discussion %}} + + ## Kubectl 补丁示例 @@ -691,4 +692,4 @@ in the Kubelet log for additional details and context about the error. -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/reserve-compute-resources.md b/content/zh/docs/tasks/administer-cluster/reserve-compute-resources.md index 9abaef533e..3b26ba5ba9 100644 --- a/content/zh/docs/tasks/administer-cluster/reserve-compute-resources.md +++ b/content/zh/docs/tasks/administer-cluster/reserve-compute-resources.md @@ -4,7 +4,7 @@ reviewers: - derekwaynecarr - dashpole title: 为系统守护进程预留计算资源 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 从 Kubernetes 1.17 版本开始,可以选择将 `reserved-cpus` 显式 cpuset 指定为操作系统守护程序、中断、计时器和 Kubernetes 守护程序保留的 CPU。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/administer-cluster/running-cloud-controller.md b/content/zh/docs/tasks/administer-cluster/running-cloud-controller.md index 014bb69dfc..1e0371908e 100644 --- a/content/zh/docs/tasks/administer-cluster/running-cloud-controller.md +++ b/content/zh/docs/tasks/administer-cluster/running-cloud-controller.md @@ -4,7 +4,7 @@ reviewers: - thockin - wlan0 title: Kubernetes 云管理控制器 -content_template: templates/concept +content_type: concept --- -{{% capture overview %}} + {{< feature-state state="beta" >}} -{{% capture overview %}} + 本文档涉及与保护集群免受意外或恶意访问有关的主题,并对总体安全性提出建议。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.11" state="beta" >}} 本文档介绍如何通过 sysctl 接口在 Kubernetes 集群中配置和使用内核参数。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + {{< warning >}} -{{% capture overview %}} + {{< feature-state state="alpha" >}} @@ -43,15 +43,16 @@ _Topology Manager_ is a Kubelet component that aims to co-ordinate the set of co --> _拓扑管理器(Topology Manager)_ 是一个 Kubelet 的一部分,旨在协调负责这些优化的一组组件。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + --- title: 为容器和 Pods 分配 CPU 资源 -content_template: templates/task +content_type: task weight: 20 --- -{{% capture overview %}} + -{{% capture overview %}} + 此页面显示如何将内存 *请求* (request)和内存 *限制* (limit)分配给一个容器。我们保障容器拥有它请求数量的内存,但不允许使用超过限制数量的内存。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -72,9 +73,9 @@ NAME v1beta1.metrics.k8s.io ``` -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + 此页面显示如何将 Kubernetes Pod 分配给 Kubernetes 集群中的特定节点。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + 了解更多关于 [标签和选择器](/docs/concepts/overview/working-with-objects/labels/)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/configure-pod-container/attach-handler-lifecycle-event.md b/content/zh/docs/tasks/configure-pod-container/attach-handler-lifecycle-event.md index ae631c7a4d..8c0cc202d6 100644 --- a/content/zh/docs/tasks/configure-pod-container/attach-handler-lifecycle-event.md +++ b/content/zh/docs/tasks/configure-pod-container/attach-handler-lifecycle-event.md @@ -1,17 +1,17 @@ --- title: 为容器的生命周期事件设置处理函数 -content_template: templates/task +content_type: task weight: 140 --- -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + ConfigMap 允许您将配置文件与镜像文件分离,以使容器化的应用程序具有可移植性。该页面提供了一系列使用示例,这些示例演示了如何使用存储在 ConfigMap 中的数据创建 ConfigMap 和配置 Pod。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 了解 ConfigMap 和 Pod @@ -824,11 +825,12 @@ ConfigMap 驻留在特定的[命令空间](/docs/concepts/overview/working-with- 这些不是创建 pods 的常用方法。 {{< /note >}} -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 遵循[使用ConfigMap配置Redis](/docs/tutorials/configuration/configure-redis-using-configmap/)的真实案例。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/configure-pod-container/configure-pod-initialization.md b/content/zh/docs/tasks/configure-pod-container/configure-pod-initialization.md index c9c875c476..170d8b1a5d 100644 --- a/content/zh/docs/tasks/configure-pod-container/configure-pod-initialization.md +++ b/content/zh/docs/tasks/configure-pod-container/configure-pod-initialization.md @@ -1,32 +1,33 @@ --- title: 配置 Pod 初始化 -content_template: templates/task +content_type: task weight: 130 --- -{{% capture overview %}} + 本文介绍在应用容器运行前,怎样利用 Init 容器初始化 Pod。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + `serviceAccountToken` 不是一种卷类型 {{< /note >}} -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + 确认 Pod 中的容器运行正常,然后监视 Pod 的变化: ```shell ls /projected-volume/ ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 确认 Pod 中的容器运行正常,然后监视 Pod 的变化: * 进一步了解[`投射`](/docs/concepts/storage/volumes/#projected) 卷。 * 阅读[一体卷](https://github.com/kubernetes/community/blob/{{< param "githubbranch" >}}/contributors/design-proposals/node/all-in-one-volume.md)设计文档。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/configure-pod-container/configure-runasusername.md b/content/zh/docs/tasks/configure-pod-container/configure-runasusername.md index 65a9e88cb5..d6a2476c6f 100644 --- a/content/zh/docs/tasks/configure-pod-container/configure-runasusername.md +++ b/content/zh/docs/tasks/configure-pod-container/configure-runasusername.md @@ -1,18 +1,18 @@ --- title: 为 Windows 的 pod 和容器配置 RunAsUserName -content_template: templates/task +content_type: task weight: 20 --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.17" state="beta" >}} @@ -29,9 +29,10 @@ This feature is in beta. The overall functionality for `RunAsUserName` will not 该功能目前处于 beta 状态。 `RunAsUserName` 的整体功能不会出现变更,但是关于用户名验证的部分可能会有所更改。 {{< /note >}} -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + -{{% capture overview %}} + -{{% capture overview %}} + 此页面展示了如何配置 Pod 以使用卷进行存储。 @@ -27,15 +27,16 @@ consistent storage that is independent of the Container, you can use a applications, such as key-value stores (such as Redis) and databases. --> -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 为 Pod 配置卷 @@ -178,9 +179,10 @@ of `Always`. kubectl delete pod redis ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 参阅[卷](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core)。 @@ -200,4 +202,4 @@ details such as mounting and unmounting the devices on the nodes. See [Volumes](/docs/concepts/storage/volumes/) for more details. --> -{{% /capture %}} + diff --git a/content/zh/docs/tasks/configure-pod-container/extended-resource.md b/content/zh/docs/tasks/configure-pod-container/extended-resource.md index 5551219219..005152b9e9 100644 --- a/content/zh/docs/tasks/configure-pod-container/extended-resource.md +++ b/content/zh/docs/tasks/configure-pod-container/extended-resource.md @@ -1,18 +1,18 @@ --- title: 为容器分派扩展资源 -content_template: templates/task +content_type: task weight: 40 --- -{{% capture overview %}} + {{< feature-state state="stable" >}} @@ -23,10 +23,11 @@ This page shows how to assign extended resources to a Container. {{< feature-state state="stable" >}} -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -38,10 +39,10 @@ That will configure one of your Nodes to advertise a dongle resource. 在您开始此练习前,请先练习[为节点广播扩展资源](/docs/tasks/administer-cluster/extended-resource-node/)。 在那个练习中将配置您的一个节点来广播 dongle 资源。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + {{< feature-state state="stable" for_k8s_version="v1.17" >}} @@ -36,15 +36,16 @@ include debugging utilities like a shell. --> 您可以使用此功能来配置协作容器,比如日志处理 sidecar 容器,或者对那些不包含诸如 shell 等调试实用工具的镜像进行故障排查。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + {{< feature-state state="beta" >}} @@ -37,11 +37,11 @@ Kubernetes 审计功能提供了与安全相关的按时间顺序排列的记录 - 它从哪触发的? - 活动的后续处理行为是什么? -{{% /capture %}} + {{< toc >}} -{{% capture body %}} + -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.11" state="stable" >}} @@ -34,9 +34,10 @@ Kubernetes node. `crictl` and its source are hosted in the 您可以使用它来检查和调试 Kubernetes 节点上的容器运行时和应用程序。 `crictl`和它的源代码在 [cri-tools](https://github.com/kubernetes-incubator/cri-tools) 代码库。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + -{{% capture overview %}} + -{{% capture overview %}} + 此页面告诉您如何调试 Pod 和 ReplicationController。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -33,9 +34,9 @@ This page shows how to debug Pods and ReplicationControllers. * 您应该先熟悉 [Pods](/docs/concepts/workloads/pods/pod/) 和 [Pod Lifecycle](/docs/concepts/workloads/pods/pod-lifecycle/) 的基础概念。 -{{% /capture %}} -{{% capture steps %}} + + 您也可以使用`kubectl describe rc ${CONTROLLER_NAME}`来检查和Replication Controllers有关的事件。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/debug-application-cluster/debug-service.md b/content/zh/docs/tasks/debug-application-cluster/debug-service.md index 7b70264018..76cccc17d3 100644 --- a/content/zh/docs/tasks/debug-application-cluster/debug-service.md +++ b/content/zh/docs/tasks/debug-application-cluster/debug-service.md @@ -2,7 +2,7 @@ reviewers: - thockin - bowei -content_template: templates/concept +content_type: concept title: 调试 Service --- @@ -11,12 +11,12 @@ title: 调试 Service reviewers: - thockin - bowei -content_template: templates/concept +content_type: concept title: Debug Services --- --> -{{% capture overview %}} + 对于新安装的 Kubernetes,经常出现的一个问题是 `Service` 没有正常工作。如果您已经运行了 `Deployment` 并创建了一个 `Service`,但是当您尝试访问它时没有得到响应,希望这份文档能帮助您找出问题所在。 -{{% /capture %}} -{{% capture body %}} + + 访问[故障排查文档](/docs/troubleshooting/)获取更多信息。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/debug-application-cluster/debug-stateful-set.md b/content/zh/docs/tasks/debug-application-cluster/debug-stateful-set.md index 61a77fa1f8..e6ad084295 100644 --- a/content/zh/docs/tasks/debug-application-cluster/debug-stateful-set.md +++ b/content/zh/docs/tasks/debug-application-cluster/debug-stateful-set.md @@ -1,23 +1,24 @@ --- title: 调试StatefulSet -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 此任务展示如何调试StatefulSet。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * 你需要有一个Kubernetes集群,通过必要的配置使kubectl命令行工具与您的集群进行通信。 * 你应该有一个运行中的StatefulSet,以便用于调试。 -{{% /capture %}} -{{% capture steps %}} + + ## 调试StatefulSet @@ -67,12 +68,13 @@ spec: kubectl annotate pods pod.alpha.kubernetes.io/initialized="true" --overwrite ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 点击链接[调试init-container](/docs/tasks/troubleshoot/debug-init-containers/),了解更多信息。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md b/content/zh/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md index 8e1b947be6..b5d2ac48ae 100644 --- a/content/zh/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md +++ b/content/zh/docs/tasks/debug-application-cluster/determine-reason-pod-failure.md @@ -1,16 +1,16 @@ --- title: 确定 Pod 失败的原因 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + @@ -28,9 +28,9 @@ This section describes how to set up Falco, how to send audit events to the Kube --> [Falco](https://falco.org/)是一个开源项目,用于为云原生平台提供入侵和异常检测。本节介绍如何设置 Falco、如何将审计事件发送到 Falco 公开的 Kubernetes Audit 端点、以及 Falco 如何应用一组规则来自动检测可疑行为。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + *节点问题探测器* 是一个 [DaemonSet](/docs/concepts/workloads/controllers/daemonset/) 用来监控节点健康。它从各种守护进程收集节点问题,并以[NodeCondition](/docs/concepts/architecture/nodes/#condition) 和 [Event](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#event-v1-core) 的形式报告给 apiserver 。 更多信息请参阅 [这里](https://github.com/kubernetes/node-problem-detector)。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + 内核监视器使用 [`Translator`] 插件将内核日志转换为内部数据结构。我们可以很容易为新的日志格式实现新的翻译器。 -{{% /capture %}} -{{% capture discussion %}} + + -{{% capture overview %}} + 从 Kubernetes 1.8开始,资源使用指标,例如容器 CPU 和内存使用率,可通过 Metrics API 在 Kubernetes 中获得。这些指标可以直接被用户访问,比如使用`kubectl top`命令行,或者这些指标由集群中的控制器使用,例如,Horizontal Pod Autoscaler,使用这些指标来做决策。 -{{% /capture %}} -{{% capture body %}} + + 在[设计文档](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/instrumentation/metrics-server.md)中可以了解到有关 Metrics Server 的更多信息。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/debug-application-cluster/resource-usage-monitoring.md b/content/zh/docs/tasks/debug-application-cluster/resource-usage-monitoring.md index cbd049906f..a91705008b 100644 --- a/content/zh/docs/tasks/debug-application-cluster/resource-usage-monitoring.md +++ b/content/zh/docs/tasks/debug-application-cluster/resource-usage-monitoring.md @@ -1,19 +1,19 @@ --- reviewers: - mikedanese -content_template: templates/concept +content_type: concept title: 资源监控工具 --- -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + 这个页面展示了如何... -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 关于你刚才所做的过程,有一点是需要知道的。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + {{< feature-state state="stable" >}} @@ -27,9 +27,10 @@ of plugins as a means of utilizing these building blocks to create more complex 通过将核心 `kubectl` 命令看作与 Kubernetes 集群交互的基本构建块,集群管理员可以将插件视为一种利用这些构建块创建更复杂行为的方法。 插件用新的子命令扩展了 `kubectl`,允许新的和自定义的特性不包括在 `kubectl` 的主要发行版中。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -28,9 +28,10 @@ across all the clusters in federation. ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) 非常相似且提供相同的功能。 在联邦控制平面中创建它们可以确保它们在联邦的所有集群中同步。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "federated-task-tutorial-prereqs.md" >}} * 通常我们还期望您拥有基本的 [Kubernetes 应用知识](/docs/tutorials/kubernetes-basics/), 特别是 [ConfigMap](/docs/tasks/configure-pod-container/configure-pod-configmap/) 相关的应用知识。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -28,9 +28,10 @@ across all the clusters in federation. 联邦控制平面中的 DaemonSet(在本指南中称为 “联邦 DaemonSet”)与传统的 Kubernetes [DaemonSet](/docs/concepts/workloads/controllers/daemonset/) 非常类似,并提供相同的功能。在联邦控制平面中创建联邦 DaemonSet 可以确保它们同步到联邦的所有集群中。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "federated-task-tutorial-prereqs.md" >}} * 你还应该具备基本的 [Kubernetes 应用知识](/docs/tutorials/kubernetes-basics/),特别是 [DaemonSet](/docs/concepts/workloads/controllers/daemonset/) 相关的应用知识。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -36,9 +36,10 @@ Some features (such as full rollout compatibility) are still in development. --> 一些特性(例如完整的 rollout 兼容性)仍在开发中。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "federated-task-tutorial-prereqs.md" >}} * 您还应当拥有基本的 [Kubernetes 应用知识](/docs/tutorials/kubernetes-basics/),特别是在 [Deployments](/docs/concepts/workloads/controllers/deployment/) 方面。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -21,10 +21,10 @@ This guide explains how to use events in federation control plane to help in deb --> 本指南介绍如何在联邦控制平面中使用事件来帮助调试。 -{{% /capture %}} -{{% capture body %}} + + 标准的 kubectl get,update,delete 命令都可以正常工作。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/federation/administer-federation/job.md b/content/zh/docs/tasks/federation/administer-federation/job.md index e10314baaf..27983d7924 100644 --- a/content/zh/docs/tasks/federation/administer-federation/job.md +++ b/content/zh/docs/tasks/federation/administer-federation/job.md @@ -1,16 +1,16 @@ --- title: 联邦 Job -content_template: templates/task +content_type: task --- -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -30,9 +30,10 @@ parallelism and completions exist across the registered clusters. 联邦控制平面中的一次性任务(在本指南中称为“联邦一次性任务”)类似于传统的 [Kubernetes 一次性任务](/docs/concepts/workloads/controllers/job/),并且提供相同的功能。 在联邦控制平面中创建 job 可以确保在已注册的集群中存在所需的并行性和完成数。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "federated-task-tutorial-prereqs.md" >}} * 你需要具备基本的 [Kubernetes 的工作知识](/docs/tutorials/kubernetes-basics/),特别是 [job](/docs/concepts/workloads/controllers/jobs-run-to-completion/)。 @@ -43,9 +44,9 @@ parallelism and completions exist across the registered clusters. general and [jobs](/docs/concepts/workloads/controllers/jobs-run-to-completion/) in particular. --> -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -31,9 +31,10 @@ across all the clusters in federation. 联邦控制平面中的命名空间(本指南中称为“联邦命名空间”)与提供相同功能的传统 Kubernetes 命名空间非常相似。 在联邦控制平面中创建它们可确保它们在联邦中的所有集群之间同步 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "federated-task-tutorial-prereqs.md" >}} * 您还需要具备基本的 [Kubernetes 工作知识](/docs/tutorials/Kubernetes-basics/), @@ -45,9 +46,9 @@ You are also expected to have a basic general and [Namespaces](/docs/concepts/overview/working-with-objects/namespaces/) in particular. --> -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -27,9 +27,10 @@ replicas exist across the registered clusters. 本指南阐述了如何在联邦控制平面中使用 ReplicaSet。 在联邦控制平面中的 ReplicaSet (在本指南中称为”联邦 ReplicaSet”) 和传统的 [Kubernetes ReplicaSet](/docs/concepts/workloads/controllers/replicaset/) 很相似,提供了一样的功能。在联邦控制平面中创建联邦 ReplicaSet 可以确保在联邦的所有集群中都有预期数量的副本。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "federated-task-tutorial-prereqs.md" >}} * 你还应该具备基本的 [Kubernetes 应用知识](/docs/tutorials/kubernetes-basics/),特别是 [ReplicaSets](/docs/concepts/workloads/controllers/replicaset/) 相关的应用知识。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -30,10 +30,10 @@ across all the clusters in federation. 联邦控制平面中的 Secret(在本指南中称为“联邦 secret”)与提供相同功能的传统 [Kubernetes Secret](/docs/concepts/configuration/secret/) 非常相似。 在联邦控制平面中创建它们可以确保它们跨联邦中的所有集群同步。 -{{% /capture %}} -{{% capture body %}} + + -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -52,17 +52,18 @@ cluster if it exists and is healthy, or the closest healthy shard in a different cluster if it does not. --> 如果存在健康的分片,联合 Kubernetes 集群(即 Pods )中的客户端将自动在其中找到联合服务的本地分片集群或者集群中最接近的健康分片;如果不存在,则使用最接近的其他集群的健康分片。 -{{% /capture %}} + {{< toc >}} -{{% capture prerequisites %}} +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 前提 @@ -432,9 +433,9 @@ many clients will fail over automatically to one of the alternative IP's in less time than that given appropriate configuration. --> 标准的 Kubernetes 服务集群 IP 已确保无响应的单个 Pod 端点以低延迟(几秒钟)自动退出服务。此外,如上所述,Kubernetes 联邦集群系统会自动监视集群的状态以及联合服务的所有分片后面的端点,并根据需要使分片进入和退出服务(例如,当服务后面的所有端点或者整个集群或可用性区域出现故障时,或者相反地从中断中恢复时)。由于 DNS 缓存固有的延迟(默认情况下,缓存超时或联合服务 DNS 记录的 TTL 配置为3分钟,可以调整),在灾难性故障的情况下,所有客户端可能要花费很长时间才能完全故障转移到备用集群。但是,鉴于每个区域服务端点可以返回的离散 IP 地址数量(例如上面的 us-central1,它有三个替代方案),与给定的合适配置相比,许多客户端将在更少的时间内自动故障转移到其他 IP。 -{{% /capture %}} -{{% capture discussion %}} + + ## 故障排除 @@ -505,4 +506,4 @@ Check that: --> * [联合提议](https://git.k8s.io/community/contributors/design-proposals/multicluster/federation.md) 详细介绍了促进这项工作的用例。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/federation/set-up-coredns-provider-federation.md b/content/zh/docs/tasks/federation/set-up-coredns-provider-federation.md index 03508536a5..8193d928dc 100644 --- a/content/zh/docs/tasks/federation/set-up-coredns-provider-federation.md +++ b/content/zh/docs/tasks/federation/set-up-coredns-provider-federation.md @@ -1,18 +1,18 @@ --- title: 将 CoreDNS 设置为联邦集群的 DNS 提供者 -content_template: templates/tutorial +content_type: tutorial weight: 130 --- -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -24,10 +24,11 @@ DNS provider for Cluster Federation. --> 此页面显示如何配置和部署 CoreDNS,将其用作联邦集群的 DNS 提供者 -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + 现在联邦集群已经为跨集群服务发现做好了准备! -{{% /capture %}} + diff --git a/content/zh/docs/tasks/federation/set-up-placement-policies-federation.md b/content/zh/docs/tasks/federation/set-up-placement-policies-federation.md index 774966f39c..1dfc62e3fd 100644 --- a/content/zh/docs/tasks/federation/set-up-placement-policies-federation.md +++ b/content/zh/docs/tasks/federation/set-up-placement-policies-federation.md @@ -1,14 +1,14 @@ --- title: 在联邦中设置放置策略 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + {{< deprecationfilewarning >}} {{< include "federation-deprecation-warning-note.md" >}} @@ -20,9 +20,10 @@ resources using an external policy engine. --> 此页面显示如何使用外部策略引擎对联邦资源强制执行基于策略的放置决策。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 您需要一个正在运行的 Kubernetes 集群(它被引用为主机集群)。有关您的平台的安装说明,请参阅[入门](/docs/setup/)指南。 -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + 本页将展示如何为 {{< glossary_tooltip term_id="pod" >}} 中的容器设置启动时要执行的命令及其入参。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + -{{% capture overview %}} + 创建后,命令 `echo Warm greetings to The Most Honorable Kubernetes` 将在容器中运行。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 本文展示如何安全地将敏感数据(如密码和加密密钥)注入到 Pods 中。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## 将 secret 数据转换为 base-64 形式 @@ -187,9 +188,10 @@ base-64 形式的密码为 `Mzk1MjgkdmRnN0pi`。 SECRET_PASSWORD=39528$vdg7Jb ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 了解更多关于 [Secrets](/docs/concepts/configuration/secret/)。 * 了解 [Volumes](/docs/concepts/storage/volumes/)。 @@ -200,4 +202,4 @@ base-64 形式的密码为 `Mzk1MjgkdmRnN0pi`。 * [Volume](/docs/api-reference/{{< param "version" >}}/#volume-v1-core) * [Pod](/docs/api-reference/{{< param "version" >}}/#pod-v1-core) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md b/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md index e702a8dcf2..84ddad382e 100644 --- a/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md +++ b/content/zh/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information.md @@ -1,22 +1,23 @@ --- title: 通过文件将Pod信息呈现给容器 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 此页面描述Pod如何使用DownwardAPIVolumeFile把自己的信息呈现给pod中运行的容器。DownwardAPIVolumeFile可以呈现pod的字段和容器字段。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## Downward API @@ -175,9 +176,9 @@ kubectl exec -it kubernetes-downwardapi-volume-example-2 -- sh ``` 你可以使用同样的命令查看`cpu_request`, `mem_limit` 和`mem_request` 文件. -{{% /capture %}} -{{% capture discussion %}} + + ## Capabilities of the Downward API @@ -225,10 +226,11 @@ kubectl exec -it kubernetes-downwardapi-volume-example-2 -- sh 对于容器来说,有时候拥有自己的信息是很有用的,可避免与Kubernetes过度耦合。Downward API使得容器使用自己或者集群的信息,而不必通过Kubernetes客户端或API服务器。 一个例子是有一个现有的应用假定要用一个非常熟悉的环境变量来保存一个唯一标识。一种可能是给应用增加处理层,但这样是冗余和易出错的,而且它违反了低耦合的目标。更好的选择是使用Pod名称作为标识,把Pod名称注入这个环境变量中。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * [PodSpec](/docs/resources-reference/{{< param "version" >}}/#podspec-v1-core) * [Volume](/docs/resources-reference/{{< param "version" >}}/#volume-v1-core) @@ -236,6 +238,6 @@ kubectl exec -it kubernetes-downwardapi-volume-example-2 -- sh * [DownwardAPIVolumeFile](/docs/resources-reference/{{< param "version" >}}/#downwardapivolumefile-v1-core) * [ResourceFieldSelector](/docs/resources-reference/{{< param "version" >}}/#resourcefieldselector-v1-core) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/inject-data-application/environment-variable-expose-pod-information.md b/content/zh/docs/tasks/inject-data-application/environment-variable-expose-pod-information.md index 610181bb41..46e101baa5 100644 --- a/content/zh/docs/tasks/inject-data-application/environment-variable-expose-pod-information.md +++ b/content/zh/docs/tasks/inject-data-application/environment-variable-expose-pod-information.md @@ -1,9 +1,9 @@ --- title: 通过环境变量将Pod信息呈现给容器 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 此页面显示了Pod如何使用环境变量把自己的信息呈现给pod中运行的容器。环境变量可以呈现pod的字段和容器字段。 @@ -11,17 +11,18 @@ content_template: templates/task 环境变量 和[DownwardAPIVolumeFiles](/docs/resources-reference/{{< param "version" >}}/#downwardapivolumefile-v1-core). 这两种呈现Pod和Container字段的方式都称为*Downward API*。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture steps %}} + + ## Downward API @@ -137,9 +138,10 @@ kubectl logs dapi-envars-resourcefieldref 67108864 ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * [给容器定义环境变量](/docs/tasks/configure-pod-container/define-environment-variable-container/) * [PodSpec](/docs/resources-reference/{{< param "version" >}}/#podspec-v1-core) @@ -149,7 +151,7 @@ kubectl logs dapi-envars-resourcefieldref * [ObjectFieldSelector](/docs/resources-reference/{{< param "version" >}}/#objectfieldselector-v1-core) * [ResourceFieldSelector](/docs/resources-reference/{{< param "version" >}}/#resourcefieldselector-v1-core) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/job/automated-tasks-with-cron-jobs.md b/content/zh/docs/tasks/job/automated-tasks-with-cron-jobs.md index 5b987b3cc3..131ef52219 100644 --- a/content/zh/docs/tasks/job/automated-tasks-with-cron-jobs.md +++ b/content/zh/docs/tasks/job/automated-tasks-with-cron-jobs.md @@ -3,7 +3,7 @@ reviewers: - chenopis title: 使用 CronJob 运行自动化任务 -content_template: templates/task +content_type: task weight: 10 --- @@ -12,12 +12,12 @@ weight: 10 title: Running Automated Tasks with a CronJob reviewers: - chenopis -content_template: templates/task +content_type: task weight: 10 --- --> -{{% capture overview %}} + -{{% capture overview %}} + -{{% capture overview %}} + 熟秋基础知识,非并行方式运行 [Job](/docs/concepts/jobs/run-to-completion-finite-workloads/)。 -{{% /capture %}} -{{% capture steps %}} + + 您可以看到,其中的一个 pod 处理了若干个工作单元。 -{{% /capture %}} -{{% capture discussion %}} + + 如果您有连续的后台处理业务,那么可以考虑使用 `replicationController` 来运行您的后台业务,和运行一个类似 [https://github.com/resque/resque](https://github.com/resque/resque) 的后台处理库。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/job/parallel-processing-expansion.md b/content/zh/docs/tasks/job/parallel-processing-expansion.md index e113804e73..b010ae6848 100644 --- a/content/zh/docs/tasks/job/parallel-processing-expansion.md +++ b/content/zh/docs/tasks/job/parallel-processing-expansion.md @@ -1,6 +1,6 @@ --- title: 使用扩展进行并行处理 -content_template: templates/concept +content_type: concept min-kubernetes-server-version: v1.8 weight: 20 --- @@ -8,13 +8,13 @@ weight: 20 -{{% capture overview %}} + 在这个示例中,我们将运行从一个公共模板创建的多个 Kubernetes Job。您可能需要先熟悉 [Jobs](/docs/concepts/workloads/controllers/jobs-run-to-completion/) 的基本概念、非并行以及如何使用它。 -{{% /capture %}} -{{% capture body %}} + + 在这种情况下,您可以考虑其他的[作业模式](/docs/concepts/jobs/run-to-completion-finite-workloads/#job-patterns)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/manage-daemon/rollback-daemon-set.md b/content/zh/docs/tasks/manage-daemon/rollback-daemon-set.md index 12764dd515..780a16f95e 100644 --- a/content/zh/docs/tasks/manage-daemon/rollback-daemon-set.md +++ b/content/zh/docs/tasks/manage-daemon/rollback-daemon-set.md @@ -2,25 +2,26 @@ approvers: - janetkuo title: 对 DaemonSet 执行回滚 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本文展示了如何对 DaemonSet 执行回滚。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * DaemonSet 滚动升级历史和 DaemonSet 回滚特性仅在 Kubernetes 1.7 及以后版本的 `kubectl` 中支持。 * 确保您了解如何 [对 DaemonSet 执行滚动升级](/docs/tasks/manage-daemon/update-daemon-set/)。 -{{% /capture %}} -{{% capture steps %}} + + ## 对 DaemonSet 执行回滚 @@ -98,10 +99,10 @@ kubectl rollout status ds/ daemonset "" successfully rolled out ``` -{{% /capture %}} -{{% capture discussion %}} + + ## 理解 DaemonSet 版本 @@ -134,6 +135,6 @@ NAME CONTROLLER REVISION AGE * 查看 [DaemonSet 滚动升级故障排除](/docs/tasks/manage-daemon/update-daemon-set/#troubleshooting)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/manage-daemon/update-daemon-set.md b/content/zh/docs/tasks/manage-daemon/update-daemon-set.md index 66c5f63175..7ad4b7259d 100644 --- a/content/zh/docs/tasks/manage-daemon/update-daemon-set.md +++ b/content/zh/docs/tasks/manage-daemon/update-daemon-set.md @@ -2,7 +2,7 @@ reviewers: - janetkuo title: 对 DaemonSet 执行滚动更新 -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本文介绍了如何对 DaemonSet 执行滚动更新。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * Kubernetes 1.6 或者更高版本中才支持 DaemonSet 滚动更新功能。 -{{% /capture %}} -{{% capture steps %}} + + 如果在 DaemonSet 中指定了 `.spec.minReadySeconds`,主节点和工作节点之间的时钟偏差会使 DaemonSet 无法检测到正确的滚动更新进度。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + -{{% capture overview %}} + {{< feature-state state="stable" >}} 作为 **GA** 特性,Kubernetes 支持在 Pod 应用中使用预先分配的巨页。本文描述了用户如何使用巨页,以及当前的限制。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + ## API @@ -121,6 +122,6 @@ token. - 作为服务质量特性,保证巨页的 NUMA 局部性。 - 支持 LimitRange 。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/manage-kubernetes-objects/imperative-config.md b/content/zh/docs/tasks/manage-kubernetes-objects/imperative-config.md index d001d4638a..1cd2daf0a1 100644 --- a/content/zh/docs/tasks/manage-kubernetes-objects/imperative-config.md +++ b/content/zh/docs/tasks/manage-kubernetes-objects/imperative-config.md @@ -1,17 +1,17 @@ --- title: 使用配置文件对 Kubernetes 对象进行命令式管理 -content_template: templates/task +content_type: task weight: 40 --- -{{% capture overview %}} + 可以使用 `kubectl` 命令行工具以及用 YAML 或 JSON 编写的对象配置文件来创建、更新和删除 Kubernetes 对象。 本文档说明了如何使用配置文件定义和管理对象。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + -{{% capture overview %}} + 这篇文章分享了如何验证 IPv4/IPv6 双协议栈的 Kubernetes 集群。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + -{{% capture overview %}} + 本文展示了如何限制应用程序的并发中断数量,在允许集群管理员管理集群节点的同时保证高可用。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + @@ -39,9 +40,9 @@ nodes. --> Pod Disruption Budgets. --> * 用户应当与集群所有者或服务提供者确认其遵从 Pod 中断预算(Pod Disruption Budgets)的规则。 -{{% /capture %}} -{{% capture steps %}} + + ## 用 PodDisruptionBudget 来保护应用 @@ -56,9 +57,9 @@ nodes. --> 1. 以 YAML 文件形式定义 PDB 。 1. 通过 YAML 文件创建 PDB 对象。 -{{% /capture %}} -{{% capture discussion %}} + + ## 确定要保护的应用 @@ -329,6 +330,6 @@ to create PDBs whose selectors overlap. --> 用户可以令选择器选择一个内置控制器所控制 pod 的子集或父集。然而,当名字空间下存在多个 PDB 时, 用户必须小心,保证 PDB 的选择器之间不重叠。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/run-application/delete-stateful-set.md b/content/zh/docs/tasks/run-application/delete-stateful-set.md index 31c789cd48..92c35c7ded 100644 --- a/content/zh/docs/tasks/run-application/delete-stateful-set.md +++ b/content/zh/docs/tasks/run-application/delete-stateful-set.md @@ -6,29 +6,30 @@ reviewers: - janetkuo - smarterclayton title: 删除 StatefulSet -content_template: templates/task +content_type: task weight: 60 --- -{{% capture overview %}} + 本文介绍如何删除 StatefulSet。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * 本文假设在您的集群上已经运行了由 StatefulSet 创建的应用。 -{{% /capture %}} -{{% capture steps %}} + + ## 删除 StatefulSet @@ -119,15 +120,16 @@ If you find that some pods in your StatefulSet are stuck in the 'Terminating' or ---> 如果您发现 StatefulSet 中的某些 pods 长时间处于 'Terminating' 或者 'Unknown' 状态,则可能需要手动干预以强制从 apiserver 中删除 pods。这是一项潜在的危险任务。详细信息请阅读[删除 StatefulSet 类型的 Pods](/docs/tasks/manage-stateful-set/delete-pods/)。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 了解更多有关[强制删除 StatefulSet 类型的 Pods](/docs/tasks/run-application/force-delete-stateful-set-pod/)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/run-application/force-delete-stateful-set-pod.md b/content/zh/docs/tasks/run-application/force-delete-stateful-set-pod.md index 7197d8034d..3a401d617a 100644 --- a/content/zh/docs/tasks/run-application/force-delete-stateful-set-pod.md +++ b/content/zh/docs/tasks/run-application/force-delete-stateful-set-pod.md @@ -5,7 +5,7 @@ reviewers: - foxish - smarterclayton title: 强制删除 StatefulSet 类型的 Pods -content_template: templates/task +content_type: task weight: 70 --- @@ -17,19 +17,20 @@ reviewers: - foxish - smarterclayton title: Force Delete StatefulSet Pods -content_template: templates/task +content_type: task weight: 70 --- ---> -{{% capture overview %}} + 本文介绍了如何删除 StatefulSet 管理的部分 pods,并且解释了这样操作时需要记住的注意事项。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 请始终谨慎地执行强制删除 StatefulSet 类型的 pods,并完全了解所涉及地风险。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 进一步了解[调试 StatefulSet](/docs/tasks/debug-application-cluster/debug-stateful-set/)。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md b/content/zh/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md index 72adc7421e..d7db4ef10b 100644 --- a/content/zh/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md +++ b/content/zh/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md @@ -5,11 +5,11 @@ reviewers: - justinsb - directxman12 title: Horizontal Pod Autoscaler演练 -content_template: templates/task +content_type: task weight: 100 --- -{{% capture overview %}} + diff --git a/content/zh/docs/tasks/run-application/run-replicated-stateful-application.md b/content/zh/docs/tasks/run-application/run-replicated-stateful-application.md index 407c7f5c18..d35a0efefa 100644 --- a/content/zh/docs/tasks/run-application/run-replicated-stateful-application.md +++ b/content/zh/docs/tasks/run-application/run-replicated-stateful-application.md @@ -1,6 +1,6 @@ --- title: 运行一个有状态的应用程序 -content_template: templates/tutorial +content_type: tutorial weight: 30 --- -{{% capture overview %}} + 请注意 **这不是生产配置**。 重点是, MySQL 设置保留在不安全的默认值上,使重点放在 Kubernetes 中运行有状态应用程序的常规模式。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + [ConfigMaps](/docs/tasks/configure-pod-container/configure-pod-configmap/). * 熟悉 MySQL 会有所帮助,但是本教程旨在介绍对其他系统应该有用的常规模式。 -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + * 观察对宕机的抵抗力。 * 缩放 StatefulSet 的大小。 -{{% /capture %}} -{{% capture lessoncontent %}} + + ## 部署 MySQL @@ -590,9 +592,10 @@ kubectl delete pvc data-mysql-3 kubectl delete pvc data-mysql-4 ``` -{{% /capture %}} -{{% capture cleanup %}} + +## {{% heading "cleanup" %}} + @@ -642,15 +645,16 @@ kubectl delete pvc data-mysql-4 如果您使用了动态预配器,当得知您删除 PersistentVolumeClaims 时,它将自动删除 PersistentVolumes。 一些动态预配器(例如用于 EBS 和 PD 的预配器)也会在删除 PersistentVolumes 时释放基础资源。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 在[Helm Charts 存储库](https://github.com/kubernetes/charts)中查找其他有状态的应用程序示例。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/run-application/run-single-instance-stateful-application.md b/content/zh/docs/tasks/run-application/run-single-instance-stateful-application.md index 6ba0afd89c..5bd417375a 100644 --- a/content/zh/docs/tasks/run-application/run-single-instance-stateful-application.md +++ b/content/zh/docs/tasks/run-application/run-single-instance-stateful-application.md @@ -1,33 +1,35 @@ --- title: 运行一个单实例有状态应用 -content_template: templates/tutorial +content_type: tutorial --- -{{% capture overview %}} + 本文介绍在 Kubernetes 中使用 PersistentVolume 和 Deployment 如何运行一个单实例有状态应用. 该应用是 MySQL. -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + * 在环境中通过磁盘创建一个PersistentVolume. * 创建一个MySQL Deployment. * 在集群内以一个已知的 DNS 名将 MySQL 暴露给其他 pods. -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} * {{< include "default-storage-class-prereqs.md" >}} -{{% /capture %}} -{{% capture lessoncontent %}} + + ## 部署MySQL @@ -158,10 +160,11 @@ kubectl delete pv mysql-pv-volume 如果通过手动的方式分配 PersistentVolume, 那么也需要手动的删除它,以及释放下层资源. 如果是用过动态分配 PersistentVolume 的方式,在删除 PersistentVolumeClaim 后 PersistentVolume 将被自动的删除. 一些存储服务(比如 EBS 和 PD)也会在 PersistentVolume 被删除时自动回收下层资源. -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 了解更多 Deployment 对象请参考 [Deployment objects](/docs/concepts/workloads/controllers/deployment/). @@ -171,6 +174,6 @@ kubectl delete pv mysql-pv-volume * 卷和持久卷请参考 [Volumes](/docs/concepts/storage/volumes/) 和 [Persistent Volumes](/docs/concepts/storage/persistent-volumes/) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/run-application/run-stateless-application-deployment.md b/content/zh/docs/tasks/run-application/run-stateless-application-deployment.md index a4b086717f..a925a0d919 100644 --- a/content/zh/docs/tasks/run-application/run-stateless-application-deployment.md +++ b/content/zh/docs/tasks/run-application/run-stateless-application-deployment.md @@ -1,32 +1,34 @@ --- title: 使用Deployment运行一个无状态应用 -content_template: templates/tutorial +content_type: tutorial --- -{{% capture overview %}} + 本文介绍通过Kubernetes Deployment对象如何去运行一个应用. -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + * 创建一个nginx deployment. * 使用kubectl列举关于deployment信息. * 更新deployment. -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} -{{% /capture %}} -{{% capture lessoncontent %}} + + ## 创建和探究一个nginx deployment @@ -132,13 +134,14 @@ content_template: templates/tutorial 创建一个多副本应用首选方法是使用Deployment,反过来使用ReplicaSet. 在Deployment和ReplicaSet加入到Kubernetes之前, 多副本应用通过[ReplicationController](/docs/concepts/workloads/controllers/replicationcontroller/)来配置. -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 了解更多 [Deployment objects](/docs/concepts/workloads/controllers/deployment/). -{{% /capture %}} + diff --git a/content/zh/docs/tasks/run-application/scale-stateful-set.md b/content/zh/docs/tasks/run-application/scale-stateful-set.md index cf4a6817a8..ef0e5223e2 100644 --- a/content/zh/docs/tasks/run-application/scale-stateful-set.md +++ b/content/zh/docs/tasks/run-application/scale-stateful-set.md @@ -8,22 +8,23 @@ approvers: - kow3ns - smarterclayton title: 弹缩StatefulSet -content_template: templates/task +content_type: task --- -{{% capture overview %}} + 本文介绍如何弹缩StatefulSet. -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * StatefulSets仅适用于Kubernetes1.5及以上版本. * **不是所有Stateful应用都适合弹缩.** 在弹缩前您的应用前. 您必须充分了解您的应用, 不适当的弹缩StatefulSet或许会造成应用自身功能的不稳定. * 仅当您确定该Stateful应用的集群是完全健康才可执行弹缩操作. -{{% /capture %}} -{{% capture steps %}} + + ## 使用 `kubectl` 弹缩StatefulSets @@ -79,12 +80,13 @@ StatefulSet的扩容/缩容操作. 一些分布式数据库在节点加入和同 这些情况下,最好是在应用级别进行弹缩操作, 并且只有在您确保Stateful应用的集群是完全健康时才执行弹缩. -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 了解更多 [deleting a StatefulSet](/docs/tasks/manage-stateful-set/deleting-a-statefulset/). -{{% /capture %}} + diff --git a/content/zh/docs/tasks/run-application/update-api-object-kubectl-patch.md b/content/zh/docs/tasks/run-application/update-api-object-kubectl-patch.md index 23a94d1d08..68c99d6881 100644 --- a/content/zh/docs/tasks/run-application/update-api-object-kubectl-patch.md +++ b/content/zh/docs/tasks/run-application/update-api-object-kubectl-patch.md @@ -1,7 +1,7 @@ --- title: 使用 kubectl patch 更新 API 对象 description: 使用 kubectl patch 更新 Kubernetes API 对象。做一个策略性的合并 patch 或 JSON 合并 patch。 -content_template: templates/task +content_type: task weight: 40 --- @@ -9,12 +9,12 @@ weight: 40 --- title: Update API Objects in Place Using kubectl patch description: Use kubectl patch to update Kubernetes API objects in place. Do a strategic merge patch or a JSON merge patch. -content_template: templates/task +content_type: task weight: 40 --- --> -{{% capture overview %}} + -{{% capture overview %}} + {{< glossary_definition term_id="service-catalog" length="all" prepend="Service Catalog is" >}} @@ -152,9 +153,10 @@ helm install catalog svc-cat/catalog --namespace catalog helm install svc-cat/catalog --name catalog --namespace catalog ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + -{{% capture overview %}} + {{< glossary_definition term_id="service-catalog" length="all" prepend="Service Catalog is" >}} @@ -115,9 +116,10 @@ If you would like to uninstall Service Catalog from your Kubernetes cluster usin sc uninstall ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 本文展示如何在 kubelet 中启用并配置证书轮换。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + * 要求 Kubernetes 1.8.0 或更高的版本 * Kubelet 证书轮换在 1.8.0 版本中处于 beta 阶段, 这意味着该特性可能在没有通知的情况下发生变化。 -{{% /capture %}} -{{% capture steps %}} + + ## 概述 @@ -60,6 +61,6 @@ Kubelet 会从 Kubernetes API 取回签署的证书,并将其写入磁盘, 会从 Kubernetes API 取回签署的证书,并将其写入磁盘。 然后它会更新与 Kubernetes API 的连接,使用新的证书重新连接到 Kubernetes API。 -{{% /capture %}} + diff --git a/content/zh/docs/tasks/tls/managing-tls-in-a-cluster.md b/content/zh/docs/tasks/tls/managing-tls-in-a-cluster.md index e82f1303ee..a5184367d1 100644 --- a/content/zh/docs/tasks/tls/managing-tls-in-a-cluster.md +++ b/content/zh/docs/tasks/tls/managing-tls-in-a-cluster.md @@ -1,6 +1,6 @@ --- title: 管理集群中的 TLS 认证 -content_template: templates/task +content_type: task reviewers: - mikedanese - beacham @@ -9,7 +9,7 @@ reviewers: -{{% capture overview %}} + -{{% capture overview %}} + 在 Kubernetes 上使用 Kubernetes 命令行工具 [kubectl](/docs/user-guide/kubectl/) 部署和管理应用程序。使用 kubectl,您可以检查集群资源;创建、删除和更新组件;查看您的新集群;并启动实例应用程序。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 您必须使用与集群小版本号差别为一的 kubectl 版本。例如,1.2版本的客户端应该与1.1版本、1.2版本和1.3版本的主节点一起使用。使用最新版本的 kubectl 有助于避免无法预料的问题。 -{{% /capture %}} -{{% capture steps %}} + + [了解如何启动并对外暴露您的应用程序](/docs/tasks/access-application-cluster/service-access-application-cluster/) -{{% /capture %}} + diff --git a/content/zh/docs/tasks/tools/install-minikube.md b/content/zh/docs/tasks/tools/install-minikube.md index db9657876d..6dba5fd3c6 100644 --- a/content/zh/docs/tasks/tools/install-minikube.md +++ b/content/zh/docs/tasks/tools/install-minikube.md @@ -1,6 +1,6 @@ --- title: 安装 Minikube -content_template: templates/task +content_type: task weight: 20 card: name: tasks @@ -10,7 +10,7 @@ card: -{{% capture overview %}} + -{{% capture overview %}} + Kubernetes 文档的这一部分包含教程。一个教程展示了如何完成一个比单个[任务](/zh/docs/tasks/)更大的目标。 通常一个教程有几个部分,每个部分都有一系列步骤。在浏览每个教程之前, @@ -29,9 +29,9 @@ Before walking through each tutorial, you may want to bookmark the [Standardized Glossary](/docs/reference/glossary/) page for later references. --> -{{% /capture %}} -{{% capture body %}} + + ## 基础知识 @@ -173,9 +173,10 @@ Before walking through each tutorial, you may want to bookmark the * [Using Source IP](/docs/tutorials/services/source-ip/) --> -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 如果您想编写教程,请参阅[使用页面模板](/zh/docs/home/contribute/page-templates/) 以获取有关教程页面类型和教程模板的信息。 @@ -185,5 +186,5 @@ If you would like to write a tutorial, see for information about the tutorial page type and the tutorial template. --> -{{% /capture %}} + diff --git a/content/zh/docs/tutorials/clusters/apparmor.md b/content/zh/docs/tutorials/clusters/apparmor.md index 655eec5db1..5dcee5fac7 100644 --- a/content/zh/docs/tutorials/clusters/apparmor.md +++ b/content/zh/docs/tutorials/clusters/apparmor.md @@ -1,15 +1,15 @@ --- title: AppArmor -content_template: templates/tutorial +content_type: tutorial --- -{{% capture overview %}} + {{< feature-state for_k8s_version="v1.4" state="beta" >}} @@ -24,9 +24,10 @@ violations. --> Apparmor 是一个 Linux 内核安全模块,它补充了标准的基于 Linux 用户和组的安全模块将程序限制为有限资源集的权限。AppArmor 可以配置为任何应用程序减少潜在的攻击面,并且提供更加深入的防御。AppArmor 是通过配置文件进行配置的,这些配置文件被调整为报名单,列出了特定程序或者容器所需要的访问权限,如 Linux 功能、网络访问、文件权限等。每个配置文件都可以在*强制*模式(阻止访问不允许的资源)或*投诉*模式(仅报告冲突)下运行。 -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + 务必: @@ -175,9 +177,9 @@ gke-test-default-pool-239f5d02-x1kf: kubelet is posting ready status. AppArmor e gke-test-default-pool-239f5d02-xwux: kubelet is posting ready status. AppArmor enabled ``` -{{% /capture %}} -{{% capture lessoncontent %}} + + ## 保护 Pod @@ -586,9 +588,10 @@ logs or through `journalctl`. More information is provided in * **value**: 配置文件引用的逗号分隔列表(如上所述) - 尽管转义逗号是配置文件名中的合法字符,但此处不能显式允许。 -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + 其他资源 @@ -598,4 +601,4 @@ logs or through `journalctl`. More information is provided in * [Apparmor 配置文件语言快速指南](https://gitlab.com/apparmor/apparmor/wikis/QuickProfileLanguage) * [Apparmor 核心策略参考](https://gitlab.com/apparmor/apparmor/wikis/Policy_Layout) -{{% /capture %}} + diff --git a/content/zh/docs/tutorials/configuration/configure-redis-using-configmap.md b/content/zh/docs/tutorials/configuration/configure-redis-using-configmap.md index 8cc92c076e..d43ee91103 100644 --- a/content/zh/docs/tutorials/configuration/configure-redis-using-configmap.md +++ b/content/zh/docs/tutorials/configuration/configure-redis-using-configmap.md @@ -3,19 +3,20 @@ reviewers: - eparis - pmorie title: 使用 ConfigMap 来配置 Redis -content_template: templates/tutorial +content_type: tutorial --- -{{% capture overview %}} + 这篇文档基于[使用 ConfigMap 来配置 Containers](/zh/docs/tasks/configure-pod-container/configure-pod-configmap/) 这个任务,提供了一个使用 ConfigMap 来配置 Redis 的真实案例。 -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + -{{% capture overview %}} + 有关 `docker build` 命令的更多信息,请参阅 [Docker 文档](https://docs.docker.com/engine/reference/commandline/build/)。 -{{% /capture %}} -{{% capture lessoncontent %}} + + -{{% capture overview %}} + 以下是提供 Kubernetes 在线培训的一些网站: -{{% /capture %}} -{{% capture body %}} + + * [自定进度的 Kubernetes 在线课程 (Learnk8s 学院)] (https://learnk8s.io/academy) -{{% /capture %}} + diff --git a/content/zh/docs/tutorials/services/source-ip.md b/content/zh/docs/tutorials/services/source-ip.md index 098f5d760f..d44eb358a0 100644 --- a/content/zh/docs/tutorials/services/source-ip.md +++ b/content/zh/docs/tutorials/services/source-ip.md @@ -1,17 +1,18 @@ --- title: 使用 Source IP -content_template: templates/tutorial +content_type: tutorial --- -{{% capture overview %}} + Kubernetes 集群中运行的应用通过 Service 抽象来互相查找、通信和与外部世界沟通。本文介绍被发送到不同类型 Services 的数据包源 IP 的变化过程,你可以根据你的需求改变这些行为。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} @@ -41,19 +42,20 @@ kubectl run source-ip-app --image=k8s.gcr.io/echoserver:1.4 deployment.apps/source-ip-app created ``` -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + * 通过多种类型的 Services 暴露一个简单应用 * 理解每种 Service 类型如何处理源 IP NAT * 理解保留源IP所涉及的折中 -{{% /capture %}} -{{% capture lessoncontent %}} + + ## Type=ClusterIP 类型 Services 的 Source IP @@ -368,9 +370,10 @@ __跨平台支持__ 第一类负载均衡器必须使用一种它和后端之间约定的协议来和真实的客户端 IP 通信,例如 HTTP [X-FORWARDED-FOR](https://en.wikipedia.org/wiki/X-Forwarded-For) 头,或者 [proxy 协议](http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt)。 第二类负载均衡器可以通过简单的在保存于 Service 的 `service.spec.healthCheckNodePort` 字段上创建一个 HTTP 健康检查点来使用上面描述的特性。 -{{% /capture %}} -{{% capture cleanup %}} + +## {{% heading "cleanup" %}} + 删除服务: @@ -386,10 +389,11 @@ $ kubectl delete svc -l run=source-ip-app $ kubectl delete deployment source-ip-app ``` -{{% /capture %}} -{{% capture whatsnext %}} + +## {{% heading "whatsnext" %}} + * 学习更多关于 [通过 services 连接应用](/zh/docs/concepts/services-networking/connect-applications-service/) * 学习更多关于 [负载均衡](/zh/docs/user-guide/load-balancer) -{{% /capture %}} + diff --git a/content/zh/docs/tutorials/stateful-application/basic-stateful-set.md b/content/zh/docs/tutorials/stateful-application/basic-stateful-set.md index e48f5f2528..868c13def6 100644 --- a/content/zh/docs/tutorials/stateful-application/basic-stateful-set.md +++ b/content/zh/docs/tutorials/stateful-application/basic-stateful-set.md @@ -1,6 +1,6 @@ --- title: StatefulSet 基础 -content_template: templates/tutorial +content_type: tutorial approvers: - enisoc - erictune @@ -11,7 +11,7 @@ approvers: --- -{{% capture overview %}} + ## 创建 StatefulSet @@ -1516,9 +1518,10 @@ StatefulSet 控制器将并发的删除所有 Pod,在删除一个 Pod 前不 kubectl delete svc nginx ``` -{{% /capture %}} -{{% capture cleanup %}} + +## {{% heading "cleanup" %}} + 你需要删除本教程中用到的 PersistentVolumes 的持久化存储介质。基于你的环境、存储配置和提供方式,按照必须的步骤保证回收所有的存储。 -{{% /capture %}} + diff --git a/content/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md b/content/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md index d05f07d135..e5e53815d9 100644 --- a/content/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md +++ b/content/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume.md @@ -2,7 +2,7 @@ title: 示例:使用 Persistent Volumes 部署 WordPress 和 MySQL reviewers: - ahmetb -content_template: templates/tutorial +content_type: tutorial weight: 20 card: name: tutorials @@ -10,7 +10,7 @@ card: title: "Stateful 示例: Wordpress with Persistent Volumes" --- -{{% capture overview %}} + 本教程展示了在 Kubernetes 上使用 [PodDisruptionBudgets](/zh/docs/admin/disruptions/#specifying-a-poddisruptionbudget) 和 [PodAntiAffinity](/zh/docs/user-guide/node-selection/#inter-pod-affinity-and-anti-affinity-beta-feature) 特性运行 [Apache Zookeeper](https://zookeeper.apache.org)。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + 在开始本教程前,你应该熟悉以下 Kubernetes 概念。 @@ -38,9 +39,10 @@ content_template: templates/tutorial 本教程假设你的集群配置为动态的提供 PersistentVolumes。如果你的集群没有配置成这样,在开始本教程前,你需要手动准备三个 20 GiB 的卷。 -{{% /capture %}} -{{% capture objectives %}} + +## {{% heading "objectives" %}} + 在学习本教程后,你将熟悉下列内容。 @@ -48,9 +50,9 @@ content_template: templates/tutorial * 如何使用 ConfigMaps 一致性配置 ensemble。 * 如何在 ensemble 中 分布 ZooKeeper 服务的部署。 * 如何在计划维护中使用 PodDisruptionBudgets 确保服务可用性。 -{{% /capture %}} -{{% capture lessoncontent %}} + + ### ZooKeeper 基础 @@ -1167,11 +1169,12 @@ node "kubernetes-minion-group-ixsl" uncordoned 你可以同时使用 `kubectl drain` 和 PodDisruptionBudgets 来保证你的服务在维护过程中仍然可用。如果使用 drain 来隔离节点并在此之前删除 pods 使节点进入离线维护状态,如果服务表达了 disruption budget,这个 budget 将被遵守。你应该总是为关键服务分配额外容量,这样它们的 Pods 就能够迅速的重新调度。 -{{% /capture %}} -{{% capture cleanup %}} + +## {{% heading "cleanup" %}} + * 使用 `kubectl uncordon` 解除你集群中所有节点的隔离。 * 你需要删除在本教程中使用的 PersistentVolumes 的持久存储媒介。请遵循必须的步骤,基于你的环境、存储配置和准备方法,保证回收所有的存储。 -{{% /capture %}} + diff --git a/content/zh/docs/tutorials/stateless-application/expose-external-ip-address.md b/content/zh/docs/tutorials/stateless-application/expose-external-ip-address.md index b5f9eccfb0..4a4d7779e2 100644 --- a/content/zh/docs/tutorials/stateless-application/expose-external-ip-address.md +++ b/content/zh/docs/tutorials/stateless-application/expose-external-ip-address.md @@ -1,18 +1,18 @@ --- title: 公开外部 IP 地址以访问集群中应用程序 -content_template: templates/tutorial +content_type: tutorial weight: 10 --- -{{% capture overview %}} + 此页面显示如何创建公开外部 IP 地址的 Kubernetes 服务对象。 -{{% /capture %}} -{{% capture prerequisites %}} + +## {{% heading "prerequisites" %}} + -{{% capture overview %}} +