Users
This guide will give you a quick start on installing and setting up the 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 the kind project.
Installation
To install ClusterLink on Linux or Mac, use the installation script:
curl -L https://github.com/clusterlink-net/clusterlink/releases/latest/download/clusterlink.sh | sh -
Check the installation by running the command:
clusterlink --version
Setup
To set up ClusterLink on a Kubernetes cluster, follow these steps:
Create the fabric’s 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
andkey.pem
in a directory named <fabric_name>. The--name
option is optional, and by default, “default_fabric” will be used.Create a peer (cluster) certificate:
clusterlink create peer-cert --name <peer_name> --fabric <fabric_name>
This command will create the certificate files
cert.pem
andkey.pem
in a directory named<fabric_name>
/<peer_name>
. The--path <path>
flag can be used to change the directory location. The--name
option is optional, and by default, “default_fabric” will be used.Install ClusterLink deployment operator:
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, theclusterlink-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 theclusterlink-system
namespace and enable ClusterLink in the cluster. The command assumes thatkubectl
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. For more details and deployment configuration see ClusterLink deployment operator.Note
To deploy ClusterLink on another cluster, repeat steps 2-3 in a console with access to the cluster.
Try it out
Check out the ClusterLink Tutorials for setting up multi-cluster connectivity for applications using two or more clusters.
Uninstall ClusterLink
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
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.
To uninstall the ClusterLink CLI, use the following command:
rm `which clusterlink`
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.