6.6 KiB
description | keywords | title |
---|---|---|
Docker EE for IBM Cloud (Beta) Quick Start | ibm, ibm cloud, quickstart, iaas, tutorial | Docker EE for IBM Cloud (Beta) Quick Start |
Docker Enterprise Edition for IBM Cloud (Beta) Quick Start
Are you ready to orchestrate Docker Enterprise Edition swarm clusters that are enhanced with the full suite of secure IBM Cloud platform, infrastructure, and Watson services? Great! Let's get you started.
To request access to the closed beta, contact us.
Step 1: Get all your accounts in order
-
Set up your IBM Cloud account:
- Register for a Pay As You Go IBM Cloud account.
- If you already have an IBM Cloud account, make sure that you can provision infrastructure resources. You might need to upgrade or link your account.
-
Get your IBM Cloud infrastructure credentials:
- Add your SSH key to IBM Cloud infrastructure, label it, and note the label.
- Log in to IBM Cloud infrastructure, select your user profile, and under the API Access Information section retrieve your API Username and Authentication Key.
-
If you have not already, create a space to use when using IBM Cloud services.
-
Get the Docker EE URL associated with your subscription. For beta, you received this in your welcome email.
-
Set your environment variables to use your IBM Cloud infrastructure credentials and your Docker EE installation URL. For example:
export SOFTLAYER_USERNAME=user.name.1234567 export SOFTLAYER_API_KEY=api-key export D4IC_DOCKER_EE_URL=my_docker-ee-url
Now let's download some Docker for IBM Cloud tools.
Step 2: Install the CLIs
-
Install the IBM Cloud CLI.
-
Install the Docker for IBM Cloud plug-in. The prefix for running commands is
bx d4ic
.$ bx plugin install docker-for-ibm-cloud -r Bluemix
-
Optional: To manage a private IBM Cloud Container Registry, install the plug-in. The prefix for running commands is
bx cr
.$ bx plugin install container-registry -r Bluemix
-
Verify that the plug-ins have been installed properly:
$ bx plugin list
Now we're ready to get to the fun stuff: making a cluster!
Step 3: Create clusters
Create a Docker EE swarm cluster in IBM Cloud. During the beta, your cluster can have a maximum of 20 nodes, up to 14 of which can be worker nodes. If you need more nodes than this, work with your Docker representative to acquire an additional Docker EE license.
-
Log in to the IBM Cloud CLI. If you have a federated ID, use the
--sso
option.$ bx login [--sso]
-
Target the IBM Cloud org and space:
$ bx target --cf
-
Create the cluster. Use the
--swarm-name
flag to name your cluster, and fill in the credentials, SSH, and Docker EE installation URL variables with the information that you previously retrieved.$ bx d4ic create --swarm-name my_swarm \ --sl-user user.name.1234567 \ --sl-api-key api_key \ --ssh-label my_ssh_label \ --ssh-key filepath_to_my_ssh_key \ --docker-ee-url my_docker-ee-url
Customize your cluster
You can customize your cluster by using other flags and options with
bx d4ic help create
, but for now, we'll just stick with a basic swarm. -
Note the cluster Name and ID.
Congrats! Your Docker EE for IBM Cloud cluster is provisioning. First, the manager node is deployed. Then, the rest of the infrastructure resources are deployed, including the worker nodes, DTR nodes, load balancers, subnet, and NFS volume.
- To check manager node status:
docker logs cluster-name_ID
. - To check infrastructure resources:
bx d4ic show --swarm-name cluster-name --sl-user user.name.1234567 --sl-api-key api_key
.
Step 4: Use UCP
Check it out: Docker for IBM Cloud uses Docker Universal Control Plane (UCP) to help you manage your cluster through a simple web UI!
Step 4a: Access UCP
-
Get your UCP password from the Docker logs Outputs:
$ docker logs cluster-name_ID ... ucp_password = UCP-password ...
-
Retrieve your cluster's load balancer URL:
$ bx d4ic list --sl-user user.name.1234567 --sl-api-key api_key
-
Copy the UCP URL for your swarm from the
bx d4ic list
command, and in your browser navigate to it. -
Log in to UCP. Your credentials are
admin
and the UCP password from thedocker logs
command, or the credentials that your admin created for you.
We're almost done! We just need to download the UCP certificate bundle so that you can create and deploy services from your local Docker client to the cluster.
Step 4b: Download client certificates
-
From the UCP GUI under your user name (for example, admin), click My Profile.
-
Click Client Bundles > New Client Bundle. A zip file is generated.
-
In the GUI, you are shown a labeland public key. You can edit the label by clicking the pencil icon and giving it a name, e.g., d4ic-ucp.
-
In a terminal, navigate and unzip the client bundle:
$ cd Downloads && unzip ucp-bundle-admin.zip
Keep your client bundle handy
Move the certificate environment variable directory to a safe and accessible location on your machine. You'll use it a lot!
-
From the client bundle directory, update your
DOCKER_HOST
andDOCKER_CERT_PATH
environment variables by loading theenv.sh
script contents into your environment.:$ source env.sh
Set your environment to use Docker EE for IBM Cloud
Repeat this to set your environment variables each time you enter a new terminal session, or after you unset your variables, to connect to the Docker EE for IBM Cloud swarm.
That's it! Your Docker EE for IBM Cloud cluster is provisioned, connected to UCP, and ready to go.
What's next, you ask? Why not try to: