avionix.kube.core

class avionix.kube.core.AWSElasticBlockStoreVolumeSource(fs_type, volume_id, partition=None, read_only=None)
Parameters
class avionix.kube.core.Affinity(pod_affinity, pod_anti_affinity, node_affinity=None)
Parameters
  • pod_affinity (PodAffinity) – Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).

  • pod_anti_affinity (PodAntiAffinity) – Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).

  • node_affinity (Optional[NodeAffinity]) – Describes node affinity scheduling rules for the pod.

class avionix.kube.core.AttachedVolume(name, device_path)
Parameters
  • name (str) – Name of the attached volume

  • device_path (str) – DevicePath represents the device path where the volume should be available

class avionix.kube.core.AzureDiskVolumeSource(caching_mode, disk_name, disk_uri, fs_type, read_only=None)
Parameters
  • caching_mode (str) – Host Caching mode: None, Read Only, Read Write.

  • disk_name (str) – The Name of the data disk in the blob storage

  • disk_uri (str) – The URI the data disk in the blob storage

  • fs_type (str) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. Implicitly inferred to be “ext4” if unspecified.

  • read_only (Optional[bool]) – Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

class avionix.kube.core.AzureFilePersistentVolumeSource(secret_name, share_name, read_only=None, secret_namespace=None)
Parameters
  • secret_name (str) – the name of secret that contains Azure Storage Account Name and Key

  • share_name (str) – Share Name

  • read_only (Optional[bool]) – Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

  • secret_namespace (Optional[str]) – the namespace of the secret that contains Azure Storage Account Name and Key default is the same as the Pod

class avionix.kube.core.AzureFileVolumeSource(secret_name, share_name, read_only=None)
Parameters
  • secret_name (str) – the name of secret that contains Azure Storage Account Name and Key

  • share_name (str) – Share Name

  • read_only (Optional[bool]) – Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

class avionix.kube.core.Binding(metadata, target, api_version=None)
Parameters
class avionix.kube.core.CSIPersistentVolumeSource(driver, volume_handle, fs_type=None, volume_attributes=None, controller_expand_secret_ref=None, controller_publish_secret_ref=None, node_publish_secret_ref=None, node_stage_secret_ref=None, read_only=None)
Parameters
  • driver (str) – Driver is the name of the driver to use for this volume. Required.

  • volume_handle (str) – VolumeHandle is the unique volume name returned by the CSI volume plugin’s CreateVolume to refer to the volume on all subsequent calls. Required.

  • fs_type (Optional[str]) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”.

  • volume_attributes (Optional[dict]) – Attributes of the volume to publish.

  • controller_expand_secret_ref (Optional[SecretReference]) – ControllerExpandSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerExpandVolume call. This is an alpha field and requires enabling ExpandCSIVolumes feature gate. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.

  • controller_publish_secret_ref (Optional[SecretReference]) – ControllerPublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI ControllerPublishVolume and ControllerUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.

  • node_publish_secret_ref (Optional[SecretReference]) – NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.

  • node_stage_secret_ref (Optional[SecretReference]) – NodeStageSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodeStageVolume and NodeStageVolume and NodeUnstageVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secrets are passed.

  • read_only (Optional[bool]) – Optional: The value to pass to ControllerPublishVolumeRequest. Defaults to false (read/write).

class avionix.kube.core.CSIVolumeSource(driver, fs_type, volume_attributes, node_publish_secret_ref=None, read_only=None)
Parameters
  • driver (str) – Driver is the name of the CSI driver that handles this volume. Consult with your admin for the correct name as registered in the cluster.

  • fs_type (str) – Filesystem type to mount. Ex. “ext4”, “xfs”, “ntfs”. If not provided, the empty value is passed to the associated CSI driver which will determine the default filesystem to apply.

  • volume_attributes (dict) – VolumeAttributes stores driver-specific properties that are passed to the CSI driver. Consult your driver’s documentation for supported values.

  • node_publish_secret_ref (Optional[LocalObjectReference]) – NodePublishSecretRef is a reference to the secret object containing sensitive information to pass to the CSI driver to complete the CSI NodePublishVolume and NodeUnpublishVolume calls. This field is optional, and may be empty if no secret is required. If the secret object contains more than one secret, all secret references are passed.

  • read_only (Optional[bool]) – Specifies a read-only configuration for the volume. Defaults to false (read/write).

class avionix.kube.core.Capabilities(add, drop)
Parameters
  • add (List[str]) – Added capabilities

  • drop (List[str]) – Removed capabilities

class avionix.kube.core.CephFSPersistentVolumeSource(monitors, path=None, read_only=None, secret_file=None, secret_ref=None, user=None)
Parameters
class avionix.kube.core.CephFSVolumeSource(monitors, path=None, read_only=None, secret_file=None, secret_ref=None, user=None)
Parameters
class avionix.kube.core.CinderPersistentVolumeSource(fs_type, volume_id, read_only=None, secret_ref=None)
Parameters
class avionix.kube.core.CinderVolumeSource(fs_type, volume_id, read_only=None, secret_ref=None)
Parameters
class avionix.kube.core.ClientIPConfig(timeout_seconds)
Parameters

timeout_seconds (int) – timeoutSeconds specifies the seconds of ClientIP type session sticky time. The value must be >0 && <=86400(for 1 day) if ServiceAffinity == “ClientIP”. Default value is 10800(for 3 hours).

class avionix.kube.core.ComponentCondition(error, message, type)
Parameters
  • error (str) – Condition error code for a component. For example, a health check error code.

  • message (str) – Message about the condition for a component. For example, information about a health check.

  • type (str) – Type of condition for a component. Valid value: “Healthy”

class avionix.kube.core.ConfigMap(metadata, data, binary_data=None, immutable=None, api_version=None)
Parameters
  • metadata (ObjectMeta) – Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata # noqa

  • data (dict) – Data contains the configuration data. Each key must consist of alphanumeric characters, ‘-‘, ‘_’ or ‘.’. Values with non-UTF-8 byte sequences must use the BinaryData field. The keys stored in Data must not overlap with the keys in the BinaryData field, this is enforced during validation process.

  • binary_data (Optional[dict]) – BinaryData contains the binary data. Each key must consist of alphanumeric characters, ‘-‘, ‘_’ or ‘.’. BinaryData can contain byte sequences that are not in the UTF-8 range. The keys stored in BinaryData must not overlap with the ones in the Data field, this is enforced during validation process. Using this field will require 1.10+ apiserver and kubelet.

  • immutable (Optional[bool]) – Immutable, if set to true, ensures that data stored in the ConfigMap cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes feature gate.

  • api_version (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: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa

class avionix.kube.core.ConfigMapEnvSource(name, optional)
Parameters
class avionix.kube.core.ConfigMapKeySelector(name, key, optional)
Parameters
class avionix.kube.core.ConfigMapList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.ConfigMapNodeConfigSource(name, kubelet_config_key, namespace=None, resource_version=None, uid=None)
Parameters
  • name (str) – Name is the metadata.name of the referenced ConfigMap. This field is required in all cases.

  • kubelet_config_key (str) – KubeletConfigKey declares which key of the referenced ConfigMap corresponds to the KubeletConfiguration structure This field is required in all cases.

  • namespace (Optional[str]) – Namespace is the metadata.namespace of the referenced ConfigMap. This field is required in all cases.

  • resource_version (Optional[str]) – ResourceVersion is the metadata.ResourceVersion of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.

  • uid (Optional[str]) – UID is the metadata.UID of the referenced ConfigMap. This field is forbidden in Node.Spec, and required in Node.Status.

class avionix.kube.core.ConfigMapProjection(name, optional, items=None)
Parameters
  • name (str) – Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa

  • optional (bool) – Specify whether the ConfigMap or its keys must be defined

  • items (Optional[List[KeyToPath]]) – If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the ‘..’ path or start with ‘..’.

class avionix.kube.core.ConfigMapVolumeSource(name, optional, default_mode=None, items=None)
Parameters
  • name (str) – Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa

  • optional (bool) – Specify whether the ConfigMap or its keys must be defined

  • default_mode (Optional[int]) – Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

  • items (Optional[List[KeyToPath]]) – If unspecified, each key-value pair in the Data field of the referenced ConfigMap will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the ConfigMap, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the ‘..’ path or start with ‘..’.

class avionix.kube.core.Container(name, args=None, command=None, env=None, env_from=None, image=None, image_pull_policy=None, lifecycle=None, liveness_probe=None, ports=None, readiness_probe=None, resources=None, security_context=None, startup_probe=None, stdin=None, stdin_once=None, termination_message_path=None, termination_message_policy=None, tty=None, volume_devices=None, volume_mounts=None, working_dir=None)
Parameters
  • name (str) – Name of the container specified as a DNS_LABEL. Each container in a pod must have a unique name (DNS_LABEL). Cannot be updated.

  • args (Optional[List[str]]) – Arguments to the entrypoint. The docker image’s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell # noqa

  • command (Optional[List[str]]) – Entrypoint array. Not executed within a shell. The docker image’s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell # noqa

  • env (Optional[List[EnvVar]]) – List of environment variables to set in the container. Cannot be updated.

  • env_from (Optional[List[EnvFromSource]]) – List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.

  • image (Optional[str]) – Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images This field is optional to allow higher level config management to default or override container images in workload controllers like Deployments and StatefulSets.

  • image_pull_policy (Optional[str]) – Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images

  • lifecycle (Optional[Lifecycle]) – Actions that the management system should take in response to container lifecycle events. Cannot be updated.

  • liveness_probe (Optional[Probe]) – Periodic probe of container liveness. Container will be restarted if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes # noqa

  • ports (Optional[List[ContainerPort]]) – List of ports to expose from the container. Exposing a port here gives the system additional information about the network connections a container uses, but is primarily informational. Not specifying a port here DOES NOT prevent that port from being exposed. Any port which is listening on the default “0.0.0.0” address inside a container will be accessible from the network. Cannot be updated.

  • readiness_probe (Optional[Probe]) – Periodic probe of container service readiness. Container will be removed from service endpoints if the probe fails. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes # noqa

  • resources (Optional[ResourceRequirements]) – Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/ # noqa

  • security_context (Optional[SecurityContext]) – Security options the pod should run with. More info: https://kubernetes.io/docs/concepts/policy/security-context/ More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/

  • startup_probe (Optional[Probe]) – StartupProbe indicates that the Pod has successfully initialized. If specified, no other probes are executed until this completes successfully. If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. This can be used to provide different probe parameters at the beginning of a Pod’s lifecycle, when it might take a long time to load data or warm a cache, than during steady-state operation. This cannot be updated. This is a beta feature enabled by the StartupProbe feature flag. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes # noqa

  • stdin (Optional[bool]) – Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.

  • stdin_once (Optional[bool]) – Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false

  • termination_message_path (Optional[str]) – Optional: Path at which the file to which the container’s termination message will be written is mounted into the container’s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.

  • termination_message_policy (Optional[str]) – Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.

  • tty (Optional[bool]) – Whether this container should allocate a TTY for itself, also requires ‘stdin’ to be true. Default is false.

  • volume_devices (Optional[List[VolumeDevice]]) – volumeDevices is the list of block devices to be used by the container.

  • volume_mounts (Optional[List[VolumeMount]]) – Pod volumes to mount into the container’s filesystem. Cannot be updated.

  • working_dir (Optional[str]) – Container’s working directory. If not specified, the container runtime’s default will be used, which might be configured in the container image. Cannot be updated.

class avionix.kube.core.ContainerImage(names, size_bytes)
Parameters
  • names (List[str]) – Names by which this image is known. e.g. [“k8s.gcr.io/hyperkube:v1.0.7”, “dockerhub.io/google_containers/hyperkube:v1.0.7”]

  • size_bytes (int) – The size of the image in bytes.

class avionix.kube.core.ContainerPort(container_port, host_ip=None, host_port=None, name=None, protocol=None)
Parameters
  • container_port (int) – Number of port to expose on the pod’s IP address. This must be a valid port number, 0 < x < 65536.

  • host_ip (Optional[str]) – What host IP to bind the external port to.

  • host_port (Optional[int]) – Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.

  • name (Optional[str]) – If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.

  • protocol (Optional[str]) – Protocol for port. Must be UDP, TCP, or SCTP. Defaults to “TCP”.

class avionix.kube.core.ContainerState(running, terminated, waiting)
Parameters
class avionix.kube.core.ContainerStateRunning(started_at)
Parameters

started_at (time) – Time at which the container was last (re-)started

class avionix.kube.core.ContainerStateTerminated(container_id, exit_code, finished_at, message, reason, signal, started_at)
Parameters
  • container_id (str) – Container’s ID in the format ‘docker://<container_id>’

  • exit_code (int) – Exit status from the last termination of the container

  • finished_at (time) – Time at which the container last terminated

  • message (str) – Message regarding the last termination of the container

  • reason (str) – (brief) reason from the last termination of the container

  • signal (int) – Signal from the last termination of the container

  • started_at (time) – Time at which previous execution of the container started

class avionix.kube.core.ContainerStateWaiting(message, reason)
Parameters
  • message (str) – Message regarding why the container is not yet running.

  • reason (str) – (brief) reason the container is not yet running.

class avionix.kube.core.DaemonEndpoint(port)
Parameters

port (int) – Port number of the given endpoint.

class avionix.kube.core.DownwardAPIProjection(items)
Parameters

items (List[DownwardAPIVolumeFile]) – Items is a list of DownwardAPIVolume file

class avionix.kube.core.DownwardAPIVolumeFile(field_ref, path, resource_field_ref, mode=None)
Parameters
  • field_ref (ObjectFieldSelector) – Required: Selects a field of the pod: only annotations, labels, name and namespace are supported.

  • path (str) – Required: Path is the relative path name of the file to be created. Must not be absolute or contain the ‘..’ path. Must be utf-8 encoded. The first item of the relative path must not start with ‘..’

  • resource_field_ref (ResourceFieldSelector) – Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, requests.cpu and requests.memory) are currently supported.

  • mode (Optional[int]) – Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

class avionix.kube.core.DownwardAPIVolumeSource(items, default_mode=None)
Parameters
  • items (List[DownwardAPIVolumeFile]) – Items is a list of downward API volume file

  • default_mode (Optional[int]) – Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

class avionix.kube.core.EmptyDirVolumeSource(medium=None, size_limit=None)
Parameters
  • medium (Optional[str]) – What type of storage medium should back this directory. The default is “” which means to use the node’s default medium. Must be an empty string (default) or Memory. More info: https://kubernetes.io/docs/concepts/storage/volumes#emptydir

  • size_limit (Optional[str]) – Total amount of local storage required for this EmptyDir volume. The size limit is also applicable for memory medium. The maximum usage on memory medium EmptyDir would be the minimum value between the SizeLimit specified here and the sum of memory limits of all containers in a pod. The default is nil which means that the limit is undefined. More info: http://kubernetes.io/docs/user-guide/volumes#emptydir

class avionix.kube.core.EndpointAddress(hostname, ip, node_name=None, target_ref=None)
Parameters
  • hostname (str) – The Hostname of this endpoint

  • ip (str) – The IP of this endpoint. May not be loopback (127.0.0.0/8), link-local (169.254.0.0/16), or link-local multicast ((224.0.0.0/24). IPv6 is also accepted but not fully supported on all platforms. Also, certain kubernetes components, like kube-proxy, are not IPv6 ready.

  • node_name (Optional[str]) – Optional: Node hosting this endpoint. This can be used to determine endpoints local to a node.

  • target_ref (Optional[ObjectReference]) – Reference to object providing the endpoint.

class avionix.kube.core.EndpointPort(name, app_protocol, port, protocol=None)
Parameters
  • name (str) – The name of this port. This must match the ‘name’ field in the corresponding ServicePort. Must be a DNS_LABEL. Optional only if one port is defined.

  • app_protocol (str) – The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. Field can be enabled with ServiceAppProtocol feature gate.

  • port (int) – The port number of the endpoint.

  • protocol (Optional[str]) – The IP protocol for this port. Must be UDP, TCP, or SCTP. Default is TCP.

class avionix.kube.core.EndpointSubset(addresses, not_ready_addresses=None, ports=None)
Parameters
  • addresses (List[EndpointAddress]) – IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize.

  • not_ready_addresses (Optional[List[EndpointAddress]]) – IP addresses which offer the related ports but are not currently marked as ready because they have not yet finished starting, have recently failed a readiness check, or have recently failed a liveness check.

  • ports (Optional[List[EndpointPort]]) – Port numbers available on the related IP addresses.

class avionix.kube.core.Endpoints(metadata, subsets=None, api_version=None)
Parameters
class avionix.kube.core.EndpointsList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.EnvFromSource(config_map_ref, prefix, secret_ref)
Parameters
  • config_map_ref (Optional[ConfigMapEnvSource]) – The ConfigMap to select from

  • prefix (Optional[str]) – An optional identifier to prepend to each key in the ConfigMap. Must be a C_IDENTIFIER.

  • secret_ref (Optional[SecretEnvSource]) – The Secret to select from

class avionix.kube.core.EnvVar(name, value=None, value_from=None)
Parameters
  • name (str) – Name of the environment variable. Must be a C_IDENTIFIER.

  • value (Optional[str]) – Variable references $(VAR_NAME) are expanded using the previous defined environment variables in the container and any service environment variables. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Defaults to “”.

  • value_from (Optional[EnvVarSource]) – Source for the environment variable’s value. Cannot be used if value is not empty.

class avionix.kube.core.EnvVarSource(config_map_key_ref, field_ref, resource_field_ref, secret_key_ref)
Parameters
  • config_map_key_ref (ConfigMapKeySelector) – Selects a key of a ConfigMap.

  • field_ref (ObjectFieldSelector) – Selects a field of the pod: supports metadata.name, metadata.namespace, metadata.labels, metadata.annotations, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.

  • resource_field_ref (ResourceFieldSelector) – Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.

  • secret_key_ref (SecretKeySelector) – Selects a key of a secret in the pod’s namespace

class avionix.kube.core.EphemeralContainer(name, image, ports, resources, startup_probe, target_container_name, args=None, command=None, env=None, env_from=None, image_pull_policy=None, lifecycle=None, liveness_probe=None, readiness_probe=None, security_context=None, stdin=None, stdin_once=None, termination_message_path=None, termination_message_policy=None, tty=None, volume_devices=None, volume_mounts=None, working_dir=None)
Parameters
  • name (str) – Name of the ephemeral container specified as a DNS_LABEL. This name must be unique among all containers, init containers and ephemeral containers.

  • image (str) – Docker image name. More info: https://kubernetes.io/docs/concepts/containers/images

  • ports (List[ContainerPort]) – Ports are not allowed for ephemeral containers.

  • resources (ResourceRequirements) – Resources are not allowed for ephemeral containers. Ephemeral containers use spare resources already allocated to the pod.

  • startup_probe (Probe) – Probes are not allowed for ephemeral containers.

  • target_container_name (str) – If set, the name of the container from PodSpec that this ephemeral container targets. The ephemeral container will be run in the namespaces (IPC, PID, etc) of this container. If not set then the ephemeral container is run in whatever namespaces are shared for the pod. Note that the container runtime must support this feature.

  • args (Optional[List[str]]) – Arguments to the entrypoint. The docker image’s CMD is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell # noqa

  • command (Optional[List[str]]) – Entrypoint array. Not executed within a shell. The docker image’s ENTRYPOINT is used if this is not provided. Variable references $(VAR_NAME) are expanded using the container’s environment. If a variable cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded, regardless of whether the variable exists or not. Cannot be updated. More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell # noqa

  • env (Optional[List[EnvVar]]) – List of environment variables to set in the container. Cannot be updated.

  • env_from (Optional[List[EnvFromSource]]) – List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.

  • image_pull_policy (Optional[str]) – Image pull policy. One of Always, Never, IfNotPresent. Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be updated. More info: https://kubernetes.io/docs/concepts/containers/images#updating-images

  • lifecycle (Optional[Lifecycle]) – Lifecycle is not allowed for ephemeral containers.

  • liveness_probe (Optional[Probe]) – Probes are not allowed for ephemeral containers.

  • readiness_probe (Optional[Probe]) – Probes are not allowed for ephemeral containers.

  • security_context (Optional[SecurityContext]) – SecurityContext is not allowed for ephemeral containers.

  • stdin (Optional[bool]) – Whether this container should allocate a buffer for stdin in the container runtime. If this is not set, reads from stdin in the container will always result in EOF. Default is false.

  • stdin_once (Optional[bool]) – Whether the container runtime should close the stdin channel after it has been opened by a single attach. When stdin is true the stdin stream will remain open across multiple attach sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the first client attaches to stdin, and then remains open and accepts data until the client disconnects, at which time stdin is closed and remains closed until the container is restarted. If this flag is false, a container processes that reads from stdin will never receive an EOF. Default is false

  • termination_message_path (Optional[str]) – Optional: Path at which the file to which the container’s termination message will be written is mounted into the container’s filesystem. Message written is intended to be brief final status, such as an assertion failure message. Will be truncated by the node if greater than 4096 bytes. The total message length across all containers will be limited to 12kb. Defaults to /dev/termination-log. Cannot be updated.

  • termination_message_policy (Optional[str]) – Indicate how the termination message should be populated. File will use the contents of terminationMessagePath to populate the container status message on both success and failure. FallbackToLogsOnError will use the last chunk of container log output if the termination message file is empty and the container exited with an error. The log output is limited to 2048 bytes or 80 lines, whichever is smaller. Defaults to File. Cannot be updated.

  • tty (Optional[bool]) – Whether this container should allocate a TTY for itself, also requires ‘stdin’ to be true. Default is false.

  • volume_devices (Optional[List[VolumeDevice]]) – volumeDevices is the list of block devices to be used by the container.

  • volume_mounts (Optional[List[VolumeMount]]) – Pod volumes to mount into the container’s filesystem. Cannot be updated.

  • working_dir (Optional[str]) – Container’s working directory. If not specified, the container runtime’s default will be used, which might be configured in the container image. Cannot be updated.

class avionix.kube.core.Event(metadata, involved_object, action=None, count=None, event_time=None, first_timestamp=None, last_timestamp=None, message=None, reason=None, related=None, reporting_component=None, reporting_instance=None, series=None, source=None, type=None, api_version=None)
Parameters
  • metadata (ObjectMeta) – Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata # noqa

  • involved_object (ObjectReference) – The object that this event is about.

  • action (Optional[str]) – What action was taken/failed regarding to the Regarding object.

  • count (Optional[int]) – The number of times this event has occurred.

  • event_time (Optional[time]) – Time when this Event was first observed.

  • first_timestamp (Optional[time]) – The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)

  • last_timestamp (Optional[time]) – The time at which the most recent occurrence of this event was recorded.

  • message (Optional[str]) – A human-readable description of the status of this operation.

  • reason (Optional[str]) – This should be a short, machine understandable string that gives the reason for the transition into the object’s current status.

  • related (Optional[ObjectReference]) – Optional secondary object for more complex actions.

  • reporting_component (Optional[str]) – Name of the controller that emitted this Event, e.g. kubernetes.io/kubelet.

  • reporting_instance (Optional[str]) – ID of the controller instance, e.g. kubelet-xyzf.

  • series (Optional[EventSeries]) – Data about the Event series this event represents or nil if it’s a singleton Event.

  • source (Optional[EventSource]) – The component reporting this event. Should be a short machine understandable string.

  • type (Optional[str]) – Type of this event (Normal, Warning), new types could be added in the future

  • api_version (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: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa

class avionix.kube.core.EventList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.EventSeries(count, last_observed_time, state)
Parameters
  • count (int) – Number of occurrences in this series up to the last heartbeat time

  • last_observed_time (time) – Time of the last occurrence observed

  • state (str) – State of this Series: Ongoing or Finished Deprecated. Planned removal for 1.18

class avionix.kube.core.EventSource(component, host)
Parameters
  • component (str) – Component from which the event is generated.

  • host (str) – Node name on which the event is generated.

class avionix.kube.core.ExecAction(command)
Parameters

command (List[str]) – Command is the command line to execute inside the container, the working directory for the command is root (‘/’) in the container’s filesystem. The command is simply exec’d, it is not run inside a shell, so traditional shell instructions (‘|’, etc) won’t work. To use a shell, you need to explicitly call out to that shell. Exit status of 0 is treated as live/healthy and non-zero is unhealthy.

class avionix.kube.core.FCVolumeSource(fs_type, lun=None, read_only=None, target_wwns=None, wwids=None)
Parameters
  • fs_type (str) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. Implicitly inferred to be “ext4” if unspecified.

  • lun (Optional[int]) – Optional: FC target lun number

  • read_only (Optional[bool]) – Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

  • target_wwns (Optional[List[str]]) – Optional: FC target worldwide names (WWNs)

  • wwids (Optional[List[str]]) – Optional: FC volume world wide identifiers (wwids) Either wwids or combination of targetWWNs and lun must be set, but not both simultaneously.

class avionix.kube.core.FlexPersistentVolumeSource(driver, fs_type, options=None, read_only=None, secret_ref=None)
Parameters
  • driver (str) – Driver is the name of the driver to use for this volume.

  • fs_type (str) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. The default filesystem depends on FlexVolume script.

  • options (Optional[dict]) – Optional: Extra command options if any.

  • read_only (Optional[bool]) – Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

  • secret_ref (Optional[SecretReference]) – Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.

class avionix.kube.core.FlexVolumeSource(driver, fs_type, options=None, read_only=None, secret_ref=None)
Parameters
  • driver (str) – Driver is the name of the driver to use for this volume.

  • fs_type (str) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. The default filesystem depends on FlexVolume script.

  • options (Optional[dict]) – Optional: Extra command options if any.

  • read_only (Optional[bool]) – Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

  • secret_ref (Optional[LocalObjectReference]) – Optional: SecretRef is reference to the secret object containing sensitive information to pass to the plugin scripts. This may be empty if no secret object is specified. If the secret object contains more than one secret, all secrets are passed to the plugin scripts.

class avionix.kube.core.FlockerVolumeSource(dataset_name, dataset_uuid)
Parameters
  • dataset_name (str) – Name of the dataset stored as metadata -> name on the dataset for Flocker should be considered as deprecated

  • dataset_uuid (str) – UUID of the dataset. This is unique identifier of a Flocker dataset

class avionix.kube.core.GCEPersistentDiskVolumeSource(fs_type, pd_name, partition=None, read_only=None)
Parameters
class avionix.kube.core.GitRepoVolumeSource(repository, revision, directory=None)
Parameters
  • repository (str) – Repository URL

  • revision (str) – Commit hash for the specified revision.

  • directory (Optional[str]) – Target directory name. Must not contain or start with ‘..’. If ‘.’ is supplied, the volume directory will be the git repository. Otherwise, if specified, the volume will contain the git repository in the subdirectory with the given name.

class avionix.kube.core.GlusterfsPersistentVolumeSource(endpoints, path, endpoints_namespace=None, read_only=None)
Parameters
class avionix.kube.core.GlusterfsVolumeSource(endpoints, path, read_only=None)
Parameters
class avionix.kube.core.HTTPGetAction(path, port, http_headers=None, host=None, scheme=None)
Parameters
  • path (str) – Path to access on the HTTP server.

  • port (int) – Name or number of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.

  • http_headers (Optional[List[HTTPHeader]]) – Custom headers to set in the request. HTTP allows repeated headers.

  • host (Optional[str]) – Host name to connect to, defaults to the pod IP. You probably want to set “Host” in httpHeaders instead.

  • scheme (Optional[str]) – Scheme to use for connecting to the host. Defaults to HTTP.

class avionix.kube.core.HTTPHeader(name, value)
Parameters
  • name (str) – The header field name

  • value (str) – The header field value

class avionix.kube.core.Handler(exec, http_get, tcp_socket)
Parameters
  • exec (ExecAction) – One and only one of the following should be specified. Exec specifies the action to take.

  • http_get (HTTPGetAction) – HTTPGet specifies the http request to perform.

  • tcp_socket (TCPSocketAction) – TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported

class avionix.kube.core.HostAlias(hostnames, ip)
Parameters
  • hostnames (List[str]) – Hostnames for the above IP address.

  • ip (str) – IP address of the host file entry.

class avionix.kube.core.HostPathVolumeSource(path, type=None)
Parameters
class avionix.kube.core.ISCSIPersistentVolumeSource(chap_auth_discovery, chap_auth_session, fs_type, initiator_name, iqn, lun, portals, secret_ref, target_portal, iscsi_interface=None, read_only=None)
Parameters
  • chap_auth_discovery (bool) – whether support iSCSI Discovery CHAP authentication

  • chap_auth_session (bool) – whether support iSCSI Session CHAP authentication

  • fs_type (str) – Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: “ext4”, “xfs”, “ntfs”. Implicitly inferred to be “ext4” if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi

  • initiator_name (str) – Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface <target portal>:<volume name> will be created for the connection.

  • iqn (str) – Target iSCSI Qualified Name.

  • lun (int) – iSCSI Target Lun number.

  • portals (List[str]) – iSCSI Target Portal List. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).

  • secret_ref (SecretReference) – CHAP Secret for iSCSI target and initiator authentication

  • target_portal (str) – iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).

  • iscsi_interface (Optional[str]) – iSCSI Interface Name that uses an iSCSI transport. Defaults to ‘default’ (tcp).

  • read_only (Optional[bool]) – ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.

class avionix.kube.core.ISCSIVolumeSource(chap_auth_discovery, chap_auth_session, fs_type, initiator_name, iqn, lun, portals, secret_ref, target_portal, iscsi_interface=None, read_only=None)
Parameters
  • chap_auth_discovery (bool) – whether support iSCSI Discovery CHAP authentication

  • chap_auth_session (bool) – whether support iSCSI Session CHAP authentication

  • fs_type (str) – Filesystem type of the volume that you want to mount. Tip: Ensure that the filesystem type is supported by the host operating system. Examples: “ext4”, “xfs”, “ntfs”. Implicitly inferred to be “ext4” if unspecified. More info: https://kubernetes.io/docs/concepts/storage/volumes#iscsi

  • initiator_name (str) – Custom iSCSI Initiator Name. If initiatorName is specified with iscsiInterface simultaneously, new iSCSI interface <target portal>:<volume name> will be created for the connection.

  • iqn (str) – Target iSCSI Qualified Name.

  • lun (int) – iSCSI Target Lun number.

  • portals (List[str]) – iSCSI Target Portal List. The portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).

  • secret_ref (LocalObjectReference) – CHAP Secret for iSCSI target and initiator authentication

  • target_portal (str) – iSCSI Target Portal. The Portal is either an IP or ip_addr:port if the port is other than default (typically TCP ports 860 and 3260).

  • iscsi_interface (Optional[str]) – iSCSI Interface Name that uses an iSCSI transport. Defaults to ‘default’ (tcp).

  • read_only (Optional[bool]) – ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false.

class avionix.kube.core.KeyToPath(key, path, mode=None)
Parameters
  • key (str) – The key to project.

  • path (str) – The relative path of the file to map the key to. May not be an absolute path. May not contain the path element ‘..’. May not start with the string ‘..’.

  • mode (Optional[int]) – Optional: mode bits to use on this file, must be a value between 0 and 0777. If not specified, the volume defaultMode will be used. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

class avionix.kube.core.Lifecycle(post_start, pre_stop)
Parameters
  • post_start (Handler) – PostStart is called immediately after a container is created. If the handler fails, the container is terminated and restarted according to its restart policy. Other management of the container blocks until the hook completes. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks # noqa

  • pre_stop (Handler) – PreStop is called immediately before a container is terminated due to an API request or management event such as liveness/startup probe failure, preemption, resource contention, etc. The handler is not called if the container crashes or exits. The reason for termination is passed to the handler. The Pod’s termination grace period countdown begins before the PreStop hooked is executed. Regardless of the outcome of the handler, the container will eventually terminate within the Pod’s termination grace period. Other management of the container blocks until the hook completes or until the termination grace period is reached. More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks # noqa

class avionix.kube.core.LimitRange(metadata, spec, api_version=None)
Parameters
class avionix.kube.core.LimitRangeItem(default, default_request, max, min, type=None, max_limit_request_ratio=None)
Parameters
  • default (dict) – Default resource requirement limit value by resource name if resource limit is omitted.

  • default_request (dict) – DefaultRequest is the default resource requirement request value by resource name if resource request is omitted.

  • max (dict) – Max usage constraints on this kind by resource name.

  • min (dict) – Min usage constraints on this kind by resource name.

  • type (Optional[str]) – Type of resource that this limit applies to.

  • max_limit_request_ratio (Optional[dict]) – MaxLimitRequestRatio if specified, the named resource must have a request and limit that are both non-zero where limit divided by request is less than or equal to the enumerated value; this represents the max burst for the named resource.

class avionix.kube.core.LimitRangeList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.LimitRangeSpec(limits)
Parameters

limits (List[LimitRangeItem]) – Limits is the list of LimitRangeItem objects that are enforced.

class avionix.kube.core.LoadBalancerIngress(hostname, ip)
Parameters
  • hostname (str) – Hostname is set for load-balancer ingress points that are DNS based (typically AWS load-balancers)

  • ip (str) – IP is set for load-balancer ingress points that are IP based (typically GCE or OpenStack load-balancers)

class avionix.kube.core.LocalObjectReference(name)
Parameters

name (str) – Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa

class avionix.kube.core.LocalVolumeSource(fs_type, path)
Parameters
  • fs_type (str) – Filesystem type to mount. It applies only when the Path is a block device. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. The default value is to auto-select a fileystem if unspecified.

  • path (str) – The full path to the volume on the node. It can be either a directory or block device (disk, partition, …).

class avionix.kube.core.NFSVolumeSource(path, server, read_only=None)
Parameters
class avionix.kube.core.Namespace(metadata, spec=None, api_version=None)
Parameters
class avionix.kube.core.NamespaceCondition(last_transition_time, message, reason, type)
Parameters
  • last_transition_time (time) – None

  • message (str) – None

  • reason (str) – None

  • type (str) – Type of namespace controller condition.

class avionix.kube.core.NamespaceList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.NamespaceSpec(finalizers=None)
Parameters

finalizers (Optional[List[str]]) – Finalizers is an opaque list of values that must be empty to permanently remove object from storage. More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/

class avionix.kube.core.Node(metadata, spec, api_version=None)
Parameters
class avionix.kube.core.NodeAddress(address, type)
Parameters
  • address (str) – The node address.

  • type (str) – Node address type, one of Hostname, ExternalIP or InternalIP.

class avionix.kube.core.NodeAffinity(preferred_during_scheduling_ignored_during_execution, required_during_scheduling_ignored_during_execution)
Parameters
  • preferred_during_scheduling_ignored_during_execution (List[PreferredSchedulingTerm]) – The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding “weight” to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.

  • required_during_scheduling_ignored_during_execution (NodeSelector) – If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to an update), the system may or may not try to eventually evict the pod from its node.

class avionix.kube.core.NodeCondition(last_heartbeat_time, last_transition_time, message, reason, type)
Parameters
  • last_heartbeat_time (time) – Last time we got an update on a given condition.

  • last_transition_time (time) – Last time the condition transit from one status to another.

  • message (str) – Human readable message indicating details about last transition.

  • reason (str) – (brief) reason for the condition’s last transition.

  • type (str) – Type of node condition.

class avionix.kube.core.NodeConfigSource(config_map)
Parameters

config_map (ConfigMapNodeConfigSource) – ConfigMap is a reference to a Node’s ConfigMap

class avionix.kube.core.NodeDaemonEndpoints(kubelet_endpoint)
Parameters

kubelet_endpoint (DaemonEndpoint) – Endpoint on which Kubelet is listening.

class avionix.kube.core.NodeList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.NodeSelector(node_selector_terms)
Parameters

node_selector_terms (List[NodeSelectorTerm]) – Required. A list of node selector terms. The terms are ORed.

class avionix.kube.core.NodeSelectorRequirement(key, operator, values)
Parameters
  • key (str) – The label key that the selector applies to.

  • operator (str) – Represents a key’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.

  • values (List[str]) – An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. If the operator is Gt or Lt, the values array must have a single element, which will be interpreted as an integer. This array is replaced during a strategic merge patch.

class avionix.kube.core.NodeSelectorTerm(match_fields, match_expressions=None)
Parameters
class avionix.kube.core.NodeSpec(external_id, pod_cidr, config_source=None, pod_cidrs=None, provider_id=None, taints=None, unschedulable=None)
Parameters
  • external_id (str) – Deprecated. Not all kubelets will set this field. Remove field after 1.13. see: https://issues.k8s.io/61966

  • pod_cidr (str) – PodCIDR represents the pod IP range assigned to the node.

  • config_source (Optional[NodeConfigSource]) – If specified, the source to get node configuration from The DynamicKubeletConfig feature gate must be enabled for the Kubelet to use this field

  • pod_cidrs (Optional[List[str]]) – podCIDRs represents the IP ranges assigned to the node for usage by Pods on that node. If this field is specified, the 0th entry must match the podCIDR field. It may contain at most 1 value for each of IPv4 and IPv6.

  • provider_id (Optional[str]) – ID of the node assigned by the cloud provider in the format: <ProviderName>://<ProviderSpecificNodeID>

  • taints (Optional[List[Taint]]) – If specified, the node’s taints.

  • unschedulable (Optional[bool]) – Unschedulable controls node schedulability of new pods. By default, node is schedulable. More info: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration

class avionix.kube.core.NodeSystemInfo(architecture, boot_id, container_runtime_version, kernel_version, kube_proxy_version, kubelet_version, machine_id, operating_system, os_image, system_uuid)
Parameters
  • architecture (str) – The Architecture reported by the node

  • boot_id (str) – Boot ID reported by the node.

  • container_runtime_version (str) – ContainerRuntime Version reported by the node through runtime remote API (e.g. docker://1.5.0).

  • kernel_version (str) – Kernel Version reported by the node from ‘uname -r’ (e.g. 3.16.0-0.bpo.4-amd64).

  • kube_proxy_version (str) – KubeProxy Version reported by the node.

  • kubelet_version (str) – Kubelet Version reported by the node.

  • machine_id (str) – MachineID reported by the node. For unique machine identification in the cluster this field is preferred. Learn more from man(5) machine-id: http://man7.org/linux/man-pages/man5/machine-id.5.html

  • operating_system (str) – The Operating System reported by the node

  • os_image (str) – OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).

  • system_uuid (str) – SystemUUID reported by the node. For unique machine identification MachineID is preferred. This field is specific to Red Hat hosts https://access.redhat.com/documentation/en-US/Red_Hat_Subscription_Management/1/html/RHSM/getting-system-uuid.html # noqa

class avionix.kube.core.ObjectFieldSelector(field_path, api_version=None)
Parameters
  • field_path (str) – Path of the field to select in the specified API version.

  • api_version (Optional[str]) – Version of the schema the FieldPath is written in terms of, defaults to “v1”.

class avionix.kube.core.PersistentVolume(metadata, spec, api_version=None)
Parameters
class avionix.kube.core.PersistentVolumeClaim(metadata, spec, api_version=None)
Parameters
class avionix.kube.core.PersistentVolumeClaimCondition(last_probe_time, last_transition_time, message, reason, type)
Parameters
  • last_probe_time (time) – Last time we probed the condition.

  • last_transition_time (time) – Last time the condition transitioned from one status to another.

  • message (str) – Human-readable message indicating details about last transition.

  • reason (str) – Unique, this should be a short, machine understandable string that gives the reason for condition’s last transition. If it reports “ResizeStarted” that means the underlying persistent volume is being resized.

  • type (str) – None

class avionix.kube.core.PersistentVolumeClaimList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.PersistentVolumeClaimSpec(access_modes, resources, data_source=None, selector=None, storage_class_name=None, volume_mode=None, volume_name=None)
Parameters
  • access_modes (List[str]) – AccessModes contains the desired access modes the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1

  • resources (ResourceRequirements) – Resources represents the minimum resources the volume should have. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources

  • data_source (Optional[TypedLocalObjectReference]) – This field can be used to specify either: * An existing VolumeSnapshot object (snapshot.storage.k8s.io/VolumeSnapshot - Beta) * An existing PVC (PersistentVolumeClaim) * An existing custom resource/object that implements data population (Alpha) In order to use VolumeSnapshot object types, the appropriate feature gate must be enabled (VolumeSnapshotDataSource or AnyVolumeDataSource) If the provisioner or an external controller can support the specified data source, it will create a new volume based on the contents of the specified data source. If the specified data source is not supported, the volume will not be created and the failure will be reported as an event. In the future, we plan to support more data source types and the behavior of the provisioner may change.

  • selector (Optional[LabelSelector]) – A label query over volumes to consider for binding.

  • storage_class_name (Optional[str]) – Name of the StorageClass required by the claim. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1

  • volume_mode (Optional[str]) – volumeMode defines what type of volume is required by the claim. Value of Filesystem is implied when not included in claim spec.

  • volume_name (Optional[str]) – VolumeName is the binding reference to the PersistentVolume backing this claim.

class avionix.kube.core.PersistentVolumeClaimVolumeSource(claim_name, read_only)
Parameters
class avionix.kube.core.PersistentVolumeList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.PersistentVolumeSpec(access_modes, capacity, host_path, aws_elastic_block_store=None, azure_disk=None, azure_file=None, cephfs=None, cinder=None, claim_ref=None, csi=None, fc=None, flex_volume=None, flocker=None, gce_persistent_disk=None, glusterfs=None, iscsi=None, local=None, mount_options=None, nfs=None, node_affinity=None, persistent_volume_reclaim_policy=None, photon_persistent_disk=None, portworx_volume=None, quobyte=None, rbd=None, scale_io=None, storage_class_name=None, storageos=None, volume_mode=None, vsphere_volume=None)
Parameters
class avionix.kube.core.PhotonPersistentDiskVolumeSource(fs_type, pd_id)
Parameters
  • fs_type (str) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. Implicitly inferred to be “ext4” if unspecified.

  • pd_id (str) – ID that identifies Photon Controller persistent disk

class avionix.kube.core.Pod(metadata, spec, api_version=None)
Parameters
class avionix.kube.core.PodAffinity(preferred_during_scheduling_ignored_during_execution, required_during_scheduling_ignored_during_execution)
Parameters
  • preferred_during_scheduling_ignored_during_execution (List[WeightedPodAffinityTerm]) – The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding “weight” to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.

  • required_during_scheduling_ignored_during_execution (List[PodAffinityTerm]) – If the affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.

class avionix.kube.core.PodAffinityTerm(label_selector, namespaces, topology_key)
Parameters
  • label_selector (LabelSelector) – A label query over a set of resources, in this case pods.

  • namespaces (List[str]) – namespaces specifies which namespaces the labelSelector applies to (matches against); null or empty list means “this pod’s namespace”

  • topology_key (str) – This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.

class avionix.kube.core.PodAntiAffinity(preferred_during_scheduling_ignored_during_execution, required_during_scheduling_ignored_during_execution)
Parameters
  • preferred_during_scheduling_ignored_during_execution (List[WeightedPodAffinityTerm]) – The scheduler will prefer to schedule pods to nodes that satisfy the anti-affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding “weight” to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.

  • required_during_scheduling_ignored_during_execution (List[PodAffinityTerm]) – If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.

class avionix.kube.core.PodCondition(last_probe_time, last_transition_time, message, reason, type)
Parameters
  • last_probe_time (time) – Last time we probed the condition.

  • last_transition_time (time) – Last time the condition transitioned from one status to another.

  • message (str) – Human-readable message indicating details about last transition.

  • reason (str) – Unique, one-word, CamelCase reason for the condition’s last transition.

  • type (str) – Type is the type of the condition. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#pod-conditions # noqa

class avionix.kube.core.PodDNSConfig(nameservers, options, searches)
Parameters
  • nameservers (List[str]) – A list of DNS name server IP addresses. This will be appended to the base nameservers generated from DNSPolicy. Duplicated nameservers will be removed.

  • options (List[PodDNSConfigOption]) – A list of DNS resolver options. This will be merged with the base options generated from DNSPolicy. Duplicated entries will be removed. Resolution options given in Options will override those that appear in the base DNSPolicy.

  • searches (List[str]) – A list of DNS search domains for host-name lookup. This will be appended to the base search paths generated from DNSPolicy. Duplicated search paths will be removed.

class avionix.kube.core.PodDNSConfigOption(name, value)
Parameters
  • name (str) – Required.

  • value (str) – None

class avionix.kube.core.PodIP(ip)
Parameters

ip (str) – ip is an IP address (IPv4 or IPv6) assigned to the pod

class avionix.kube.core.PodList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.PodReadinessGate(condition_type)
Parameters

condition_type (str) – ConditionType refers to a condition in the pod’s condition list with matching type.

class avionix.kube.core.PodSecurityContext(fs_group=None, run_as_group=None, run_as_non_root=None, se_linux_options=None, supplemental_groups=None, sysctls=None, windows_options=None, fs_group_change_policy=None, run_as_user=None)
Parameters
  • fs_group (Optional[int]) – A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR’d with rw-rw—- If unset, the Kubelet will not modify the ownership and permissions of any volume.

  • run_as_group (Optional[int]) – The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.

  • run_as_non_root (Optional[bool]) – Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

  • se_linux_options (Optional[SELinuxOptions]) – The SELinux context to be applied to all containers. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.

  • supplemental_groups (Optional[List[int]]) – A list of groups applied to the first process run in each container, in addition to the container’s primary GID. If unspecified, no groups will be added to any container.

  • sysctls (Optional[List[Sysctl]]) – Sysctls hold a list of namespaced sysctls used for the pod. Pods with unsupported sysctls (by the container runtime) might fail to launch.

  • windows_options (Optional[WindowsSecurityContextOptions]) – The Windows specific settings applied to all containers. If unspecified, the options within a container’s SecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

  • fs_group_change_policy (Optional[str]) – fsGroupChangePolicy defines behavior of changing ownership and permission of the volume before being exposed inside Pod. This field will only apply to volume types which support fsGroup based ownership(and permissions). It will have no effect on ephemeral volume types such as: secret, configmaps and emptydir. Valid values are “OnRootMismatch” and “Always”. If not specified defaults to “Always”.

  • run_as_user (Optional[int]) – The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in SecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence for that container.

class avionix.kube.core.PodSpec(containers, active_deadline_seconds=None, affinity=None, automount_service_account_token=None, dns_config=None, dns_policy=None, enable_service_links=None, ephemeral_containers=None, host_aliases=None, host_ipc=None, host_network=None, host_pid=None, hostname=None, image_pull_secrets=None, init_containers=None, node_name=None, node_selector=None, overhead=None, preemption_policy=None, priority=None, priority_class_name=None, readiness_gates=None, restart_policy=None, runtime_class_name=None, scheduler_name=None, security_context=None, service_account=None, service_account_name=None, share_process_namespace=None, subdomain=None, termination_grace_period_seconds=None, tolerations=None, topology_spread_constraints=None, volumes=None)
Parameters
  • containers (List[Container]) – List of containers belonging to the pod. Containers cannot currently be added or removed. There must be at least one container in a Pod. Cannot be updated.

  • active_deadline_seconds (Optional[int]) – Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill associated containers. Value must be a positive integer.

  • affinity (Optional[Affinity]) – If specified, the pod’s scheduling constraints

  • automount_service_account_token (Optional[bool]) – AutomountServiceAccountToken indicates whether a service account token should be automatically mounted.

  • dns_config (Optional[PodDNSConfig]) – Specifies the DNS parameters of a pod. Parameters specified here will be merged to the generated DNS configuration based on DNSPolicy.

  • dns_policy (Optional[str]) – Set DNS policy for the pod. Defaults to “ClusterFirst”. Valid values are ‘ClusterFirstWithHostNet’, ‘ClusterFirst’, ‘Default’ or ‘None’. DNS parameters given in DNSConfig will be merged with the policy selected with DNSPolicy. To have DNS options set along with hostNetwork, you have to specify DNS policy explicitly to ‘ClusterFirstWithHostNet’.

  • enable_service_links (Optional[bool]) – EnableServiceLinks indicates whether information about services should be injected into pod’s environment variables, matching the syntax of Docker links. Optional: Defaults to true.

  • ephemeral_containers (Optional[List[EphemeralContainer]]) – List of ephemeral containers run in this pod. Ephemeral containers may be run in an existing pod to perform user-initiated actions such as debugging. This list cannot be specified when creating a pod, and it cannot be modified by updating the pod spec. In order to add an ephemeral container to an existing pod, use the pod’s ephemeralcontainers subresource. This field is alpha-level and is only honored by servers that enable the EphemeralContainers feature.

  • host_aliases (Optional[List[HostAlias]]) – HostAliases is an optional list of hosts and IPs that will be injected into the pod’s hosts file if specified. This is only valid for non-hostNetwork pods.

  • host_ipc (Optional[bool]) – Use the host’s ipc namespace. Optional: Default to false.

  • host_network (Optional[bool]) – Host networking requested for this pod. Use the host’s network namespace. If this option is set, the ports that will be used must be specified. Default to false.

  • host_pid (Optional[bool]) – Use the host’s pid namespace. Optional: Default to false.

  • hostname (Optional[str]) – Specifies the hostname of the Pod If not specified, the pod’s hostname will be set to a system-defined value.

  • image_pull_secrets (Optional[List[LocalObjectReference]]) – ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec. If specified, these secrets will be passed to individual puller implementations for them to use. For example, in the case of docker, only DockerConfig type secrets are honored. More info: https://kubernetes.io/docs/concepts/containers/images#specifying-imagepullsecrets-on-a-pod # noqa

  • init_containers (Optional[List[Container]]) – List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Init containers may not have Lifecycle actions, Readiness probes, Liveness probes, or Startup probes. The resourceRequirements of an init container are taken into account during scheduling by finding the highest request/limit for each resource type, and then using the max of of that value or the sum of the normal containers. Limits are applied to init containers in a similar fashion. Init containers cannot currently be added or removed. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/

  • node_name (Optional[str]) – NodeName is a request to schedule this pod onto a specific node. If it is non-empty, the scheduler simply schedules this pod onto that node, assuming that it fits resource requirements.

  • node_selector (Optional[dict]) – NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node’s labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/

  • overhead (Optional[dict]) – Overhead represents the resource overhead associated with running a pod for a given RuntimeClass. This field will be autopopulated at admission time by the RuntimeClass admission controller. If the RuntimeClass admission controller is enabled, overhead must not be set in Pod create requests. The RuntimeClass admission controller will reject Pod create requests which have the overhead already set. If RuntimeClass is configured and selected in the PodSpec, Overhead will be set to the value defined in the corresponding RuntimeClass, otherwise it will remain unset and treated as zero. More info: https://git.k8s.io/enhancements/keps/sig-node/20190226-pod-overhead.md This field is alpha-level as of Kubernetes v1.16, and is only honored by servers that enable the PodOverhead feature.

  • preemption_policy (Optional[str]) – PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.

  • priority (Optional[int]) – The priority value. Various system components use this field to find the priority of the pod. When Priority Admission Controller is enabled, it prevents users from setting this field. The admission controller populates this field from PriorityClassName. The higher the value, the higher the priority.

  • priority_class_name (Optional[str]) – If specified, indicates the pod’s priority. “system-node-critical” and “system-cluster-critical” are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.

  • readiness_gates (Optional[List[PodReadinessGate]]) – If specified, all readiness gates will be evaluated for pod readiness. A pod is ready when all its containers are ready AND all conditions specified in the readiness gates have status equal to “True” More info: https://git.k8s.io/enhancements/keps/sig-network/0007-pod-ready%2B%2B.md

  • restart_policy (Optional[str]) – Restart policy for all containers within the pod. One of Always, OnFailure, Never. Default to Always. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#restart-policy # noqa

  • runtime_class_name (Optional[str]) – RuntimeClassName refers to a RuntimeClass object in the node.k8s.io group, which should be used to run this pod. If no RuntimeClass resource matches the named class, the pod will not be run. If unset or empty, the “legacy” RuntimeClass will be used, which is an implicit class with an empty definition that uses the default runtime handler. More info: https://git.k8s.io/enhancements/keps/sig-node/runtime-class.md This is a beta feature as of Kubernetes v1.14.

  • scheduler_name (Optional[str]) – If specified, the pod will be dispatched by specified scheduler. If not specified, the pod will be dispatched by default scheduler.

  • security_context (Optional[PodSecurityContext]) – SecurityContext holds pod-level security attributes and common container settings. Optional: Defaults to empty. See type description for default values of each field.

  • service_account (Optional[str]) – DeprecatedServiceAccount is a depreciated alias for ServiceAccountName. Deprecated: Use serviceAccountName instead.

  • service_account_name (Optional[str]) – ServiceAccountName is the name of the ServiceAccount to use to run this pod. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ # noqa

  • share_process_namespace (Optional[bool]) – Share a single process namespace between all of the containers in a pod. When this is set containers will be able to view and signal processes from other containers in the same pod, and the first process in each container will not be assigned PID 1. HostPID and ShareProcessNamespace cannot both be set. Optional: Default to false.

  • subdomain (Optional[str]) – If specified, the fully qualified Pod hostname will be “<hostname>.<subdomain>.<pod namespace>.svc.<cluster domain>”. If not specified, the pod will not have a domainname at all.

  • termination_grace_period_seconds (Optional[int]) – Optional duration in seconds the pod needs to terminate gracefully. May be decreased in delete request. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period will be used instead. The grace period is the duration in seconds after the processes running in the pod are sent a termination signal and the time when the processes are forcibly halted with a kill signal. Set this value longer than the expected cleanup time for your process. Defaults to 30 seconds.

  • tolerations (Optional[List[Toleration]]) – If specified, the pod’s tolerations.

  • topology_spread_constraints (Optional[List[TopologySpreadConstraint]]) – TopologySpreadConstraints describes how a group of pods ought to spread across topology domains. Scheduler will schedule pods in a way which abides by the constraints. This field is only honored by clusters that enable the EvenPodsSpread feature. All topologySpreadConstraints are ANDed.

  • volumes (Optional[List[Volume]]) – List of volumes that can be mounted by containers belonging to the pod. More info: https://kubernetes.io/docs/concepts/storage/volumes

class avionix.kube.core.PodTemplate(metadata, template, api_version=None)
Parameters
class avionix.kube.core.PodTemplateList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.PodTemplateSpec(metadata, spec)
Parameters
class avionix.kube.core.PortworxVolumeSource(fs_type, volume_id, read_only=None)
Parameters
  • fs_type (str) – FSType represents the filesystem type to mount Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”. Implicitly inferred to be “ext4” if unspecified.

  • volume_id (str) – VolumeID uniquely identifies a Portworx volume

  • read_only (Optional[bool]) – Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

class avionix.kube.core.PreferredSchedulingTerm(preference, weight)
Parameters
  • preference (NodeSelectorTerm) – A node selector term, associated with the corresponding weight.

  • weight (int) – Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.

class avionix.kube.core.Probe(exec=None, http_get=None, initial_delay_seconds=None, period_seconds=None, tcp_socket=None, failure_threshold=None, success_threshold=None, timeout_seconds=None)
Parameters
  • exec (Optional[ExecAction]) – One and only one of the following should be specified. Exec specifies the action to take.

  • http_get (Optional[HTTPGetAction]) – HTTPGet specifies the http request to perform.

  • initial_delay_seconds (Optional[int]) – Number of seconds after the container has started before liveness probes are initiated. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes # noqa

  • period_seconds (Optional[int]) – How often (in seconds) to perform the probe. Default to 10 seconds. Minimum value is 1.

  • tcp_socket (Optional[TCPSocketAction]) – TCPSocket specifies an action involving a TCP port. TCP hooks not yet supported

  • failure_threshold (Optional[int]) – Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1.

  • success_threshold (Optional[int]) – Minimum consecutive successes for the probe to be considered successful after having failed. Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1.

  • timeout_seconds (Optional[int]) – Number of seconds after which the probe times out. Defaults to 1 second. Minimum value is 1. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes # noqa

class avionix.kube.core.ProjectedVolumeSource(default_mode, sources)
Parameters
  • default_mode (int) – Mode bits to use on created files by default. Must be a value between 0 and 0777. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

  • sources (List[VolumeProjection]) – list of volume projections

class avionix.kube.core.QuobyteVolumeSource(registry, tenant, volume, group=None, read_only=None, user=None)
Parameters
  • registry (str) – Registry represents a single or multiple Quobyte Registry services specified as a string as host:port pair (multiple entries are separated with commas) which acts as the central registry for volumes

  • tenant (str) – Tenant owning the given Quobyte volume in the Backend Used with dynamically provisioned Quobyte volumes, value is set by the plugin

  • volume (str) – Volume is a string that references an already created Quobyte volume by name.

  • group (Optional[str]) – Group to map volume access to Default is no group

  • read_only (Optional[bool]) – ReadOnly here will force the Quobyte volume to be mounted with read-only permissions. Defaults to false.

  • user (Optional[str]) – User to map volume access to Defaults to serivceaccount user

class avionix.kube.core.RBDPersistentVolumeSource(fs_type, image, monitors, keyring=None, pool=None, read_only=None, secret_ref=None, user=None)
Parameters
class avionix.kube.core.RBDVolumeSource(fs_type, image, monitors, keyring=None, pool=None, read_only=None, secret_ref=None, user=None)
Parameters
class avionix.kube.core.ReplicationController(metadata, spec, api_version=None)
Parameters
class avionix.kube.core.ReplicationControllerCondition(last_transition_time, message, reason, type)
Parameters
  • last_transition_time (time) – The last time the condition transitioned from one status to another.

  • message (str) – A human readable message indicating details about the transition.

  • reason (str) – The reason for the condition’s last transition.

  • type (str) – Type of replication controller condition.

class avionix.kube.core.ReplicationControllerList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.ReplicationControllerSpec(template, selector, min_ready_seconds=None, replicas=None)
Parameters
class avionix.kube.core.ResourceFieldSelector(container_name, resource, divisor=None)
Parameters
  • container_name (str) – Container name: required for volumes, optional for env vars

  • resource (str) – Required: resource to select

  • divisor (Optional[str]) – Specifies the output format of the exposed resources, defaults to “1”

class avionix.kube.core.ResourceQuota(metadata, spec, api_version=None)
Parameters
class avionix.kube.core.ResourceQuotaList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.ResourceQuotaSpec(hard, scope_selector=None, scopes=None)
Parameters
  • hard (dict) – hard is the set of desired hard limits for each named resource. More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/

  • scope_selector (Optional[ScopeSelector]) – scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota but expressed using ScopeSelectorOperator in combination with possible values. For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched.

  • scopes (Optional[List[str]]) – A collection of filters that must match each object tracked by a quota. If not specified, the quota matches all objects.

class avionix.kube.core.ResourceRequirements(limits=None, requests=None)
Parameters
class avionix.kube.core.SELinuxOptions(level, role, type, user)
Parameters
  • level (str) – Level is SELinux level label that applies to the container.

  • role (str) – Role is a SELinux role label that applies to the container.

  • type (str) – Type is a SELinux type label that applies to the container.

  • user (str) – User is a SELinux user label that applies to the container.

class avionix.kube.core.ScaleIOPersistentVolumeSource(gateway, protection_domain, ssl_enabled, storage_pool, system, volume_name, fs_type=None, read_only=None, secret_ref=None, storage_mode=None)
Parameters
  • gateway (str) – The host address of the ScaleIO API Gateway.

  • protection_domain (str) – The name of the ScaleIO Protection Domain for the configured storage.

  • ssl_enabled (bool) – Flag to enable/disable SSL communication with Gateway, default false

  • storage_pool (str) – The ScaleIO Storage Pool associated with the protection domain.

  • system (str) – The name of the storage system as configured in ScaleIO.

  • volume_name (str) – The name of a volume already created in the ScaleIO system that is associated with this volume source.

  • fs_type (Optional[str]) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. Default is “xfs”

  • read_only (Optional[bool]) – Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

  • secret_ref (Optional[SecretReference]) – SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.

  • storage_mode (Optional[str]) – Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.

class avionix.kube.core.ScaleIOVolumeSource(gateway, protection_domain, ssl_enabled, storage_pool, system, volume_name, fs_type=None, read_only=None, secret_ref=None, storage_mode=None)
Parameters
  • gateway (str) – The host address of the ScaleIO API Gateway.

  • protection_domain (str) – The name of the ScaleIO Protection Domain for the configured storage.

  • ssl_enabled (bool) – Flag to enable/disable SSL communication with Gateway, default false

  • storage_pool (str) – The ScaleIO Storage Pool associated with the protection domain.

  • system (str) – The name of the storage system as configured in ScaleIO.

  • volume_name (str) – The name of a volume already created in the ScaleIO system that is associated with this volume source.

  • fs_type (Optional[str]) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. Default is “xfs”.

  • read_only (Optional[bool]) – Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

  • secret_ref (Optional[LocalObjectReference]) – SecretRef references to the secret for ScaleIO user and other sensitive information. If this is not provided, Login operation will fail.

  • storage_mode (Optional[str]) – Indicates whether the storage for a volume should be ThickProvisioned or ThinProvisioned. Default is ThinProvisioned.

class avionix.kube.core.ScopeSelector(match_expressions=None)
Parameters

match_expressions (Optional[List[ScopedResourceSelectorRequirement]]) – A list of scope selector requirements by scope of the resources.

class avionix.kube.core.ScopedResourceSelectorRequirement(operator, scope_name, values)
Parameters
  • operator (str) – Represents a scope’s relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist.

  • scope_name (str) – The name of the scope that the selector applies to.

  • values (List[str]) – An array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.

class avionix.kube.core.Secret(metadata, data=None, immutable=None, string_data=None, type=None, api_version=None)
Parameters
  • metadata (ObjectMeta) – Standard object’s metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata # noqa

  • data (Optional[dict]) – Data contains the secret data. Each key must consist of alphanumeric characters, ‘-‘, ‘_’ or ‘.’. The serialized form of the secret data is a base64 encoded string, representing the arbitrary (possibly non-string) data value here. Described in https://tools.ietf.org/html/rfc4648#section-4

  • immutable (Optional[bool]) – Immutable, if set to true, ensures that data stored in the Secret cannot be updated (only object metadata can be modified). If not set to true, the field can be modified at any time. Defaulted to nil. This is an alpha field enabled by ImmutableEphemeralVolumes feature gate.

  • string_data (Optional[dict]) – stringData allows specifying non-binary secret data in string form. It is provided as a write-only convenience method. All keys and values are merged into the data field on write, overwriting any existing values. It is never output when reading from the API.

  • type (Optional[str]) – Used to facilitate programmatic handling of secret data.

  • api_version (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: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources # noqa

class avionix.kube.core.SecretEnvSource(name, optional)
Parameters
class avionix.kube.core.SecretKeySelector(name, key, optional)
Parameters
class avionix.kube.core.SecretList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.SecretProjection(name, optional, items=None)
Parameters
  • name (str) – Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names # noqa

  • optional (bool) – Specify whether the Secret or its key must be defined

  • items (Optional[List[KeyToPath]]) – If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the ‘..’ path or start with ‘..’.

class avionix.kube.core.SecretReference(name, namespace=None)
Parameters
  • name (str) – Name is unique within a namespace to reference a secret resource.

  • namespace (Optional[str]) – Namespace defines the space within which the secret name must be unique.

class avionix.kube.core.SecretVolumeSource(optional, secret_name, default_mode=None, items=None)
Parameters
  • optional (bool) – Specify whether the Secret or its keys must be defined

  • secret_name (str) – Name of the secret in the pod’s namespace to use. More info: https://kubernetes.io/docs/concepts/storage/volumes#secret

  • default_mode (Optional[int]) – Optional: mode bits to use on created files by default. Must be a value between 0 and 0777. Defaults to 0644. Directories within the path are not affected by this setting. This might be in conflict with other options that affect the file mode, like fsGroup, and the result can be other mode bits set.

  • items (Optional[List[KeyToPath]]) – If unspecified, each key-value pair in the Data field of the referenced Secret will be projected into the volume as a file whose name is the key and content is the value. If specified, the listed keys will be projected into the specified paths, and unlisted keys will not be present. If a key is specified which is not present in the Secret, the volume setup will error unless it is marked optional. Paths must be relative and may not contain the ‘..’ path or start with ‘..’.

class avionix.kube.core.SecurityContext(allow_privilege_escalation, run_as_group, run_as_non_root, se_linux_options, windows_options, capabilities=None, privileged=None, proc_mount=None, read_only_root_filesystem=None, run_as_user=None)
Parameters
  • allow_privilege_escalation (bool) – AllowPrivilegeEscalation controls whether a process can gain more privileges than its parent process. This bool directly controls if the no_new_privs flag will be set on the container process. AllowPrivilegeEscalation is true always when the container is: 1) run as Privileged 2) has CAP_SYS_ADMIN

  • run_as_group (int) – The GID to run the entrypoint of the container process. Uses runtime default if unset. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

  • run_as_non_root (bool) – Indicates that the container must run as a non-root user. If true, the Kubelet will validate the image at runtime to ensure that it does not run as UID 0 (root) and fail to start the container if it does. If unset or false, no such validation will be performed. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

  • se_linux_options (SELinuxOptions) – The SELinux context to be applied to the container. If unspecified, the container runtime will allocate a random SELinux context for each container. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

  • windows_options (WindowsSecurityContextOptions) – The Windows specific settings applied to all containers. If unspecified, the options from the PodSecurityContext will be used. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

  • capabilities (Optional[Capabilities]) – The capabilities to add/drop when running containers. Defaults to the default set of capabilities granted by the container runtime.

  • privileged (Optional[bool]) – Run container in privileged mode. Processes in privileged containers are essentially equivalent to root on the host. Defaults to false.

  • proc_mount (Optional[str]) – procMount denotes the type of proc mount to use for the containers. The default is DefaultProcMount which uses the container runtime defaults for readonly paths and masked paths. This requires the ProcMountType feature flag to be enabled.

  • read_only_root_filesystem (Optional[bool]) – Whether this container has a read-only root filesystem. Default is false.

  • run_as_user (Optional[int]) – The UID to run the entrypoint of the container process. Defaults to user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.

class avionix.kube.core.Service(metadata, spec, api_version=None)
Parameters
class avionix.kube.core.ServiceAccount(metadata, automount_service_account_token=None, image_pull_secrets=None, secrets=None, api_version=None)
Parameters
class avionix.kube.core.ServiceAccountList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.ServiceAccountTokenProjection(path, audience=None, expiration_seconds=None)
Parameters
  • path (str) – Path is the path relative to the mount point of the file to project the token into.

  • audience (Optional[str]) – Audience is the intended audience of the token. A recipient of a token must identify itself with an identifier specified in the audience of the token, and otherwise should reject the token. The audience defaults to the identifier of the apiserver.

  • expiration_seconds (Optional[int]) – ExpirationSeconds is the requested duration of validity of the service account token. As the token approaches expiration, the kubelet volume plugin will proactively rotate the service account token. The kubelet will start trying to rotate the token if the token is older than 80 percent of its time to live or if the token is older than 24 hours.Defaults to 1 hour and must be at least 10 minutes.

class avionix.kube.core.ServiceList(metadata, items, api_version=None)
Parameters
class avionix.kube.core.ServicePort(port, app_protocol=None, name=None, node_port=None, protocol=None, target_port=None)
Parameters
  • port (int) – The port that will be exposed by this service.

  • app_protocol (Optional[str]) – The application protocol for this port. This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names such as mycompany.com/my-custom-protocol. Field can be enabled with ServiceAppProtocol feature gate.

  • name (Optional[str]) – The name of this port within the service. This must be a DNS_LABEL. All ports within a ServiceSpec must have unique names. When considering the endpoints for a Service, this must match the ‘name’ field in the EndpointPort. Optional if only one ServicePort is defined on this service.

  • node_port (Optional[int]) – The port on each node on which this service is exposed when type=NodePort or LoadBalancer. Usually assigned by the system. If specified, it will be allocated to the service if unused or else creation of the service will fail. Default is to auto-allocate a port if the ServiceType of this Service requires one. More info: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport # noqa

  • protocol (Optional[str]) – The IP protocol for this port. Supports “TCP”, “UDP”, and “SCTP”. Default is TCP.

  • target_port (Optional[int]) – Number or name of the port to access on the pods targeted by the service. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME. If this is a string, it will be looked up as a named port in the target Pod’s container ports. If this is not specified, the value of the ‘port’ field is used (an identity map). This field is ignored for services with clusterIP=None, and should be omitted or set equal to the ‘port’ field. More info: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service # noqa

class avionix.kube.core.ServiceSpec(ports, cluster_ip=None, external_ips=None, external_name=None, external_traffic_policy=None, health_check_node_port=None, ip_family=None, load_balancer_ip=None, load_balancer_source_ranges=None, publish_not_ready_addresses=None, selector=None, session_affinity=None, session_affinity_config=None, topology_keys=None, type=None)
Parameters
  • ports (List[ServicePort]) – The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies # noqa

  • cluster_ip (Optional[str]) – clusterIP is the IP address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are “None”, empty string (“”), or a valid IP address. “None” can be specified for headless services when proxying is not required. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies # noqa

  • external_ips (Optional[List[str]]) – externalIPs is a list of IP addresses for which nodes in the cluster will also accept traffic for this service. These IPs are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this IP. A common example is external load-balancers that are not part of the Kubernetes system.

  • external_name (Optional[str]) – externalName is the external reference that kubedns or equivalent will return as a CNAME record for this service. No proxying will be involved. Must be a valid RFC-1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be ExternalName.

  • external_traffic_policy (Optional[str]) – externalTrafficPolicy denotes if this Service desires to route external traffic to node-local or cluster-wide endpoints. “Local” preserves the client source IP and avoids a second hop for LoadBalancer and Nodeport type services, but risks potentially imbalanced traffic spreading. “Cluster” obscures the client source IP and may cause a second hop to another node, but should have good overall load-spreading.

  • health_check_node_port (Optional[int]) – healthCheckNodePort specifies the healthcheck nodePort for the service. If not specified, HealthCheckNodePort is created by the service api backend with the allocated nodePort. Will use user-specified nodePort value if specified by the client. Only effects when Type is set to LoadBalancer and ExternalTrafficPolicy is set to Local.

  • ip_family (Optional[str]) – ipFamily specifies whether this Service has a preference for a particular IP family (e.g. IPv4 vs. IPv6). If a specific IP family is requested, the clusterIP field will be allocated from that family, if it is available in the cluster. If no IP family is requested, the cluster’s primary IP family will be used. Other IP fields (loadBalancerIP, loadBalancerSourceRanges, externalIPs) and controllers which allocate external load-balancers should use the same IP family. Endpoints for this Service will be of this family. This field is immutable after creation. Assigning a ServiceIPFamily not available in the cluster (e.g. IPv6 in IPv4 only cluster) is an error condition and will fail during clusterIP assignment.

  • load_balancer_ip (Optional[str]) – Only applies to Service Type: LoadBalancer LoadBalancer will get created with the IP specified in this field. This feature depends on whether the underlying cloud-provider supports specifying the loadBalancerIP when a load balancer is created. This field will be ignored if the cloud-provider does not support the feature.

  • load_balancer_source_ranges (Optional[List[str]]) – If specified and supported by the platform, this will restrict traffic through the cloud-provider load-balancer will be restricted to the specified client IPs. This field will be ignored if the cloud-provider does not support the feature.” More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/ # noqa

  • publish_not_ready_addresses (Optional[bool]) – publishNotReadyAddresses, when set to true, indicates that DNS implementations must publish the notReadyAddresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a StatefulSet’s Headless Service to propagate SRV records for its Pods without respect to their readiness for purpose of peer discovery.

  • selector (Optional[dict]) – Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types ClusterIP, NodePort, and LoadBalancer. Ignored if type is ExternalName. More info: https://kubernetes.io/docs/concepts/services-networking/service/

  • session_affinity (Optional[str]) – Supports “ClientIP” and “None”. Used to maintain session affinity. Enable client IP based session affinity. Must be ClientIP or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies # noqa

  • session_affinity_config (Optional[SessionAffinityConfig]) – sessionAffinityConfig contains the configurations of session affinity.

  • topology_keys (Optional[List[str]]) – topologyKeys is a preference-order list of topology keys which implementations of services should use to preferentially sort endpoints when accessing this Service, it can not be used at the same time as externalTrafficPolicy=Local. Topology keys must be valid label keys and at most 16 keys may be specified. Endpoints are chosen based on the first topology key with available backends. If this field is specified and all entries have no backends that match the topology of the client, the service has no backends for that client and connections should fail. The special value “*” may be used to mean “any topology”. This catch-all value, if used, only makes sense as the last value in the list. If this is not specified or empty, no topology constraints will be applied.

  • options are ExternalName, ClusterIP, NodePort, and LoadBalancer. "ExternalName" maps to the specified externalName. "ClusterIP" allocates a cluster-internal IP address for load-balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If clusterIP is "None", no virtual IP is allocated and the endpoints are published as a set of endpoints rather than a stable IP. "NodePort" builds on ClusterIP and allocates a port on every node which routes to the clusterIP. "LoadBalancer" builds on NodePort and creates an external load-balancer (if supported in the current cloud) which routes to the clusterIP. More info (typeValid) – https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types # noqa

class avionix.kube.core.SessionAffinityConfig(client_ip)
Parameters

client_ip (ClientIPConfig) – clientIP contains the configurations of Client IP based session affinity.

class avionix.kube.core.StorageOSPersistentVolumeSource(fs_type, volume_name, volume_namespace, read_only=None, secret_ref=None)
Parameters
  • fs_type (str) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. Implicitly inferred to be “ext4” if unspecified.

  • volume_name (str) – VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.

  • volume_namespace (str) – VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod’s namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to “default” if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.

  • read_only (Optional[bool]) – Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

  • secret_ref (Optional[ObjectReference]) – SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.

class avionix.kube.core.StorageOSVolumeSource(fs_type, volume_name, volume_namespace, read_only=None, secret_ref=None)
Parameters
  • fs_type (str) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. Implicitly inferred to be “ext4” if unspecified.

  • volume_name (str) – VolumeName is the human-readable name of the StorageOS volume. Volume names are only unique within a namespace.

  • volume_namespace (str) – VolumeNamespace specifies the scope of the volume within StorageOS. If no namespace is specified then the Pod’s namespace will be used. This allows the Kubernetes name scoping to be mirrored within StorageOS for tighter integration. Set VolumeName to any name to override the default behaviour. Set to “default” if you are not using namespaces within StorageOS. Namespaces that do not pre-exist within StorageOS will be created.

  • read_only (Optional[bool]) – Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.

  • secret_ref (Optional[LocalObjectReference]) – SecretRef specifies the secret to use for obtaining the StorageOS API credentials. If not specified, default values will be attempted.

class avionix.kube.core.Sysctl(name, value)
Parameters
  • name (str) – Name of a property to set

  • value (str) – Value of a property to set

class avionix.kube.core.TCPSocketAction(port, host=None)
Parameters
  • port (int) – Number or name of the port to access on the container. Number must be in the range 1 to 65535. Name must be an IANA_SVC_NAME.

  • host (Optional[str]) – Optional: Host name to connect to, defaults to the pod IP.

class avionix.kube.core.Taint(effect, key, time_added, value)
Parameters
  • effect (str) – Required. The effect of the taint on pods that do not tolerate the taint. Valid effects are NoSchedule, PreferNoSchedule and NoExecute.

  • key (str) – Required. The taint key to be applied to a node.

  • time_added (time) – TimeAdded represents the time at which the taint was added. It is only written for NoExecute taints.

  • value (str) – The taint value corresponding to the taint key.

class avionix.kube.core.Toleration(effect, key, toleration_seconds, value, operator=None)
Parameters
  • effect (str) – Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.

  • key (str) – Key is the taint key that the toleration applies to. Empty means match all taint keys. If the key is empty, operator must be Exists; this combination means to match all values and all keys.

  • toleration_seconds (int) – TolerationSeconds represents the period of time the toleration (which must be of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default, it is not set, which means tolerate the taint forever (do not evict). Zero and negative values will be treated as 0 (evict immediately) by the system.

  • value (str) – Value is the taint value the toleration matches to. If the operator is Exists, the value should be empty, otherwise just a regular string.

  • operator (Optional[str]) – Operator represents a key’s relationship to the value. Valid operators are Exists and Equal. Defaults to Equal. Exists is equivalent to wildcard for value, so that a pod can tolerate all taints of a particular category.

class avionix.kube.core.TopologySelectorLabelRequirement(key, values)
Parameters
  • key (str) – The label key that the selector applies to.

  • values (List[str]) – An array of string values. One value must match the label to be selected. Each entry in Values is ORed.

class avionix.kube.core.TopologySelectorTerm(match_label_expressions)
Parameters

match_label_expressions (List[TopologySelectorLabelRequirement]) – A list of topology selector requirements by labels.

class avionix.kube.core.TopologySpreadConstraint(label_selector, max_skew, topology_key, when_unsatisfiable)
Parameters
  • label_selector (LabelSelector) – LabelSelector is used to find matching pods. Pods that match this label selector are counted to determine the number of pods in their corresponding topology domain.

  • max_skew (int) – MaxSkew describes the degree to which pods may be unevenly distributed. It’s the maximum permitted difference between the number of matching pods in any two topology domains of a given topology type. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 1/1/0: | zone1 | zone2 | zone3 | | P | P | | - if MaxSkew is 1, incoming pod can only be scheduled to zone3 to become 1/1/1; scheduling it onto zone1(zone2) would make the ActualSkew(2-0) on zone1(zone2) violate MaxSkew(1). - if MaxSkew is 2, incoming pod can be scheduled onto any zone. It’s a required field. Default value is 1 and 0 is not allowed.

  • topology_key (str) – TopologyKey is the key of node labels. Nodes that have a label with this key and identical values are considered to be in the same topology. We consider each <key, value> as a “bucket”, and try to put balanced number of pods into each bucket. It’s a required field.

  • when_unsatisfiable (str) – WhenUnsatisfiable indicates how to deal with a pod if it doesn’t satisfy the spread constraint. - DoNotSchedule (default) tells the scheduler not to schedule it - ScheduleAnyway tells the scheduler to still schedule it It’s considered as “Unsatisfiable” if and only if placing incoming pod on any topology violates “MaxSkew”. For example, in a 3-zone cluster, MaxSkew is set to 1, and pods with the same labelSelector spread as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | If WhenUnsatisfiable is set to DoNotSchedule, incoming pod can only be scheduled to zone2(zone3) to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) satisfies MaxSkew(1). In other words, the cluster can still be imbalanced, but scheduler won’t make it more imbalanced. It’s a required field.

class avionix.kube.core.TypedLocalObjectReference(name, api_group=None)
Parameters
  • name (str) – Name is the name of resource being referenced

  • api_group (Optional[str]) – APIGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required.

class avionix.kube.core.Volume(name, config_map=None, downward_api=None, empty_dir=None, git_repo=None, host_path=None, persistent_volume_claim=None, projected=None, secret=None, aws_elastic_block_store=None, azure_disk=None, azure_file=None, cephfs=None, cinder=None, csi=None, fc=None, flex_volume=None, flocker=None, gce_persistent_disk=None, glusterfs=None, iscsi=None, nfs=None, photon_persistent_disk=None, portworx_volume=None, quobyte=None, rbd=None, scale_io=None, storageos=None, vsphere_volume=None)
Parameters
class avionix.kube.core.VolumeDevice(name, device_path)
Parameters
  • name (str) – name must match the name of a persistentVolumeClaim in the pod

  • device_path (str) – devicePath is the path inside of the container that the device will be mapped to.

class avionix.kube.core.VolumeMount(name, mount_path, mount_propagation=None, read_only=None, sub_path=None, sub_path_expr=None)
Parameters
  • name (str) – This must match the Name of a Volume.

  • mount_path (str) – Path within the container at which the volume should be mounted. Must not contain ‘:’.

  • mount_propagation (Optional[str]) – mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.

  • read_only (Optional[bool]) – Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.

  • sub_path (Optional[str]) – Path within the volume from which the container’s volume should be mounted. Defaults to “” (volume’s root).

  • sub_path_expr (Optional[str]) – Expanded path within the volume from which the container’s volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container’s environment. Defaults to “” (volume’s root). SubPathExpr and SubPath are mutually exclusive.

class avionix.kube.core.VolumeNodeAffinity(required)
Parameters

required (NodeSelector) – Required specifies hard node constraints that must be met.

class avionix.kube.core.VolumeProjection(config_map, downward_api, secret, service_account_token)
Parameters
class avionix.kube.core.VsphereVirtualDiskVolumeSource(fs_type, storage_policy_id, storage_policy_name, volume_path)
Parameters
  • fs_type (str) – Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. “ext4”, “xfs”, “ntfs”. Implicitly inferred to be “ext4” if unspecified.

  • storage_policy_id (str) – Storage Policy Based Management (SPBM) profile ID associated with the StoragePolicyName.

  • storage_policy_name (str) – Storage Policy Based Management (SPBM) profile name.

  • volume_path (str) – Path that identifies vSphere volume vmdk

class avionix.kube.core.WeightedPodAffinityTerm(pod_affinity_term, weight)
Parameters
  • pod_affinity_term (PodAffinityTerm) – Required. A pod affinity term, associated with the corresponding weight.

  • weight (int) – weight associated with matching the corresponding podAffinityTerm, in the range 1-100.

class avionix.kube.core.WindowsSecurityContextOptions(gmsa_credential_spec, gmsa_credential_spec_name, run_as_user_name=None)
Parameters
  • gmsa_credential_spec (str) – GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field.

  • gmsa_credential_spec_name (str) – GMSACredentialSpecName is the name of the GMSA credential spec to use.

  • run_as_user_name (Optional[str]) – The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence.