KubernetesTokenService#
- class gafaelfawr.services.kubernetes.KubernetesTokenService(*, token_service, storage, logger)#
Bases:
objectManage Gafaelfawr service tokens stored in Kubernetes secrets.
The
GafaelfawrServiceTokencustom 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 theGafaelfawrServiceTokenKubernetes object.namespace (
str) – Namespace of theGafaelfawrServiceTokenKubernetes object.body – Contents of the
GafaelfawrServiceTokenKubernetes object.service_token (
GafaelfawrServiceToken)
- Returns:
Information to put into the
statusportion of the object, orNoneif no status update is required.- Return type:
KubernetesResourceStatus or None
- Raises:
KubernetesError – Some error occurred while trying to write to Kubernetes.