Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peak-ai/eks-token
Python Package to get EKS auth token (Alternative to "aws eks get-token ...." CLI)
https://github.com/peak-ai/eks-token
boto3 eks k8s k8scluster python token
Last synced: 7 days ago
JSON representation
Python Package to get EKS auth token (Alternative to "aws eks get-token ...." CLI)
- Host: GitHub
- URL: https://github.com/peak-ai/eks-token
- Owner: peak-ai
- License: lgpl-2.1
- Created: 2020-09-28T11:52:14.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-22T04:40:11.000Z (22 days ago)
- Last Synced: 2024-10-23T06:54:56.523Z (21 days ago)
- Topics: boto3, eks, k8s, k8scluster, python, token
- Language: Python
- Homepage:
- Size: 76.2 KB
- Stars: 26
- Watchers: 3
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
# eks-token
EKS Token package, an alternate to "aws eks get-token ..." CLI![CodeQuality](https://github.com/peak-ai/eks-token/workflows/CodeQL/badge.svg) ![Publish](https://github.com/peak-ai/eks-token/workflows/Upload%20Python%20Package/badge.svg) ![stable](https://img.shields.io/github/v/release/peak-ai/eks-token) ![](https://img.shields.io/github/v/release/peak-ai/eks-token?include_prereleases) ![](https://img.shields.io/github/license/peak-ai/eks-token) ![](https://img.shields.io/github/languages/count/peak-ai/eks-token) ![](https://img.shields.io/github/languages/top/peak-ai/eks-token) ![](https://img.shields.io/github/issues-raw/peak-ai/eks-token) ![](https://img.shields.io/github/issues-pr-raw/peak-ai/eks-token) ![](https://img.shields.io/github/languages/code-size/peak-ai/eks-token) ![](https://img.shields.io/github/repo-size/peak-ai/eks-token)
![logo](https://raw.githubusercontent.com/peak-ai/eks-token/main/eks-iam.png)
## Usage
### Installation
```shell
pip install eks-token
```### Basic usage
```python
from eks_token import get_token
from pprint import pprintresponse = get_token(cluster_name='')
pprint(response)
```
Expected Output
```python
{'apiVersion': 'client.authentication.k8s.io/v1alpha1',
'kind': 'ExecCredential',
'spec': {},
'status': {'expirationTimestamp': '2020-10-01T15:05:17Z',
'token': 'k8s-aws-v1.'}}
```### Extract token from response
```python
from eks_token import get_tokentoken = get_token(cluster_name='value')['status']['token']
print(token)
```### Get Token signed for particular IAM role
Pass `role_arn` argument to the function
```python
from eks_token import get_tokentoken = get_token(cluster_name='', role_arn='')['status']['token']
print(token)
```## Contribution
Check our guidelines [here](CONTRIBUTING.md)