Application lifecycle management

After the cluster manager is installed, you could install the application management components to the hub cluster.

Prerequisite

You must meet the following prerequisites to install the application lifecycle management add-on:

  • Ensure kubectl and kustomize are installed.

  • Ensure golang is installed, if you are planning to install from the source.

  • Ensure the open-cluster-management cluster manager is installed. See Cluster Manager for more information.

  • Ensure the open-cluster-management klusterlet is installed. See Klusterlet for more information.

Install from source

Clone the multicloud-operators-subscription repository.

git clone https://github.com/open-cluster-management/multicloud-operators-subscription

Deploy the subscription operators to the hub cluster.

export TRAVIS_BUILD=0
kubectl config use-context <hub cluster context> # kubectl config use-context kind-hub
cd multicloud-operators-subscription
make deploy-community-hub # make deploy-community-hub GO_REQUIRED_MIN_VERSION:= # if you see warnings regarding go version

Deploy the subscription operators to managed cluster(s).

export TRAVIS_BUILD=0
export HUB_KUBECONFIG=</path/to/hub_cluster/.kube/config> # export HUB_KUBECONFIG=~/hub-kubeconfig
kubectl config use-context <managed cluster context> # kubectl config use-context kind-cluster1
export MANAGED_CLUSTER_NAME=<managed cluster name> # export MANAGED_CLUSTER_NAME=cluster1
make deploy-community-managed # make deploy-community-managed GO_REQUIRED_MIN_VERSION:= # if you see warnings regarding go version

Install community operator from OperatorHub.io

If you are using OKD, OpenShift, or have OLM installed in your cluster, you can install the multicluster subscription community operator with a released version from the OperatorHub.io.

What is next

After a successful deployment, test the subscription operator with a helm subscription. Run the following command:

kubectl config use-context <hub cluster context> # kubectl config use-context kind-hub
cd multicloud-operators-subscription
kubectl apply -f examples/helmrepo-hub-channel

After a while, you should see the subscription propagated to the managed cluster and the Helm app installed. By default, when a subscription deploys subscribed applications to target clusters, the applications are deployed to that subscription namespace. To confirm, run the following command:

$ kubectl config use-context <managed cluster context> # kubectl config use-context kind-cluster1
$ kubectl get subscriptions.apps 
NAME        STATUS       AGE    LOCAL PLACEMENT   TIME WINDOW
nginx-sub   Subscribed   107m   true  
$ kubectl get pod
NAME                                                   READY   STATUS      RESTARTS   AGE
nginx-ingress-47f79-controller-6f495bb5f9-lpv7z        1/1     Running     0          108m
nginx-ingress-47f79-default-backend-7559599b64-rhwgm   1/1     Running     0          108m