Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-4863

Doc draft: Support configuring nodeSelector and tolerations for foundation add-ons

XMLWordPrintable

    • 4
    • False
    • Hide

      None

      Show
      None
    • False
    • No

      Create an informative issue (See each section, incomplete templates/issues won't be triaged)

      Using the current documentation as a model, please complete the issue template. 

      Note: Doc team updates the current version and the two previous versions (n-2). For earlier versions, we will address only high-priority, customer-reported issues for releases in support.

      Prerequisite: Start with what we have

      Always look at the current documentation to describe the change that is needed. Use the source or portal link for Step 3:

       - Use the Customer Portal: https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/2.7

       - Use the GitHub link to find the staged docs in the repository: https://github.com/stolostron/rhacm-docs 

       

      It is a new component, so there is nothing in the ACM documentation to base it on.

      Describe the changes in the doc and link to your dev story

      Provide info for the following steps:

      1. - [ X ] Mandatory Choose the documentation release (Published releases are refreshed ~weekly after publication). 
           
            - [ ] ACM 2.4
            - [ ] ACM 2.5
            - [ ] ACM 2.6
            - [ ]ACM 2.7
            - [ X ]ACM 2.8 (upcoming release)

            - [ ] MCE 2.0
            - [ ] MCE 2.1 
            - [ X ] MCE 2.2 (upcoming release)

       

      (please note its an ACM only component, will not be part of MCE)
         

      2. - [ X ] Mandatory Choose the type of documentation change.

            - [ X ] New topic in an existing section or new section
            - [ ] Update to an existing topic

      3. - [ ] Mandatory for bugs: What is the diff? Clearly define what the problem is, what the change is, and link to the current documentation:

      4. - [ X ] Mandatory for GA content:

      Add a new topic in https://github.com/stolostron/rhacm-docs/tree/2.8_stage/add-on

       

      Configure nodeSelector and tolerations for Red Hat Advanced Cluster Management for Kubernetes add-ons 

      1.  Use `AddonDeploymentConfig` API to create a configuration to specify the `nodeSelector` and `tolerations` on a certain namespace on the hub cluster 

            ```
            cat <<EOF | oc apply -f -
            apiVersion: addon.open-cluster-management.io/v1alpha1
            kind: AddOnDeploymentConfig
            metadata:
              name: <config-name>
              namespace: <config-name-space>
            spec:
              nodePlacement:
                nodeSelector: <node-selector>
                tolerations: <tolerations>
            EOF
            ``` 

            Replace `config-name` with the name of the `AddonDeploymentConfig` that you just created
            Replace `config-namespace` with the namespace of the `AddonDeploymentConfig` that you just created
            Replace `node-selector` with your node selector
            Replace `tolerations` with your tolerations

            for example

            ```
            cat <<EOF | oc apply -f -
            apiVersion: addon.open-cluster-management.io/v1alpha1
            kind: AddOnDeploymentConfig
            metadata:
              name: deploy-config
              namespace: open-cluster-management-hub
            spec:
              nodePlacement:
                nodeSelector: 
                    "node-dedicated": "acm-addon"
                tolerations:
                - effect: NoSchedule
                   key: node-dedicated
                   value: acm-addon
                   operator: Equal
            EOF
            ```

      2. Use the configuration that you just created as the global  default configuration for your add-on

            ```
            oc patch clustermanagementaddons <addon-name> --type='json' -p='[{"op":"add", "path":"/spec/supportedConfigs", "value":[\{"group":"addon.open-cluster-management.io","resource":"addondeploymentconfigs", "defaultConfig":{"name":"<config-name>","namespace":"<config-namespace>"}}]}]'
            ```

            Replace `addon-name` with your add-on name
            Replace `config-name` with the name of the `AddonDeploymentConfig` that you just created
            Replace `config-namespace` with the namespace of the `AddonDeploymentConfig` that you just created

            After these, the `nodeSelector` and `tolerations` that you specified will be applied to your add-on on all managed clusters.

            You can also override the global default `AddonDeploymentConfig` configuration for your add-on on a certain managed cluster by using following steps

            1. Use `AddonDeploymentConfig` API to create another configuration to specify the `nodeSelector` and `tolerations` on the hub cluster 

            2. Reference the new configuration that you just created to your add-on `ManagedClusterAddon` on a managed cluster that you specified

            ```
            oc -n <managed-cluster> patch managedclusteraddons <addon-name> --type='json' -p='[{"op":"add", "path":"/spec/configs", "value":[

      {"group":"addon.open-cluster-management.io","resource":"addondeploymentconfigs","namespace":"<config-namespace>","name":"<config-name>"}

      ]}]'
            ```

            Replace `managed-cluster` with your managed cluster name
            Replace `addon-name` with your add-on name
            Replace `config-namespace` with the namespace of the `AddonDeploymentConfig` that you just created
            Replace `config-name` with the name of the `AddonDeploymentConfig` that you just created

            After these, the new configuration that you referenced in the  add-on `ManagedClusterAddon` will override the global default configuration that you defined in add-on `ClusterManagementAddon` previously

          

             - [ X ] Add link to dev story here:

      https://issues.redhat.com/browse/ACM-2200

       

         - Errata release note version, this is NOT for regular refreshes: 
            (published with Errata release)
        
            - [ ] ACM 2.4.x
            - [ ] ACM 2.5.x
            - [ ] ACM 2.6.x

            - [ ] MCE 2.0.x

            - [ ] MCE 2.1.x

              chrisadawson Christopher Dawson
              wliu1 Wei Liu
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: