Skip to content

Commit

Permalink
Update e2e examples to use placement (#353)
Browse files Browse the repository at this point in the history
Update ansible examples to use placement

Signed-off-by: Jonathan Marcantonio <jmarcant@redhat.com>
  • Loading branch information
lennysgarage authored Jun 22, 2023
1 parent 6a2ac11 commit fa39a85
Show file tree
Hide file tree
Showing 22 changed files with 253 additions and 114 deletions.
7 changes: 7 additions & 0 deletions examples/ansible-post/appsub/01-clustersetbinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
name: default
namespace: default
spec:
clusterSet: default
14 changes: 0 additions & 14 deletions examples/ansible-post/appsub/01-placement-rule.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions examples/ansible-post/appsub/02-placement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: non-local-cluster
namespace: default
spec:
# apply to 1 cluster whoevers name not local-cluster
numberOfClusters: 1
clusterSets:
- default
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: name
operator: "NotIn"
values:
- local-cluster
3 changes: 2 additions & 1 deletion examples/ansible-post/appsub/03-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ spec:
channel: default/git
placement:
placementRef:
kind: PlacementRule
kind: Placement
name: non-local-cluster
namespace: default
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
name: default
namespace: default
spec:
clusterSet: default
14 changes: 0 additions & 14 deletions examples/ansible-pre-workflow/appsub/01-placement-rule.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions examples/ansible-pre-workflow/appsub/02-placement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: non-local-cluster
namespace: default
spec:
# apply to 1 cluster whoevers name not local-cluster
numberOfClusters: 1
clusterSets:
- default
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: name
operator: "NotIn"
values:
- local-cluster
3 changes: 2 additions & 1 deletion examples/ansible-pre-workflow/appsub/03-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ spec:
channel: default/git
placement:
placementRef:
kind: PlacementRule
kind: Placement
name: non-local-cluster
namespace: default
7 changes: 7 additions & 0 deletions examples/ansible-tags/appsub/01-clustersetbinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
name: default
namespace: default
spec:
clusterSet: default
14 changes: 0 additions & 14 deletions examples/ansible-tags/appsub/01-placement-rule.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions examples/ansible-tags/appsub/02-placement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: non-local-cluster
namespace: default
spec:
# apply to 1 cluster whoevers name not local-cluster
numberOfClusters: 1
clusterSets:
- default
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: name
operator: "NotIn"
values:
- local-cluster
3 changes: 2 additions & 1 deletion examples/ansible-tags/appsub/03-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ spec:
channel: default/git
placement:
placementRef:
kind: PlacementRule
kind: Placement
name: non-local-cluster
namespace: default
7 changes: 7 additions & 0 deletions examples/ansible/appsub/01-clustersetbinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
name: default
namespace: default
spec:
clusterSet: default
14 changes: 0 additions & 14 deletions examples/ansible/appsub/01-placement-rule.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions examples/ansible/appsub/02-placement.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: non-local-cluster
namespace: default
spec:
# apply to 1 cluster whoevers name not local-cluster
numberOfClusters: 1
clusterSets:
- default
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: name
operator: "NotIn"
values:
- local-cluster
3 changes: 2 additions & 1 deletion examples/ansible/appsub/03-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ spec:
channel: default/git
placement:
placementRef:
kind: PlacementRule
kind: Placement
name: non-local-cluster
namespace: default
33 changes: 24 additions & 9 deletions examples/e2e_example/github_channel_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,38 @@ spec:
type: Git
pathname: https://github.com/ianzhang366/acm-applifecycle-samples.git
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
name: default
namespace: default
spec:
clusterSet: default
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: towhichcluster
namespace: git-sub-ns
namespace: default
labels:
name: git-sub
spec:
clusterReplicas: 1
clusterLabels:
matchLabels:
environment: Dev
numberOfClusters: 1
clusterSets:
- default
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: environment
operator: "In"
values:
- Dev
---
apiVersion: apps.open-cluster-management.io/v1
kind: Subscription
metadata:
name: git-sub
namespace: git-sub-ns
labels:
name: git-sub
annotations:
Expand All @@ -61,4 +75,5 @@ spec:
placement:
placementRef:
name: towhichcluster
kind: PlacementRule
namespace: default
kind: Placement
33 changes: 24 additions & 9 deletions examples/e2e_example/github_helm_channel_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,38 @@ spec:
type: Git
pathname: https://github.com/open-cluster-management/multicloud-operators-subscription
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
name: default
namespace: default
spec:
clusterSet: default
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: towhichcluster
namespace: git-sub-ns-helm
namespace: default
labels:
name: git-sub
spec:
clusterReplicas: 1
clusterLabels:
matchLabels:
environment: Dev
numberOfClusters: 1
clusterSets:
- default
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: environment
operator: "In"
values:
- Dev
---
apiVersion: apps.open-cluster-management.io/v1
kind: Subscription
metadata:
name: git-helm-sub
namespace: git-sub-ns-helm
annotations:
apps.open-cluster-management.io/github-path: test/github/helmcharts/chart1
labels:
Expand All @@ -61,4 +75,5 @@ spec:
placement:
placementRef:
name: towhichcluster
kind: PlacementRule
namespace: default
kind: Placement
33 changes: 24 additions & 9 deletions examples/e2e_example/helm_channel_e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,38 @@ spec:
pathname: https://ianzhang366.github.io/guestbook-chart/
insecureSkipVerify: true
---
apiVersion: apps.open-cluster-management.io/v1
kind: PlacementRule
apiVersion: cluster.open-cluster-management.io/v1beta2
kind: ManagedClusterSetBinding
metadata:
name: default
namespace: default
spec:
clusterSet: default
---
apiVersion: cluster.open-cluster-management.io/v1beta1
kind: Placement
metadata:
name: towhichcluster
namespace: helm-sub-ns
namespace: default
labels:
name: helm-sub
spec:
clusterReplicas: 1
clusterLabels:
matchLabels:
environment: Dev
numberOfClusters: 1
clusterSets:
- default
predicates:
- requiredClusterSelector:
labelSelector:
matchExpressions:
- key: environment
operator: "In"
values:
- Dev
---
apiVersion: apps.open-cluster-management.io/v1
kind: Subscription
metadata:
name: helm-sub
namespace: helm-sub-ns
labels:
name: helm-sub
spec:
Expand All @@ -63,4 +77,5 @@ spec:
placement:
placementRef:
name: towhichcluster
kind: PlacementRule
namespace: default
kind: Placement
Loading

0 comments on commit fa39a85

Please sign in to comment.