A cluster link is a unidirectional relationship between a cluster and another cluster.
You add and remove links from one cluster to another cluster using DC/OS CLI dcos cluster link and dcos cluster unlink commands, and the cluster link API. Once a link is set up, you can easily switch between clusters using the CLI or UI. If the links have been set up using an SSO provider, you will not need to provide credentials to switch clusters.
You must be logged in as a superuser or have the appropriate cluster link permission to view, add, and remove links and grant permissions to view linked clusters.
Enable access to cluster links using SSO
As superuser:
-
Configure an OpenID IDP.
- Ensure that both cluster URLs are provided in Authorized JavaScript origins and Authorized redirect URIs fields in the Google Dev console.
- Give the OIDC a name, such as “google-idp”.
- Ensure that both clusters use the same
Client-Id
andClient-Secret
when configuring OIDC.
-
Provide each user with permission to see services and linked clusters:
-
Select Organization -> Users.
-
Select a user.
-
Click Add Permission.
-
In the top right, click Insert Permission String.
-
Paste in the permissions:
-
Click Add Permission.
-
Add a link to a cluster
To add a link to another cluster, run the dcos cluster link
command, supplying the URL of the cluster to link to:
Viewing linked clusters
To view all linked clusters, run the dcos cluster list
command. If a cluster was linked, but not set up, it status is UNCONFIGURED
. If a cluster is linked and attached, its status is AVAILABLE
. Also see Viewing Connected Clusters.
Remove a link to a cluster
To remove a link, dcos cluster unlink
command and supply the name or ID of a linked cluster. For example:
Switch clusters
You can switch between linked clusters using the CLI or UI. When you switch clusters using the CLI, the new cluster becomes the CLI’s active cluster. When you switch clusters using the UI, the new cluster becomes the cluster you see in the UI. If you switch the cluster in the CLI, it doesn’t change the cluster in the UI; similarly, switching in the UI doesn’t affect the attached cluster in the CLI.
Switch to a linked cluster from the DC/OS CLI
Run the dcos cluster attach
command and supply the name or ID of a linked cluster:
If you run dcos cluster list
, <linked-cluster>
will have an asterisk by its name.
Switch to a linked cluster from the DC/OS UI
-
From the left hand navigation menu, select Cluster > Linked Clusters.
Figure 1 - Linked Clusters link
-
At the top-right corner of the DC/OS UI, click the down arrow to the right of your cluster name.
Figure 2 - Open cluster menu
-
Select Switch Cluster.
Figure 3 - Switch clusters
-
Click the name of the cluster to switch to.
Figure 4 - Switching to linked cluster
Switching clusters as a superuser
If you are logged in as a superuser you can also switch directly to a linked cluster in the Linked Clusters tab.
-
Select Cluster > Linked Clusters.
-
At the far right, click the vertical ellipsis and select Switch.
Figure 5 - Switching to linked clusters
Linking and switching cluster examples
Link clusters as a superuser operator via CLI
-
Set up cluster
cluster-a
using thedcos-user
provider.The response requests that you verify the fingerprint of the cluster certificate bundle, which must be accepted with the response
yes
. The CLI prompts for superuser credentials. Provide the credentials. -
Set up
cluster-b
using thedcos-user
provider.The response requests that you verify the fingerprint of the cluster certificate bundle, which must be accepted with the response
yes
. The CLI prompts for superuser credentials. Provide the credentials. -
Attach to cluster
cluster-a
and list. -
Link to cluster
cluster-b
from clustercluster-a
.The CLI prompts you to choose the login provider for switching.
-
Choose Google IDP (2). If the cluster links successfully, there will be no response.
-
Attach to cluster
cluster-b
. -
Link to cluster
cluster-a
from clustercluster-b
.The CLI prompts to choose the login provider for switching.
-
Choose Google IDP (2).
-
List clusters.
Once an operator has set up links you can switch between clusters using the UI or CLI.
Switch clusters using the UI with Google SSO
You can easily switch to a linked cluster that has been set up with the Google OpenID provider.
-
Log in to DC/OS UI of cluster
cluster-a
as an external user using Google credentials.Figure 6 - Google login
-
At the top-right corner of the DC/OS UI, click the down arrow to the right of your cluster name.
Figure 7 - Switch cluster
-
Click Switch Cluster.
Switch clusters using the CLI with Google SSO
You can easily switch to a linked cluster that has been set up with the Google OpenID provider.
-
List authentication providers.
-
Set up cluster with Google IDP.
The response requests that you verify the fingerprint of the cluster certificate bundle, which must be accepted with the response
yes
. -
Copy the authentication token from the browser and paste in the terminal.
-
List clusters. The setup cluster shows as AVAILABLE and attached and the previously linked cluster shows as UNCONFIGURED.
-
Attach to UNCONFIGURED cluster.
The response requests that you verify the fingerprint of the cluster certificate bundle, which must be accepted with the response
yes
. -
Copy the authentication token from the browser and paste in the terminal. The CLI successfully attaches to cluster
cluster-b
. -
List clusters to verify attachment to
cluster-b
.