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:
token_service (
TokenService
) – Token management service.storage (
KubernetesTokenStorage
) – Storage layer for the Kubernetes cluster.logger (
BoundLogger
) – Logger to report issues.
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 theGafaelfawrServiceToken
Kubernetes object.namespace (
str
) – Namespace of theGafaelfawrServiceToken
Kubernetes object.body – Contents of the
GafaelfawrServiceToken
Kubernetes object.service_token (
GafaelfawrServiceToken
)
- Returns:
Information to put into the
status
portion of the object, orNone
if no status update is required.- Return type:
KubernetesResourceStatus or None
- Raises:
KubernetesError – Some error occurred while trying to write to Kubernetes.