Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions api/apiv1/design/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ var DatabaseNodeSpec = g.Type("DatabaseNodeSpec", func() {
g.Example(5432)
g.Meta("struct:tag:json", "port,omitempty")
})
g.Attribute("patroni_port", g.Int, func() {
g.Description("The port used by Patroni for this node. Overrides the Patroni port set in the DatabaseSpec. NOTE: This field is not currently supported for Docker Swarm.")
g.Minimum(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does port 0 have meaningful semantics for Patroni on SystemD hosts, or should this be Minimum(1) since there's no random-port-assignment mechanism like Docker provides?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good callout! Yes, it has the same meaning: 0 will assign a random port. You're right that we can't rely on OS features to do that for us, so I'm building that feature. I've kept this description vague for now since I'm still working out the details, and I don't want it to be misleading if we need to cut a release before I'm done. We will also eventually add support for this field in Swarm because it's useful for deploying a proxy in front of the instances. That'll be a separate follow-up ticket.

g.Maximum(65535)
g.Example(8888)
g.Meta("struct:tag:json", "patroni_port,omitempty")
})
g.Attribute("cpus", g.String, func() {
g.Description("The number of CPUs to allocate for the database on this node and to use for tuning Postgres. It can include the SI suffix 'm', e.g. '500m' for 500 millicpus. Cannot allocate units smaller than 1m. Defaults to the number of available CPUs on the host if 0 or unspecified. Cannot allocate more CPUs than are available on the host. Whether this limit is enforced depends on the orchestrator.")
g.Pattern(cpuPattern)
Expand Down Expand Up @@ -540,6 +547,13 @@ var DatabaseSpec = g.Type("DatabaseSpec", func() {
g.Example(5432)
g.Meta("struct:tag:json", "port,omitempty")
})
g.Attribute("patroni_port", g.Int, func() {
g.Description("The port used by Patroni for this database. NOTE: This field is not currently supported for Docker Swarm.")
g.Minimum(0)
g.Maximum(65535)
g.Example(8888)
g.Meta("struct:tag:json", "patroni_port,omitempty")
})
g.Attribute("cpus", g.String, func() {
g.Description("The number of CPUs to allocate for the database and to use for tuning Postgres. Defaults to the number of available CPUs on the host. Can include an SI suffix, e.g. '500m' for 500 millicpus. Whether this limit is enforced depends on the orchestrator.")
g.Pattern(cpuPattern)
Expand Down
7 changes: 7 additions & 0 deletions api/apiv1/gen/control_plane/service.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions api/apiv1/gen/http/control_plane/client/encode_decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions api/apiv1/gen/http/control_plane/client/types.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions api/apiv1/gen/http/control_plane/server/encode_decode.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading