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
, andimagebuilder
are required.
-
Clone this repository by using
git clone
. -
Build the
submariner-addon
image locally by runningmake images
. -
Prepare clusters by running
make clusters
. This will:- Create two clusters:
cluster1
andcluster2
.cluster1
is going to be used as the Hub. - Load the local Docker images to the kind cluster
cluster1
. - Deploy the operator-lifecycle-manager
- Deploy the
ClusterManager
andsubmariner-addon
oncluster1
. This includes the required Hub cluster components. - Deploy the
Klusterlet
oncluster1
andcluster2
. This includes the required the managed cluster agents. - Join
cluster1
andcluster2
to the Hub clustercluster1
, thecluster1
andcluster2
are 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
ManagedClusterAddon
on each managed cluster namespaces. - Deploy the Submariner Broker on the Hub cluster and the required Submariner components on the managed clusters.
- Interconnect
cluster1
andcluster2
using 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 Manager
Operator and instance (version >= 0.2.0) from OperatorHub. -
On the managed clusters, install
Klusterlet
Operator and instance (version >= 0.2.0) from OperatorHub. -
Approve the
ManagedClusters
on the hub cluster.$ oc get managedclusters $ oc get csr | grep <managedcluster name> | grep Pending $ oc adm certificate approve <managedcluster csr>
-
Accept the
ManagedClusters
on 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
ManagedClusters
into theManagedClusterSet
.$ oc label managedclusters <managedcluster name> "cluster.open-cluster-management.io/clusterset=pro" --overwrite
-
Create a
ManagedClusterAddon
in 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-operator
Note: the name of
ManagedClusterAddOn
must besubmariner
The add-on has been integrated into ACM 2.2 as a default component:
-
Install ACM following the
deploy
repo. -
Import or create OCP clusters as managed cluster through the ACM console UI.
Note: The manged clusters must meet the
Prerequisites
for 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
ClusterServiceVersion
resource:kubectl edit ClusterServiceVersion -n open-cluster-management
to 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.