Curl k8s

From UVOO Tech Wiki
Jump to navigation Jump to search
kubectl config view --minify --raw --output 'jsonpath={..cluster.certificate-authority-data}' | base64 -d > ca.pem
kubectl config view --minify --raw --output 'jsonpath={..user.client-certificate-data}' | base64 -d > crt.pem
kubectl config view --minify --raw --output 'jsonpath={..user.client-key-data}' | base64 -d > key.pem

curl --cert crt.pem --key key.pem --cacert ca.pem https://$K8S_IP:6443/api/v1/pods
curl --cert userbob.pem --key userBob-key.pem \  
--cacert /path/to/ca.pem \   
https://k8sServer:6443/api/v1/pods
ht‌tps://10.128.0.3:6443/api/v1/namespaces/default/pods