autoscaling_v1
CrossVersionObjectReference
class
lightkube.models.autoscaling_v1.CrossVersionObjectReference(kind, name, apiVersion=None)HorizontalPodAutoscaler
class
lightkube.models.autoscaling_v1.HorizontalPodAutoscaler(apiVersion=None, kind=None, metadata=None, spec=None, status=None)configuration of a horizontal pod autoscaler.
parameters
- apiVersion
Optional[str]- APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info - kind
Optional[str]- Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info - metadata
Optional[meta_v1.ObjectMeta]- Standard object metadata. More info - spec
Optional[HorizontalPodAutoscalerSpec]- spec defines the behaviour of autoscaler. More info - status
Optional[HorizontalPodAutoscalerStatus]- status is the current information about the autoscaler.
HorizontalPodAutoscalerList
class
lightkube.models.autoscaling_v1.HorizontalPodAutoscalerList(items, apiVersion=None, kind=None, metadata=None)list of horizontal pod autoscaler objects.
parameters
- items
List[HorizontalPodAutoscaler]- items is the list of horizontal pod autoscaler objects. - apiVersion
Optional[str]- APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info - kind
Optional[str]- Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info - metadata
Optional[meta_v1.ListMeta]- Standard list metadata.
HorizontalPodAutoscalerSpec
class
lightkube.models.autoscaling_v1.HorizontalPodAutoscalerSpec(maxReplicas, scaleTargetRef, minReplicas=None, targetCPUUtilizationPercentage=None)specification of a horizontal pod autoscaler.
parameters
- maxReplicas
int- maxReplicas is the upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas. - scaleTargetRef
CrossVersionObjectReference- reference to scaled resource; horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource. - minReplicas
Optional[int]- minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available. - targetCPUUtilizationPercentage
Optional[int]- targetCPUUtilizationPercentage is the target average CPU utilization (represented as a percentage of requested CPU) over all the pods; if not specified the default autoscaling policy will be used.
HorizontalPodAutoscalerStatus
class
lightkube.models.autoscaling_v1.HorizontalPodAutoscalerStatus(currentReplicas, desiredReplicas, currentCPUUtilizationPercentage=None, lastScaleTime=None, observedGeneration=None)current status of a horizontal pod autoscaler
parameters
- currentReplicas
int- currentReplicas is the current number of replicas of pods managed by this autoscaler. - desiredReplicas
int- desiredReplicas is the desired number of replicas of pods managed by this autoscaler. - currentCPUUtilizationPercentage
Optional[int]- currentCPUUtilizationPercentage is the current average CPU utilization over all pods, represented as a percentage of requested CPU, e.g. 70 means that an average pod is using now 70% of its requested CPU. - lastScaleTime
Optional[meta_v1.Time]- lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods; used by the autoscaler to control how often the number of pods is changed. - observedGeneration
Optional[int]- observedGeneration is the most recent generation observed by this autoscaler.
Scale
class
lightkube.models.autoscaling_v1.Scale(apiVersion=None, kind=None, metadata=None, spec=None, status=None)Scale represents a scaling request for a resource.
parameters
- apiVersion
Optional[str]- APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info - kind
Optional[str]- Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info - metadata
Optional[meta_v1.ObjectMeta]- Standard object metadata; More info - spec
Optional[ScaleSpec]- spec defines the behavior of the scale. More info - status
Optional[ScaleStatus]- status is the current status of the scale. More info Read-only.
ScaleSpec
class
lightkube.models.autoscaling_v1.ScaleSpec(replicas=None)ScaleSpec describes the attributes of a scale subresource.
parameters
- replicas
Optional[int]- replicas is the desired number of instances for the scaled object.
ScaleStatus
class
lightkube.models.autoscaling_v1.ScaleStatus(replicas, selector=None)ScaleStatus represents the current status of a scale subresource.
parameters
- replicas
int- replicas is the actual number of observed instances of the scaled object. - selector
Optional[str]- selector is the label query over pods that should match the replicas count. This is same as the label selector but in the string format to avoid introspection by clients. The string will be in the same format as the query-param syntax. More info about label selectors: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/