-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmulti_cluster_resource_pod_example.yaml
60 lines (57 loc) · 1.58 KB
/
multi_cluster_resource_pod_example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
apiVersion: mulitcluster.practice.com/v1alpha1
kind: MultiClusterResource
metadata:
name: mypod.pod
namespace: default
spec:
template:
apiVersion: v1
kind: Pod
metadata:
name: multicluster-pod
namespace: default
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always
placement:
clusters:
- name: tencent1
- name: tencent2
- name: tencent4
# 可以不填写
customize:
clusters:
- name: tencent1
action:
- path: "/spec/containers/0/image"
op: "replace"
value:
- "nginx:1.19.0-alpine"
- name: tencent2
action:
- path: "/metadata/annotations/example"
op: "add"
value:
- "example"
- path: "/spec/containers/0/image"
op: "replace"
value:
- "nginx:1.19.0-alpine"
- name: tencent4
action:
- path: "/spec/containers/0/image"
op: "replace"
value:
- "nginx:1.17.0-alpine"
# pod patch 操作默认不能新增容器,所以如下操作不行
# - path: "/spec/containers/-"
# value:
# - "name=busybox11"
# - "image=nginx:1.19.0-alpine"
# op: "add"