- .github
- devel
- doc
-
examples
-
dynamic-client
-
notebooks
-
watch
-
yaml_dir
- README.md
- __init__.py
- annotate_deployment.py
- api_discovery.py
- apply_from_dict.py
- apply_from_directory.py
- apply_from_single_file.py
- cluster_scoped_custom_object.py
- cronjob_crud.py
- deployment_create.py
- deployment_crud.py
- duration-gep2257.py
- in_cluster_config.py
- ingress_create.py
- job_crud.py
- multiple_clusters.py
- namespaced_custom_object.py
- node_labels.py
- out_of_cluster_config.py
- pick_kube_config_context.py
- pod_config_list.py
- pod_exec.py
- pod_portforward.py
- remote_cluster.py
- rollout-daemonset.py
- rollout-statefulset.py
-
dynamic-client
- kubernetes
- scripts
- .gitignore
- CHANGELOG.md
- CONTRIBUTING.md
- LICENSE
- MANIFEST.in
- OWNERS
- README.md
- SECURITY_CONTACTS
- code-of-conduct.md
- codecov.yml
- requirements.txt
- setup.cfg
- setup.py
- test-requirements.txt
- tox.ini
Explanation
The V2MetricTarget
class represents a target value for a metric within a Kubernetes object. This class is part of the Kubernetes client library for Python, enabling users to interact with the Kubernetes API.
Core Properties:
type
: A string indicating the metric type. Possible values includeUtilization
,Value
, andAverageValue
. This property is mandatory and cannot beNone
.average_utilization
: An integer representing the target average utilization of a resource metric across all related pods. This is expressed as a percentage of the requested resource value. This property applies only to theResource
metric source type.average_value
: A string representing the target average value of a metric across all related pods. This is expressed as a quantity.value
: A string representing the target value of a metric. This is expressed as a quantity.
Purpose:
The V2MetricTarget
class is used to define the desired value or utilization level for a specific metric within a Kubernetes object. This object is typically part of a larger configuration structure, such as a Horizontal Pod Autoscaler (HPA).
Example Use:
from kubernetes.client import V2MetricTarget
# Define a metric target for CPU utilization
metric_target = V2MetricTarget(
type="Utilization",
average_utilization=80,
)
Note: This class relies on the Configuration
class to manage client-side validation, ensuring the provided values adhere to the Kubernetes API specifications.
Graph
The graph shows the usage of functions within the codebase.
Select a code symbol to view it's graph