colebrooke / kubernetes-nagios

Basic health checks for a Kubernetes cluster
MIT License
50 stars 44 forks source link

Cater for bearer token based authentication #9

Open MnrGreg opened 4 years ago

MnrGreg commented 4 years ago

/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)"
grimurd commented 3 years ago

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