Kf アプリは、クラスタ内の専用ノードにデプロイできます。アプリ Pod が存在するノードでよりきめ細かい管理が必要な場合、この機能が必要になります。例:
異なるアプリ間で同じクラスタを共有していても、特定のアプリで専用ノードが必要な場合。
特定の組織(Kf Space)に専用のノードが必要な場合。
Windows などの特定のオペレーティング システムをターゲットにする場合。
頻繁に通信を行う 2 つの異なるサービスの Pod を共存させる場合。
コンピューティングの分離を実現するため、Kf は Kubernetes nodeSelector を使用します。この機能を使用するには、まず、アプリ Pod を配置するノードまたはノードプールにラベルを追加し、同じ条件ラベルを Kf Space に追加します。この Space にインストールされているすべてのアプリが、一致するラベルを持つノードに配置されます。
Kf は各 Kf Build を実行する Kubernetes Pod を作成します。buildNodeSelector 機能を使用してコンピューティング リソースを分離し、Build Pod のみを実行できます。ユースケースの 1 つは、SSD を使用するノードでビルドするように Build Pod を分離し、他のノードで App Pod を実行することです。BuildNodeSelector 機能は、クラスタ内でのコンピューティング リソースの最適化と柔軟性を提供します。このページの「BuildNodeSelector と Build ノードプールの構成」をご覧ください。
ビルドノード セレクタは、Build Pod のノードセレクタをオーバーライドする場合にのみ有効です。App Pod には影響しません。たとえば、Space のノードセレクタと Kfsystem の Build ノードセレクタの両方を指定した場合、App Pod には Space ノードセレクタがあり、Buid Pod には Kfsystem の Build ノードセレクタがあります。ノードセレクタが Space のみで指定されている場合、App Pod と Build Pod の両方に Space からのノードセレクタが含まれます。
[[["わかりやすい","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 UTC。"],[],[],null,["# Enable compute isolation\n\nKf Apps can be deployed on dedicated nodes in the cluster.\nThis feature is required if you have the circumstances where you might want more\ncontrol on a node where an App Pod lands. For example:\n\n- If you are sharing the same cluster for different Apps but want dedicated nodes for a particular App.\n- If you want dedicated nodes for a given organization (Kf Space).\n- If you want to target a specific operating system like Windows.\n- If you want 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\nuse this feature, first add labels on the nodes or node pools where you want\nyour App Pods to land and then add the same qualifying labels on the Kf Space.\nAll the Apps installed in this Space then land on the nodes with matching labels.\n\nKf creates a Kubernetes pod to execute each Kf Build, the buildNodeSelector feature can be used to isolate compute resources to execute only the Build pods. One use case is to isolate Build pods to run on nodes with SSD, while running the App pods on other nodes. The BuildNodeSelectors feature provides compute resource optimization and flexibility in the cluster. Please refer to chapter 'Configure BuildNodeSelectors and a build node pool' on this page.\n\nConfigure 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.8/cli/kf-stacks)\n-------------------------------------------------------------------------\n\nDeployment of Kf Apps can be further targeted based\non what stack (buildpack) is being used to build and package the App. For\nexample, if you want your applications built with `spaceStacksV2` to land on\nnodes with Linux kernel 4.4.1., `nodeSelector` values on a stack override the\nvalues configured on the Space.\n\nTo configure the `nodeSelector` on a 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 .....\n\nConfigure BuildNodeSelectors and a Build node pool\n--------------------------------------------------\n\nBuild node selectors are only effective at overriding the node selectors for the Build pods, they do not affect App pods. For example, if you specify both the node selectors on the Space and the Build node selectors in Kfsystem, App pods will have the Space node selectors while the Build pods will have the Build node selectors from Kfsystem; if node selectors are only specified in the Space, both the App and Build pods will have the node selector from the Space.\n\n1. Add labels (`disktype:ssd` for example) on the nodes that you want your Build pods to be assigned to.\n\n kubectl label nodes \u003cvar translate=\"no\"\u003enodeid\u003c/var\u003e disktype=ssd\n\n2. Add/update Build node selectors (in the format of `key:value` pairs) by patching KfSystem CR.\n\n kubectl patch kfsystem kfsystem --type='json' -p='[{'op': 'replace', 'path': '/spec/kf/config/buildNodeSelectors', 'value': {\u003ckey\u003e:\u003cvalue\u003e}}]'\n\n For example, to add `disktype=ssd` as the Build node selector: \n\n kubectl patch kfsystem kfsystem --type='json' -p='[{'op': 'replace', 'path': '/spec/kf/config/buildNodeSelectors', 'value': {\"disktype\":\"ssd\"}}]'"]]