Commit 6624d09
authored
Add support for ManagedPrefixLists in EC2 controller (#295)
Issue #, if available: aws-controllers-k8s/community#2665
Description of changes:
Added support for ManagedPrefixLists. This was validated with a KIND local cluster, and here are the results:
- Controller logs
```
$ kubectl -n ack-system logs ack-ec2-controller-6f9ff4897-nxlpb | grep prefix
{"level":"info","ts":"2025-10-28T10:56:18.991Z","msg":"Starting EventSource","controller":"managedprefixlist","controllerGroup":"ec2.services.k8s.aws","controllerKind":"ManagedPrefixList","source":"kind source: *v1alpha1.ManagedPrefixList"}
{"level":"info","ts":"2025-10-28T10:56:19.193Z","msg":"Starting Controller","controller":"managedprefixlist","controllerGroup":"ec2.services.k8s.aws","controllerKind":"ManagedPrefixList"}
{"level":"info","ts":"2025-10-28T10:56:19.193Z","msg":"Starting workers","controller":"managedprefixlist","controllerGroup":"ec2.services.k8s.aws","controllerKind":"ManagedPrefixList","worker count":1}
```
- ManagedPrefixList status
```
$ kubectl get ManagedPrefixLists
NAME ID NAME STATE VERSION
ack-managed-prefix-list pl-0e02e7c2410655ae5 ack-final-test-11184 create-complete 1
apiVersion: ec2.services.k8s.aws/v1alpha1
kind: ManagedPrefixList
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"ec2.services.k8s.aws/v1alpha1","kind":"ManagedPrefixList","metadata":{"annotations":{},"name":"ack-managed-prefix-list","namespace":"default"},"spec":{"addressFamily":"IPv4","entries":[{"cidr":"10.250.0.0/24","description":"ACK Created - Network 1"},{"cidr":"10.250.1.0/24","description":"ACK Created - Network 2"},{"cidr":"10.250.2.0/24","description":"ACK Created - Network 3"}],"maxEntries":10,"prefixListName":"ack-final-test-11184","tags":[{"key":"Environment","value":"production"},{"key":"ManagedBy","value":"ACK-Controller"},{"key":"Purpose","value":"Demo"}]}}
creationTimestamp: "2025-10-28T10:54:38Z"
finalizers:
- finalizers.ec2.services.k8s.aws/ManagedPrefixList
generation: 1
name: ack-managed-prefix-list
namespace: default
resourceVersion: "3836"
uid: 16681e81-40cd-4137-ad0f-ff06ed0ec060
spec:
addressFamily: IPv4
entries:
- cidr: 10.250.0.0/24
description: ACK Created - Network 1
- cidr: 10.250.1.0/24
description: ACK Created - Network 2
- cidr: 10.250.2.0/24
description: ACK Created - Network 3
maxEntries: 10
prefixListName: ack-final-test-11184
tags:
- key: ManagedBy
value: ACK-Controller
- key: Purpose
value: Demo
status:
ackResourceMetadata:
ownerAccountID: "258057316678"
region: us-west-2
conditions:
- lastTransitionTime: "2025-10-28T10:56:20Z"
message: Resource synced successfully
reason: ""
status: "True"
type: ACK.ResourceSynced
ownerID: "258057316678"
prefixListARN: arn:aws:ec2:us-west-2:258057316678:prefix-list/pl-0e02e7c2410655ae5
prefixListID: pl-0e02e7c2410655ae5
state: create-complete
version: 1
```
- ManagedPrefixList created in AWS
<img width="1234" height="584" alt="image" src="https://github.com/user-attachments/assets/69f52395-cac6-4a62-95b4-477ccdd84b19" />
- ManagedPrefixList updated
<img width="1234" height="584" alt="image" src="https://github.com/user-attachments/assets/11c14d81-c685-4e95-a908-87615519e54b" />
- ManagedPrefixList deleted
<img width="1234" height="584" alt="image" src="https://github.com/user-attachments/assets/009a7225-67f9-448a-a047-a475156cdd97" />
---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.1 parent acecb3a commit 6624d09
File tree
34 files changed
+3470
-75
lines changed- apis/v1alpha1
- cmd/controller
- config
- crd
- bases
- rbac
- helm
- crds
- templates
- pkg/resource/managed_prefix_list
- templates/hooks/managed_prefix_list
- test/e2e
- resources
- tests
34 files changed
+3470
-75
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
| |||
150 | 153 | | |
151 | 154 | | |
152 | 155 | | |
153 | | - | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| |||
230 | 233 | | |
231 | 234 | | |
232 | 235 | | |
| 236 | + | |
| 237 | + | |
233 | 238 | | |
234 | 239 | | |
235 | 240 | | |
| |||
612 | 617 | | |
613 | 618 | | |
614 | 619 | | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
615 | 697 | | |
616 | 698 | | |
617 | 699 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments