Smarter AWS EKS Helper
- class smarter.apps.infrastructure.providers.aws.helpers.eks.AWSEks(aws_access_key_id=None, aws_secret_access_key=None, aws_region=None, aws_profile=None, shared_resource_identifier=None, environment=None, environment_domain=None, root_domain=None, debug_mode=False, init_info=None)[source]
Bases:
AWSBaseThe AWS EKS helper: the platform’s cluster,
smarter_settings.aws_eks_cluster_name.The cluster is optional. Without its name, the platform runs, but nothing is deployed to Kubernetes, and the first attempt to reach the cluster logs how to set it.
- cluster_name_is_set()[source]
Return True if
smarter_settings.aws_eks_cluster_nameis set.If it is not, log how to set it, once per process.
- Return type:
- get_cluster_resources()[source]
Describe the cloud resources of the platform’s EKS cluster: the cluster, its add-ons and its node groups.
- get_token()[source]
Create a bearer token for the platform’s EKS cluster, as
aws eks get-tokendoes.The token is an STS GetCallerIdentity url, presigned with the session’s credentials and the cluster’s name, which EKS calls to identify the caller. Creating it makes no request, so it takes milliseconds rather than the seconds that the aws cli takes to start.
- Return type:
- Returns:
The token, and when it should no longer be used, as a
time.time().- Raises:
AWSNotReadyError – If AWS is not ready, or the cluster’s name or region is not set.