File tree 4 files changed +344
-84
lines changed
platforms/kubernetes/postgres-operator
4 files changed +344
-84
lines changed Original file line number Diff line number Diff line change 99
99
enum:
100
100
- true
101
101
- false
102
+ antiaffinity:
103
+ type: object
104
+ x-kubernetes-preserve-unknown-fields: true
105
+ properties:
106
+ policy:
107
+ type: string
108
+ enum:
109
+ - 'preferred'
110
+ - 'required'
111
+ podAntiAffinityTerm:
112
+ type: string
113
+ enum:
114
+ - 'none'
115
+ - 'autofailover-readwrite'
116
+ - 'autofailover-readwrite-readonly'
117
+ topologyKey:
118
+ type: string
102
119
services:
103
120
type: array
104
121
items:
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ metadata:
6
6
spec :
7
7
action : start # stop start
8
8
deletepvc : true
9
+ antiaffinity :
10
+ policy : preferred # preferred/required
11
+ podAntiAffinityTerm : autofailover-readwrite # none/autofailover-readwrite/autofailover-readwrite-readonly
12
+ topologyKey : " kubernetes.io/hostname" # when policy is required, only allow "kubernetes.io/hostname"
9
13
services :
10
14
- selector : primary # autofailover/primary/standby/readonly/standby-readonly
11
15
metadata :
31
35
podspec :
32
36
terminationGracePeriodSeconds : 60
33
37
containers :
34
- - image : docker.io/library/ radondb-postgresql:12.12-v1.0.0
38
+ - image : radondb-postgresql:12.12-v1.0.0
35
39
imagePullPolicy : IfNotPresent
36
40
name : postgresql # can't change the name
37
41
volumeMounts :
72
76
podspec :
73
77
terminationGracePeriodSeconds : 60
74
78
containers :
75
- - image : docker.io/library/ radondb-postgresql:12.12-v1.0.0
79
+ - image : radondb-postgresql:12.12-v1.0.0
76
80
imagePullPolicy : IfNotPresent
77
81
name : postgresql # can't change the name
78
82
volumeMounts :
96
100
podspec :
97
101
terminationGracePeriodSeconds : 60
98
102
containers :
99
- - image : docker.io/library/ radondb-postgresql:12.12-v1.0.0
103
+ - image : radondb-postgresql:12.12-v1.0.0
100
104
imagePullPolicy : IfNotPresent
101
105
name : postgresql # can't change the name
102
106
volumeMounts :
Original file line number Diff line number Diff line change 106
106
MACHINE_MODE = "machine"
107
107
K8S_MODE = "k8s"
108
108
109
+ # antiaffinity
110
+ SPEC_ANTIAFFINITY = "antiaffinity"
111
+ SPEC_ANTIAFFINITY_POLICY = "policy"
112
+ SPEC_ANTIAFFINITY_REQUIRED = "required"
113
+ SPEC_ANTIAFFINITY_PREFERRED = "preferred"
114
+ SPEC_ANTIAFFINITY_POLICY_REQUIRED = "requiredDuringSchedulingIgnoredDuringExecution"
115
+ SPEC_ANTIAFFINITY_POLICY_PREFERRED = "preferredDuringSchedulingIgnoredDuringExecution"
116
+ SPEC_ANTIAFFINITY_PODANTIAFFINITYTERM = "podAntiAffinityTerm"
117
+ SPEC_ANTIAFFINITY_TOPOLOGYKEY = "topologyKey"
118
+
109
119
# docker-compose
110
120
DOCKER_COMPOSE_FILE = "docker-compose.yaml"
111
121
DOCKER_COMPOSE_FILE_DATA = '''
You can’t perform that action at this time.
0 commit comments