Skip to content

Commit

Permalink
feat: remove-pgbouncer
Browse files Browse the repository at this point in the history
  • Loading branch information
skatsaounis committed Sep 2, 2024
1 parent 1d1f97e commit 211d481
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 70 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,5 @@ And `juju login` as usual.
- MAAS Region: <https://charmhub.io/maas-region>
- MAAS Region: <https://charmhub.io/maas-agent>
- PostgreSQL: <https://charmhub.io/postgresql>
- PgBouncer: <https://charmhub.io/pgbouncer>
- HAProxy: <https://charmhub.io/haproxy>
- Keepalived: <https://charmhub.io/keepalived>
2 changes: 1 addition & 1 deletion anvil-python/anvil/commands/upgrades/inter_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def __init__(
jhelper,
manifest,
model,
["maas-region", "pgbouncer"],
["maas-region"],
"maas-region-plan",
MAASREGION_CONFIG_KEY,
MAASREGION_UNIT_TIMEOUT,
Expand Down
11 changes: 2 additions & 9 deletions anvil-python/anvil/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

MAAS_REGION_CHANNEL = "3.4/edge"
MAAS_AGENT_CHANNEL = "3.4/edge"
MAAS_REGION_CHANNEL = "3.5/edge"
MAAS_AGENT_CHANNEL = "3.5/edge"
POSTGRESQL_CHANNEL = "14/stable"
PGBOUNCER_CHANNEL = "1/stable"
HAPROXY_CHANNEL = "latest/stable"
KEEPALIVED_CHANNEL = "latest/stable"

Expand All @@ -25,7 +24,6 @@
"maas-agent": MAAS_AGENT_CHANNEL,
"haproxy": HAPROXY_CHANNEL,
"postgresql": POSTGRESQL_CHANNEL,
"pgbouncer": PGBOUNCER_CHANNEL,
"keepalived": KEEPALIVED_CHANNEL,
}
K8S_CHARMS: dict[str, str] = {}
Expand All @@ -48,11 +46,6 @@
"revision": "charm_maas_region_revision",
"config": "charm_maas_region_config",
},
"pgbouncer": {
"channel": "charm_pgbouncer_channel",
"revision": "charm_pgbouncer_revision",
"config": "charm_pgbouncer_config",
},
}
}

Expand Down
36 changes: 2 additions & 34 deletions cloud/etc/deploy-maas-region/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,7 @@ resource "juju_application" "maas-region" {
)
}

resource "juju_application" "pgbouncer" {
name = "pgbouncer"
model = data.juju_model.machine_model.name
units = 0 # it is a subordinate charm

charm {
name = "pgbouncer"
channel = var.charm_pgbouncer_channel
revision = var.charm_pgbouncer_revision
base = "ubuntu@22.04"
}

config = merge({
pool_mode = "session"
max_db_connections = var.max_connections_per_region
}, var.charm_pgbouncer_config)
}

resource "juju_integration" "postgresql-pgbouncer" {
model = data.juju_model.machine_model.name

application {
name = "postgresql"
endpoint = "database"
}

application {
name = juju_application.pgbouncer.name
endpoint = "backend-database"
}
}

resource "juju_integration" "maas-region-pgbouncer" {
resource "juju_integration" "maas-region-postgresql" {
model = data.juju_model.machine_model.name

application {
Expand All @@ -93,7 +61,7 @@ resource "juju_integration" "maas-region-pgbouncer" {
}

application {
name = juju_application.pgbouncer.name
name = "postgresql"
endpoint = "database"
}
}
Expand Down
26 changes: 1 addition & 25 deletions cloud/etc/deploy-maas-region/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,32 +48,8 @@ variable "enable_haproxy" {
default = false
}

variable "charm_pgbouncer_channel" {
description = "Operator channel for PgBouncer deployment"
type = string
default = "1/stable"
}

variable "charm_pgbouncer_revision" {
description = "Operator channel revision for PgBouncer deployment"
type = number
default = null
}

variable "charm_pgbouncer_config" {
description = "Operator config for PgBouncer deployment"
type = map(string)
default = {}
}

variable "max_connections_per_region" {
description = "Maximum number of concurrent connections to allow to the database server per region"
type = number
default = 50
}

variable "tls_mode" {
description = "TLS Mode for MAAS Region charm ('', 'termination', or 'passthrough')"
type = string
default = ""
}
}

0 comments on commit 211d481

Please sign in to comment.