Changing your deployment to use dedicated resources

After you provision Db2, you can set your Db2 deployment to use dedicated nodes.

Before you begin

You must complete the following tasks:
  1. Configure dedicated nodes to use for your deployment. For more information, see Setting up dedicated nodes for your Db2 deployment.
  2. Create a Db2 deployment and ensure it is in Ready state. For more information, see Creating a service instance for Db2.

Procedure

  1. Run the following command to patch your Db2uCluster or Db2uInstance :
    oc patch db2ucluster <instance_id> -n ${PROJECT_CPD_INST_OPERANDS} --type merge -p '{"spec":{"affinity":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"icp4data","operator":"In","values":["<label_name>"]}]}]}}},"tolerations":[{"effect":"NoSchedule","key":"icp4data","operator":"Equal","value":"<dedicated_specifier>"}]}}'
    oc patch db2uinstance <instance_id> -n ${PROJECT_CPD_INST_OPERANDS} --type merge -p '{"spec":{"affinity":{"nodeAffinity":{"requiredDuringSchedulingIgnoredDuringExecution":{"nodeSelectorTerms":[{"matchExpressions":[{"key":"icp4data","operator":"In","values":["<label_name>"]}]}]}}},"tolerations":[{"effect":"NoSchedule","key":"icp4data","operator":"Equal","value":"<dedicated_specifier>"}]}}'
  2. Run the following commands to verify that the deployment is now using dedicated nodes:
    oc get sts c-<instance_id>-db2u -n ${PROJECT_CPD_INST_OPERANDS} -oyaml | grep <dedicated_specifier>
    oc get sts c-<instance_id>-etcd -n ${PROJECT_CPD_INST_OPERANDS} -oyaml | grep <dedicated_specifier>

    See the following example output:

    value: <dedicated_specifier>

    Where <dedicated_specifier> is the assigned label of the node that is dedicated to the deployment.