MetricSpecV2
Class sealed net10.0
Represents a metric specification used for horizontal scaling in Kubernetes. Supports various types of metrics for monitoring and scaling, such as container resource metrics, external metrics, pod metrics, object metrics, and resource metrics.
namespace Aspire.Hosting.Kubernetes.Resources;
public sealed class MetricSpecV2{ // ...} 7 members
Constructors1
Section titled ConstructorsProperties6
Section titled PropertiesContainerResourceget; set Represents a container resource metric source for Kubernetes scaling. This property provides the configuration needed to scale workloads based on resource utilization metrics associated with a specific container within a pod.
Externalget; set Defines the configuration for an external metric source in the Kubernetes MetricSpecV2.
Objectget; set Gets or sets the Object metric source. The Object metric source indicates a metric that is measured on a specific Kubernetes object (for example, hits-per-second on an Ingress object). The current value of the metric is obtained from the described Kubernetes object.
Podsget; set Represents a metric source targeted at Kubernetes Pods. Provides scalable metrics for workloads at the Pod level, enabling monitoring and adjustment based on specific scale conditions of pod metrics.
Resourceget; set Represents a resource-based metric source used for autoscaling in Kubernetes environments. This property defines how the resource metrics should be retrieved and targeted for scaling purposes.
Typeget; setstring Specifies the type of metric source used for scaling in Kubernetes. The value of this property determines the nature of the scaling metric and corresponds to one of the metric sources available in the MetricSpecV2 class (e.g., "ContainerResource", "Resource", "External", "Pods", or "Object").