|
| 1 | +[[admin-guide-aws-cluster-labeling]] |
| 2 | += Labeling Clusters for Amazon Web Services (AWS) |
| 3 | +{product-author} |
| 4 | +{product-version} |
| 5 | +:data-uri: |
| 6 | +:icons: |
| 7 | +:experimental: |
| 8 | +:toc: macro |
| 9 | +:toc-title: |
| 10 | + |
| 11 | +toc::[] |
| 12 | + |
| 13 | +== Overview |
| 14 | + |
| 15 | +This topic describes how to label an existing {product-title} cluster running on |
| 16 | +Amazon Web Services (AWS). |
| 17 | + |
| 18 | +To correctly identify which resources are associated with a cluster, tag |
| 19 | +resources with the key `kubernetes.io/cluster/<name>`, where `<name>` is a unique |
| 20 | +name for the cluster. Tagging all resources with the |
| 21 | +`kubernetes.io/cluster/<name>` tag avoids potential issues with multiple zones |
| 22 | +or multiple clusters. |
| 23 | + |
| 24 | +See |
| 25 | +xref:../install_config/configuring_aws.adoc#install-config-configuring-aws[Configuring |
| 26 | +AWS] for guidance on configuring AWS variables and {product-title} masters for |
| 27 | +AWS. |
| 28 | + |
| 29 | +See xref:../architecture/core_concepts/pods_and_services.adoc#labels[Pods and |
| 30 | +Services] to learn more about labeling and tagging in {product-title}. |
| 31 | + |
| 32 | +[[resources-that-need-tags]] |
| 33 | +== Resources That Need Tags |
| 34 | +There are four types of resources that need to be tagged: |
| 35 | + |
| 36 | +* Instances |
| 37 | +* Security Groups |
| 38 | +* Load Balancers |
| 39 | +* EBS Volumes |
| 40 | + |
| 41 | +[[tagging-an-existing-cluster]] |
| 42 | +== Tagging an Existing Cluster |
| 43 | + |
| 44 | +A cluster will use the value of the `kubernetes.io/cluster/<name>` tag to determine which |
| 45 | +resources belong to the cluster. Therefore, you must tag all resources with the |
| 46 | +key `kubernetes.io/cluster/<name>` and have the same value for that key. |
| 47 | + |
| 48 | +. Tag all instances with `kubernetes.io/cluster/<name>` and a value to be used as the cluster ID. |
| 49 | +. Tag any security groups with `kubernetes.io/cluster/<name>` and the same value used for the instances. |
| 50 | +. Tag any load balancers with `kubernetes.io/cluster/<name>` and the same value used for the instances. |
| 51 | +. Tag all EBS volumes with `kubernetes.io/cluster/<name>` and the same value used for the instances. The EBS Volumes that need to be tagged can found with: |
| 52 | ++ |
| 53 | +[source,bash] |
| 54 | +---- |
| 55 | +$ oc get pv -o json|jq '.items[].spec.awsElasticBlockStore.volumeID' |
| 56 | +---- |
| 57 | + |
| 58 | +. Restart `atomic-openshift-master` and `atomic-openshift-node` on all nodes: |
| 59 | ++ |
| 60 | +[source,bash] |
| 61 | +---- |
| 62 | +# systemctl restart atomic-openshift-master-api atomic-openshift-master-controller atomic-openshift-node |
| 63 | +---- |
0 commit comments