KubernetesTokenService

class gafaelfawr.services.kubernetes.KubernetesTokenService(*, token_service, storage, logger)

Bases: object

Manage Gafaelfawr service tokens stored in Kubernetes secrets.

The GafaelfawrServiceToken custom resource defines a Gafaelfawr service token that should be created and managed as a Kubernetes secret. This class provides the core of the Kubernetes operator that does this. It is intended to be driven via Kopf and a thin layer of Kopf event handlers.

Parameters:

Methods Summary

update(name, namespace, service_token)

Handle a change to a GafaelfawrServiceToken.

Methods Documentation

async update(name, namespace, service_token)

Handle a change to a GafaelfawrServiceToken.

Parameters:
  • name (str) – Name of the GafaelfawrServiceToken Kubernetes object.

  • namespace (str) – Namespace of the GafaelfawrServiceToken Kubernetes object.

  • body – Contents of the GafaelfawrServiceToken Kubernetes object.

  • service_token (GafaelfawrServiceToken)

Returns:

Information to put into the status portion of the object, or None if no status update is required.

Return type:

KubernetesResourceStatus or None

Raises:

KubernetesError – Some error occurred while trying to write to Kubernetes.