Users

Installing and configuring a basic ClusterLink deployment

This guide will give you a quick start on installing and setting up ClusterLink on a Kubernetes cluster.

Prerequisites

Before you start, you must have access to a Kubernetes cluster. For example, you can set up a local environment using kind.

Installation

  1. To install ClusterLink CLI on Linux or Mac, use the installation script:

    curl -L https://github.com/clusterlink-net/clusterlink/releases/download/v0.3.0/clusterlink.sh | sh -
    
  2. Check the installation by running the command:

    clusterlink --version
    
Download specific CLI version

To install a specific version of the ClusterLink CLI, use the URL path of the version release: For example, to download version v0.2.1:

curl -L https://github.com/clusterlink-net/clusterlink/releases/download/v0.2.1/clusterlink.sh | sh -

Setup

To set up ClusterLink on a Kubernetes cluster, follow these steps:

  1. Create the fabric’s certificate authority (CA) certificate and private key:

    clusterlink create fabric --name <fabric_name>
    

    The ClusterLink fabric is defined as all K8s clusters (peers) that install ClusterLink gateways and can share services between the clusters, enabling communication among those services. This command will create the CA files cert.pem and key.pem in a directory named <fabric_name>. The --name option is optional, and by default, “default_fabric” will be used.

  2. Create a peer (cluster) certificate:

    clusterlink create peer-cert --name <peer_name> --fabric <fabric_name>
    

    This command will create the certificate files cert.pem and key.pem in a directory named <fabric_name>/<peer_name>. The --path <path> flag can be used to change the directory location. Here too, the --name option is optional, and by default, “default_fabric” will be used.

All the peer certificates in the fabric should be created from the same fabric CA files in step 1.

  1. Install ClusterLink deployment:

    clusterlink deploy peer --name <peer_name> --fabric <fabric_name>
    

    This command will deploy the ClusterLink operator on the clusterlink-operator namespace and convert the peer certificates to secrets in the namespace where ClusterLink components will be installed. By default, the clusterlink-system namespace is used. In addition, it will create a ClusterLink instance custom resource object and deploy it to the operator. The operator will then create the ClusterLink components in the clusterlink-system namespace and enable ClusterLink in the cluster. The command assumes that kubectl is set to the correct peer (K8s cluster) and that the certificates were created by running the previous command on the same working directory. If they were not, use the flag --path <path> for pointing to the working directory that was used in the previous command. The --fabric option is optional, and by default, “default_fabric” will be used. To install a specific image of ClusterLink use the --tag <version> flag. For more details and deployment configuration see ClusterLink deployment operator.

    Note

    To set up ClusterLink on another cluster, create another set of peer certificates (step 2). Deploy ClusterLink in a console with access to the cluster (step 3).

Try it out

Check out the ClusterLink tutorials for setting up multi-cluster connectivity for applications using two or more clusters.

  1. To remove a ClusterLink instance from the cluster, please delete the ClusterLink instance custom resource. The ClusterLink operator will subsequently remove all instance components (control-plane, data-plane, and ingress service).

    kubectl delete instances.clusterlink.net  -A --all
    
  2. To completely remove ClusterLink from the cluster, including the operator, CRDs, namespaces, and instances, use the following command:

    clusterlink delete peer --name peer1
    

Note

This command using the current kubectl context.

  1. To uninstall the ClusterLink CLI, use the following command:

    rm `which clusterlink`