You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: operators/README.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -192,12 +192,12 @@ Below you will find a concise description of the reconcile flow, the assignment
192
192
-`pkg/utils/ip.go` — helpers for parsing IP pools (CIDR, ranges, single IPs) via `ParseIPPool`. Utilities currently target IPv4.
193
193
-`pkg/forge/loadbalancers.go` — helpers that build metadata, names, labels and annotations for LoadBalancer Services; labels used to filter relevant Services are defined here and some values are configurable via Helm.
194
194
195
-
References
195
+
#### References
196
196
- CRD fields( [Instance](deploy/crds/crownlabs.polito.it_instances.yaml) and [Template](deploy/crds/crownlabs.polito.it_templates.yaml)): `Instance.spec.publicExposure` and `Instance.status.publicExposure`; `Template.spec.allowPublicExposure` enables the feature per-template.
197
197
-[Helm values](deploy/instance-operator/values.yaml) : see `configurations.publicExposure` below.
198
198
-[Deployment template](deploy/instance-operator/templates/deployment.yaml) : the flag `--public-exposure-loadbalancer-ips-key=...` passes the annotation key.
199
199
200
-
Assignment logic (high level)
200
+
#### Assignment logic (high level)
201
201
1) IP pool
202
202
The pool of available public IPs is configured via Helm and passed to the operator in `PublicExposureOpts.IPPool`. Pool entries may be CIDRs, ranges or single IPs; parsing is performed by `operators/pkg/utils/ip.go::ParseIPPool`.
203
203
@@ -216,8 +216,8 @@ Assignment logic (high level)
216
216
6) Status and network policy
217
217
After the Service is ready, the operator updates `instance.Status.PublicExposure` with the `ExternalIP` and the assigned ports, and creates the needed `NetworkPolicy` to allow traffic to the Instance (`pkg/instctrl/networkpolicy.go`).
218
218
219
-
Helm
220
-
-The public exposure configuration lives in the instance-operator values chart under `configurations.publicExposure`.
219
+
#### Helm
220
+
The public exposure configuration is in the instance-operator values chart under `configurations.publicExposure`.
- Requests are validated by `ValidatePublicExposureRequest` (checks for duplicates, ranges, protocols, etc.).
236
236
- If a request is invalid, `PublicExposure` status is set to `Error` and an explanatory message is recorded.
237
237
238
-
Notes and operational caveats
238
+
#### Notes and operational caveats
239
239
- Requirement: MetalLB (or another LoadBalancer controller that supports the used annotation mechanism) must be installed to make this feature work out-of-the-box.
240
240
- Port-request priority: the allocator prefers to satisfy explicitly requested ports before assigning automatic/random ports. In corner cases where a user requests a specific port on an Instance that previously had that port assigned automatically, the allocator may reassign the old automatic port to the new explicit request and select a different automatic port for the previous service.
241
241
- Enabling public exposure: the feature is available only for Instances that reference Templates with `spec.allowPublicExposure: true`.
242
242
243
-
243
+
#### Run-time configuration example
244
+
When a user configures a new public exposure for his VM/container, the controller automatically generates a set of YAML configurations in order to allow the system to work.
244
245
Below is a minimal example that follows the Instance CRD schema in `deploy/crds/crownlabs.polito.it_instances.yaml`.
245
246
246
-
Instance spec (CRD-compliant example)
247
+
##### Instance spec (CRD-compliant example)
247
248
```yaml
248
249
apiVersion: crownlabs.polito.it/v1alpha2
249
250
kind: Instance
@@ -263,7 +264,7 @@ spec:
263
264
port: 2222 # explicit external port requested
264
265
```
265
266
266
-
Expected status after reconcile (CRD-compliant example)
267
+
##### Expected status after reconcile (CRD-compliant example)
0 commit comments