Proxy API
Start the proxy:
1kubectl proxy &
Then curl the API server:
1curl http://localhost:8001
Create a token:
1export TOKEN=$(kubectl create token default)
2
3kubectl create clusterrole api-access-root \
4 --verb=get --non-resource-url=/*
5
6kubectl create clusterrolebinding api-access-root \
7 --clusterrole api-access-root --serviceaccount=default:default
Retrieve the API Server endpoint:
1export APISERVER=$(kubectl config view | grep https | \
2 cut -f 2- -d ":" | tr -d " ")
Confirm that the APISERVER
variable stored the same IP as the Kubernetes control plane IP by issuing the following two commands and comparing their outputs:
1echo $APISERVER
2
3https://192.168.99.100:8443
4
5kubectl cluster-info
We can also get the certs straight from the list in ~/.kube/config
.