- OpenShift CLI Version >= 4.3.0
Needed for kustomize
oc version
- Add the subscription to your Red Hat Advanced Cluster Management for Kubernetes HUB
clone https://github.com/open-cluster-management/demo-subscription-gitops.git
oc apply -k demo-subscription-gitops/placement/subscription/
A nice looking topology you might find is a development & production cluster. Using the console, you can easily create an Application that runs a copy of the application on you development clusters and a different version on proudction.
At least two clusters, each with a distinct label, one for development and one for production.
- Navigate in the left menu to
Managed applications
- Choose
Create application
- Enter the following values:
- Name:
nginx
- Namespace:
nginx
- Repository types
Git
- URL
https://github.com/open-cluster-management/demo-subscription-gitops.git
- Branch
master
- ** Path** `placement/nginx
- Select
Deploy application resources only on clusters matching specified labels
- Enter the label information for your development cluster
- Select
Add another repository
- Repository types
Git
- URL
https://github.com/open-cluster-management/demo-subscription-gitops.git
- Branch
production
- ** Path** `placement/nginx
- Select
Deploy application resources only on clusters matching specified labels
- Enter the label information for your production cluster
- Click
Save
- Navigate to the Manage applications in the UI. Click the
nginx-placement
Application name. - View the Topology, look around, by default the application should have deployed to
vendor: OpenShift
clusters - Click the
Resources
tab - Edit the placement rule, and change
vendor: OpenShift
tocloud: Amazon
and your application will be migrated to any cluster with thecloud: Amazon
label. You need to adjust this key and value pair, based on what is seen in your Cluster List page as available labels - To spread the app to all clusters, change the YAML as follows:
clusterSelector:
matchLabels: {}