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
Co-authored-by: Riccardo Marco Miracapillo s324163 <s324163@studenti.polito.it>
Co-authored-by: Andrea Buonaurio <65712954+andreabuon@users.noreply.github.com>
Copy file name to clipboardExpand all lines: operators/README.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -134,6 +134,46 @@ The Instance Operator requires Golang 1.16 and `make`. To build the operator:
134
134
go build ./cmd/instance-operator/main.go
135
135
```
136
136
137
+
### Instance Automation Operator
138
+
139
+
The **Instance Automation Controller** (`instautoctrl` package) is responsible for all the automation tasks with regard to Instances, focusing on four main actions:
140
+
141
+
- instance inactivity
142
+
- instance expiration
143
+
- instance termination
144
+
- instance submission
145
+
146
+
The first two actions ensure that unused or expired resources are efficiently managed, improving resource utilization and reducing unnecessary costs, while still providing tenants with proper notifications as well as flexibility to the administrator through configuration options and annotations.
147
+
148
+
The last two actions are instead related to exam automation, allowing to automatically terminate Instances and submit exam files.
149
+
150
+
You can find the full documentation [here](/operators/pkg/instautoctrl/README.md).
151
+
152
+
#### Instance Inactive Termination controller
153
+
154
+
This controller periodically checks running Instances to determine if they are still in use or can be terminated because of inactivity.
155
+
Each **Template** resource associated with an Instance defines an `InactivityTimeout` field, which represents the period of inactivity after which the Instance is considered unused.
156
+
If omitted, this field is automatically added in the Template resource with a `never` value set by default, meaning that Instances created from that template will be ignored by this controller.
157
+
158
+
To evaluate whether an Instance is active, the controller relies on **Prometheus** metrics.
159
+
It verifies whether the tenant has accessed the Instance recently, either through the frontend (by analyzing Ingress metrics) or via SSH (using a specific SSH bastion tracker metric).
160
+
If activity is detected, the controller postpones the check.
161
+
If no activity is recorded for a time longer than the `InactivityTimeout`, the process of inactivity handling begins.
162
+
When an Instance has been marked as inactive, the controller starts sending email notifications to tenants, warning them that the Instance will be paused or deleted if they do not access it.
163
+
The number of notifications sent is defined by the `inactiveTerminationMaxNumberOfAlerts` parameter in the Helm chart.
164
+
Once this limit is reached, the controller takes action: **persistent Instances are paused**, while **non-persistent Instances are deleted**.
165
+
After the final action, an additional email is sent to inform the tenant.
166
+
Both the controller and the email notifications can be enabled or disabled through the Helm chart using the `enableInstanceInactiveTermination` and `enableInactivityNotifications` parameters.
167
+
In addition, the behavior can be customized using annotations. For example, the `CustomNumberOfAlertsAnnotation` on a Template allows overriding the default number of notifications for a specific Instance type, while the `InstanceInactivityIgnoreNamespace` annotation, set to `True` on a Namespace completely excludes its Instances from the inactivity termination logic.
168
+
169
+
#### Instance Expiration controller
170
+
While the Instance Inactive Termination Controller deletes Instances when these are not used for an extended period of time, this controller (_Instance Expiration Controller_) introduces an orthogonal feature, i.e., the capability to delete an Instance when its maximum lifespan has expired, no matter if the instance has been used or not.
171
+
Each Template defines a `DeleteAfter` field that specifies how long an Instance can exist before it must be removed. When an Instance reaches this limit, the controller automatically deletes it.
172
+
Analogously to the Instance Inactive Termination Controller, omitting the `DeleteAfter` field means it is automatically set to `never` by default, meaning that Instances created from that template will be ignored by this controller.
173
+
As with inactivity termination, this feature can be managed through Helm chart parameters: `enableInstanceExpiration` controls whether the controller is active, while `enableExpirationNotifications` enables or disables email alerts to inform tenants before deletion.
174
+
This feature can be used when we know already that an Instance will not be needed after a given period; a possible example is the instance used to carry out an exam, which can be safely deleted when the exam has finished.
175
+
The `ExpirationIgnoreNamespace` annotation, when set to `True`, allows to ignore all Instances in a Namespace, preventing them from being deleted due to expiration.
176
+
137
177
## SSH bastion
138
178
139
179
The SSH bastion is composed of three basic blocks:
0 commit comments