Creating a service ID by using IBM Cloud Private CLI

Prerequisites

Install the IBM Cloud Private CLI. See Installing the IBM Cloud Private CLI to get started.

Creating a service ID

  1. Log in to IBM Cloud Private and set the namespace to generate tokens. The following command prompts you for a password and account:

    cloudctl login -a https://<Cluster Master Host>:<Cluster Master API Port> u -n kube-system --skip-ssl-validation
    

    The <Cluster Master Host> and <Cluster Master API Port> parameters are defined in IBM Cloud Private endpoints.

  2. Use the following commands to list IAM commands and data:

  3. Create the service ID for a service with the following command:

     cloudctl iam service-id-create <service-id-name> -d <service-id-description>
    

    For example, to create a service ID for a metering service, run the following command, where <service-id-name> is meteringserviceId and <service-id-description> is service id for metering:

     cloudctl iam service-id-create "meteringserviceId" -d "service id for metering"
    

    See the example output:

     Output
     ------
     Creating service ID meteringserviceId bound to current account as admin...
     OK
     Service ID meteringserviceId is created successfully
    
     Name          meteringserviceId
     Description   service id for metering
     CRN           crn:v1:icp:private:k8::n/kube-system::serviceid:ServiceId-58451b31-607b-42b4-99c8-1ceeea96bb48
     Bound To      crn:v1:icp:private:k8::n/kube-system:::
    

    You can manage service IDs, create and manage API keys, and create and manage policies for access to specific services that are needed by an application.