10-5-----Kubernetes API

API的设计和使用方式

如何开发一个容器平台

在项目deep-in-kubernetes查看有 grep -r "apiVersion" 写法。

api核心组     有两级           版本---资源

apis非核心    三级表示       分组---版本---资源

修改api-server参数为  - --insecure-port=8080 测试

kubectl edit pods kube-apiserver-m1 -n kube-system -o yaml #
vim /etc/kubernetes/manifests/kube-apiserver.yaml
kubectl get pods kube-apiserver-m1 -n kube-system -o yaml

# 访问测试
curl http://localhost:8080/healthz

# 测试阿皮地址
curl http://localhost:8080/api/v1/nodes
curl http://localhost:8080/api/v1/pods

API官网  https://kubernetes.io/zh/docs/concepts/overview/kubernetes-api/   

Python客户端   

https://kubernetes.io/zh/docs/reference/using-api/client-libraries/

https://github.com/kubernetes-client/python/tree/master/examples

原文地址:https://www.cnblogs.com/edeny/p/14682169.html