|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * rosa_cluster_admin/rosa_nodes/rosa-managing-worker-nodes.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="rosa-adding-tags-cli{context}"] |
| 7 | += Adding tags to a machine pool using the ROSA CLI |
| 8 | + |
| 9 | +You can add tags to a machine pool for your {product-title} cluster by using the ROSA command line interface (CLI). |
| 10 | + |
| 11 | +[IMPORTANT] |
| 12 | +==== |
| 13 | +You must ensure that your tag keys are not `aws`, `red-hat-managed`, `red-hat-clustertype`, or `Name`. In addition, you must not set a tag key that begins with `kubernetes.io/cluster/`. Your tag's key cannot be longer than 128 characters, while your tag's value cannot be longer than 256 characters. Red{nbsp}Hat reserves the right to add additional reserved tags in the future. |
| 14 | +==== |
| 15 | + |
| 16 | +.Prerequisites |
| 17 | + |
| 18 | +* You installed and configured the latest AWS (`aws`), ROSA (`rosa`), and OpenShift (`oc`) CLIs on your workstation. |
| 19 | +* You logged in to your Red{nbsp}Hat account by using the `rosa` CLI. |
| 20 | +* You created a {product-title} (ROSA) cluster. |
| 21 | +
|
| 22 | +.Procedure |
| 23 | + |
| 24 | +* Create a machine pool with a custom tag by running the following command: |
| 25 | ++ |
| 26 | +-- |
| 27 | +[source,terminal] |
| 28 | +---- |
| 29 | +$ rosa create machinepools --cluster=<name> --replicas=<replica_count> \ |
| 30 | + --name <mp_name> --tags='<key> <value>,<key> <value>' \ <1> |
| 31 | +---- |
| 32 | +<1> Replace `<key> <value>,<key> <value>` with a key and value for each tag. |
| 33 | +-- |
| 34 | ++ |
| 35 | +.Example output |
| 36 | +[source,terminal] |
| 37 | +---- |
| 38 | +$ rosa create machinepools --cluster=mycluster --replicas 2 --tags='tagkey1 tagvalue1,tagkey2 tagvaluev2' |
| 39 | +
|
| 40 | +I: Checking available instance types for machine pool 'mp-1' |
| 41 | +I: Machine pool 'mp-1' created successfully on cluster 'mycluster' |
| 42 | +I: To view the machine pool details, run 'rosa describe machinepool --cluster mycluster --machinepool mp-1' |
| 43 | +I: To view all machine pools, run 'rosa list machinepools --cluster mycluster' |
| 44 | +---- |
| 45 | + |
| 46 | +.Verification |
| 47 | + |
| 48 | +* Use the `describe` command to see the details of the machine pool with the tags, and verify that the tags are included for your machine pool in the output: |
| 49 | ++ |
| 50 | +[source,terminal] |
| 51 | +---- |
| 52 | +$ rosa describe machinepool --cluster=<cluster_name> <machine_pool_name> |
| 53 | +---- |
| 54 | ++ |
| 55 | +.Example output |
| 56 | +[source,terminal] |
| 57 | +---- |
| 58 | +$ rosa describe machinepool --cluster classic-rosa --machinepool mp-1 |
| 59 | +
|
| 60 | +ID: mp-1 |
| 61 | +Cluster ID: 2baiirqa2141oreotoivp4sipq84vp5g |
| 62 | +Autoscaling: No |
| 63 | +Replicas: 2 |
| 64 | +Instance type: m5.xlarge |
| 65 | +Labels: |
| 66 | +Taints: |
| 67 | +Availability zones: us-east-1a |
| 68 | +Subnets: |
| 69 | +Spot instances: No |
| 70 | +Disk size: 300 GiB |
| 71 | +Additional Security Group IDs: |
| 72 | +Tags: red-hat-clustertype=rosa, red-hat-managed=true, tagkey1=tagvalue1, tagkey2=tagvaluev2 |
| 73 | +---- |
0 commit comments