Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACM-18034: Doc resourceRequirements add-on configuration #7528

Open
wants to merge 5 commits into
base: 2.13_stage
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion add-ons/addon_overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
With {acm} klusterlet add-ons, you can further configure your managed clusters to improve performance and add functionality to your applications. See the following enablement options:

* xref:../add-ons/klusterlet_managed.adoc#add-ons-klusterlet[Enabling klusterlet add-ons on clusters for cluster management]
* xref:../add-ons/configure_nodeselector_tolerations_addons.adoc#configure-nodeselector-tolerations-addons[Configuring nodeSelectors and tolerations for klusterlet add-ons]
* xref:../add-ons/configure_klusterlet_addons.adoc#configure-klusterlet_addons[Configuring klusterlet add-ons]
* xref:../add-ons/cluster_wide_proxy.adoc#enable-cluster-wide-proxy-addon[Enabling cluster-wide proxy on existing cluster add-ons]
134 changes: 134 additions & 0 deletions add-ons/configure_klusterlet_addons.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
[#configure-klusterlet-addons]
= Configuring klusterlet add-ons

In {acm-short}, you can configure the following klusterlet add-ons to improve the performance and functionality of your managed clusters:

* application-manager
* cert-policy-controller
* cluster-proxy
* config-policy-controller
* governance-policy-framework
* hypershift-addon
* managed-serviceaccount
* observability-controller
* search-collector
* submariner
* volsync
* work-manager

// This note only applies to ACM 2.13 and should be removed in ACM 2.14.
*Note:* Configuring `resourceRequirements` is only available for the following add-ons:

* cert-policy-controller
* config-policy-controller
* governance-policy-framework

[#setting-addondeploymentconfig-klusterlet-addons]
== Setting up the _AddOnDeploymentConfig_ to configure klusterlet add-ons

When you configure the klusterlet add-ons, you can apply specifications to all the add-ons on each of your managed clusters, such as the `nodeSelector` and `tolerations`. To configure the klusterlet add-on, complete the following steps:

. Use the `AddonDeploymentConfig` API to create an add-on configuration in any namespace on the hub cluster.

. Create a file named `addondeploymentconfig.yaml` with the following template:

+
[source,yaml]
----
apiVersion: addon.open-cluster-management.io/v1alpha1
kind: AddOnDeploymentConfig
metadata:
name: config-name <1>
namespace: config-name-space <2>
spec:
nodePlacement:
nodeSelector: node-selector <3>
tolerations: tolerations <4>
resourceRequirements: <5>
- containerID: "<workload-kind>:<workload-name>:<container-name>" <6>
resources:
requests:
memory: 75Mi
limits:
memory: 150Mi
----
+
<1> Replace `config-name` with the name of the `AddonDeploymentConfig` that you created.
<2> Replace `config-namespace` with the namespace of the `AddonDeploymentConfig` that you created.
<3> Replace `node-selector` with your node selector.
<4> Replace `tolerations` with your tolerations.
// The note here only applies to ACM 2.13 and should be removed in ACM 2.14.
<5> *Note:* Configuring `resourceRequirements` is only available for policy add-ons. List resource requirements here to override the `resources` of the add-on workload containers. If an add-on container matches more than one of the items in the list, the last matching configuration is applied.
<6> Replace `<workload-kind>` with the kind of workload, for example: `deployment`. Replace `<workload-name>` with the name of the workload. Replace `<container-name>` with the name of the container.
.. For any of these values, you can use `\*` attribute to apply the configuration to all objects managed by the add-on. For example, if you used the `\*:\*:\*` attribute , it would apply the configuration to every container of every workload kind in any add-on the configuration is attached to.
+
A completed `AddOnDeployment` resembles the following example:
+
[source,yaml]
----
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
----


[#configuring-klusterlet-addons-all-managedclusters]
== Configuring a klusterlet add-on for all managed clusters

After you set up the `AddOnDeploymentConfig`, you can configure it with the `ClusterManagementAddOn` which then applies this add-on to all your managed clusters attached to the hub cluster. To configure a klusterlet add-on for all managed clusters, complete the following steps:

. Apply the `AddOnDeploymentConfig` file to your klusterlet add-on by running the following command:
+
[source,bash]
----
oc apply -f addondeploymentconfig
----

. Use the configuration that you created as the global default configuration for your add-on by running the following command:
+
[source,bash]
----
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 created.
* Replace `<config-namespace>` with the namespace of the `AddonDeploymentConfig` that you created.

[#configuring-klusterlet-addons-single-managedclusters]
== Configuring a klusterlet add-on for a single managed cluster

You can also override the global default `AddonDeploymentConfig` configuration for your add-on on a certain managed cluster. By overriding, you can configure a klusterlet add-on for a single managed cluster because the add-on only applies to a the particular managed cluster attached to that namespace of that hub cluster. To override configurations, complete the following steps:

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

. Connect the new configuration that you created to your `ManagedClusterAddon` add-on on the managed cluster by running the following command:
+
[source,bash]
----
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 created
* Replace `config-name` with the name of the `AddonDeploymentConfig` that you created
+

The new configuration that you referenced in the `ManagedClusterAddon` add-on overrides the global default configuration that you defined earlier in the `ClusterManagementAddon` add-on.

To make sure that you can deploy your content to the correct nodes, see link:../clusters/cluster_lifecycle/adv_config_cluster.adoc#config-klusterlet-nodes[Optional: Configuring the klusterlet to run on specific nodes].
102 changes: 0 additions & 102 deletions add-ons/configure_nodeselector_tolerations_addons.adoc

This file was deleted.

2 changes: 1 addition & 1 deletion add-ons/main.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ include::modules/common-attributes.adoc[]

include::addon_overview.adoc[leveloffset=+1]
include::klusterlet_managed.adoc[leveloffset=+2]
include::configure_nodeselector_tolerations_addons.adoc[leveloffset=+2]
include::configure_klusterlet_addons.adoc[leveloffset=+2]
include::cluster_wide_proxy.adoc[leveloffset=+2]
2 changes: 1 addition & 1 deletion clusters/cluster_lifecycle/adv_config_cluster.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ metadata:
open-cluster-management/tolerations: '[{"key":"dedicated","operator":"Equal","value":"acm","effect":"NoSchedule"}]'
----

. To make sure your content is deployed to the correct nodes, complete the steps in link:../../add-ons/configure_nodeselector_tolerations_addons.adoc#configure-nodeselector-tolerations-addons[Configuring nodeSelectors and tolerations for klusterlet add-ons].
. To make sure that you can deploy your content to the correct nodes, see link:../../add-ons/configure_klusterlet_addons.adoc#configure-klusterlet_addons[Configuring klusterlet add-ons].

[#custom-server-url-ca]
== Customizing the server URL and CA bundle of the hub cluster API server when importing a managed cluster (Technology Preview)
Expand Down
2 changes: 1 addition & 1 deletion clusters/release_notes/mce_known_issues.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ If the `managed-serviceaccount` add-on is required, you can work around the issu

. Update the `managed-serviceaccount` `ManagedClusterAddon` in the local cluster namespace to use the `addonDeploymentConfig` custom resource you created.

See link:../../add-ons/configure_nodeselector_tolerations_addons.adoc#configure-nodeselector-tolerations-addons[Configuring nodeSelectors and tolerations for klusterlet add-ons] to learn more about how to use the `addonDeploymentConfig` custom resource to configure `tolerations` and `nodeSelector` for add-ons.
To learn more about how to use the `addonDeploymentConfig` custom resource to configure `tolerations` and `nodeSelector` for add-on, see link:../../add-ons/configure_klusterlet_addons.adoc#configure-klusterlet_addons[Configuring klusterlet add-ons].

[#nodes-shut-down-bmh]
=== Nodes shut down after removing `BareMetalHost` resource
Expand Down