In OpenShift Container Platform, 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 OpenShift Container Platform cluster creation. You cannot modify the user-defined tags after cluster creation.
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 OpenShift Container Platform clusters upgraded to OpenShift Container Platform 4.17.
User-defined and OpenShift Container Platform specific tags are applied only to the resources created by the OpenShift Container Platform installer and its core operators such as Machine api provider azure Operator, Cluster Ingress Operator, Cluster Image Registry Operator.
By default, OpenShift Container Platform installer attaches the OpenShift Container Platform tags to the Azure resources. These OpenShift Container Platform tags are not accessible for the users.
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.
Sample install-config.yaml
file
additionalTrustBundlePolicy: Proxyonly (1)
apiVersion: v1
baseDomain: catchall.azure.devcluster.openshift.com (2)
compute: (3)
- architecture: amd64
hyperthreading: Enabled (4)
name: worker
platform: {}
replicas: 3
controlPlane: (5)
architecture: amd64
hyperthreading: Enabled (6)
name: master
platform: {}
replicas: 3
metadata:
creationTimestamp: null
name: user (7)
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
machineNetwork:
- cidr: 10.0.0.0/16
networkType: OVNKubernetes (8)
serviceNetwork:
- 172.30.0.0/16
platform:
azure:
baseDomainResourceGroupName: os4-common (9)
cloudName: AzurePublicCloud (10)
outboundType: Loadbalancer
region: southindia (11)
userTags: (12)
createdBy: user
environment: dev
1 |
Defines the trust bundle policy. |
2 |
Required. The baseDomain parameter specifies the base domain of your cloud provider. The installation program prompts you for this value. |
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. |
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. |
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. |
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. |
7 |
The installation program prompts you for this value. |
8 |
The cluster network plugin to install. The default value OVNKubernetes is the only supported value. |
9 |
Specifies the resource group for the base domain of the Azure DNS zone. |
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. |
11 |
Required. Specifies the name of the Azure region that hosts your cluster. The installation program prompts you for this value. |
12 |
Defines the additional keys and values that the installation program adds as tags to all Azure resources that it creates. |
The user-defined tags have the following limitations:
-
A tag key can have a maximum of 128 characters.
-
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.
-
Tag keys are case-insensitive.
-
Tag keys cannot be name
. It cannot have prefixes such as kubernetes.io
, openshift.io
, microsoft
, azure
, and windows
.
-
A tag value can have a maximum of 256 characters.
-
You can configure a maximum of 10 tags for resource group and resources.