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
apply deislabs#43
With this change, Osiris can now manage both Deployments and StatefulSets.
I introduced a new service annotation `osiris.deislabs.io/statefulset` to link a service with its statefulset, otherwise everything works the same as with Deployments.
Internally, I tried to avoid duplicated code, and introduced a `kind` parameter to make a distinction between deployments and statefulsets.
Copy file name to clipboardExpand all lines: 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
@@ -29,11 +29,11 @@ Various types of Kubernetes resources can be Osiris-enabled using an annotation.
29
29
Osiris-enabled pods are automatically instrumented with a __metrics-collecting
30
30
proxy__ deployed as a sidecar container.
31
31
32
-
Osiris-enabled deployments (if _already_ scaled to a configurable minimum number
33
-
of replicas-- one by default) automatically have metrics from their pods
34
-
continuously scraped and analyzed by the __zeroscaler__ component. When the
35
-
aggregated metrics reveal that all of the deployment's pods are idling, the
36
-
zeroscaler scales the deployment to zero replicas.
32
+
Osiris-enabled deployments or statefulSets (if _already_ scaled to a configurable
33
+
minimum number of replicas-- one by default) automatically have metrics from
34
+
their pods continuously scraped and analyzed by the __zeroscaler__ component.
35
+
When the aggregated metrics reveal that all of the deployment's pods are idling,
36
+
the zeroscaler scales the deployment to zero replicas.
37
37
38
38
Under normal circumstances, scaling a deployment to zero replicas poses a
39
39
problem: any services that select pods from that deployment (and only that
@@ -175,14 +175,14 @@ spec:
175
175
176
176
Most of Osiris configuration is done with Kubernetes annotations - as seen in the Usage section.
177
177
178
-
#### Deployment Annotations
178
+
#### Deployment & StatefulSet Annotations
179
179
180
-
The following table lists the supported annotations for Kubernetes `Deployments` and their default values.
180
+
The following table lists the supported annotations for Kubernetes `Deployments` and `StatefulSets`, and their default values.
181
181
182
182
| Annotation | Description | Default |
183
183
| ---------- | ----------- | ------- |
184
-
|`osiris.dm.gg/enabled`| Enable the zeroscaler component to scrape and analyze metrics from the deployment's pods and scale the deployment to zero when idle. Allowed values: `y`, `yes`, `true`, `on`, `1`. |_no value_ (= disabled) |
185
-
|`osiris.dm.gg/minReplicas`| The minimum number of replicas to set on the deployment when Osiris will scale up. If you set `2`, Osiris will scale the deployment from `0` to `2` replicas directly. Osiris won't collect metrics from deployments which have more than `minReplicas` replicas - to avoid useless collections of metrics. |`1`|
184
+
|`osiris.dm.gg/enabled`| Enable the zeroscaler component to scrape and analyze metrics from the deployment's or statefulSet's pods and scale the deployment/statefulSet to zero when idle. Allowed values: `y`, `yes`, `true`, `on`, `1`. |_no value_ (= disabled) |
185
+
|`osiris.dm.gg/minReplicas`| The minimum number of replicas to set on the deployment/statefulSet when Osiris will scale up. If you set `2`, Osiris will scale the deployment/statefulSet from `0` to `2` replicas directly. Osiris won't collect metrics from deployments/statefulSets which have more than `minReplicas` replicas - to avoid useless collections of metrics. |`1`|
186
186
|`osiris.dm.gg/metricsCheckInterval`| The interval in which Osiris would repeatedly track the pod http request metrics. The value is the number of seconds of the interval. Note that this value override the global value defined by the `zeroscaler.metricsCheckInterval` Helm value. |_value of the `zeroscaler.metricsCheckInterval` Helm value_|
187
187
188
188
#### Pod Annotations
@@ -202,6 +202,7 @@ The following table lists the supported annotations for Kubernetes `Services` an
202
202
| ---------- | ----------- | ------- |
203
203
|`osiris.dm.gg/enabled`| Enable this service's endpoints to be managed by the Osiris endpoints controller. Allowed values: `y`, `yes`, `true`, `on`, `1`. |_no value_ (= disabled) |
204
204
|`osiris.dm.gg/deployment`| Name of the deployment which is behind this service. This is _required_ to map the service with its deployment. |_no value_|
205
+
|`osiris.dm.gg/statefulset`| Name of the statefulSet which is behind this service. This is _required_ to map the service with its statefulSet. |_no value_|
205
206
|`osiris.dm.gg/loadBalancerHostname`| Map requests coming from a specific hostname to this service. Note that if you have multiple hostnames, you can set them with different annotations, using `osiris.dm.gg/loadBalancerHostname-1`, `osiris.dm.gg/loadBalancerHostname-2`, ... |_no value_|
206
207
|`osiris.dm.gg/ingressHostname`| Map requests coming from a specific hostname to this service. If you use an ingress in front of your service, this is required to create a link between the ingress and the service. Note that if you have multiple hostnames, you can set them with different annotations, using `osiris.dm.gg/ingressHostname-1`, `osiris.dm.gg/ingressHostname-2`, ... |_no value_|
207
208
|`osiris.dm.gg/ingressDefaultPort`| Custom service port when the request comes from an ingress. Default behaviour if there are more than 1 port on the service, is to look for a port named `http`, and fallback to the port `80`. Set this if you have multiple ports and using a non-standard port with a non-standard name. |_no value_|
0 commit comments