com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.MetricSpec.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-kubernetes-kotlin Show documentation
Show all versions of pulumi-kubernetes-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs
import kotlin.String
import kotlin.Suppress
/**
* MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).
* @property containerResource containerResource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing a single container in each pod of the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source. This is an alpha feature and can be enabled by the HPAContainerMetrics feature flag.
* @property external external refers to a global metric that is not associated with any Kubernetes object. It allows autoscaling based on information coming from components running outside of cluster (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).
* @property object object refers to a metric describing a single kubernetes object (for example, hits-per-second on an Ingress object).
* @property pods pods refers to a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.
* @property resource resource refers to a resource metric (such as those specified in requests and limits) known to Kubernetes describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the "pods" source.
* @property type type is the type of metric source. It should be one of "ContainerResource", "External", "Object", "Pods" or "Resource", each mapping to a matching field in the object. Note: "ContainerResource" type is available on when the feature-gate HPAContainerMetrics is enabled
*/
public data class MetricSpec(
public val containerResource: ContainerResourceMetricSource? = null,
public val `external`: ExternalMetricSource? = null,
public val `object`: ObjectMetricSource? = null,
public val pods: PodsMetricSource? = null,
public val resource: ResourceMetricSource? = null,
public val type: String,
) {
public companion object {
public fun toKotlin(javaType: com.pulumi.kubernetes.autoscaling.v2.outputs.MetricSpec): MetricSpec = MetricSpec(
containerResource = javaType.containerResource().map({ args0 ->
args0.let({ args0 ->
com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.ContainerResourceMetricSource.Companion.toKotlin(args0)
})
}).orElse(null),
`external` = javaType.`external`().map({ args0 ->
args0.let({ args0 ->
com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.ExternalMetricSource.Companion.toKotlin(args0)
})
}).orElse(null),
`object` = javaType.`object`().map({ args0 ->
args0.let({ args0 ->
com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.ObjectMetricSource.Companion.toKotlin(args0)
})
}).orElse(null),
pods = javaType.pods().map({ args0 ->
args0.let({ args0 ->
com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.PodsMetricSource.Companion.toKotlin(args0)
})
}).orElse(null),
resource = javaType.resource().map({ args0 ->
args0.let({ args0 ->
com.pulumi.kubernetes.autoscaling.v2.kotlin.outputs.ResourceMetricSource.Companion.toKotlin(args0)
})
}).orElse(null),
type = javaType.type(),
)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy