Skip to content

Commit 4d24e41

Browse files
authored
docs: add rp examples (#192)
1 parent 15623ab commit 4d24e41

File tree

3 files changed

+67
-0
lines changed

3 files changed

+67
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This tests selecting a single resource in a namespace,
2+
# and applying it to all clusters.
3+
# Prerequisite: create a configMap named "test-cm" in namespace "test-ns".
4+
apiVersion: placement.kubernetes-fleet.io/v1beta1
5+
kind: ResourcePlacement
6+
metadata:
7+
name: rp-cm
8+
namespace: test-ns
9+
spec:
10+
resourceSelectors:
11+
- group: ""
12+
kind: ConfigMap
13+
name: test-cm
14+
version: v1
15+
policy:
16+
placementType: PickAll
17+
strategy:
18+
type: RollingUpdate
19+
rollingUpdate:
20+
maxUnavailable: 1
21+
maxSurge: 1
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This tests selecting multiple resources in a namespace,
2+
# and only applying to a subset of clusters.
3+
# Prerequisite: create and expose a deployment named "test-nginx" in namespace "test-ns".
4+
apiVersion: placement.kubernetes-fleet.io/v1beta1
5+
kind: ResourcePlacement
6+
metadata:
7+
name: rp-nginx
8+
namespace: test-ns
9+
spec:
10+
resourceSelectors:
11+
- group: apps
12+
kind: Deployment
13+
name: test-nginx
14+
version: v1
15+
- group: ""
16+
kind: Service
17+
name: test-nginx
18+
version: v1
19+
policy:
20+
placementType: PickN
21+
numberOfClusters: 2
22+
strategy:
23+
type: RollingUpdate
24+
rollingUpdate:
25+
maxUnavailable: 1
26+
maxSurge: 1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# This tests a CRP selecting a namespace only.
2+
# Prerequisite: create a namespace named "test-ns".
3+
apiVersion: placement.kubernetes-fleet.io/v1beta1
4+
kind: ClusterResourcePlacement
5+
metadata:
6+
name: ns-only-crp
7+
spec:
8+
resourceSelectors:
9+
- group: ""
10+
kind: Namespace
11+
name: test-ns
12+
version: v1
13+
selectionScope: NamespaceOnly # only namespace itself is placed, no resources within the namespace
14+
policy:
15+
placementType: PickAll
16+
strategy:
17+
type: RollingUpdate
18+
rollingUpdate:
19+
maxUnavailable: 1
20+
maxSurge: 1

0 commit comments

Comments
 (0)