Optional Configuration in CDAP Custom Resource

In addition to the basic configuration mentioned in Installing CDAP on Kubernetes | Deploy CDAP , there are optional fields that can be added in the CDAP custom resource to enable additional features and control how CDAP services are deployed on Kubernetes. The Custom Resource Definition (CRD) contains all the supported settings. Some of the useful fields are listed here.

Name

Operator Version

Description

Usage

Name

Operator Version

Description

Usage

affinity

2.5.0+

Affinity describes node affinity scheduling rules for pods that run CDAP services. You can indicate that a rule is soft or preferred, so that the k8s scheduler still schedules the Pod even if it can't find a matching node.

With pod affinity/anti-affinity, you can constrain a Pod using labels on other Pods running on the node (or other topological domain), instead of just node labels, which allows you to define rules for which Pods can be co-located on a node.

The affinity field is similar to the one used by k8s for pods, deployments, replica sets etc. See k8s docs.

Assume you want AppFabric and Messaging services to be scheduled on separate nodes. If running the services on different nodes isn’t possible, you want the services to still get scheduled. This constraint can be represented using the following configuration in the CDAP custom resource:

appFabric: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchExpressions: - key: cdap.container.AppFabric operator: In values: - my-instance topologyKey: kubernetes.io/hostname weight: 1 ... messaging: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchExpressions: - key: cdap.container.Messaging operator: In values: - my-instance topologyKey: kubernetes.io/hostname weight: 1 ...

 

Created in 2020 by Google Inc.