Selecting clusters
TALM builds a remediation plan and selects clusters based on the following fields:
-
The
clusterLabelSelectorfield specifies the labels of the clusters that you want to update. This consists of a list of the standard label selectors fromk8s.io/apimachinery/pkg/apis/meta/v1. Each selector in the list uses either label value pairs or label expressions. Matches from each selector are added to the final list of clusters along with the matches from theclusterSelectorfield and theclusterfield. -
The
clustersfield specifies a list of clusters to update. -
The
canariesfield specifies the clusters for canary updates. -
The
maxConcurrencyfield specifies the number of clusters to update in a batch. -
The
actionsfield specifiesbeforeEnableactions that TALM takes as it begins the update process, andafterCompletionactions that TALM takes as it completes policy remediation for each cluster.
You can use the clusters, clusterLabelSelector, and clusterSelector fields together to create a combined list of clusters.
The remediation plan starts with the clusters listed in the canaries field. Each canary cluster forms a single-cluster batch.
ClusterGroupUpgrade CR with the enabled field set to falseapiVersion: ran.openshift.io/v1alpha1
kind: ClusterGroupUpgrade
metadata:
creationTimestamp: '2022-11-18T16:27:15Z'
finalizers:
- ran.openshift.io/cleanup-finalizer
generation: 1
name: talm-cgu
namespace: talm-namespace
resourceVersion: '40451823'
uid: cca245a5-4bca-45fa-89c0-aa6af81a596c
Spec:
actions:
afterCompletion:
addClusterLabels:
upgrade-done: ""
deleteClusterLabels:
upgrade-running: ""
deleteObjects: true
beforeEnable:
addClusterLabels:
upgrade-running: ""
clusters:
- spoke1
enable: false
managedPolicies:
- talm-policy
preCaching: false
remediationStrategy:
canaries:
- spoke1
maxConcurrency: 2
timeout: 240
clusterLabelSelectors:
- matchExpressions:
- key: label1
operator: In
values:
- value1a
- value1b
batchTimeoutAction:
status:
computedMaxConcurrency: 2
conditions:
- lastTransitionTime: '2022-11-18T16:27:15Z'
message: All selected clusters are valid
reason: ClusterSelectionCompleted
status: 'True'
type: ClustersSelected
- lastTransitionTime: '2022-11-18T16:27:15Z'
message: Completed validation
reason: ValidationCompleted
status: 'True'
type: Validated
- lastTransitionTime: '2022-11-18T16:37:16Z'
message: Not enabled
reason: NotEnabled
status: 'False'
type: Progressing
managedPoliciesForUpgrade:
- name: talm-policy
namespace: talm-namespace
managedPoliciesNs:
talm-policy: talm-namespace
remediationPlan:
- - spoke1
- - spoke2
- spoke3
status:
-
Spec.actions.afterCompletionspecifies the action that TALM takes when it completes policy remediation for each cluster. -
Spec.actions.beforeEnablespecifies the action that TALM takes as it begins the update process. -
Spec.clustersdefines the list of clusters to update. -
Spec.enabletheenablefield is set tofalse. -
Spec.managedPolicieslists the user-defined set of policies to remediate. -
Spec.remediationStrategydefines the specifics of the cluster updates. -
Spec.preCaching.canariesdefines the clusters for canary updates. -
Spec.preCaching.maxConcurrencydefines the maximum number of concurrent updates in a batch. The number of remediation batches is the number of canary clusters, plus the number of clusters, except the canary clusters, divided by themaxConcurrencyvalue. The clusters that are already compliant with all the managed policies are excluded from the remediation plan. -
Spec.clusterLabelSelectorsdisplays the parameters for selecting clusters. -
Spec.batchTimeoutActioncontrols what happens if a batch times out. Possible values areabortorcontinue. If unspecified, the default iscontinue. -
statusdisplays information about the status of the updates. -
Spec.preCaching.conditions.typetheClustersSelectedcondition shows that all selected clusters are valid. -
Spec.preCaching.conditions.typetheValidatedcondition shows that all selected clusters have been validated.
|
|
Any failures during the update of a canary cluster stops the update process. |
When the remediation plan is successfully created, you can you set the enable field to true and TALM starts to update the non-compliant clusters with the specified managed policies.
|
|
You can only make changes to the |