MetadataStorage#

class controller.storage.metadata.MetadataStorage(metadata_path)#

Bases: object

Storage layer for pod metadata for the running pod.

Some attributes of the Kubernetes objects created by the lab controller depend on metadata about where the lab controller is running. This storage layer retrieves that information via the Kubernetes downward API.

Parameters:

metadata_path (Path) – Path at which the downward API data is mounted.

Attributes Summary

namespace

The namespace in which the lab controller is running.

owner_reference

An owner reference pointing to the lab controller.

Attributes Documentation

namespace#

The namespace in which the lab controller is running.

Some resources, such as prepuller pods, are spawned in the same namespace as the lab controller.

owner_reference#

An owner reference pointing to the lab controller.

We want some objects, such as prepuller pods, to show as owned by the lab controller. This enables clearer display in services such as Argo CD and also hopefully tells Kubernetes to delete the pods when the lab controller is deleted, avoiding later conflicts.