Why does binding a service to a cluster result in a same name error?

Virtual Private Cloud Classic infrastructure

When you try to bind an IBM Cloud service to your cluster, you see an error message indicating that multiple services with the same name were found.

Multiple services with the same name were found.
Run 'ibmcloud resource service-instances' to view available IBM Cloud service instances...

Multiple service instances might have the same name in different regions or resource groups.

Use the service instance GUID or CRN to uniquely identify the service when creating service credentials and binding them to your cluster.

  1. Log in to the IBM Cloud region that includes the service instance to bind.

  2. List your service instances and get the GUID or CRN for the specific service instance.

    ibmcloud resource service-instances --output json | grep -A 5 "<service_instance_name>"
    

    Example output showing the GUID and CRN:

    "guid": "1234abcd-5678-efgh-9012-ijklmnop3456",
    "crn": "crn:v1:bluemix:public:service-name:us-south:a/abc123:1234abcd-5678-efgh-9012-ijklmnop3456::",
    
  3. Create service credentials for the service instance using the GUID or CRN.

    ibmcloud resource service-key-create <key_name> <role> --instance-id <service_instance_GUID>
    
  4. Get the service credentials.

    ibmcloud resource service-key <key_name> --output json
    
  5. Create a Kubernetes secret in your cluster with the service credentials.

    kubectl create secret generic <secret_name> --from-literal=<key>=<value> -n <namespace>
    
  6. Reference the secret in your app deployment to access the service credentials.

For more information, see Adding services by using IBM Cloud service binding.