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
20 changes: 20 additions & 0 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ spec:
# Required: AWS region
region: us-east-2

# VPC configuration
vpc_az_count: 2 # Number of availability zones (default: 3, max: 3)

# RDS PostgreSQL configuration
db_engine_version: "15.12"
db_instance_class: db.m5d.large
Expand Down Expand Up @@ -278,6 +281,23 @@ workbench:
accountId: account-name
```

## VPC Availability Zone Configuration

The `vpc_az_count` setting controls how many availability zones the VPC subnets span. This affects where EKS nodes and EBS volumes can be placed.

| Value | Use Case |
|-------|----------|
| `3` (default) | Maximum redundancy across AZs |
| `2` | Recommended for workloads with StatefulSets using EBS volumes |

### Why Use 2 AZs?

EBS volumes are bound to a single availability zone. When using StatefulSets (like Loki or Mimir for monitoring), the PersistentVolumes are created in a specific AZ. If a node group rolls and new nodes are placed in different AZs than where the PVs exist, pods cannot schedule.

With 3 AZs and 2 nodes, there's no guarantee that nodes will cover all AZs where PVs may exist. Restricting to 2 AZs ensures that after any node operation, there will always be a node available in each AZ where PVs are located.

**Note:** This setting only affects new VPCs. Changing this value on an existing workload will cause Pulumi to attempt to delete subnets in the removed AZ.

## See Also

- [Getting Started](GETTING_STARTED.md)
Expand Down
4 changes: 2 additions & 2 deletions python-pulumi/src/ptd/pulumi_resources/aws_vpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import ptd

AWS_UTILITIES_CUTOFF_VERSION_MAJOR = 6
MIN_AZ_COUNT = 3
MAX_AZ_COUNT = 3
MIN_CIDR_BLOCK_SIZE = 4096


Expand Down Expand Up @@ -83,7 +83,7 @@ def __init__(
if len(azs) == 0:
pulumi.error("Using zero availability zones is not supported")

if len(azs) > MIN_AZ_COUNT:
if len(azs) > MAX_AZ_COUNT:
pulumi.error("Using more than three availability zones is not supported")

if len(azs) == 1:
Expand Down
21 changes: 18 additions & 3 deletions python-pulumi/src/ptd/pulumi_resources/aws_workload_helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,12 @@ def _define_mimir(self, release: str, version: str, components):
"alertmanager": {"enabled": False},
"ruler": {"enabled": False},
"ingester": {
"persistentVolume": {"size": "20Gi"},
"persistentVolume": {
"size": "20Gi",
"enableRetentionPolicy": True,
"whenDeleted": "Delete",
"whenScaled": "Delete",
},
"replicas": components.mimir_replicas,
"zoneAwareReplication": {"enabled": False},
"affinity": {
Expand All @@ -567,7 +572,12 @@ def _define_mimir(self, release: str, version: str, components):
},
},
"compactor": {
"persistentVolume": {"size": "20Gi"},
"persistentVolume": {
"size": "20Gi",
"enableRetentionPolicy": True,
"whenDeleted": "Delete",
"whenScaled": "Delete",
},
"replicas": components.mimir_replicas,
"affinity": {
"nodeAffinity": {
Expand All @@ -587,7 +597,12 @@ def _define_mimir(self, release: str, version: str, components):
},
},
"store_gateway": {
"persistentVolume": {"size": "20Gi"},
"persistentVolume": {
"size": "20Gi",
"enableRetentionPolicy": True,
"whenDeleted": "Delete",
"whenScaled": "Delete",
},
"replicas": components.mimir_replicas,
"zoneAwareReplication": {"enabled": False},
"affinity": {
Expand Down
Loading