This code allows the kubernetes client to work on aws linux (where child_process doesn't work).
Firstly, it checks if the cluster is running on EKS - if so, it fetches the refreshtoken directly from aws's api instead
of through shell.
To make this work, you need to have an enviroment variable "AWS_CREDENTIALS" of which the value is the path to your credentials file (ie. credentials.txt or configs/credentials.txt"
In your credentials.txt should be layed out like the one below.
This code allows the kubernetes client to work on aws linux (where child_process doesn't work).
Firstly, it checks if the cluster is running on EKS - if so, it fetches the refreshtoken directly from aws's api instead of through shell.
To make this work, you need to have an enviroment variable "AWS_CREDENTIALS" of which the value is the path to your credentials file (ie. credentials.txt or configs/credentials.txt"
In your credentials.txt should be layed out like the one below.
After doing this, you should be all set and it should fetch refreshtokens directly from AWS (no need to change any of your production code) :)