ClusterTaintPolicy v1alpha1
apiVersion: policy.karmada.io/v1alpha1
import "github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1"
ClusterTaintPolicy
ClusterTaintPolicy automates taint management on Cluster objects based on declarative conditions. The system evaluates AddOnConditions to determine when to add taints, and RemoveOnConditions to determine when to remove taints. AddOnConditions are evaluated before RemoveOnConditions. Taints are NEVER automatically removed when the ClusterTaintPolicy is deleted.
apiVersion: policy.karmada.io/v1alpha1
kind: ClusterTaintPolicy
metadata (ObjectMeta)
spec (ClusterTaintPolicySpec), required
Spec represents the desired behavior of ClusterTaintPolicy.
ClusterTaintPolicySpec
ClusterTaintPolicySpec represents the desired behavior of ClusterTaintPolicy.
taints ([]Taint), required
Taints specifies the taints that need to be added or removed on the cluster object which match with TargetClusters. If the Taints is modified, the system will process the taints based on the latest value of Taints during the next condition-triggered execution, regardless of whether the taint has been added or removed.
Taint describes the taint that needs to be applied to the cluster.
taints.effect (string), required
Effect represents the taint effect to be applied to a cluster.
Possible enum values:
"NoExecute"
Evict any already-running pods that do not tolerate the taint. Currently enforced by NodeController."NoSchedule"
Do not allow new pods to schedule onto the node unless they tolerate the taint, but allow all pods submitted to Kubelet without going through the scheduler to start, and allow all already-running pods to continue running. Enforced by the scheduler."PreferNoSchedule"
Like TaintEffectNoSchedule, but the scheduler tries not to schedule new pods onto the node, rather than prohibiting new pods from scheduling onto the node entirely. Enforced by the scheduler.
taints.key (string), required
Key represents the taint key to be applied to a cluster.
taints.value (string)
Value represents the taint value corresponding to the taint key.
addOnConditions ([]MatchCondition)
AddOnConditions defines the conditions to match for triggering the controller to add taints on the cluster object. The match conditions are ANDed. If AddOnConditions is empty, no taints will be added.
MatchCondition represents the condition match detail of activating the failover relevant taints on target clusters.
addOnConditions.conditionType (string), required
ConditionType specifies the ClusterStatus condition type.
addOnConditions.operator (string), required
Operator represents a relationship to a set of values. Valid operators are In, NotIn.
addOnConditions.statusValues ([]string), required
StatusValues is an array of metav1.ConditionStatus values. The item specifies the ClusterStatus condition status.
removeOnConditions ([]MatchCondition)
RemoveOnConditions defines the conditions to match for triggering the controller to remove taints from the cluster object. The match conditions are ANDed. If RemoveOnConditions is empty, no taints will be removed.
MatchCondition represents the condition match detail of activating the failover relevant taints on target clusters.
removeOnConditions.conditionType (string), required
ConditionType specifies the ClusterStatus condition type.
removeOnConditions.operator (string), required
Operator represents a relationship to a set of values. Valid operators are In, NotIn.
removeOnConditions.statusValues ([]string), required
StatusValues is an array of metav1.ConditionStatus values. The item specifies the ClusterStatus condition status.
targetClusters (ClusterAffinity)
TargetClusters specifies the clusters that ClusterTaintPolicy needs to pay attention to. For clusters that no longer match the TargetClusters, the taints will be kept unchanged. If targetClusters is not set, any cluster can be selected.
ClusterAffinity represents the filter to select clusters.
targetClusters.clusterNames ([]string)
ClusterNames is the list of clusters to be selected.
targetClusters.exclude ([]string)
ExcludedClusters is the list of clusters to be ignored.
targetClusters.fieldSelector (FieldSelector)
FieldSelector is a filter to select member clusters by fields. The key(field) of the match expression should be 'provider', 'region', or 'zone', and the operator of the match expression should be 'In' or 'NotIn'. If non-nil and non-empty, only the clusters match this filter will be selected.
FieldSelector is a field filter.
targetClusters.fieldSelector.matchExpressions ([][NodeSelectorRequirement](../common-definitions/node-selector-requirement#nodeselectorrequirement))
A list of field selector requirements.
targetClusters.labelSelector (LabelSelector)
LabelSelector is a filter to select member clusters by labels. If non-nil and non-empty, only the clusters match this filter will be selected.
ClusterTaintPolicyList
ClusterTaintPolicyList contains a list of ClusterTaintPolicy
apiVersion: policy.karmada.io/v1alpha1
kind: ClusterTaintPolicyList
metadata (ListMeta)
items ([][ClusterTaintPolicy](../policy-resources/cluster-taint-policy-v1alpha1#clustertaintpolicy)), required
Operations
get
read the specified ClusterTaintPolicy
HTTP Request
GET /apis/policy.karmada.io/v1alpha1/clustertaintpolicies/{name}
Parameters
name (in path): string, required
name of the ClusterTaintPolicy
pretty (in query): string
Response
200 (ClusterTaintPolicy): OK
get
read status of the specified ClusterTaintPolicy
HTTP Request
GET /apis/policy.karmada.io/v1alpha1/clustertaintpolicies/{name}/status
Parameters
name (in path): string, required
name of the ClusterTaintPolicy
pretty (in query): string
Response
200 (ClusterTaintPolicy): OK
list
list or watch objects of kind ClusterTaintPolicy
HTTP Request
GET /apis/policy.karmada.io/v1alpha1/clustertaintpolicies
Parameters
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
Response
200 (ClusterTaintPolicyList): OK
create
create a ClusterTaintPolicy
HTTP Request
POST /apis/policy.karmada.io/v1alpha1/clustertaintpolicies
Parameters
- body: ClusterTaintPolicy, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
Response
200 (ClusterTaintPolicy): OK
201 (ClusterTaintPolicy): Created
202 (ClusterTaintPolicy): Accepted
update
replace the specified ClusterTaintPolicy
HTTP Request
PUT /apis/policy.karmada.io/v1alpha1/clustertaintpolicies/{name}
Parameters
name (in path): string, required
name of the ClusterTaintPolicy
body: ClusterTaintPolicy, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
Response
200 (ClusterTaintPolicy): OK
201 (ClusterTaintPolicy): Created
update
replace status of the specified ClusterTaintPolicy
HTTP Request
PUT /apis/policy.karmada.io/v1alpha1/clustertaintpolicies/{name}/status
Parameters
name (in path): string, required
name of the ClusterTaintPolicy
body: ClusterTaintPolicy, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
Response
200 (ClusterTaintPolicy): OK
201 (ClusterTaintPolicy): Created
patch
partially update the specified ClusterTaintPolicy
HTTP Request
PATCH /apis/policy.karmada.io/v1alpha1/clustertaintpolicies/{name}
Parameters
name (in path): string, required
name of the ClusterTaintPolicy
body: Patch, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
force (in query): boolean
pretty (in query): string
Response
200 (ClusterTaintPolicy): OK
201 (ClusterTaintPolicy): Created
patch
partially update status of the specified ClusterTaintPolicy
HTTP Request
PATCH /apis/policy.karmada.io/v1alpha1/clustertaintpolicies/{name}/status
Parameters
name (in path): string, required
name of the ClusterTaintPolicy
body: Patch, required
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
force (in query): boolean
pretty (in query): string
Response
200 (ClusterTaintPolicy): OK
201 (ClusterTaintPolicy): Created
delete
delete a ClusterTaintPolicy
HTTP Request
DELETE /apis/policy.karmada.io/v1alpha1/clustertaintpolicies/{name}
Parameters
name (in path): string, required
name of the ClusterTaintPolicy
body: DeleteOptions
dryRun (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
pretty (in query): string
propagationPolicy (in query): string
Response
200 (Status): OK
202 (Status): Accepted
deletecollection
delete collection of ClusterTaintPolicy
HTTP Request
DELETE /apis/policy.karmada.io/v1alpha1/clustertaintpolicies
Parameters
- body: DeleteOptions
continue (in query): string
dryRun (in query): string
fieldSelector (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
labelSelector (in query): string
limit (in query): integer
pretty (in query): string
propagationPolicy (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
Response
200 (Status): OK