- .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
This code defines a Python class, V1ImageVolumeSource
, representing a Kubernetes image volume source. It allows users to specify how to use an image or artifact as a volume in a pod.
The key elements of this class are:
pull_policy
: This attribute defines the policy for pulling OCI objects. It accepts three values:Always
(pulls the image every time),Never
(uses only a local image), andIfNotPresent
(pulls only if the image isn’t locally available). The default behavior depends on the image tag;Always
is used for:latest
tags, whileIfNotPresent
is used for other tags.reference
: This attribute stores the image or artifact reference to be used. It works similarly to theimage
field in a container definition. The Kubernetes system will assemble the necessary pull secrets to access the image. This field is optional, allowing higher-level configuration management to handle image defaults and overrides.
The code also includes methods for accessing and manipulating the pull_policy
and reference
attributes, as well as helper methods for serializing and comparing objects. This class is part of a larger Kubernetes client library for Python, enabling developers to interact with Kubernetes resources using Python.
Graph
The graph shows the usage of functions within the codebase.
Select a code symbol to view it's graph