jiebi/CodeConvo huggingface dataset:
<ins> --- title: 启用拓扑感知提示 content_type: task min-kubernetes-server-version: 1.21 --- <!-- --- reviewers: - robscott title: Enabling Topology Aware Hints content_type: task min-kubernetes-server-version: 1.21 --- --> <!-- overview --> {{< feature-state for_k8s_version="v1.21" state="alpha" >}} <!-- _Topology Aware Hints_ enable topology aware routing with topology hints included in {{< glossary_tooltip text="EndpointSlices" term_id="endpoint-slice" >}}. This approach tries to keep traffic close to where it originated from; you might do this to reduce costs, or to improve network performance. --> _拓扑感知提示_ 启用具有拓扑感知能力的路由，其中拓扑感知信息包含在 {{< glossary_tooltip text="EndpointSlices" term_id="endpoint-slice" >}} 中。 此功能尽量将流量限制在它的发起区域附近； 可以降低成本，或者提高网络性能。 ## {{% heading "prerequisites" %}} {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}} <!-- The following prerequisite is needed in order to enable topology aware hints: * Configure the {{< glossary_tooltip text="kube-proxy" term_id="kube-proxy" >}} to run in iptables mode or IPVS mode * Ensure that you have not disabled EndpointSlices --> 为了启用拓扑感知提示，先要满足以下先决条件： * 配置 {{< glossary_tooltip text="kube-proxy" term_id="kube-proxy" >}} 以 iptables 或 IPVS 模式运行 * 确保未禁用 EndpointSlices <!-- ## Enable Topology Aware Hints --> ## 启动拓扑感知提示 {#enable-topology-aware-hints} <!-- To enable service topology hints, enable the `TopologyAwareHints` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for the kube-apiserver, kube-controller-manager, and kube-proxy: --> 要启用服务拓扑感知，请启用 kube-apiserver、kube-controller-manager、和 kube-proxy 的 [特性门控](/zh/docs/reference/command-line-tools-reference/feature-gates/) `TopologyAwareHints`。 ``` --feature-gates="TopologyAwareHints=true" ``` ## {{% heading "whatsnext" %}} <!-- * Read about [Topology Aware Hints](/docs/concepts/services-networking/topology-aware-hints) for Services * Read [Connecting Applications with Services](/docs/concepts/services-networking/connect-applications-service/) --> * 参阅面向服务的[拓扑感知提示](/zh/docs/concepts/services-networking/topology-aware-hints) * 参阅[用服务连通应用](/zh/docs/concepts/services-networking/connect-applications-service/) </ins>
/docs/tasks/administer-cluster/quota-memory-cpu-namespace/     /docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/ 301 /docs/tasks/administer-cluster/quota-pod-namespace/     /docs/tasks/administer-cluster/manage-resources/quota-pod-namespace/ 301 /docs/tasks/administer-cluster/reserve-compute-resources/out-of-resource.md     /docs/tasks/administer-cluster/out-of-resource/ 301 <del> /docs/tasks/administer-cluster/out-of-resource/     /docs/concepts/scheduling-eviction/pod-eviction/ 301 </del> <ins> /docs/tasks/administer-cluster/out-of-resource/     /docs/concepts/scheduling-eviction/node-pressure-eviction/ 301 </ins> /docs/tasks/administer-cluster/romana-network-policy/     /docs/tasks/administer-cluster/network-policy-provider/romana-network-policy/ 301 /docs/tasks/administer-cluster/running-cloud-controller.md     /docs/tasks/administer-cluster/running-cloud-controller/ 301 /docs/tasks/administer-cluster/share-configuration/     /docs/tasks/access-application-cluster/configure-access-multiple-clusters/ 301
<button id="desktopShowVideoButton" onclick="kub.showVideo()">Watch Video</button> <br> <br> <del> <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/?utm_source=kubernetes.io&utm_medium=nav&utm_campaign=kccncna20" button id="desktopKCButton">Attend KubeCon NA virtually on November 17-20, 2020</a> </del> <ins> <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-north-america/?utm_source=kubernetes.io&utm_medium=nav&utm_campaign=kccncna21" button id="desktopKCButton">Attend KubeCon North America on October 11-15, 2021</a> </ins> <br> <br> <br> <br> <del> <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-europe/?utm_source=kubernetes.io&utm_medium=nav&utm_campaign=kccnceu21" button id="desktopKCButton">Attend KubeCon EU virtually on May 4 – 7, 2021</a> </del> <ins> <a href="https://events.linuxfoundation.org/kubecon-cloudnativecon-europe/?utm_source=kubernetes.io&utm_medium=nav&utm_campaign=kccnceu21" button id="desktopKCButton">Revisit KubeCon EU 2021</a> </ins> </div> <div id="videoPlayer"> <iframe data-url="https://www.youtube.com/embed/H06qrNmGqyE?autoplay=1" frameborder="0" allowfullscreen></iframe>
`ContainerDevices` do expose the topology information declaring to which NUMA cells the device is affine. The NUMA cells are identified using a opaque integer ID, which value is consistent to what device <del> plugins report [when they register themselves to the kubelet](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#device-plugin-integration-with-the-topology-manager). </del> <ins> plugins report [when they register themselves to the kubelet](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#device-plugin-integration-with-the-topology-manager). </ins> The gRPC service is served over a unix socket at `/var/lib/kubelet/pod-resources/kubelet.sock`.
of cluster (node) autoscaling may cause voluntary disruptions to defragment and compact nodes. Your cluster administrator or hosting provider should have documented what level of voluntary disruptions, if any, to expect. Certain configuration options, such as <del> [using PriorityClasses](https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/) </del> <ins> [using PriorityClasses](/docs/concepts/configuration/pod-priority-preemption/) </ins> in your pod spec can also cause voluntary (and involuntary) disruptions.
## {{% heading "whatsnext" %}} <del> * Read the [kube-scheduler reference](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/) </del> <ins> * Read the [kube-scheduler reference](/docs/reference/command-line-tools-reference/kube-scheduler/) </ins> * Learn about [scheduling](/docs/concepts/scheduling-eviction/kube-scheduler/) * Read the [kube-scheduler configuration (v1beta1)](/docs/reference/config-api/kube-scheduler-config.v1beta1/) reference
Generates keys and certificate signing requests (CSRs) for all the certificates required to run the control plane. This command also generates partial kubeconfig files with private key data in the  "users &gt; user &gt; client-key-data" field, and for each kubeconfig file an accompanying ".csr" file is created. <del> This command is designed for use in [Kubeadm External CA Mode](https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#external-ca-mode). It generates CSRs which you can then submit to your external certificate authority for signing. </del> <ins> This command is designed for use in [Kubeadm External CA Mode](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#external-ca-mode). It generates CSRs which you can then submit to your external certificate authority for signing. </ins> The PEM encoded signed certificates should then be saved alongside the key files, using ".crt" as the file extension, or in the case of kubeconfig files, the PEM encoded signed certificate should be base64 encoded and added to the kubeconfig file in the "users &gt; user &gt; client-certificate-data" field.
PodSecurityPolicy in the **policy/v1beta1** API version will no longer be served in v1.25, and the PodSecurityPolicy admission controller will be removed. PodSecurityPolicy replacements are still under discussion, but current use can be migrated to <del> [3rd-party admission webhooks](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/) now. </del> <ins> [3rd-party admission webhooks](/docs/reference/access-authn-authz/extensible-admission-controllers/) now. </ins> #### RuntimeClass {#runtimeclass-v125}
* start and configure additional etcd instance * configure the {{< glossary_tooltip term_id="kube-apiserver" text="API server" >}} to use it for storing events <del> See [Operating etcd clusters for Kubernetes](https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/) and [Set up a High Availability etcd cluster with kubeadm](docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm/) </del> <ins> See [Operating etcd clusters for Kubernetes](/docs/tasks/administer-cluster/configure-upgrade-etcd/) and [Set up a High Availability etcd cluster with kubeadm](/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm/) </ins> for details on configuring and managing etcd for a large cluster. ## Addon resources
security mechanisms to make sure that users and workloads can get access to the resources they need, while keeping workloads, and the cluster itself, secure. You can set limits on the resources that users and workloads can access <del> by managing [policies](https://kubernetes.io/docs/concepts/policy/) and </del> <ins> by managing [policies](/docs/concepts/policy/) and </ins> [container resources](/docs/concepts/configuration/manage-resources-containers/). Before building a Kubernetes production environment on your own, consider
deployment methods. - Configure user management by determining your [Authentication](/docs/reference/access-authn-authz/authentication/) and <del> [Authorization](docs/reference/access-authn-authz/authorization/) methods. </del> <ins> [Authorization](/docs/reference/access-authn-authz/authorization/) methods. </ins> - Prepare for application workloads by setting up <del> [resource limits](docs/tasks/administer-cluster/manage-resources/), </del> <ins> [resource limits](/docs/tasks/administer-cluster/manage-resources/), </ins> [DNS autoscaling](/docs/tasks/administer-cluster/dns-horizontal-autoscaling/) and [service accounts](/docs/reference/access-authn-authz/service-accounts-admin/).
certificates by requesting them from the `certificates.k8s.io` API. One known limitation is that the CSRs (Certificate Signing Requests) for these certificates cannot be automatically approved by the default signer in the kube-controller-manager - <del> [`kubernetes.io/kubelet-serving`](https://kubernetes.io/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers). </del> <ins> [`kubernetes.io/kubelet-serving`](/docs/reference/access-authn-authz/certificate-signing-requests/#kubernetes-signers). </ins> This will require action from the user or a third party controller. These CSRs can be viewed using:
<ins> ## `LoggingConfiguration`     {#LoggingConfiguration} **Appears in:** - [KubeletConfiguration](#kubelet-config-k8s-io-v1beta1-KubeletConfiguration) LoggingConfiguration contains logging options Refer [Logs Options](https://github.com/kubernetes/component-base/blob/master/logs/options.go) for more information. <table class="table"> <thead><tr><th width="30%">Field</th><th>Description</th></tr></thead> <tbody> <tr><td><code>format</code> <B>[Required]</B><br/> <code>string</code> </td> <td> Format Flag specifies the structure of log messages. default value of format is `text`</td> </tr> <tr><td><code>sanitization</code> <B>[Required]</B><br/> <code>bool</code> </td> <td> [Experimental] When enabled prevents logging of fields tagged as sensitive (passwords, keys, tokens). Runtime log sanitization may introduce significant computation overhead and therefore should not be enabled in production.`)</td> </tr> </tbody> </table> </ins> ## `KubeletConfiguration`     {#kubelet-config-k8s-io-v1beta1-KubeletConfiguration}
status to master if node status does not change. Kubelet will ignore this frequency and post node status immediately if any change is detected. It is only used when node lease feature is enabled. nodeStatusReportFrequency's <del> default value is 1m. But if nodeStatusUpdateFrequency is set explicitly, </del> <ins> default value is 5m. But if nodeStatusUpdateFrequency is set explicitly, </ins> nodeStatusReportFrequency's default value will be set to nodeStatusUpdateFrequency for backward compatibility. <del> Default: "1m"</td> </del> <ins> Default: "5m"</td> </ins> </tr>
</tr> <ins> <tr><td><code>memoryManagerPolicy</code><br/> <code>string</code> </td> <td> MemoryManagerPolicy is the name of the policy to use by memory manager. Requires the MemoryManager feature gate to be enabled. Dynamic Kubelet Config (beta): This field should not be updated without a full node reboot. It is safest to keep this value the same as the local config. Default: "none"</td> </tr> </ins> <tr><td><code>topologyManagerPolicy</code><br/> <code>string</code> </td>
<td> ShutdownGracePeriodCriticalPods specifies the duration used to terminate critical pods during a node shutdown. This should be less than ShutdownGracePeriod. For example, if ShutdownGracePeriod=30s, and ShutdownGracePeriodCriticalPods=10s, during a node shutdown the first 20 seconds would be reserved for gracefully terminating normal pods, and the last 10 seconds would be reserved for terminating critical pods. <del> Default: "10s"</td> </del> <ins> Default: "0s"</td> </tr> <tr><td><code>reservedMemory</code><br/> <a href="#kubelet-config-k8s-io-v1beta1-MemoryReservation"><code>[]MemoryReservation</code></a> </td> <td> ReservedMemory specifies a comma-separated list of memory reservations for NUMA nodes. The parameter makes sense only in the context of the memory manager feature. The memory manager will not allocate reserved memory for container workloads. For example, if you have a NUMA0 with 10Gi of memory and the ReservedMemory was specified to reserve 1Gi of memory at NUMA0, the memory manager will assume that only 9Gi is available for allocation. You can specify a different amount of NUMA node and memory types. You can omit this parameter at all, but you should be aware that the amount of reserved memory from all NUMA nodes should be equal to the amount of memory specified by the node allocatable features(https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable). If at least one node allocatable parameter has a non-zero value, you will need to specify at least one NUMA node. Also, avoid specifying: 1. Duplicates, the same NUMA node, and memory type, but with a different value. 2. zero limits for any memory type. 3. NUMAs nodes IDs that do not exist under the machine. 4. memory types except for memory and hugepages-<size> Default: nil</td> </tr> <tr><td><code>enableProfilingHandler</code><br/> <code>bool</code> </td> <td> enableProfilingHandler enables profiling via web interface host:port/debug/pprof/ Default: true</td> </tr> <tr><td><code>enableDebugFlagsHandler</code><br/> <code>bool</code> </td> <td> enableDebugFlagsHandler enables flags endpoint via web interface host:port/debug/flags/v Default: true</td> </ins> </tr>
<del> ## `ResourceChangeDetectionStrategy`     {#kubelet-config-k8s-io-v1beta1-ResourceChangeDetectionStrategy} (Alias of `string`) **Appears in:** - [KubeletConfiguration](#kubelet-config-k8s-io-v1beta1-KubeletConfiguration) ResourceChangeDetectionStrategy denotes a mode in which internal managers (secret, configmap) are discovering object changes. ## `LoggingConfiguration`     {#LoggingConfiguration} </del> <ins> ## `MemoryReservation`     {#kubelet-config-k8s-io-v1beta1-MemoryReservation} </ins>
- [KubeletConfiguration](#kubelet-config-k8s-io-v1beta1-KubeletConfiguration) <del> LoggingConfiguration contains logging options Refer [Logs Options](https://github.com/kubernetes/component-base/blob/master/logs/options.go) for more information. </del> <ins> MemoryReservation specifies the memory reservation of different types for each NUMA node </ins> <table class="table"> <thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
<del> <tr><td><code>format</code> <B>[Required]</B><br/> <code>string</code> </del> <ins> <tr><td><code>numaNode</code> <B>[Required]</B><br/> <code>int32</code> </ins> </td> <td> <del> Format Flag specifies the structure of log messages. default value of format is `text`</td> </del> <ins> <span class="text-muted">No description provided.</span> </td> </ins> </tr> <del> <tr><td><code>sanitization</code> <B>[Required]</B><br/> <code>bool</code> </del> <ins> <tr><td><code>limits</code> <B>[Required]</B><br/> <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#resourcelist-v1-core"><code>core/v1.ResourceList</code></a> </ins> </td> <td> <del> [Experimental] When enabled prevents logging of fields tagged as sensitive (passwords, keys, tokens). Runtime log sanitization may introduce significant computation overhead and therefore should not be enabled in production.`)</td> </del> <ins> <span class="text-muted">No description provided.</span> </td> </ins> </tr> </tbody> </table> <ins> ## `ResourceChangeDetectionStrategy`     {#kubelet-config-k8s-io-v1beta1-ResourceChangeDetectionStrategy} (Alias of `string`) **Appears in:** - [KubeletConfiguration](#kubelet-config-k8s-io-v1beta1-KubeletConfiguration) ResourceChangeDetectionStrategy denotes a mode in which internal managers (secret, configmap) are discovering object changes. </ins>
{{ $show := cond (or (lt $ulNr $ulShow) $activePath (and (not $shouldDelayActive) (eq $s.Parent $p.Parent)) (and (not $shouldDelayActive) (eq $s.Parent $p)) (and (not $shouldDelayActive) ($p.IsDescendant $s.Parent))) true false -}} {{ $mid := printf "m-%s" ($s.RelPermalink | anchorize) -}} {{ $pages_tmp := where (union $s.Pages $s.Sections).ByWeight ".Params.toc_hide" "!=" true -}} <ins> {{/* We get untranslated subpages below to make sure we build all levels of the sidenav in localizationed docs sets */}} {{ with site.Params.language_alternatives -}} {{ range . }} {{ with (where $.section.Translations ".Lang" . ) -}} {{ $p := index . 0 -}} {{ $pages_tmp = where ( $pages_tmp | lang.Merge (union $p.Pages $p.Sections)) ".Params.toc_hide" "!=" true -}} {{ end -}} {{ end -}} {{ end -}} </ins> {{ $pages := $pages_tmp | first $sidebarMenuTruncate -}} {{ $withChild := gt (len $pages) 0 -}} {{ $manualLink := cond (isset $s.Params "manuallink") $s.Params.manualLink ( cond (isset $s.Params "manuallinkrelref") (relref $s $s.Params.manualLinkRelref) $s.RelPermalink) -}}
<del> --- reviewers: - rickypai - thockin title: Adding entries to Pod /etc/hosts with HostAliases content_type: concept weight: 60 min-kubernetes-server-version: 1.7 --- <!-- overview --> Adding entries to a Pod's `/etc/hosts` file provides Pod-level override of hostname resolution when DNS and other options are not applicable. You can add these custom entries with the HostAliases field in PodSpec. Modification not using HostAliases is not suggested because the file is managed by the kubelet and can be overwritten on during Pod creation/restart. <!-- body --> ## Default hosts file content Start an Nginx Pod which is assigned a Pod IP: ```shell kubectl run nginx --image nginx ``` ``` pod/nginx created ``` Examine a Pod IP: ```shell kubectl get pods --output=wide ``` ``` NAME     READY     STATUS    RESTARTS   AGE    IP           NODE nginx    1/1       Running   0          13s    10.200.0.4   worker0 ``` The hosts file content would look like this: ```shell kubectl exec nginx -- cat /etc/hosts ``` ``` # Kubernetes-managed hosts file. 127.0.0.1	localhost ::1	localhost ip6-localhost ip6-loopback fe00::0	ip6-localnet fe00::0	ip6-mcastprefix fe00::1	ip6-allnodes fe00::2	ip6-allrouters 10.200.0.4	nginx ``` By default, the `hosts` file only includes IPv4 and IPv6 boilerplates like `localhost` and its own hostname. ## Adding additional entries with hostAliases In addition to the default boilerplate, you can add additional entries to the `hosts` file. For example: to resolve `foo.local`, `bar.local` to `127.0.0.1` and `foo.remote`, `bar.remote` to `10.1.2.3`, you can configure HostAliases for a Pod under `.spec.hostAliases`: {{< codenew file="service/networking/hostaliases-pod.yaml" >}} You can start a Pod with that configuration by running: ```shell kubectl apply -f https://k8s.io/examples/service/networking/hostaliases-pod.yaml ``` ``` pod/hostaliases-pod created ``` Examine a Pod's details to see its IPv4 address and its status: ```shell kubectl get pod --output=wide ``` ``` NAME                           READY     STATUS      RESTARTS   AGE       IP              NODE hostaliases-pod                0/1       Completed   0          6s        10.200.0.5      worker0 ``` The `hosts` file content looks like this: ```shell kubectl logs hostaliases-pod ``` ``` # Kubernetes-managed hosts file. 127.0.0.1	localhost ::1	localhost ip6-localhost ip6-loopback fe00::0	ip6-localnet fe00::0	ip6-mcastprefix fe00::1	ip6-allnodes fe00::2	ip6-allrouters 10.200.0.5	hostaliases-pod # Entries added by HostAliases. 127.0.0.1	foo.local	bar.local 10.1.2.3	foo.remote	bar.remote ``` with the additional entries specified at the bottom. ## Why does the kubelet manage the hosts file? {#why-does-kubelet-manage-the-hosts-file} The kubelet [manages](https://github.com/kubernetes/kubernetes/issues/14633) the `hosts` file for each container of the Pod to prevent Docker from [modifying](https://github.com/moby/moby/issues/17190) the file after the containers have already been started. {{< caution >}} Avoid making manual changes to the hosts file inside a container. If you make manual changes to the hosts file, those changes are lost when the container exits. {{< /caution >}} </del>