Commit 23d5465
authored
[Framework] implement ingress operator (#75)
### **Description**
Full description in the LLD that linked to this Jira -
https://iguazio.atlassian.net/browse/NUC-498
This PR introduces a new IngressWatcher component that uses Kubernetes
informers to watch for Ingress resource changes and updates an internal
IngressHostCache accordingly. The watcher handles add, update, and
delete events, extracts relevant data (host, path, target list), and
reflects those changes in the in-memory cache.
### **Affected Areas**
- `pkg/kube/ingress.go` – new file with the IngressWatcher
implementation
- Uses `IngressHostCache` from `pkg/ingresscache`
- Integrates with `k8s.io/client-go` for informers
### **Testing**
- Unit tests coverage for all event handler paths (add, update, delete)
correctly modify the ingress cache.
- Unit tests validates cache sync behavior and logging of edge cases
(e.g., missing host/path).
- Integrations tests are out of scope for this PR, will be introduced as
part of the code changes in `Nuclio`
### **Changes Made**
- Added `IngressWatcher` struct to manage and respond to Kubernetes
Ingress resource changes.
- Implemented handlers for Add, Update, and Delete events.
- Extracted ingress data: host, path, targets via helper methods.
- Registered shared informer factory with label selector support.
### **Additional notes**
- Assumes each Ingress contains exactly one rule and one path.
- Includes detailed error logging for resilience and observability.
- Additional PR for integrating the ingress cache and ingress watcher is
needed1 parent 5b0d9bc commit 23d5465
4 files changed
+949
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | | - | |
| 31 | + | |
28 | 32 | | |
29 | 33 | | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| 39 | + | |
35 | 40 | | |
36 | 41 | | |
37 | 42 | | |
38 | | - | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
50 | | - | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| |||
0 commit comments