Support node/pod affinity, tolerations and topologySpreadConstraints that CNPG supports #717
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The PR will add a new API field called
affinity_configuration
that is a typeClusterAffinity
andtopology_spread_constraints
that is typeClusterTopologySpreadConstraints
from CNPG. This will allow us to directly support all of the node/pod affinity and toleration types that CNPG supports.The concept is that the control-plane will set the toleration/affinity when setting up the new instance, which we will just pass on to CNPG using their spec.
This change will move the default setting of
affinity
of CNPG fromcnpg_cluster_from_cdb
function into theCoreDB
API with our current defaultsThis will also do the same for the
Pooler
API and also theAppService
Deployments
.The
PlacementConfig
does a lot of work specifically around converting the types. So we take in theClusterAffinity
andClusterTopologySpreadConstraints
they get converted into native Kubernetes API's and placed inPlacementConfig
. ThePlacementConfig
has several methods that can convert the types to use with thePooler
or we can use the types directly in a normal KubernetesPod
orDeployment
if we wish.fixes: PLAT-431