Skip to content

Commit 021ab07

Browse files
owentherealFxKu
andauthored
Introduce masterServiceAnnotations & replicaServiceAnnotations (#2161)
* Introduce `masterServiceAnnotations` & `replicaServiceAnnotations` Introduce `masterServiceAnnotations` & `replicaServiceAnnotations` to the `Postgresql` CRD. `masterServiceAnnotations` overrides `serviceAnnotations` for master role if not empty. `replicaServiceAnnotations` overrides `serviceAnnotations` for replica role if not empty. Existing definition of `serviceAnnotations` continue to work for backward compatibitlity when neither `masterServiceAnnotations` nor `replicaServiceAnnotations` is defined. This closes #1927 * Accumulate service annotations First, global config, then ServiceAnnotations overriding, then MasterServiceAnnotations and ReplicaServiceAnnotations. This addresses #2161 (comment). * Update admin doc with master & replica service annotations overrides Addressed #2161 (comment) Co-authored-by: Felix Kunde <[email protected]>
1 parent 9744813 commit 021ab07

File tree

11 files changed

+184
-60
lines changed

11 files changed

+184
-60
lines changed

charts/postgres-operator/crds/postgresqls.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ spec:
223223
items:
224224
type: string
225225
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
226+
masterServiceAnnotations:
227+
type: object
228+
additionalProperties:
229+
type: string
226230
nodeAffinity:
227231
type: object
228232
properties:
@@ -402,6 +406,10 @@ spec:
402406
replicaLoadBalancer:
403407
type: boolean
404408
description: deprecated
409+
replicaServiceAnnotations:
410+
type: object
411+
additionalProperties:
412+
type: string
405413
resources:
406414
type: object
407415
properties:

docs/administrator.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,9 +784,15 @@ services:
784784
This value can't be overwritten. If any changing in its value is needed, it
785785
MUST be done changing the DNS format operator config parameters; and
786786
- `service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout` with
787-
a default value of "3600". This value can be overwritten with the operator
788-
config parameter `custom_service_annotations` or the cluster parameter
789-
`serviceAnnotations`.
787+
a default value of "3600".
788+
789+
There are multiple options to specify service annotations that will be merged
790+
with each other and override in the following order (where latter take
791+
precedence):
792+
1. Default annotations if LoadBalancer is enabled
793+
2. Globally configured `custom_service_annotations`
794+
3. `serviceAnnotations` specified in the cluster manifest
795+
4. `masterServiceAnnotations` and `replicaServiceAnnotations` specified in the cluster manifest
790796

791797
To limit the range of IP addresses that can reach a load balancer, specify the
792798
desired ranges in the `allowedSourceRanges` field (applies to both master and

docs/reference/cluster_manifest.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,22 @@ These parameters are grouped directly under the `spec` key in the manifest.
173173
[administrator docs](https://github.com/zalando/postgres-operator/blob/master/docs/administrator.md#load-balancers-and-allowed-ip-ranges)
174174
for more information regarding default values and overwrite rules.
175175

176+
* **masterServiceAnnotations**
177+
A map of key value pairs that gets attached as [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/)
178+
to the master service created for the database cluster. Check the
179+
[administrator docs](https://github.com/zalando/postgres-operator/blob/master/docs/administrator.md#load-balancers-and-allowed-ip-ranges)
180+
for more information regarding default values and overwrite rules.
181+
This field overrides `serviceAnnotations` with the same key for the master
182+
service if not empty.
183+
184+
* **replicaServiceAnnotations**
185+
A map of key value pairs that gets attached as [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/)
186+
to the replica service created for the database cluster. Check the
187+
[administrator docs](https://github.com/zalando/postgres-operator/blob/master/docs/administrator.md#load-balancers-and-allowed-ip-ranges)
188+
for more information regarding default values and overwrite rules.
189+
This field overrides `serviceAnnotations` with the same key for the replica
190+
service if not empty.
191+
176192
* **enableShmVolume**
177193
Start a database pod without limitations on shm memory. By default Docker
178194
limit `/dev/shm` to `64M` (see e.g. the [docker

go.mod

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ require (
1111
github.com/r3labs/diff v1.1.0
1212
github.com/sirupsen/logrus v1.8.1
1313
github.com/stretchr/testify v1.7.0
14-
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e
14+
golang.org/x/crypto v0.1.0
15+
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a
1516
gopkg.in/yaml.v2 v2.4.0
1617
k8s.io/api v0.23.5
1718
k8s.io/apiextensions-apiserver v0.23.5
@@ -33,7 +34,7 @@ require (
3334
github.com/gogo/protobuf v1.3.2 // indirect
3435
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3536
github.com/golang/protobuf v1.5.2 // indirect
36-
github.com/google/go-cmp v0.5.5 // indirect
37+
github.com/google/go-cmp v0.5.8 // indirect
3738
github.com/google/gofuzz v1.1.0 // indirect
3839
github.com/googleapis/gnostic v0.5.5 // indirect
3940
github.com/imdario/mergo v0.3.5 // indirect
@@ -47,15 +48,14 @@ require (
4748
github.com/modern-go/reflect2 v1.0.2 // indirect
4849
github.com/pmezard/go-difflib v1.0.0 // indirect
4950
github.com/spf13/pflag v1.0.5 // indirect
50-
golang.org/x/mod v0.5.1 // indirect
51-
golang.org/x/net v0.0.0-20211209124913-491a49abca63 // indirect
51+
golang.org/x/mod v0.6.0 // indirect
52+
golang.org/x/net v0.1.0 // indirect
5253
golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect
53-
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 // indirect
54-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
55-
golang.org/x/text v0.3.7 // indirect
54+
golang.org/x/sys v0.1.0 // indirect
55+
golang.org/x/term v0.1.0 // indirect
56+
golang.org/x/text v0.4.0 // indirect
5657
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
57-
golang.org/x/tools v0.1.7 // indirect
58-
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
58+
golang.org/x/tools v0.2.0 // indirect
5959
google.golang.org/appengine v1.6.7 // indirect
6060
google.golang.org/protobuf v1.27.1 // indirect
6161
gopkg.in/inf.v0 v0.9.1 // indirect

go.sum

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,9 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
216216
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
217217
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
218218
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
219-
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
220219
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
220+
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
221+
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
221222
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
222223
github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g=
223224
github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -500,8 +501,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
500501
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
501502
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
502503
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
503-
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8=
504-
golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
504+
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
505+
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
505506
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
506507
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
507508
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -512,6 +513,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
512513
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
513514
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
514515
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
516+
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a h1:tlXy25amD5A7gOfbXdqCGN5k8ESEed/Ee1E5RcrYnqU=
517+
golang.org/x/exp v0.0.0-20230108222341-4b8118a2686a/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
515518
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
516519
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
517520
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
@@ -537,8 +540,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
537540
golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
538541
golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
539542
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
540-
golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
541-
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
543+
golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I=
544+
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
542545
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
543546
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
544547
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -586,8 +589,9 @@ golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qx
586589
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
587590
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
588591
golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
589-
golang.org/x/net v0.0.0-20211209124913-491a49abca63 h1:iocB37TsdFuN6IBRZ+ry36wrkoV51/tl5vOWqkcPGvY=
590592
golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
593+
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
594+
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
591595
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
592596
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
593597
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -676,11 +680,12 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
676680
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
677681
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
678682
golang.org/x/sys v0.0.0-20210831042530-f4d43177bf5e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
679-
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881 h1:TyHqChC80pFkXWraUUf6RuB5IqFdQieMLwwCJokV2pc=
680-
golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
683+
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
684+
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
681685
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
682-
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
683686
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
687+
golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
688+
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
684689
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
685690
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
686691
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -689,8 +694,9 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
689694
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
690695
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
691696
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
692-
golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
693697
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
698+
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
699+
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
694700
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
695701
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
696702
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -756,8 +762,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
756762
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
757763
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
758764
golang.org/x/tools v0.1.6-0.20210820212750-d4cc65f0b2ff/go.mod h1:YD9qOF0M9xpSpdWTBbzEl5e/RnCefISl8E5Noe10jFM=
759-
golang.org/x/tools v0.1.7 h1:6j8CgantCy3yc8JGBqkDLMKWqZ0RDU2g1HVgacojGWQ=
760-
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
765+
golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
766+
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
761767
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
762768
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
763769
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

manifests/postgresql.crd.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ spec:
221221
items:
222222
type: string
223223
pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$'
224+
masterServiceAnnotations:
225+
type: object
226+
additionalProperties:
227+
type: string
224228
nodeAffinity:
225229
type: object
226230
properties:
@@ -400,6 +404,10 @@ spec:
400404
replicaLoadBalancer:
401405
type: boolean
402406
description: deprecated
407+
replicaServiceAnnotations:
408+
type: object
409+
additionalProperties:
410+
type: string
403411
resources:
404412
type: object
405413
properties:

pkg/apis/acid.zalan.do/v1/crds.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,14 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
355355
},
356356
},
357357
},
358+
"masterServiceAnnotations": {
359+
Type: "object",
360+
AdditionalProperties: &apiextv1.JSONSchemaPropsOrBool{
361+
Schema: &apiextv1.JSONSchemaProps{
362+
Type: "string",
363+
},
364+
},
365+
},
358366
"nodeAffinity": {
359367
Type: "object",
360368
Properties: map[string]apiextv1.JSONSchemaProps{
@@ -654,6 +662,14 @@ var PostgresCRDResourceValidation = apiextv1.CustomResourceValidation{
654662
Type: "boolean",
655663
Description: "deprecated",
656664
},
665+
"replicaServiceAnnotations": {
666+
Type: "object",
667+
AdditionalProperties: &apiextv1.JSONSchemaPropsOrBool{
668+
Schema: &apiextv1.JSONSchemaProps{
669+
Type: "string",
670+
},
671+
},
672+
},
657673
"resources": {
658674
Type: "object",
659675
Properties: map[string]apiextv1.JSONSchemaProps{

pkg/apis/acid.zalan.do/v1/postgresql_type.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ type PostgresSpec struct {
7979
StandbyCluster *StandbyDescription `json:"standby,omitempty"`
8080
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
8181
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
82-
TLS *TLSDescription `json:"tls,omitempty"`
83-
AdditionalVolumes []AdditionalVolume `json:"additionalVolumes,omitempty"`
84-
Streams []Stream `json:"streams,omitempty"`
85-
Env []v1.EnvVar `json:"env,omitempty"`
82+
// MasterServiceAnnotations takes precedence over ServiceAnnotations for master role if not empty
83+
MasterServiceAnnotations map[string]string `json:"masterServiceAnnotations,omitempty"`
84+
// ReplicaServiceAnnotations takes precedence over ServiceAnnotations for replica role if not empty
85+
ReplicaServiceAnnotations map[string]string `json:"replicaServiceAnnotations,omitempty"`
86+
TLS *TLSDescription `json:"tls,omitempty"`
87+
AdditionalVolumes []AdditionalVolume `json:"additionalVolumes,omitempty"`
88+
Streams []Stream `json:"streams,omitempty"`
89+
Env []v1.EnvVar `json:"env,omitempty"`
8690

8791
// deprecated json tags
8892
InitContainersOld []v1.Container `json:"init_containers,omitempty"`

pkg/apis/acid.zalan.do/v1/zz_generated.deepcopy.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)