<p>I have created a IAM (identity and access management) <a href="https://console.bluemix.net/docs/iam/serviceid.html#serviceids" rel="nofollow noreferrer">service ID</a> on IBM Cloud. Thereafter, I granted Administrator privilege for <a href="https://console.bluemix.net/docs/containers/container_index.html#container_index" rel="nofollow noreferrer">IBM Cloud Kubernetes Service</a> to that service ID.</p>

<p>Now, how do I create a cluster using that service ID? I cannot log in to IBM Cloud with that id. What are the proper steps?</p>

data_henrik
<p>It can be done by following this flow:<br>
   1. Create an <a href="https://console.bluemix.net/docs/iam/apikeys.html#manapikey" rel="nofollow noreferrer">API key for that service ID</a>:</p>

<pre><code>ibmcloud iam service-api-key-create KeyName ServiceId-identifier \
-d "an optional description" --file save-Api-key2this-file
</code></pre>

<ol start="2">
<li><p>Using that API key, <a href="https://console.bluemix.net/docs/iam/apikey_iamtoken.html#iamtoken_from_apikey" rel="nofollow noreferrer">obtain an IAM token for that service ID</a>. </p>

<pre><code>curl -k -X POST   --header "Content-Type: application/x-www-form-urlencoded" \
--header "Accept: application/json" \
--data-urlencode "grant_type=urn:ibm:params:oauth:grant-type:apikey" \
--data-urlencode "apikey=APIKEY-FROM-STEP-1"\
https://iam.bluemix.net/identity/token
</code></pre></li>
<li><p>Use the <a href="https://containers.bluemix.net/swagger-api/#!/clusters/CreateCluster" rel="nofollow noreferrer">REST API for Kubernetes service to create the cluster</a>. Provide the token from step 2 for authorization:</p>

<pre><code>curl -X POST --header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'X-Region: eu-de' --header 'Authorization: TOKEN-FROM-STEP2' -d '{ \
  "dataCenter": "fra04", \ 
   "disableAutoUpdate": true, \ 
   "diskEncryption": true, \ 
   "enableTrusted": false, \ 
   "machineType": "u2c.2x4", \ 
   "name": "henrik-paid-fra04-serviceID", \ 
   "noSubnet": true, \ 
   "privateVlan": "2397641", \ 
   "publicVlan": "2397639", \ 
   "workerNum": 2 \ 
 }' 'https://containers.bluemix.net/v1/clusters'
</code></pre></li>
</ol>
