Overview

This topic describes how to label an existing OpenShift Origin cluster running on Amazon Web Services (AWS).

To correctly identify which resources are associated with a cluster, tag resources with the key kubernetes.io/cluster/<name>, where <name> is a unique name for the cluster. Tagging all resources with the kubernetes.io/cluster/<name> tag avoids potential issues with multiple zones or multiple clusters.

See Configuring AWS for guidance on configuring AWS variables and OpenShift Origin masters for AWS.

See Pods and Services to learn more about labeling and tagging in OpenShift Origin.

Resources That Need Tags

There are four types of resources that need to be tagged:

  • Instances

  • Security Groups

  • Load Balancers

  • EBS Volumes

Tagging an Existing Cluster

A cluster will use the value of the kubernetes.io/cluster/<name> tag to determine which resources belong to the cluster. Therefore, you must tag all resources with the key kubernetes.io/cluster/<name> and have the same value for that key.

  1. Tag all instances with kubernetes.io/cluster/<name> and a value to be used as the cluster ID.

  2. Tag any security groups with kubernetes.io/cluster/<name> and the same value used for the instances.

  3. Tag any load balancers with kubernetes.io/cluster/<name> and the same value used for the instances.

  4. 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:

    $ oc get pv -o json|jq '.items[].spec.awsElasticBlockStore.volumeID'
  5. Restart atomic-openshift-master and atomic-openshift-node on all nodes:

    # systemctl restart atomic-openshift-master-api atomic-openshift-master-controller atomic-openshift-node