Skip to content

Commit 0d0aa73

Browse files
author
Shubha Narayanan
committed
User-defined tags improvement
1 parent bcdbfe6 commit 0d0aa73

5 files changed

+109
-102
lines changed

installing/installing_azure/ipi/installing-azure-customizations.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ include::modules/installation-configure-proxy.adoc[leveloffset=+2]
5959

6060
include::modules/installation-user-defined-tags-azure.adoc[leveloffset=+1]
6161

62-
include::modules/querying-user-defined-tags-azure.adoc[leveloffset=+1]
62+
include::modules/installation-creating-user-defined-tags-azure.adoc[leveloffset=+2]
63+
64+
include::modules/installation-user-defined-tags-requirements-azure.adoc[leveloffset=+2]
6365

6466
//Installing the OpenShift CLI by downloading the binary: Moved up to precede manual cred (short and long) steps, which require the use of `oc`
6567
include::modules/cli-installing-cli.adoc[leveloffset=+1]
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// Module included in the following assemblies:
2+
// * installing/installing_azure/installing-azure-customizations.adoc
3+
:_mod-docs-content-type: PROCEDURE
4+
[id="installation-creating-user-defined-tags-azure_{context}"]
5+
= Creating user-defined tags for {azure-short}
6+
7+
To define the list of user-defined tags, edit the `.platform.azure.userTags` field in the `install-config.yaml` file.
8+
9+
.Procedure
10+
11+
* Specify the `.platform.azure.userTags` field as shown in the following `install-config.yaml` file:
12+
+
13+
[source,yaml]
14+
----
15+
apiVersion: v1
16+
baseDomain: example.com
17+
#...
18+
platform:
19+
azure:
20+
userTags: <1>
21+
<key>: <value> <2>
22+
#...
23+
----
24+
<1> Defines the additional keys and values that the installation program adds as tags to all {azure-short} resources that it creates.
25+
<2> Specify the key and value. You can configure a maximum of 10 tags for resource group and resources. Tag keys are case-insensitive. For more information on requirements for specifying user-defined tags, see "User-defined tags requirements" section.
26+
+
27+
.Example `install-config.yaml` file
28+
[source,yaml]
29+
----
30+
apiVersion: v1
31+
baseDomain: example.com
32+
#...
33+
platform:
34+
azure:
35+
userTags:
36+
createdBy: user
37+
environment: dev
38+
#...
39+
----
40+
41+
.Verification
42+
43+
* Access the list of created user-defined tags for the Azure resources by running the following command:
44+
+
45+
[source,terminal]
46+
----
47+
$ oc get infrastructures.config.openshift.io cluster -o=jsonpath-as-json='{.status.platformStatus.azure.resourceTags}'
48+
----
49+
+
50+
.Example output
51+
[source,json]
52+
----
53+
[
54+
[
55+
{
56+
"key": "createdBy",
57+
"value": "user"
58+
},
59+
{
60+
"key": "environment",
61+
"value": "dev"
62+
}
63+
]
64+
]
65+
----
66+

modules/installation-user-defined-tags-azure.adoc

Lines changed: 7 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -3,78 +3,16 @@
33

44
:_mod-docs-content-type: CONCEPT
55
[id="installing-azure-user-defined-tags_{context}"]
6-
= Configuring user-defined tags for Azure
6+
= Configuring user-defined tags for {azure-short}
77

8-
In {product-title}, you can use the tags for grouping resources and for managing resource access and cost. You can define the tags on the Azure resources in the `install-config.yaml` file only during {product-title} cluster creation. You cannot modify the user-defined tags after cluster creation.
8+
In {product-title}, you can use tags for grouping resources and for managing resource access and cost. Tags are applied only to the resources created by the {product-title} installation program and its core Operators such as Machine API Operator, Cluster Ingress Operator, Cluster Image Registry Operator. The {product-title} consists of the following types of tags:
99

10-
Support for user-defined tags is available only for the resources created in the Azure Public Cloud. User-defined tags are not supported for the {product-title} clusters upgraded to {product-title} {product-version}.
10+
{product-title} tags:: By default, {product-title} installation program attaches the {product-title} tags to the {azure-short} resources. These {product-title} tags are not accessible to the users. The format of the {product-title} tags is `kubernetes.io_cluster.<cluster_id>:owned`, where `<cluster_id>` is the value of `.status.infrastructureName` in the infrastructure resource for the cluster.
1111

12-
User-defined and {product-title} specific tags are applied only to the resources created by the {product-title} installer and its core operators such as Machine api provider azure Operator, Cluster Ingress Operator, Cluster Image Registry Operator.
12+
User-defined tags:: User-defined tags are manually created in `install-config.yaml` file during installation. When creating the user-defined tags, you must consider the following points:
1313

14-
By default, {product-title} installer attaches the {product-title} tags to the Azure resources. These {product-title} tags are not accessible for the users.
14+
** User-defined tags on {azure-short} resources can only be defined during {product-title} cluster creation, and cannot be modified after the cluster is created.
1515

16-
You can use the `.platform.azure.userTags` field in the `install-config.yaml` file to define the list of user-defined tags as shown in the following `install-config.yaml` file.
16+
** Support for user-defined tags is available only for the resources created in the {azure-short} Public Cloud.
1717

18-
.Sample `install-config.yaml` file
19-
[source,yaml]
20-
----
21-
additionalTrustBundlePolicy: Proxyonly <1>
22-
apiVersion: v1
23-
baseDomain: catchall.azure.devcluster.openshift.com <2>
24-
compute: <3>
25-
- architecture: amd64
26-
hyperthreading: Enabled <4>
27-
name: worker
28-
platform: {}
29-
replicas: 3
30-
controlPlane: <5>
31-
architecture: amd64
32-
hyperthreading: Enabled <6>
33-
name: master
34-
platform: {}
35-
replicas: 3
36-
metadata:
37-
creationTimestamp: null
38-
name: user <7>
39-
networking:
40-
clusterNetwork:
41-
- cidr: 10.128.0.0/14
42-
hostPrefix: 23
43-
machineNetwork:
44-
- cidr: 10.0.0.0/16
45-
networkType: OVNKubernetes <8>
46-
serviceNetwork:
47-
- 172.30.0.0/16
48-
platform:
49-
azure:
50-
baseDomainResourceGroupName: os4-common <9>
51-
cloudName: AzurePublicCloud <10>
52-
outboundType: Loadbalancer
53-
region: southindia <11>
54-
userTags: <12>
55-
createdBy: user
56-
environment: dev
57-
----
58-
<1> Defines the trust bundle policy.
59-
<2> Required. The `baseDomain` parameter specifies the base domain of your cloud provider. The installation program prompts you for this value.
60-
<3> The configuration for the machines that comprise compute. The `compute` section is a sequence of mappings. To meet the requirements of the different data structures, the first line of the `compute` section must begin with a hyphen, `-`. If you do not provide these parameters and values, the installation program provides the default value.
61-
<4> To enable or disable simultaneous multithreading, or `hyperthreading`. By default, simultaneous multithreading is enabled to increase the performance of your machines' cores. You can disable it by setting the parameter value to `Disabled`. If you disable simultaneous multithreading in some cluster machines, you must disable it in all cluster machines.
62-
<5> The configuration for the machines that comprise the control plane. The `controlPlane` section is a single mapping. The first line of the `controlPlane` section must not begin with a hyphen, `-`. You can use only one control plane pool. If you do not provide these parameters and values, the installation program provides the default value.
63-
<6> To enable or disable simultaneous multithreading, or `hyperthreading`. By default, simultaneous multithreading is enabled to increase the performance of your machines' cores. You can disable it by setting the parameter value to `Disabled`. If you disable simultaneous multithreading in some cluster machines, you must disable it in all cluster machines.
64-
<7> The installation program prompts you for this value.
65-
<8> The cluster network plugin to install. The default value `OVNKubernetes` is the only supported value.
66-
<9> Specifies the resource group for the base domain of the Azure DNS zone.
67-
<10> Specifies the name of the Azure cloud environment. You can use the `cloudName` field to configure the Azure SDK with the Azure API endpoints. If you do not provide value, the default value is Azure Public Cloud.
68-
<11> Required. Specifies the name of the Azure region that hosts your cluster. The installation program prompts you for this value.
69-
<12> Defines the additional keys and values that the installation program adds as tags to all Azure resources that it creates.
70-
71-
The user-defined tags have the following limitations:
72-
73-
* A tag key can have a maximum of 128 characters.
74-
* A tag key must begin with a letter, end with a letter, number or underscore, and can contain only letters, numbers, underscores, periods, and hyphens.
75-
* Tag keys are case-insensitive.
76-
* Tag keys cannot be `name`. It cannot have prefixes such as `kubernetes.io`, `openshift.io`, `microsoft`, `azure`, and `windows`.
77-
* A tag value can have a maximum of 256 characters.
78-
* You can configure a maximum of 10 tags for resource group and resources.
79-
80-
For more information about Azure tags, see link:https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json[Azure user-defined tags]
18+
** User-defined tags are not supported for the {product-title} clusters upgraded to {product-title} {product-version}.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Module included in the following assemblies:
2+
// * installing/installing_azure/installing-azure-customizations.adoc
3+
:_mod-docs-content-type: REFERENCE
4+
[id="installation-user-defined-tags-requirements-azure_{context}"]
5+
= User-defined tags requirements
6+
7+
The user-defined tags have the following requirements:
8+
9+
* A tag key must have a maximum of 128 characters.
10+
11+
* A tag key must begin with a letter.
12+
13+
* A tag key must end with a letter, number or underscore.
14+
15+
* A tag key must contain only letters, numbers, underscores(`_`), periods(`.`), and hyphens(`-`).
16+
17+
* A tag key must not be specified as `name`.
18+
19+
* A tag key must not have the following prefixes:
20+
21+
** `kubernetes.io`
22+
23+
** `openshift.io`
24+
25+
** `microsoft`
26+
27+
** `azure`
28+
29+
** `windows`
30+
31+
* A tag value must have a maximum of 256 characters.
32+
33+
For more information about Azure tags, see link:https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-resources?tabs=json[Azure user-defined tags].

modules/querying-user-defined-tags-azure.adoc

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)