Skip to content

Commit 430fb3e

Browse files
Merge pull request #57097 from xenolinux/azure-tags
OSDOCS#5411: Document user-defined Azure tags
2 parents 5aa67a0 + e71c645 commit 430fb3e

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

installing/installing_azure/installing-azure-customizations.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ include::modules/installation-azure-marketplace-subscribe.adoc[leveloffset=+1]
2929

3030
include::modules/installation-obtaining-installer.adoc[leveloffset=+1]
3131

32+
include::modules/installation-user-defined-tags-azure.adoc[leveloffset=+1]
33+
34+
include::modules/querying-user-defined-tags-azure.adoc[leveloffset=+1]
35+
3236
include::modules/installation-initializing.adoc[leveloffset=+1]
3337

3438
include::modules/installation-configuration-parameters.adoc[leveloffset=+2]
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
// Module included in the following assemblies:
2+
// * installing/installing_azure/installing-azure-customizations.adoc
3+
4+
:_content-type: CONCEPT
5+
[id="installing-azure-user-defined-tags_{context}"]
6+
= Configuring the user-defined tags for Azure
7+
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.
9+
10+
Support for user-defined tags is available only for the resources created in the Azure Public Cloud, and in {product-title} 4.13 as a Technology Preview (TP). User-defined tags are not supported for the {product-title} clusters upgraded to {product-title} 4.13.
11+
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.
13+
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.
15+
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.
17+
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+
featureSet: TechPreviewNoUpgrade <3>
25+
compute: <4>
26+
- architecture: amd64
27+
hyperthreading: Enabled <5>
28+
name: worker
29+
platform: {}
30+
replicas: 3
31+
controlPlane: <4> <6>
32+
architecture: amd64
33+
hyperthreading: Enabled <5>
34+
name: master
35+
platform: {}
36+
replicas: 3
37+
metadata:
38+
creationTimestamp: null
39+
name: user <2>
40+
networking:
41+
clusterNetwork:
42+
- cidr: 10.128.0.0/14
43+
hostPrefix: 23
44+
machineNetwork:
45+
- cidr: 10.0.0.0/16
46+
networkType: OVNKubernetes <7>
47+
serviceNetwork:
48+
- 172.30.0.0/16
49+
platform:
50+
azure:
51+
baseDomainResourceGroupName: os4-common <8>
52+
cloudName: AzurePublicCloud <9>
53+
outboundType: Loadbalancer
54+
region: southindia <2>
55+
userTags: <10>
56+
createdBy: user
57+
environment: dev
58+
----
59+
<1> Defines the trust bundle policy.
60+
<2> Required. The installation program prompts you for this value.
61+
<3> You must set the `featureSet` field as `TechPreviewNoUpgrade`.
62+
<4> If you do not provide these parameters and values, the installation program provides the default value.
63+
<5> 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+
<6> The `controlPlane` section is a single mapping, but 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, `-`, and the first line of the `controlPlane` section must not. Only one control plane pool is used.
65+
<7> The cluster network plugin to install. The supported values are `OVNKubernetes` and `OpenShiftSDN`. The default value is `OVNKubernetes`.
66+
<8> Specifies the resource group for the base domain of the Azure DNS zone.
67+
<9> 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+
<10> Defines the additional keys and values that the installer adds as tags to all Azure resources that it creates.
69+
70+
The user-defined tags have the following limitations:
71+
72+
* A tag key can have a maximum of 128 characters.
73+
* 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.
74+
* Tag keys are case-insensitive.
75+
* Tag keys cannot be `name`. It cannot have prefixes such as `kubernetes.io`, `openshift.io`, `microsoft`, `azure`, and `windows`.
76+
* A tag value can have a maximum of 256 characters.
77+
* You can configure a maximum of 10 tags for resource group and resources.
78+
79+
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]
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Module included in the following assemblies:
2+
// * installing/installing_azure/installing-azure-customizations.adoc
3+
4+
:_content-type: PROCEDURE
5+
[id="querying-azure-user-defined-tags_{context}"]
6+
= Querying user-defined tags for Azure
7+
8+
After creating the {product-title} cluster, you can access the list of defined tags for the Azure resources. The format of the {product-title} tags is `kubernetes.io_cluster.<cluster_id>:owned`. The `cluster_id` parameter is the value of `.status.infrastructureName` present in `config.openshift.io/Infrastructure`.
9+
10+
* Query the tags defined for Azure resources by running the following command:
11+
+
12+
[source,terminal]
13+
----
14+
$ oc get infrastructures.config.openshift.io cluster -o=jsonpath-as-json='{.status.platformStatus.azure.resourceTags}'
15+
----
16+
+
17+
.Example output
18+
[source,json]
19+
----
20+
[
21+
[
22+
{
23+
"key": "createdBy",
24+
"value": "user"
25+
},
26+
{
27+
"key": "environment",
28+
"value": "dev"
29+
}
30+
]
31+
]
32+
----

0 commit comments

Comments
 (0)