Skip to content

Commit dbbe67b

Browse files
authored
Merge branch 'main' into monitor
2 parents d858b08 + c41bf86 commit dbbe67b

File tree

4 files changed

+344
-84
lines changed

4 files changed

+344
-84
lines changed

platforms/kubernetes/postgres-operator/deploy/postgres-operator.yaml.template

+17
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,23 @@ spec:
9999
enum:
100100
- true
101101
- 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
102119
services:
103120
type: array
104121
items:

platforms/kubernetes/postgres-operator/deploy/postgresql.yaml

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ metadata:
66
spec:
77
action: start #stop start
88
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"
913
services:
1014
- selector: primary # autofailover/primary/standby/readonly/standby-readonly
1115
metadata:
@@ -31,7 +35,7 @@ spec:
3135
podspec:
3236
terminationGracePeriodSeconds: 60
3337
containers:
34-
- image: docker.io/library/radondb-postgresql:12.12-v1.0.0
38+
- image: radondb-postgresql:12.12-v1.0.0
3539
imagePullPolicy: IfNotPresent
3640
name: postgresql #can't change the name
3741
volumeMounts:
@@ -72,7 +76,7 @@ spec:
7276
podspec:
7377
terminationGracePeriodSeconds: 60
7478
containers:
75-
- image: docker.io/library/radondb-postgresql:12.12-v1.0.0
79+
- image: radondb-postgresql:12.12-v1.0.0
7680
imagePullPolicy: IfNotPresent
7781
name: postgresql #can't change the name
7882
volumeMounts:
@@ -96,7 +100,7 @@ spec:
96100
podspec:
97101
terminationGracePeriodSeconds: 60
98102
containers:
99-
- image: docker.io/library/radondb-postgresql:12.12-v1.0.0
103+
- image: radondb-postgresql:12.12-v1.0.0
100104
imagePullPolicy: IfNotPresent
101105
name: postgresql #can't change the name
102106
volumeMounts:

platforms/kubernetes/postgres-operator/postgres/constants.py

+10
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@
106106
MACHINE_MODE = "machine"
107107
K8S_MODE = "k8s"
108108

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+
109119
# docker-compose
110120
DOCKER_COMPOSE_FILE = "docker-compose.yaml"
111121
DOCKER_COMPOSE_FILE_DATA = '''

0 commit comments

Comments
 (0)