Skip to content

Commit eaff1b5

Browse files
authored
Merge pull request #16 from platform9/feat/lb-octavia
feat(lb): Octavia load-balancer family (pcd_lb_*) — Phase 3
2 parents 140c9f0 + a57c43b commit eaff1b5

31 files changed

Lines changed: 3141 additions & 2 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ All notable changes to this project are documented here. The format is based on
5454
- Block storage (Cinder v3): `pcd_blockstorage_volume` resource (create/extend/import;
5555
code-complete — acceptance is blocked on the CE lab having no storage backend, see
5656
DECISIONS.md) and `pcd_blockstorage_volume` / `pcd_blockstorage_snapshot` data sources.
57+
- Load balancing (Octavia v2) — Phase 3: `pcd_lb_loadbalancer`, `pcd_lb_listener`,
58+
`pcd_lb_pool`, `pcd_lb_member`, `pcd_lb_monitor`, `pcd_lb_l7policy`, `pcd_lb_l7rule`
59+
resources and a `pcd_lb_loadbalancer` data source. Every child operation resolves the
60+
root load balancer and waits for its `provisioning_status` to return to `ACTIVE` before
61+
and after mutating (Octavia serializes changes per load balancer). Code-complete; see
62+
DECISIONS.md for live-validation status.
5763

5864
- Registry documentation generation wired via `tfplugindocs` (`make generate`) — renders
5965
`docs/` for every resource and data source plus the provider index from schema

DECISIONS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ yet passable on this lab (reason noted). Generated registry docs are not committ
3636
| Compute | `pcd_compute_volume_attach` | **PENDING** — code-complete; needs a booted instance **and** a Cinder backend (both lab-blocked). Best-effort volume waiter degrades gracefully without Cinder. |
3737
| Block storage | `pcd_blockstorage_volume` | **PENDING** — no Cinder storage backend on the lab (`storageBackends={}`); volumes go `creating → error`. Create + waiter + error-detection verified. |
3838
| Block storage (DS) | `pcd_blockstorage_volume`, `_snapshot` | **PENDING** — untestable without volumes on this lab. |
39+
| Load balancing (Octavia) | `pcd_lb_loadbalancer`, `_listener`, `_pool`, `_member`, `_monitor`, `_l7policy`, `_l7rule` + `_loadbalancer` DS | **PENDING** — Phase 3, code-complete; per-LB wait-for-`ACTIVE` lifecycle, root-LB resolution for every child, echo-only churny fields. Full-tree acc test + examples written. Octavia is live on the lab (Step 0), but LB provisioning needs a working amphora/provider driver; not yet run live (credentials unavailable this session). |
3940

4041
Both PENDING items are lab-side configuration gaps (Platform9 / lab-ops), not provider
4142
defects; their acceptance tests flip green on a properly-configured PCD cloud.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
data "pcd_lb_loadbalancer" "example" {
2+
name = "tf-example-lb"
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import pcd_lb_l7policy.example <id>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
resource "pcd_networking_network" "example" {
2+
name = "tf-example-lb-net"
3+
}
4+
5+
resource "pcd_networking_subnet" "example" {
6+
network_id = pcd_networking_network.example.id
7+
cidr = "10.0.0.0/24"
8+
}
9+
10+
resource "pcd_lb_loadbalancer" "example" {
11+
name = "tf-example-lb"
12+
vip_subnet_id = pcd_networking_subnet.example.id
13+
}
14+
15+
resource "pcd_lb_pool" "example" {
16+
name = "tf-example-pool"
17+
loadbalancer_id = pcd_lb_loadbalancer.example.id
18+
protocol = "HTTP"
19+
lb_method = "ROUND_ROBIN"
20+
}
21+
22+
resource "pcd_lb_listener" "example" {
23+
loadbalancer_id = pcd_lb_loadbalancer.example.id
24+
protocol = "HTTP"
25+
protocol_port = 80
26+
}
27+
28+
resource "pcd_lb_l7policy" "example" {
29+
name = "tf-example-l7policy"
30+
listener_id = pcd_lb_listener.example.id
31+
action = "REDIRECT_TO_POOL"
32+
redirect_pool_id = pcd_lb_pool.example.id
33+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import pcd_lb_l7rule.example <l7policy_id>/<l7rule_id>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
resource "pcd_networking_network" "example" {
2+
name = "tf-example-lb-net"
3+
}
4+
5+
resource "pcd_networking_subnet" "example" {
6+
network_id = pcd_networking_network.example.id
7+
cidr = "10.0.0.0/24"
8+
}
9+
10+
resource "pcd_lb_loadbalancer" "example" {
11+
name = "tf-example-lb"
12+
vip_subnet_id = pcd_networking_subnet.example.id
13+
}
14+
15+
resource "pcd_lb_pool" "example" {
16+
name = "tf-example-pool"
17+
loadbalancer_id = pcd_lb_loadbalancer.example.id
18+
protocol = "HTTP"
19+
lb_method = "ROUND_ROBIN"
20+
}
21+
22+
resource "pcd_lb_listener" "example" {
23+
loadbalancer_id = pcd_lb_loadbalancer.example.id
24+
protocol = "HTTP"
25+
protocol_port = 80
26+
}
27+
28+
resource "pcd_lb_l7policy" "example" {
29+
listener_id = pcd_lb_listener.example.id
30+
action = "REDIRECT_TO_POOL"
31+
redirect_pool_id = pcd_lb_pool.example.id
32+
}
33+
34+
resource "pcd_lb_l7rule" "example" {
35+
l7policy_id = pcd_lb_l7policy.example.id
36+
type = "HOST_NAME"
37+
compare_type = "EQUAL_TO"
38+
value = "www.example.com"
39+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import pcd_lb_listener.example <id>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
resource "pcd_networking_network" "example" {
2+
name = "tf-example-lb-net"
3+
}
4+
5+
resource "pcd_networking_subnet" "example" {
6+
network_id = pcd_networking_network.example.id
7+
cidr = "10.0.0.0/24"
8+
}
9+
10+
resource "pcd_lb_loadbalancer" "example" {
11+
name = "tf-example-lb"
12+
vip_subnet_id = pcd_networking_subnet.example.id
13+
}
14+
15+
resource "pcd_lb_listener" "example" {
16+
name = "tf-example-listener"
17+
loadbalancer_id = pcd_lb_loadbalancer.example.id
18+
protocol = "HTTP"
19+
protocol_port = 80
20+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import pcd_lb_loadbalancer.example <id>

0 commit comments

Comments
 (0)