blob: 59ec509ca5434511e81070b473c3fab7cac5434b [file] [log] [blame]
:py:mod:`airflow.providers.amazon.aws.hooks.eks`
================================================
.. py:module:: airflow.providers.amazon.aws.hooks.eks
.. autoapi-nested-parse::
Interact with Amazon EKS, using the boto3 library.
Module Contents
---------------
Classes
~~~~~~~
.. autoapisummary::
airflow.providers.amazon.aws.hooks.eks.ClusterStates
airflow.providers.amazon.aws.hooks.eks.FargateProfileStates
airflow.providers.amazon.aws.hooks.eks.NodegroupStates
airflow.providers.amazon.aws.hooks.eks.EksHook
airflow.providers.amazon.aws.hooks.eks.EKSHook
Attributes
~~~~~~~~~~
.. autoapisummary::
airflow.providers.amazon.aws.hooks.eks.DEFAULT_PAGINATION_TOKEN
airflow.providers.amazon.aws.hooks.eks.STS_TOKEN_EXPIRES_IN
airflow.providers.amazon.aws.hooks.eks.AUTHENTICATION_API_VERSION
.. py:data:: DEFAULT_PAGINATION_TOKEN
:annotation: =
.. py:data:: STS_TOKEN_EXPIRES_IN
:annotation: = 60
.. py:data:: AUTHENTICATION_API_VERSION
:annotation: = client.authentication.k8s.io/v1alpha1
.. py:class:: ClusterStates
Bases: :py:obj:`enum.Enum`
Contains the possible State values of an EKS Cluster.
.. py:attribute:: CREATING
:annotation: = CREATING
.. py:attribute:: ACTIVE
:annotation: = ACTIVE
.. py:attribute:: DELETING
:annotation: = DELETING
.. py:attribute:: FAILED
:annotation: = FAILED
.. py:attribute:: UPDATING
:annotation: = UPDATING
.. py:attribute:: NONEXISTENT
:annotation: = NONEXISTENT
.. py:class:: FargateProfileStates
Bases: :py:obj:`enum.Enum`
Contains the possible State values of an AWS Fargate profile.
.. py:attribute:: CREATING
:annotation: = CREATING
.. py:attribute:: ACTIVE
:annotation: = ACTIVE
.. py:attribute:: DELETING
:annotation: = DELETING
.. py:attribute:: CREATE_FAILED
:annotation: = CREATE_FAILED
.. py:attribute:: DELETE_FAILED
:annotation: = DELETE_FAILED
.. py:attribute:: NONEXISTENT
:annotation: = NONEXISTENT
.. py:class:: NodegroupStates
Bases: :py:obj:`enum.Enum`
Contains the possible State values of an EKS Managed Nodegroup.
.. py:attribute:: CREATING
:annotation: = CREATING
.. py:attribute:: ACTIVE
:annotation: = ACTIVE
.. py:attribute:: UPDATING
:annotation: = UPDATING
.. py:attribute:: DELETING
:annotation: = DELETING
.. py:attribute:: CREATE_FAILED
:annotation: = CREATE_FAILED
.. py:attribute:: DELETE_FAILED
:annotation: = DELETE_FAILED
.. py:attribute:: DEGRADED
:annotation: = DEGRADED
.. py:attribute:: NONEXISTENT
:annotation: = NONEXISTENT
.. py:class:: EksHook(*args, **kwargs)
Bases: :py:obj:`airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
Interact with Amazon EKS, using the boto3 library.
Additional arguments (such as ``aws_conn_id``) may be specified and
are passed down to the underlying AwsBaseHook.
.. seealso::
:class:`~airflow.providers.amazon.aws.hooks.base_aws.AwsBaseHook`
.. py:attribute:: client_type
:annotation: = eks
.. py:method:: create_cluster(self, name, roleArn, resourcesVpcConfig, **kwargs)
Creates an Amazon EKS control plane.
:param name: The unique name to give to your Amazon EKS Cluster.
:param roleArn: The Amazon Resource Name (ARN) of the IAM role that provides permissions
for the Kubernetes control plane to make calls to AWS API operations on your behalf.
:param resourcesVpcConfig: The VPC configuration used by the cluster control plane.
:return: Returns descriptive information about the created EKS Cluster.
:rtype: Dict
.. py:method:: create_nodegroup(self, clusterName, nodegroupName, subnets, nodeRole, *, tags = None, **kwargs)
Creates an Amazon EKS managed node group for an Amazon EKS Cluster.
:param clusterName: The name of the Amazon EKS cluster to create the EKS Managed Nodegroup in.
:param nodegroupName: The unique name to give your managed nodegroup.
:param subnets: The subnets to use for the Auto Scaling group that is created for your nodegroup.
:param nodeRole: The Amazon Resource Name (ARN) of the IAM role to associate with your nodegroup.
:param tags: Optional tags to apply to your nodegroup.
:return: Returns descriptive information about the created EKS Managed Nodegroup.
:rtype: Dict
.. py:method:: create_fargate_profile(self, clusterName, fargateProfileName, podExecutionRoleArn, selectors, **kwargs)
Creates an AWS Fargate profile for an Amazon EKS cluster.
:param clusterName: The name of the Amazon EKS cluster to apply the Fargate profile to.
:param fargateProfileName: The name of the Fargate profile.
:param podExecutionRoleArn: The Amazon Resource Name (ARN) of the pod execution role to
use for pods that match the selectors in the Fargate profile.
:param selectors: The selectors to match for pods to use this Fargate profile.
:return: Returns descriptive information about the created Fargate profile.
:rtype: Dict
.. py:method:: delete_cluster(self, name)
Deletes the Amazon EKS Cluster control plane.
:param name: The name of the cluster to delete.
:return: Returns descriptive information about the deleted EKS Cluster.
:rtype: Dict
.. py:method:: delete_nodegroup(self, clusterName, nodegroupName)
Deletes an Amazon EKS managed node group from a specified cluster.
:param clusterName: The name of the Amazon EKS Cluster that is associated with your nodegroup.
:param nodegroupName: The name of the nodegroup to delete.
:return: Returns descriptive information about the deleted EKS Managed Nodegroup.
:rtype: Dict
.. py:method:: delete_fargate_profile(self, clusterName, fargateProfileName)
Deletes an AWS Fargate profile from a specified Amazon EKS cluster.
:param clusterName: The name of the Amazon EKS cluster associated with the Fargate profile to delete.
:param fargateProfileName: The name of the Fargate profile to delete.
:return: Returns descriptive information about the deleted Fargate profile.
:rtype: Dict
.. py:method:: describe_cluster(self, name, verbose = False)
Returns descriptive information about an Amazon EKS Cluster.
:param name: The name of the cluster to describe.
:param verbose: Provides additional logging if set to True. Defaults to False.
:return: Returns descriptive information about a specific EKS Cluster.
:rtype: Dict
.. py:method:: describe_nodegroup(self, clusterName, nodegroupName, verbose = False)
Returns descriptive information about an Amazon EKS managed node group.
:param clusterName: The name of the Amazon EKS Cluster associated with the nodegroup.
:param nodegroupName: The name of the nodegroup to describe.
:param verbose: Provides additional logging if set to True. Defaults to False.
:return: Returns descriptive information about a specific EKS Nodegroup.
:rtype: Dict
.. py:method:: describe_fargate_profile(self, clusterName, fargateProfileName, verbose = False)
Returns descriptive information about an AWS Fargate profile.
:param clusterName: The name of the Amazon EKS Cluster associated with the Fargate profile.
:param fargateProfileName: The name of the Fargate profile to describe.
:param verbose: Provides additional logging if set to True. Defaults to False.
:return: Returns descriptive information about an AWS Fargate profile.
:rtype: Dict
.. py:method:: get_cluster_state(self, clusterName)
Returns the current status of a given Amazon EKS Cluster.
:param clusterName: The name of the cluster to check.
:return: Returns the current status of a given Amazon EKS Cluster.
:rtype: ClusterStates
.. py:method:: get_fargate_profile_state(self, clusterName, fargateProfileName)
Returns the current status of a given AWS Fargate profile.
:param clusterName: The name of the Amazon EKS Cluster associated with the Fargate profile.
:param fargateProfileName: The name of the Fargate profile to check.
:return: Returns the current status of a given AWS Fargate profile.
:rtype: AWS FargateProfileStates
.. py:method:: get_nodegroup_state(self, clusterName, nodegroupName)
Returns the current status of a given Amazon EKS managed node group.
:param clusterName: The name of the Amazon EKS Cluster associated with the nodegroup.
:param nodegroupName: The name of the nodegroup to check.
:return: Returns the current status of a given Amazon EKS Nodegroup.
:rtype: NodegroupStates
.. py:method:: list_clusters(self, verbose = False)
Lists all Amazon EKS Clusters in your AWS account.
:param verbose: Provides additional logging if set to True. Defaults to False.
:return: A List containing the cluster names.
:rtype: List
.. py:method:: list_nodegroups(self, clusterName, verbose = False)
Lists all Amazon EKS managed node groups associated with the specified cluster.
:param clusterName: The name of the Amazon EKS Cluster containing nodegroups to list.
:param verbose: Provides additional logging if set to True. Defaults to False.
:return: A List of nodegroup names within the given cluster.
:rtype: List
.. py:method:: list_fargate_profiles(self, clusterName, verbose = False)
Lists all AWS Fargate profiles associated with the specified cluster.
:param clusterName: The name of the Amazon EKS Cluster containing Fargate profiles to list.
:param verbose: Provides additional logging if set to True. Defaults to False.
:return: A list of Fargate profile names within a given cluster.
:rtype: List
.. py:method:: generate_config_file(self, eks_cluster_name, pod_namespace, pod_username = None, pod_context = None)
Writes the kubeconfig file given an EKS Cluster.
:param eks_cluster_name: The name of the cluster to generate kubeconfig file for.
:param pod_namespace: The namespace to run within kubernetes.
.. py:method:: fetch_access_token_for_cluster(self, eks_cluster_name)
.. py:class:: EKSHook(*args, **kwargs)
Bases: :py:obj:`EksHook`
This hook is deprecated.
Please use :class:`airflow.providers.amazon.aws.hooks.eks.EksHook`.