Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 33 additions & 10 deletions docs/resources/node_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ resource "devzero_node_policy" "azure_example" {
- `instance_hypervisors_tip` (String) Tooltip for instance hypervisors
- `instance_sizes` (Attributes) Instance sizes selector (e.g., Standard_D4s for Azure, large for AWS) (see [below for nested schema](#nestedatt--instance_sizes))
- `instance_sizes_tip` (String) Tooltip for instance sizes
- `instance_types` (Attributes) Instance types selector — explicit full type names (e.g., m5.xlarge for AWS, Standard_D4s_v2 for Azure) (see [below for nested schema](#nestedatt--instance_types))
- `labels` (Map of String) Map of Kubernetes labels to apply to nodes provisioned with this policy.
- `limits` (Attributes) Maximum resource limits for nodes provisioned with this policy. (see [below for nested schema](#nestedatt--limits))
- `limits_tip` (String) Tooltip for limits
Expand Down Expand Up @@ -340,7 +341,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand Down Expand Up @@ -461,7 +462,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand Down Expand Up @@ -507,7 +508,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand All @@ -529,7 +530,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand All @@ -551,7 +552,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand All @@ -573,7 +574,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand All @@ -595,7 +596,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand All @@ -617,7 +618,29 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

- `values` (List of String) List of values for In/NotIn operators



<a id="nestedatt--instance_types"></a>
### Nested Schema for `instance_types`

Optional:

- `match_expressions` (Attributes List) List of label selector requirements (see [below for nested schema](#nestedatt--instance_types--match_expressions))
- `match_labels` (Map of String) Map of label key-value pairs to match

<a id="nestedatt--instance_types--match_expressions"></a>
### Nested Schema for `instance_types.match_expressions`

Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand Down Expand Up @@ -648,7 +671,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand Down Expand Up @@ -689,7 +712,7 @@ Optional:
Required:

- `key` (String) Label key
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`.
- `operator` (String) Operator for matching. Valid values: `In`, `NotIn`, `Exists`, `DoesNotExist`, `Gt`, `Lt`. `Gt`/`Lt` apply to numeric selectors such as `instance_generations` and `instance_cpus`.

Optional:

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/workload_policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ resource "devzero_workload_policy" "cost_saving" {
- `cron_schedule` (String) Cron expression for scheduled application. Uses standard 5-field cron format in the cluster timezone.
- `defragmentation_schedule` (String) Cron expression for background defragmentation that can move workloads to reduce fragmentation.
- `description` (String) Free-form description of the policy to help others understand its intent and scope.
- `detection_triggers` (List of String) Detection triggers for when to apply the workload policy. Only one of `pod_creation` or `pod_update` is allowed.The `pod_creation` trigger is used to apply the workload policy when a pod is created.The `pod_update` trigger is used to apply the workload policy when a pod is updated.
- `detection_triggers` (List of String) Detection triggers for when to apply the workload policy. Valid values: `pod_creation`, `pod_update`, `pod_evict`.The `pod_creation` trigger is used to apply the workload policy when a pod is created.The `pod_update` trigger is used to apply the workload policy when a pod is updated.The `pod_evict` trigger is used to apply the workload policy when a pod is evicted.
- `drift_delta_percent` (Number) Percentage drift from baseline that triggers VPA refresh
- `enable_pmax_protection` (Boolean) When true, the recommender raises requests to cover observed peak usage when the peak-to-recommendation ratio exceeds `pmax_ratio_threshold`. Default: false.
- `gpu_vertical_scaling` (Attributes) GPU vertical scaling options (see [below for nested schema](#nestedatt--gpu_vertical_scaling))
Expand Down
18 changes: 17 additions & 1 deletion docs/resources/workload_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ resource "devzero_workload_rule" "manual" {

action_triggers = ["on_schedule", "on_detection"]
cron_schedule = "0 2 * * *"
detection_triggers = ["pod_creation", "pod_update"]
detection_triggers = ["pod_creation", "pod_update", "pod_evict"]

cpu_rule = {
enabled = true
Expand All @@ -56,6 +56,19 @@ resource "devzero_workload_rule" "manual" {
max_replicas = 10
target_utilization = 0.70
primary_metric = "cpu"

# External/Prometheus metric trigger
metrics = [
{
type = "prometheus"
target_value = "100"
server_address = "http://prometheus.monitoring.svc.cluster.local:9090"
query = "rate(http_requests_total{job=\"my-api\"}[5m])"
metadata = {
"customKey" = "customValue"
}
}
]
}

emergency_response = {
Expand Down Expand Up @@ -324,6 +337,9 @@ Required:

Optional:

- `metadata` (Map of String) Free-form key-value metadata for external scalers (e.g. serverAddress, query for Prometheus).
- `query` (String) PromQL query string. Packed into metadata by the service layer.
- `server_address` (String) Prometheus server URL. Packed into metadata by the service layer.
- `target_utilization` (String) Target utilization as a decimal string. Example: '0.70'
- `target_value` (String) Absolute target value as a string. Example: '50000000'
- `weight` (String) Weight for composite formula scaling (0-1 decimal string). Example: '0.5'
Expand Down
15 changes: 14 additions & 1 deletion examples/resources/devzero_workload_rule/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ resource "devzero_workload_rule" "manual" {

action_triggers = ["on_schedule", "on_detection"]
cron_schedule = "0 2 * * *"
detection_triggers = ["pod_creation", "pod_update"]
detection_triggers = ["pod_creation", "pod_update", "pod_evict"]

cpu_rule = {
enabled = true
Expand All @@ -41,6 +41,19 @@ resource "devzero_workload_rule" "manual" {
max_replicas = 10
target_utilization = 0.70
primary_metric = "cpu"

# External/Prometheus metric trigger
metrics = [
{
type = "prometheus"
target_value = "100"
server_address = "http://prometheus.monitoring.svc.cluster.local:9090"
query = "rate(http_requests_total{job=\"my-api\"}[5m])"
metadata = {
"customKey" = "customValue"
}
}
]
}

emergency_response = {
Expand Down
Loading
Loading