Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Le app Kf possono essere implementate su nodi dedicati nel cluster. Questa funzionalità è obbligatoria se ritieni di dover avere un maggiore controllo su un nodo in cui viene eseguito un pod di app. Ad esempio, se condividi lo stesso cluster per app diverse, ma vuoi nodi dedicati per una determinata app, se vuoi nodi dedicati per una determinata organizzazione(spazio Kf), per scegliere come target un sistema operativo specifico come Windows o per collocare in modo co-localizzato i pod di due servizi diversi che comunicano di frequente.
Per abilitare l'isolamento del calcolo, Kf utilizza nodeSelector di Kubernetes. Per utilizzare questa funzionalità, aggiungi prima le etichette ai nodi o ai node pool in cui vuoi che vengano caricati i pod di app, quindi aggiungi le stesse etichette idonee allo spazio Kf. Tutte le app installate in questo spazio verranno caricate sui nodi con le etichette corrispondenti.
Configurazione di nodeSelector in un cluster Kf
Per impostazione predefinita, l'isolamento del calcolo è disattivato. Utilizza la procedura riportata di seguito per configurare le etichette e nodeSelector.
Aggiungi un'etichetta (distype=ssd) al nodo in cui vuoi che vengano eseguiti i pod dell'applicazione.
kubectllabelnodesnodeiddisktype=ssd
Aggiungi la stessa etichetta allo spazio Kf. Tutte le app di cui è stato eseguito il deployment in questo spazio verranno quindi caricate sui nodi idonei.
Il deployment delle app Kf può essere ulteriormente scelto come target in base allo stack (buildpack) utilizzato per creare e pacchettizzare l'app. Ad esempio, se vuoi che le tue applicazioni create con spaceStacksV2 vengano caricate su nodi con il kernel Linux 4.4.1. I valori nodeSelector in uno stack sostituiranno i valori configurati nello spazio.
Per configurare nodeSelector su Stack.
Modifica il config-defaults del cluster Kf e aggiungi le etichette.
$ kubectl -n kf edit configmaps config-defaults
Aggiungi nodeSelector alla definizione degli stack.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[],[],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 ....."]]