eks-iam-auth
v0.1.1
Published
Authenticate with AWS EKS clusters using AWS IAM
Downloads
583
Readme
eks-iam-auth
Authenticate with AWS EKS clusters using AWS IAM.
When using the AWS CLI it's possible to set up kubectl
such that it authenticates with your cluster using AWS IAM (docs). It is based on aws eks get-token
(docs). Unfortunately no such option currently exists in aws-sdk-js.
Installation
yarn add eks-iam-auth
or
npm i eks-iam-auth
Usage
import { getBearerToken } from 'getBearerToken'
import { Client1_13 as Client } from 'kubernetes-client'
const client = new Client({
config: {
url: 'https://<endpoint>.eks.amazonaws.com',
auth: {
bearer: getBearerToken('<cluster-name>'),
},
insecureSkipTlsVerify: true,
},
})
client.apis.apps.v1.deployments.get()
Currently only supports using AWS credentials from process.env.
License
eks-iam-auth is licensed under the terms of the MIT license.