No project description provided
Project description
tokeks
A zero-dependency Python library for getting the Kubernetes token of a AWS EKS cluster.
No AWS CLI, third-party client or library (boto3, botocore, etc.) required.
Installation
pip install tokeks
Usage prerequisites
Assign your credentials to environment variables:
export AWS_ACCESS_KEY_ID="..."
export AWS_SECRET_ACCESS_KEY="..."
Library usage
from tokeks import Tokeks
tokeks = Tokeks(
access_key_id=os.environ['AWS_ACCESS_KEY_ID'],
secret_access_key=os.environ['AWS_SECRET_ACCESS_KEY'],
region_id='YOUR_REGION_ID',
cluster_id='YOUR_CLUSTER_ID')
token = tokeks.get_token()
CLI usage
-
Go to project directory
-
Run script:
TOKEN=$(./getekstoken us-west-1 cluster-1)
- Verify Kubernetes API access:
APISERVER=...
curl -X GET $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure
If the response is something like:
{
"kind": "APIVersions",
"versions": [
"v1"
],
"serverAddressByClientCIDRs": [
{
"clientCIDR": "0.0.0.0/0",
"serverAddress": "..."
}
]
}
(and does not contain "Unauthorized"), you're good to go!
Inspired by:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tokeks-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tokeks-0.1.1-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
442982e85af8013af80f22d3fb86aece39ec5b9dd3705d0ebd523ec547d5d812
|
|
| MD5 |
3e7bed6450aa52689c5242a81331e992
|
|
| BLAKE2b-256 |
4d93ecc723156dd9bf7a556cb8c743cafa89220ee0f4ae7cc1562a438dadbe79
|