Compute Isolation

Kf 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.

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 will then land on the nodes with matching labels.

Configuring nodeSelector in a Kf cluster

By default, compute isolation is disabled. Use the following procedure to configure labels and nodeSelector.

  1. Add a label (distype=ssd) on the node where you want your application pods to land.

    kubectl label nodes nodeid disktype=ssd 
  2. 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.

  3. Check the label is configured.

    kf configure-space get-nodeselector space-name
  4. 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 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.

To configure the nodeSelector on Stack.

  1. Edit the config-defaults of your Kf cluster and add the labels.

    $ kubectl -n kf edit configmaps config-defaults
    
  2. Add nodeSelector to the stacks definition.

    .....
    .....
    spaceStacksV2: |
    - name:  cflinuxfs3
            image: cloudfoundry/cflinuxfs3
            nodeSelector:
                  OS_KERNEL: LINUX_4.4.1 
    .....
    .....