diff --git a/apis/clusterinstance.json.adoc b/apis/clusterinstance.json.adoc index 7ce840056b..aa636d5374 100644 --- a/apis/clusterinstance.json.adoc +++ b/apis/clusterinstance.json.adoc @@ -362,7 +362,14 @@ The default value is `None`.|string |*diskEncryption* + __optional__|Enable or disable disk encryption for the cluster.|object |*extraAnnotations* + -__optional__|Specify additional cluster-level annotations to be applied to the rendered templates.|object +__optional__|Specify additional cluster-level annotations to be applied to the rendered templates by using the following format: + +[source,yaml] +---- +extraAnnotations: + ClusterDeployment: + myClusterAnnotation: success +---- +|object |*extraLabels* + __optional__|Specify additional cluster-level labels to be applied to the rendered templates by using the following format: + [source,yaml] @@ -446,7 +453,14 @@ The following values are supported: * `UEFISecureBoot` * `legacy`|string |*extraAnnotations* + -__optional__|Specify additional node-level annotations to be applied to the rendered templates.|object +__optional__|Specify additional node-level annotations to be applied to the rendered templates by using the following format: + +[source,yaml] +---- +extraAnnotations: + BareMetalHost: + myNodeAnnotation: success +---- +|object |*extraLabels* + __optional__|Specify additional node-level labels to be applied to the rendered templates. + [source,yaml] diff --git a/mce_acm_integration/siteconfig/siteconfig_installation_templates.adoc b/mce_acm_integration/siteconfig/siteconfig_installation_templates.adoc index 472a562aaa..fd99ac6319 100644 --- a/mce_acm_integration/siteconfig/siteconfig_installation_templates.adoc +++ b/mce_acm_integration/siteconfig/siteconfig_installation_templates.adoc @@ -14,6 +14,7 @@ For more information about installation templates, see the following documentati * <> * <> * <> +* <> [#template-functions] == Template functions @@ -140,16 +141,16 @@ metadata: If the {sco} deletes the resources, `KlusterletAddonConfig` and `ManagedCluster` custom resources are the first to be deleted, while the `AgentClusterInstall` and `ClusterDeployment` custom resources are the last. -[#extra-labels] -== Configuration of custom labels using the extraLabels field +[#extra-annotations-labels] +== Configuration of additional annotations and labels -You can configure additional custom labels to both cluster-level and node-level installation manifests by using the `extraLabels` fields in the `ClusterInstance` API. -The {sco} applies your custom labels to the manifests that you specify in the `ClusterInstance` custom resource. +You can configure additional additional annotations and labels to both cluster-level and node-level installation manifests by using the `extraAnnotations` and `extraLabels` fields in the `ClusterInstance` API. +The {sco} applies your additional annotations and labels to the manifests that you specify in the `ClusterInstance` additional resource. -When creating the labels, you must specify a manifest type to allow the {sco} to apply your custom labels to the appropriate manifest. -However, the labels are arbitrary and you can set any key and value pairs. +When creating your additional annotations and labels, you must specify a manifest type to allow the {sco} to apply them to the appropriate manifest. +However, the annotations and labels are arbitrary and you can set any key and value pairs that are meaningful to your applications. -.Example application of extraLabels +.Example application of extraAnnotations and extraLabels [source,yaml] ---- apiVersion: siteconfig.open-cluster-management.io/v1alpha1 @@ -160,41 +161,59 @@ metadata: spec: [...] clusterName: "example-sno" + extraAnnotations: <1> + ClusterDeployment: + myClusterAnnotation: success extraLabels: <1> ManagedCluster: common: "true" group-du: "" - sites : "example-sno" - vendor: "auto-detect" nodes: - hostName: "example-sno.example.redhat.com" role: "master" + extraAnnotations: <2> + BareMetalHost: + myNodeAnnotation: success extraLabels: <2> BareMetalHost: "testExtraLabel": "success" ---- -<1> These are cluster-level labels that the {sco} applies to the the `ManagedCluster` manifest. -<2> This is a node-level label that the {sco} applies to the `BareMetalHost` manifest. +<1> These are cluster-level annotations and labels that the {sco} applies to the the `ManagedCluster` and `ClusterDeployment` manifests. +<2> These are node-level annotations and labels that the {sco} applies to the `BareMetalHost` manifest. + +. You can verify that your additional labels are applied by running the following command: ++ +-- +[source,terminal] +---- +$ oc get managedclusters example-sno -ojsonpath='{.metadata.labels}' | jq +---- .Example applied labels [source,json] ---- { - "cluster.open-cluster-management.io/clusterset": "default", "common": "true", "group-du": "", - "name": "example-sno", - "siteconfig.open-cluster-management.io/owned-by": "example-sno_example-sno", - "sites": "example-sno", - "vendor": "auto-detect" + ... } ---- +-- +. You can verify that your additional annotations are applied by running the following command: ++ +-- +[source,terminal] +---- +$ oc get bmh example-sno.example.redhat.com -n example-sno -ojsonpath='{.metadata.annotations}' | jq +---- + +.Example applied annotation [source,json] ---- { - "infraenvs.agent-install.openshift.io": "example-sno", - "siteconfig.open-cluster-management.io/owned-by": "example-sno_example-sno", - "testExtraLabel": "success" + "myNodeAnnotation": "success", + ... } ----- \ No newline at end of file +---- +-- \ No newline at end of file