Skip to content

Commit d7d851b

Browse files
andrewlecuyerjkatz
authored andcommitted
Sync the cluster service template in the Ansible installer
with the cluster service template for a bash install. This ensures that the proper ports and selectors are in place for any services (e.g. primary and replica services) created for a cluster.
1 parent 9be012b commit d7d851b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ansible/roles/pgo-operator/files/pgo-configs/cluster-service.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,25 @@
3535
"port": {{.ExporterPort}},
3636
"targetPort": {{.ExporterPort}},
3737
"nodePort": 0
38+
}, {
39+
"name": "patroni",
40+
"protocol": "TCP",
41+
"port": 8009,
42+
"targetPort": 8009,
43+
"nodePort": 0
3844
}
3945
],
4046
"selector": {
47+
{{ if or (eq .Name .ClusterName) (eq .Name (printf "%s%s" .ClusterName "-replica")) }}
48+
"pg-cluster": "{{.ClusterName}}",
49+
{{ if eq .Name (printf "%s%s" .ClusterName "-replica") }}
50+
"role": "replica"
51+
{{else}}
52+
"role": "master"
53+
{{end}}
54+
{{else}}
4155
"service-name": "{{.ServiceName}}"
56+
{{end}}
4257
},
4358
"type": "{{.ServiceType}}",
4459
"sessionAffinity": "None"

0 commit comments

Comments
 (0)