colebrooke/kubernetes-nagios

Cater for bearer token based authentication

Opened this issue · 1 comments

/kind feature

The curl methods are clean however only the netrc authentication method is possible. We have a need for authentication using native Kubernetes Service Account tokens.

Feature request: Add an optional input parameter for token based authentication

Usage ./check_kube_nodes.sh [-t <TARGETSERVER> -c <CREDENTIALSFILE> -b <BEARERTOKEN>] [-k <KUBE_CONFIG>]
K8STATUS="$(curl -sS $SSL --header "Authorization: Bearer $BEARERTOKEN" $TARGET/api/v1/nodes)"

I was able to use sevice tokens by passing kube config to the script with the token in it.