mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 10:00:11 +00:00
@@ -8,10 +8,9 @@ hubctx="kind-hub"
|
|||||||
|
|
||||||
kubectl config use ${hubctx}
|
kubectl config use ${hubctx}
|
||||||
|
|
||||||
echo "Add cluster1, cluster2 to the clusterset"
|
echo "Bind clusterset to default namespace"
|
||||||
|
|
||||||
kubectl label managedcluster cluster1 cluster.open-cluster-management.io/clusterset=app-demo --overwrite
|
clusteradm clusterset bind default --namespace default
|
||||||
kubectl label managedcluster cluster2 cluster.open-cluster-management.io/clusterset=app-demo --overwrite
|
|
||||||
|
|
||||||
echo "Label cluster1 so placement will select cluster1 only"
|
echo "Label cluster1 so placement will select cluster1 only"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
apiVersion: cluster.open-cluster-management.io/v1beta1
|
|
||||||
kind: ManagedClusterSet
|
|
||||||
metadata:
|
|
||||||
name: app-demo
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
apiVersion: cluster.open-cluster-management.io/v1beta1
|
|
||||||
kind: ManagedClusterSetBinding
|
|
||||||
metadata:
|
|
||||||
name: app-demo
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
clusterSet: app-demo
|
|
||||||
@@ -6,7 +6,7 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
numberOfClusters: 1
|
numberOfClusters: 1
|
||||||
clusterSets:
|
clusterSets:
|
||||||
- app-demo
|
- default
|
||||||
predicates:
|
predicates:
|
||||||
- requiredClusterSelector:
|
- requiredClusterSelector:
|
||||||
labelSelector:
|
labelSelector:
|
||||||
|
|||||||
19
solutions/deploy-manifests/README.md
Normal file
19
solutions/deploy-manifests/README.md
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# Deploy manifests to a managed cluster
|
||||||
|
|
||||||
|
## Prerequisite
|
||||||
|
|
||||||
|
Set up the dev environment in your local machine following [setup dev environment](../setup-dev-environment).
|
||||||
|
|
||||||
|
## Run the clusteradm command to deploy an nginx deployment to a cluster
|
||||||
|
|
||||||
|
```
|
||||||
|
clusteradm create work nginx -f manifests/nginx.yaml --cluster cluster1
|
||||||
|
```
|
||||||
|
|
||||||
|
Now will see that nginx deployment is applied on cluster1. To update the existing nginx deployment on the cluster, run:
|
||||||
|
|
||||||
|
```
|
||||||
|
clusteradm create work nginx -f manifests/nginx.yaml --cluster cluster1 --overwrite
|
||||||
|
```
|
||||||
|
|
||||||
|
it will update the nginx deployment on the cluster1.
|
||||||
20
solutions/deploy-manifests/manifests/nginx.yaml
Normal file
20
solutions/deploy-manifests/manifests/nginx.yaml
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: nginx-deployment
|
||||||
|
namespace: default
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx
|
||||||
|
replicas: 2 # tells deployment to run 2 pods matching the template
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx
|
||||||
|
image: nginx:1.14.2
|
||||||
|
ports:
|
||||||
|
- containerPort: 80
|
||||||
Reference in New Issue
Block a user