Difference between revisions of "Curl k8s"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
Line 1: Line 1:
 +
```
 +
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 \   
 
curl --cert userbob.pem --key userBob-key.pem \   

Latest revision as of 18:11, 3 January 2025

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