An integration between ACM and Submariner. Submariner enables direct networking between Pods and Services in different Kubernetes clusters.
Check the CONTRIBUTING Doc for how to contribute to the repo.
The steps below can be used for testing on a local environment:
Note:
kind,kubectl, andimagebuilderare required.
-
Clone this repository by using
git clone. -
Build the
submariner-addonimage locally by runningmake images. -
Prepare clusters by running
make clusters. This will:- Create two clusters:
cluster1andcluster2.cluster1is going to be used as the Hub. - Load the local Docker images to the kind cluster
cluster1. - Deploy the operator-lifecycle-manager
- Deploy the
ClusterManagerandsubmariner-addononcluster1. This includes the required Hub cluster components. - Deploy the
Klusterletoncluster1andcluster2. This includes the required the managed cluster agents. - Join
cluster1andcluster2to the Hub clustercluster1, thecluster1andcluster2are the managed clusters.
- Create two clusters:
-
Run the demo by issuing
make demo. This will:- Label the managed clusters with
cluster.open-cluster-management.io/clusterset: clusterset1. - Create a
ClusterSet. - Create
ManagedClusterAddonon each managed cluster namespaces. - Deploy the Submariner Broker on the Hub cluster and the required Submariner components on the managed clusters.
- Interconnect
cluster1andcluster2using Submariner.
- Label the managed clusters with
To delete the kind environment, use make clean.
Note: minimum supported version is OpenShift 4.4/Kubernetes 1.17
The steps below can be used to test with OpenShift Container Platform (OCP) clusters on AWS:
-
Prepare 3 OCP clusters (1 Hub cluster and 2 managed clusters) on AWS for Submariner. Please refer to this section for detailed instructions.
-
On the Hub cluster, install
Cluster ManagerOperator and instance (version >= 0.2.0) from OperatorHub. -
On the managed clusters, install
KlusterletOperator and instance (version >= 0.2.0) from OperatorHub. -
Approve the
ManagedClusterson the hub cluster.$ oc get managedclusters $ oc get csr | grep <managedcluster name> | grep Pending $ oc adm certificate approve <managedcluster csr> -
Accept the
ManagedClusterson the Hub cluster.$ oc patch managedclusters <managedcluster name> --type merge --patch '{"spec":{"hubAcceptsClient":true}}'
-
Apply the manifests of submariner-addon.
$ oc apply -k deploy/config/manifests
-
Create a
ManagedClusterSet.apiVersion: cluster.open-cluster-management.io/v1beta1 kind: ManagedClusterSet metadata: name: pro -
Join the
ManagedClustersinto theManagedClusterSet.$ oc label managedclusters <managedcluster name> "cluster.open-cluster-management.io/clusterset=pro" --overwrite -
Create a
ManagedClusterAddonin the managed cluster namespace to deploy the Submariner on the managed cluster.apiVersion: addon.open-cluster-management.io/v1alpha1 kind: ManagedClusterAddOn metadata: name: submariner namespace: <managedcluster name> spec: installNamespace: submariner-operatorNote: the name of
ManagedClusterAddOnmust besubmariner
The add-on has been integrated into ACM 2.2 as a default component:
-
Install ACM following the
deployrepo. -
Import or create OCP clusters as managed cluster through the ACM console UI.
Note: The manged clusters must meet the
Prerequisitesfor Submariner. -
To test an in-development version of the addon, build an image and push it to one of your repositories on Quay, then edit the
ClusterServiceVersionresource:kubectl edit ClusterServiceVersion -n open-cluster-managementto replace all instances of the addon with your image tag.
You can find the appropriate digest on Quay by clicking on the “download” button and choosing “Docker Pull (by digest)”.
-
Start deploying Submariner to managed clusters following the Setup of Submariner on the Hub cluster above.
To use a different version of Submariner itself, edit submariner.io-submariners-cr.yaml and rebuild your image.