Este conteúdo não está disponível no idioma selecionado.
Add-ons
Access information about klusterlet add-ons.
Abstract
Chapter 1. Managed cluster advanced configuration Copiar o linkLink copiado para a área de transferência!
With Red Hat Advanced Cluster Management for Kubernetes klusterlet add-ons, you can further configure your managed clusters to improve performance and add functionality to your applications. See the following enablement options:
1.1. Enabling klusterlet add-ons on clusters for cluster management Copiar o linkLink copiado para a área de transferência!
After you install Red Hat Advanced Cluster Management for Kubernetes and then create or import clusters with multicluster engine operator you can enable the klusterlet add-ons for those managed clusters. The klusterlet add-ons are not enabled by default if you created or imported clusters unless you create or import with the Red Hat Advanced Cluster Management console. See the following available klusterlet add-ons:
- application-manager
- cert-policy-controller
- config-policy-controller
- governance-policy-framework
- search-collector
Complete the following steps to enable the klusterlet add-ons for the managed clusters after Red Hat Advanced Cluster Management is installed:
Create a YAML file that is similar to the following
KlusterletAddonConfig, with thespecvalue that represents the add-ons:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The
policy-controlleradd-on is divided into two add-ons: Thegovernance-policy-frameworkand theconfig-policy-controller. As a result, thepolicyControllercontrols thegovernance-policy-frameworkand theconfig-policy-controllermanagedClusterAddons.
-
Save the file as
klusterlet-addon-config.yaml. Apply the YAML by running the following command on the hub cluster:
oc apply -f klusterlet-addon-config.yaml
oc apply -f klusterlet-addon-config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow To verify whether the enabled
managedClusterAddonsare created after theKlusterletAddonConfigis created, run the following command:oc get managedclusteraddons -n <cluster namespace>
oc get managedclusteraddons -n <cluster namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2. Configuring klusterlet add-ons Copiar o linkLink copiado para a área de transferência!
In Red Hat Advanced Cluster Management, 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
Important: For Red Hat Advanced Cluster Management version 2.13, you can only configure resourceRequirements for the following add-ons:
- cert-policy-controller
- config-policy-controller
- governance-policy-framework
1.2.1. Setting up the AddOnDeploymentConfig to configure klusterlet add-ons Copiar o linkLink copiado para a área de transferência!
When you configure the klusterlet add-ons, you can apply specifications to any of 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
AddonDeploymentConfigAPI to create an add-on configuration in any namespace on the hub cluster. Create a file named
addondeploymentconfig.yamlwith the following template:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
config-namewith the name of theAddonDeploymentConfigthat you created. - 2
- Replace
config-namespacewith the namespace of theAddonDeploymentConfigthat you created. - 3
- Replace
<node-selector>with your node selector. - 4
- Replace
<tolerations>with your tolerations. - 5
- Note: For Red Hat Advanced Cluster Management version 2.13, you can only configure
resourceRequirementsfor policy add-ons. List resource requirements here to override theresourcesof 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
AddOnDeploymentConfigresembles the following example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
1.2.2. Configuring a klusterlet add-on for all managed clusters Copiar o linkLink copiado para a área de transferência!
After you set up the AddOnDeploymentConfig, you can configure it with the ClusterManagementAddOn which then applies this add-on configuration to all your managed clusters that are attached to the hub cluster. To configure a klusterlet add-on for all managed clusters, complete the following steps:
Apply the
AddOnDeploymentConfigfile to your klusterlet add-on by running the following command:oc apply -f addondeploymentconfig.yaml
oc apply -f addondeploymentconfig.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Connect the new configuration that you created to an add-on for all of your managed clusters by patching the
ClusterManagementAddOnresource. Run the following command to patch thespec.supportedConfigsparameter in theClusterManagementAddOnto point to the new configuration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
<addon-name>with your add-on name. -
Replace
<config-name>with the name of theAddonDeploymentConfigthat you created. -
Replace
<config-namespace>with the namespace of theAddonDeploymentConfigthat you created.
-
Replace
1.2.3. Configuring a klusterlet add-on for a single managed cluster Copiar o linkLink copiado para a área de transferência!
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 configuration only applies to a the particular managed cluster attached to that namespace of the hub cluster. To override configurations, complete the following steps:
-
Use the
AddonDeploymentConfigAPI to create another configuration to specify thenodeSelectorandtolerationson the hub cluster. Connect the new configuration that you created to your
ManagedClusterAddOnadd-on on the hub cluster in the managed cluster namespace. Run the following command to patch thespec.configsparameter in theManagedClusterAddOnto point to the new configuration:Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Replace
managed-clusterwith your managed cluster name -
Replace
addon-namewith your add-on name -
Replace
config-namespacewith the namespace of theAddonDeploymentConfigthat you created -
Replace
config-namewith the name of theAddonDeploymentConfigthat you created
-
Replace
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 Optional: Configuring the klusterlet to run on specific nodes.
1.3. Enabling cluster-wide proxy on existing cluster add-ons Copiar o linkLink copiado para a área de transferência!
You can configure the KlusterletAddonConfig in the cluster namespace to add the proxy environment variables to all the klusterlet add-on pods of the managed Red Hat OpenShift Container Platform clusters. Complete the following steps to configure the KlusterletAddonConfig to add the three environment variables to the pods of the klusterlet add-ons:
Edit the
KlusterletAddonConfigfile that is in the namespace of the cluster that needs the proxy. You can use the console to find the resource, or you can edit from the terminal with the following command:oc -n <my-cluster-name> edit klusterletaddonconfig <my-cluster-name>
oc -n <my-cluster-name> edit klusterletaddonconfig <my-cluster-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note: If you are working with only one cluster, you do not need
<my-cluster-name>at the end of your command. See the following command:oc -n <my-cluster-name> edit klusterletaddonconfig
oc -n <my-cluster-name> edit klusterletaddonconfigCopy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the
.spec.proxyConfigsection of the file so it resembles the following example. Thespec.proxyConfigis an optional section:spec proxyConfig: httpProxy: "<proxy_not_secure>" httpsProxy: "<proxy_secure>" noProxy: "<no_proxy>"spec proxyConfig: httpProxy: "<proxy_not_secure>"1 httpsProxy: "<proxy_secure>"2 noProxy: "<no_proxy>"3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
proxy_not_securewith the address of the proxy server forhttprequests. For example, usehttp://192.168.123.145:3128. - 2
- Replace
proxy_securewith the address of the proxy server forhttpsrequests. For example, usehttps://192.168.123.145:3128. - 3
- Replace
no_proxywith a comma delimited list of IP addresses, hostnames, and domain names where traffic is not routed through the proxy. For example, use.cluster.local,.svc,10.128.0.0/14,example.com.
If the OpenShift Container Platform cluster is created with cluster wide proxy configured on the hub cluster, the cluster wide proxy configuration values are added to the pods of the klusterlet add-ons as environment variables when the following conditions are met:
-
The
.spec.policyController.proxyPolicyin theaddonsection is enabled and set toOCPGlobalProxy. The
.spec.applicationManager.proxyPolicyis enabled and set toCustomProxy.Note: The default value of
proxyPolicyin theaddonsection isDisabled.See the following examples of
proxyPolicyentries:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Important: Global proxy settings do not impact alert forwarding. To set up alert forwarding for Red Hat Advanced Cluster Management hub clusters with a cluster-wide proxy, see Forwarding alerts for more details.