Skip to content

Commit 8937518

Browse files
authored
use old LB DNS format when teamId prefix is disabled (zalando#2011)
* use old LB DNS format when teamId prefix is disabled * support both old and new format in external-dns * switch dns template from team to namespace
1 parent 21d00e2 commit 8937518

File tree

12 files changed

+113
-54
lines changed

12 files changed

+113
-54
lines changed

charts/postgres-operator/crds/operatorconfigurations.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,10 +424,10 @@ spec:
424424
default: "Cluster"
425425
master_dns_name_format:
426426
type: string
427-
default: "{cluster}.{team}.{hostedzone}"
427+
default: "{cluster}.{namespace}.{hostedzone}"
428428
replica_dns_name_format:
429429
type: string
430-
default: "{cluster}-repl.{team}.{hostedzone}"
430+
default: "{cluster}-repl.{namespace}.{hostedzone}"
431431
aws_or_gcp:
432432
type: object
433433
properties:

charts/postgres-operator/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,9 @@ configLoadBalancer:
269269
# define external traffic policy for the load balancer
270270
external_traffic_policy: "Cluster"
271271
# defines the DNS name string template for the master load balancer cluster
272-
master_dns_name_format: "{cluster}.{team}.{hostedzone}"
272+
master_dns_name_format: "{cluster}.{namespace}.{hostedzone}"
273273
# defines the DNS name string template for the replica load balancer cluster
274-
replica_dns_name_format: "{cluster}-repl.{team}.{hostedzone}"
274+
replica_dns_name_format: "{cluster}-repl.{namespace}.{hostedzone}"
275275

276276
# options to aid debugging of the operator itself
277277
configDebug:

docs/reference/operator_parameters.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,15 +617,15 @@ In the CRD-based configuration they are grouped under the `load_balancer` key.
617617

618618
* **master_dns_name_format** defines the DNS name string template for the
619619
master load balancer cluster. The default is
620-
`{cluster}.{team}.{hostedzone}`, where `{cluster}` is replaced by the cluster
621-
name, `{team}` is replaced with the team name and `{hostedzone}` is replaced
620+
`{cluster}.{namespace}.{hostedzone}`, where `{cluster}` is replaced by the cluster
621+
name, `{namespace}` is replaced with the namespace and `{hostedzone}` is replaced
622622
with the hosted zone (the value of the `db_hosted_zone` parameter). No other
623623
placeholders are allowed.
624624

625625
* **replica_dns_name_format** defines the DNS name string template for the
626626
replica load balancer cluster. The default is
627-
`{cluster}-repl.{team}.{hostedzone}`, where `{cluster}` is replaced by the
628-
cluster name, `{team}` is replaced with the team name and `{hostedzone}` is
627+
`{cluster}-repl.{namespace}.{hostedzone}`, where `{cluster}` is replaced by the
628+
cluster name, `{namespace}` is replaced with the namespace and `{hostedzone}` is
629629
replaced with the hosted zone (the value of the `db_hosted_zone` parameter).
630630
No other placeholders are allowed.
631631

docs/user.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ specified explicitly.
152152

153153
The operator automatically generates a password for each manifest role and
154154
places it in the secret named
155-
`{username}.{team}-{clustername}.credentials.postgresql.acid.zalan.do` in the
155+
`{username}.{clustername}.credentials.postgresql.acid.zalan.do` in the
156156
same namespace as the cluster. This way, the application running in the
157157
K8s cluster and connecting to Postgres can obtain the password right from the
158158
secret, without ever sharing it outside of the cluster.
@@ -182,7 +182,7 @@ be in the form of `namespace.username`.
182182

183183
For such usernames, the secret is created in the given namespace and its name is
184184
of the following form,
185-
`{namespace}.{username}.{team}-{clustername}.credentials.postgresql.acid.zalan.do`
185+
`{namespace}.{username}.{clustername}.credentials.postgresql.acid.zalan.do`
186186

187187
### Infrastructure roles
188188

manifests/configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ data:
8787
logical_backup_schedule: "30 00 * * *"
8888
major_version_upgrade_mode: "manual"
8989
# major_version_upgrade_team_allow_list: ""
90-
master_dns_name_format: "{cluster}.{team}.{hostedzone}"
90+
master_dns_name_format: "{cluster}.{namespace}.{hostedzone}"
9191
# master_pod_move_timeout: 20m
9292
# max_instances: "-1"
9393
# min_instances: "-1"
@@ -124,7 +124,7 @@ data:
124124
ready_wait_interval: 3s
125125
ready_wait_timeout: 30s
126126
repair_period: 5m
127-
replica_dns_name_format: "{cluster}-repl.{team}.{hostedzone}"
127+
replica_dns_name_format: "{cluster}-repl.{namespace}.{hostedzone}"
128128
replication_username: standby
129129
resource_check_interval: 3s
130130
resource_check_timeout: 10m

manifests/operatorconfiguration.crd.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,10 +422,10 @@ spec:
422422
default: "Cluster"
423423
master_dns_name_format:
424424
type: string
425-
default: "{cluster}.{team}.{hostedzone}"
425+
default: "{cluster}.{namespace}.{hostedzone}"
426426
replica_dns_name_format:
427427
type: string
428-
default: "{cluster}-repl.{team}.{hostedzone}"
428+
default: "{cluster}-repl.{namespace}.{hostedzone}"
429429
aws_or_gcp:
430430
type: object
431431
properties:

manifests/postgresql-operator-default-configuration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ configuration:
133133
enable_replica_load_balancer: false
134134
enable_replica_pooler_load_balancer: false
135135
external_traffic_policy: "Cluster"
136-
master_dns_name_format: "{cluster}.{team}.{hostedzone}"
137-
replica_dns_name_format: "{cluster}-repl.{team}.{hostedzone}"
136+
master_dns_name_format: "{cluster}.{namespace}.{hostedzone}"
137+
replica_dns_name_format: "{cluster}-repl.{namespace}.{hostedzone}"
138138
aws_or_gcp:
139139
# additional_secret_mount: "some-secret-name"
140140
# additional_secret_mount_path: "/some/dir"

0 commit comments

Comments
 (0)