|
token=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) |
|
node_url="https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT}/api/v1/nodes/${HOSTNAME}" |
|
response=$(curl -k -s -H "Authorization: Bearer $token" $node_url) |
|
ipv4_subnet=$(echo $response | jq '.spec.podCIDR') |
|
|
we are using curl -k
which is insecure. We should use --cacert
with the ca cert in the same folder as token
file.