Skip to content

Commit 545843a

Browse files
authored
Formatting cleanup for the public exposure documentation (#996)
1 parent b32fc5c commit 545843a

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

operators/README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,12 @@ Below you will find a concise description of the reconcile flow, the assignment
192192
- `pkg/utils/ip.go` — helpers for parsing IP pools (CIDR, ranges, single IPs) via `ParseIPPool`. Utilities currently target IPv4.
193193
- `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.
194194

195-
References
195+
#### References
196196
- 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.
197197
- [Helm values](deploy/instance-operator/values.yaml) : see `configurations.publicExposure` below.
198198
- [Deployment template](deploy/instance-operator/templates/deployment.yaml) : the flag `--public-exposure-loadbalancer-ips-key=...` passes the annotation key.
199199

200-
Assignment logic (high level)
200+
#### Assignment logic (high level)
201201
1) IP pool
202202
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`.
203203

@@ -216,8 +216,8 @@ Assignment logic (high level)
216216
6) Status and network policy
217217
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`).
218218

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`.
221221
```yaml
222222
configurations:
223223
publicExposure:
@@ -231,19 +231,20 @@ Helm
231231
loadBalancerIPsKey: "metallb.universe.tf/loadBalancerIPs"
232232
```
233233
234-
Validation and controls
234+
#### Validation and controls
235235
- Requests are validated by `ValidatePublicExposureRequest` (checks for duplicates, ranges, protocols, etc.).
236236
- If a request is invalid, `PublicExposure` status is set to `Error` and an explanatory message is recorded.
237237

238-
Notes and operational caveats
238+
#### Notes and operational caveats
239239
- Requirement: MetalLB (or another LoadBalancer controller that supports the used annotation mechanism) must be installed to make this feature work out-of-the-box.
240240
- 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.
241241
- Enabling public exposure: the feature is available only for Instances that reference Templates with `spec.allowPublicExposure: true`.
242242

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.
244245
Below is a minimal example that follows the Instance CRD schema in `deploy/crds/crownlabs.polito.it_instances.yaml`.
245246

246-
Instance spec (CRD-compliant example)
247+
##### Instance spec (CRD-compliant example)
247248
```yaml
248249
apiVersion: crownlabs.polito.it/v1alpha2
249250
kind: Instance
@@ -263,7 +264,7 @@ spec:
263264
port: 2222 # explicit external port requested
264265
```
265266

266-
Expected status after reconcile (CRD-compliant example)
267+
##### Expected status after reconcile (CRD-compliant example)
267268
```yaml
268269
kind: Instance
269270
metadata:

0 commit comments

Comments
 (0)