Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add cluster refresh #35

Merged
merged 27 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ ubuntu@infra1:~$ juju run maas-region/0 create-admin username=admin password=pas

# Managing the cluster after initial deployment


## Cluster updates

You can refresh the cluster by running the `refresh` command:

```bash
ubuntu@infra1:~$ maas-anvil refresh
```

This allows passing a new manifest file with `--manifest` for updating configuration options.

## Juju permission denied

If you get an error message such as:
Expand Down
24 changes: 24 additions & 0 deletions anvil-python/anvil/commands/haproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def haproxy_install_steps(
fqdn: str,
accept_defaults: bool,
preseed: dict[Any, Any],
refresh: bool = False,
) -> List[BaseStep]:
return [
TerraformInitStep(manifest.get_tfhelper("haproxy-plan")),
Expand All @@ -195,6 +196,29 @@ def haproxy_install_steps(
model,
accept_defaults=accept_defaults,
deployment_preseed=preseed,
refresh=refresh,
SK1Y101 marked this conversation as resolved.
Show resolved Hide resolved
),
AddHAProxyUnitsStep(client, fqdn, jhelper, model),
]


def haproxy_upgrade_steps(
client: Client,
manifest: Manifest,
jhelper: JujuHelper,
model: str,
accept_defaults: bool,
preseed: dict[Any, Any],
) -> List[BaseStep]:
return [
TerraformInitStep(manifest.get_tfhelper("haproxy-plan")),
DeployHAProxyApplicationStep(
client,
manifest,
jhelper,
model,
accept_defaults=accept_defaults,
deployment_preseed=preseed,
refresh=True,
),
]
19 changes: 18 additions & 1 deletion anvil-python/anvil/commands/maas_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,26 @@ def maas_agent_install_steps(
jhelper: JujuHelper,
model: str,
fqdn: str,
refresh: bool = False,
) -> List[BaseStep]:
return [
TerraformInitStep(manifest.get_tfhelper("maas-agent-plan")),
DeployMAASAgentApplicationStep(client, manifest, jhelper, model),
DeployMAASAgentApplicationStep(
client, manifest, jhelper, model, refresh=refresh
),
AddMAASAgentUnitsStep(client, fqdn, jhelper, model),
]


def maas_agent_upgrade_steps(
client: Client,
manifest: Manifest,
jhelper: JujuHelper,
model: str,
) -> List[BaseStep]:
return [
TerraformInitStep(manifest.get_tfhelper("maas-agent-plan")),
DeployMAASAgentApplicationStep(
client, manifest, jhelper, model, refresh=True
),
]
19 changes: 18 additions & 1 deletion anvil-python/anvil/commands/maas_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,26 @@ def maas_region_install_steps(
jhelper: JujuHelper,
model: str,
fqdn: str,
refresh: bool = False,
) -> List[BaseStep]:
return [
TerraformInitStep(manifest.get_tfhelper("maas-region-plan")),
DeployMAASRegionApplicationStep(client, manifest, jhelper, model),
DeployMAASRegionApplicationStep(
client, manifest, jhelper, model, refresh
),
AddMAASRegionUnitsStep(client, fqdn, jhelper, model),
]


def maas_region_upgrade_steps(
client: Client,
manifest: Manifest,
jhelper: JujuHelper,
model: str,
) -> List[BaseStep]:
return [
TerraformInitStep(manifest.get_tfhelper("maas-region-plan")),
DeployMAASRegionApplicationStep(
client, manifest, jhelper, model, refresh=True
),
]
24 changes: 24 additions & 0 deletions anvil-python/anvil/commands/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def postgresql_install_steps(
fqdn: str,
accept_defaults: bool,
preseed: dict[Any, Any],
refresh: bool = False,
) -> List[BaseStep]:
return [
TerraformInitStep(manifest.get_tfhelper("postgresql-plan")),
Expand All @@ -60,11 +61,34 @@ def postgresql_install_steps(
model,
accept_defaults=accept_defaults,
deployment_preseed=preseed,
refresh=refresh,
),
AddPostgreSQLUnitsStep(client, fqdn, jhelper, model),
]


def postgresql_upgrade_steps(
client: Client,
manifest: Manifest,
jhelper: JujuHelper,
model: str,
accept_defaults: bool,
preseed: dict[Any, Any],
) -> List[BaseStep]:
return [
TerraformInitStep(manifest.get_tfhelper("postgresql-plan")),
DeployPostgreSQLApplicationStep(
client,
manifest,
jhelper,
model,
accept_defaults=accept_defaults,
deployment_preseed=preseed,
refresh=True,
),
]


def postgresql_questions() -> dict[str, questions.PromptQuestion]:
return {
"max_connections": questions.PromptQuestion(
Expand Down
Loading
Loading