Kf 應用程式可部署在叢集中的專屬節點。如果您需要在應用程式 pod 所在的節點上享有更多控制權,就必須使用這項功能。舉例來說,如果您要為不同的應用程式共用同一個叢集,但希望為特定應用程式提供專屬節點,或是要為特定機構(Kf Space) 提供專屬節點、指定 Windows 等特定作業系統,或是將兩個經常通訊的不同服務的 Pod 放置在同一位置,
為了啟用運算分隔,Kf 會使用 Kubernetes nodeSelector。如要使用這項功能,請先在您希望應用程式 Pod 降落的節點或節點集區中新增標籤,然後在 Kf 空間中新增相同的符合條件標籤。此時,在這個空間中安裝的所有應用程式都會連至標籤相符的節點。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Compute Isolation\n\nKf Apps can be deployed on dedicated nodes in the cluster. This feature is required if you have the circumstances where you may want more control on a node where an App pod lands. For example, if you are sharing a same cluster for different Apps but want dedicated nodes for a particular App, if you want dedicated nodes for a given organization(Kf Space), to target a specific operating system like Windows, or to co-locate pods from two different services that frequently communicate.\n\nTo enable compute isolation, Kf uses the Kubernetes [nodeSelector](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node). To use this feature, first add labels on the nodes or node pools where you want your App pods to land and then add the same qualifying labels on the Kf Space. All the Apps installed in this Space will then land on the nodes with matching labels.\n\nConfiguring nodeSelector in a Kf cluster\n----------------------------------------\n\nBy default, compute isolation is disabled. Use the following procedure\nto configure labels and nodeSelector.\n\n1. Add a label (`distype=ssd`) on the node where you want your application pods to\n land.\n\n kubectl label nodes \u003cvar translate=\"no\"\u003enodeid\u003c/var\u003e disktype=ssd \n\n2. Add the same label on the Kf Space. All Apps deployed in this Space\n will then land on the qualifying nodes.\n\n kf configure-space set-nodeselector \u003cvar translate=\"no\"\u003espace-name\u003c/var\u003e disktype ssd\n\n You can add multiple labels by running the same command again.\n3. Check the label is configured.\n\n kf configure-space get-nodeselector \u003cvar translate=\"no\"\u003espace-name\u003c/var\u003e\n\n4. Delete the label from the space.\n\n kf configure-space unset-nodeselector \u003cvar translate=\"no\"\u003espace-name\u003c/var\u003e disktype\n\nOverride nodeSelector for [kf Stacks](/migrate/kf/docs/2.2/cli/kf-stacks)\n-------------------------------------------------------------------------\n\nDeployment of Kf Apps can be further taregetted based on what Stack (buildpack) is being used to build and package the App. For example, if you want your applications built with `spaceStacksV2` to land on nodes with Linux kernel 4.4.1. `nodeSelector` values on a Stack will override the values configured on the Space.\n\nTo configure the `nodeSelector` on Stack.\n\n1. Edit the `config-defaults` of your Kf cluster and add the labels.\n\n $ kubectl -n kf edit configmaps config-defaults\n\n2. Add `nodeSelector` to the stacks definition.\n\n .....\n .....\n spaceStacksV2: |\n - name: cflinuxfs3\n image: cloudfoundry/cflinuxfs3\n nodeSelector:\n OS_KERNEL: LINUX_4.4.1 \n .....\n ....."]]