Kf Apps can be deployed on dedicated nodes in the cluster. This feature is required if you have the circumstances where you might want more control on a node where an App Pod lands. For example:
- If you are sharing the same cluster for different Apps but want dedicated nodes for a particular App.
- If you want dedicated nodes for a given organization (Kf Space).
- If you want to target a specific operating system like Windows.
- If you want to co-locate Pods from two different services that frequently communicate.
To enable compute isolation, Kf uses the Kubernetes nodeSelector. 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 then land on the nodes with matching labels.
Configure nodeSelector in a Kf cluster
By default, compute isolation is disabled. Use the following procedure to configure labels and nodeSelector.
Add a label (
distype=ssd) on the node where you want your application pods to land.
kubectl label nodes nodeid disktype=ssd
Add the same label on the Kf Space. All Apps deployed in this Space will then land on the qualifying nodes.
kf configure-space set-nodeselector space-name disktype ssd
You can add multiple labels by running the same command again.
Check the label is configured.
kf configure-space get-nodeselector space-name
Delete the label from the space.
kf configure-space unset-nodeselector space-name disktype
Override nodeSelector for Kf stacks
Deployment of Kf Apps can be further targeted 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 override the
values configured on the Space.
To configure the
nodeSelector on a stack:
config-defaultsof your Kf cluster and add the labels.
$ kubectl -n kf edit configmaps config-defaults
nodeSelectorto the stacks definition.
..... ..... spaceStacksV2: | - name: cflinuxfs3 image: cloudfoundry/cflinuxfs3 nodeSelector: OS_KERNEL: LINUX_4.4.1 ..... .....