KubernetesIngressStorage

class gafaelfawr.storage.kubernetes.KubernetesIngressStorage(api_client, logger)

Bases: object

Kubernetes storage layer for ingress objects.

This abstracts creation of Ingress resources based on configuration and templates in GafaelfawrIngress resources by wrapping the underlying Kubernetes Python client.

Parameters:
  • api_client (ApiClient) – Kubernetes async client to use.

  • logger (BoundLogger) – Logger to use.

Notes

Unlike KubernetesTokenStorage, this storage layer is very lightweight, since the API is defined in terms of Kubernetes API objects (there was no compelling reason to create parallel models) and the service is responsible for assembling those objects based on the template in GafaelfawrIngress.

Methods Summary

create_ingress(ingress, parent)

Create a Kubernetes Ingress resource.

get_ingress(name, namespace)

Retrieve a Kubernetes Ingress resource.

replace_ingress(ingress, parent)

Replace a Kubernetes Ingress resource.

Methods Documentation

async create_ingress(ingress, parent)

Create a Kubernetes Ingress resource.

Parameters:
  • ingress (V1Ingress) – The Ingress object to create. This will be modified in place to add owner metadata.

  • parent (GafaelfawrIngress) – The parent object for the ingress

Returns:

Status information to store in the parent object.

Return type:

KubernetesResourceStatus

async get_ingress(name, namespace)

Retrieve a Kubernetes Ingress resource.

Parameters:
  • name (str) – Name of the ingress

  • namespace (str) – Namespace in which the ingress is located

Returns:

The Kubernetes ingress object, or None if it doesn’t exist.

Return type:

kubernetes_asyncio.client.models.V1Ingress or None

async replace_ingress(ingress, parent)

Replace a Kubernetes Ingress resource.

Parameters:
  • ingress (V1Ingress) – The Ingress object to replace. This will be modified in place to add owner metadata.

  • parent (GafaelfawrIngress) – The parent object for the ingress

Returns:

Status information to store in the parent object.

Return type:

KubernetesResourceStatus