|
| 1 | +//Module included in the following assemblies: |
| 2 | +// hosted_control_planes/hcp-manage/hcp-manage-aws.adoc |
| 3 | + |
| 4 | +:_mod-docs-content-type: PROCEDURE |
| 5 | +[id="hcp-aws-tags_{context}"] |
| 6 | += Adding or updating {aws-short} tags for a hosted cluster |
| 7 | + |
| 8 | +As a cluster instance administrator, you can add or update {aws-first} tags without needing to re-create your hosted cluster. _Tags_ are key-value pairs that are attached to {aws-short} resources for management and automation. |
| 9 | + |
| 10 | +You might want to use tags for the following purposes: |
| 11 | + |
| 12 | +* Managing access controls. |
| 13 | +* Tracking chargeback or showback. |
| 14 | +* Managing cloud IAM conditional permissions. |
| 15 | +* Aggregating resources based on tags. For example, you can query tags to calculate resource usage and billing costs. |
| 16 | +
|
| 17 | +You can add or update tags for several different types of resources, including EFS access points, load balancer resources, Amazon EBS volumes, IAM users, and {aws-short} S3. |
| 18 | + |
| 19 | +[IMPORTANT] |
| 20 | +==== |
| 21 | +On network load balancers, tags cannot be added or updated. The {aws-short} load balancer reconciles whatever tags are in the `HostedCluster` resource. If you try to add or update a tag, the load balancer overwrites the tag. |
| 22 | +
|
| 23 | +In addition, tags cannot be updated on the default security group resource that is created directly by {hcp}. |
| 24 | +==== |
| 25 | + |
| 26 | +.Prerequisites |
| 27 | + |
| 28 | +* You must have cluster administrator permissions for your hosted cluster on {aws-short}. |
| 29 | +
|
| 30 | +.Procedure |
| 31 | + |
| 32 | +. If you want to add or update tags for EFS access points, complete steps 1 and 2. If you are adding or updating tags for other types of resources, complete only step 2. |
| 33 | + |
| 34 | +.. In the `aws-efs-csi-driver-operator` service account, add two annotations, as shown in the following example. These annotations are required so that the {aws-short} EKS pod identity webhook that runs on the cluster can correctly assign {aws-short} roles to the pods that the EFS Operator uses. |
| 35 | ++ |
| 36 | +[source,yaml] |
| 37 | +---- |
| 38 | +apiVersion: v1 |
| 39 | +kind: ServiceAccount |
| 40 | +metadata: |
| 41 | + name: <service_account_name> |
| 42 | + namespace: <project_name> |
| 43 | + annotations: |
| 44 | + eks.amazonaws.com/role-arn:<role_arn> |
| 45 | + eks.amazonaws.com/audience:sts.amazonaws.com |
| 46 | +---- |
| 47 | + |
| 48 | +.. Delete the Operator pod or roll out a restart of the `aws-efs-csi-driver-operator` deployment. |
| 49 | + |
| 50 | +. In the `HostedCluster` resource, enter information in the `resourceTags` fields, as shown in the following example: |
| 51 | ++ |
| 52 | +.Example `HostedCluster` resource |
| 53 | +[source,yaml] |
| 54 | +---- |
| 55 | +apiVersion: hypershift.openshift.io/v1beta1 |
| 56 | +kind: HostedCluster |
| 57 | +metadata: |
| 58 | + #... |
| 59 | +spec: |
| 60 | + autoscaling: {} |
| 61 | + clusterID: <cluster_id> |
| 62 | + configuration: {} |
| 63 | + controllerAvailabilityPolicy: SingleReplica |
| 64 | + dns: |
| 65 | + #... |
| 66 | + etcd: |
| 67 | + #... |
| 68 | + fips: false |
| 69 | + infraID: <infra_id> |
| 70 | + infrastructureAvailabilityPolicy: SingleReplica |
| 71 | + issuerURL: https://<issuer_url>.s3.<region>.amazonaws.com |
| 72 | + networking: |
| 73 | + #... |
| 74 | + olmCatalogPlacement: management |
| 75 | + platform: |
| 76 | + aws: |
| 77 | + #... |
| 78 | + resourceTags: |
| 79 | + - key: kubernetes.io/cluster/<tag> #<1> |
| 80 | + value: owned |
| 81 | + rolesRef: |
| 82 | + #... |
| 83 | + type: AWS |
| 84 | +---- |
| 85 | + |
| 86 | +<1> Specify the tag that you want to add to your resource. |
0 commit comments