1- 获取api命令
[注:以下命令的url地址http://127.0.0.1/为k8s master的地址]
kubectl api-versions
输出内容如下:
apps/v1beta1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1beta1
autoscaling/v1
batch/v1
certificates.k8s.io/v1alpha1
extensions/v1beta1
policy/v1beta1
rbac.authorization.k8s.io/v1alpha1
storage.k8s.io/v1beta1
v1
2- 根据groupVersion筛选
curl http://127.0.0.1:8080/apis|grep groupVersion|cut -d: -f2|sort|uniq -c|cut -d\\" -f2
输出如下:
apps/v1beta1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1beta1
autoscaling/v1
batch/v1
certificates.k8s.io/v1alpha1
extensions/v1beta1
policy/v1beta1
rbac.authorization.k8s.io/v1alpha1
storage.k8s.io/v1beta1
3- 根据kind筛选
curl http://127.0.0.1:8080/api/v1|grep kind|cut -d: -f2|sort|uniq -c|cut -d \\" -f2
输出如下:
APIResourceList
Binding
ComponentStatus
ConfigMap
Endpoints
Event
Eviction
LimitRange
Namespace
Node
PersistentVolume
PersistentVolumeClaim
Pod
PodTemplate
ReplicationController
ResourceQuota
Scale
Secret
SecurityContextConstraints
Service
ServiceAccount
4- 总结
在master的url地址后面增加api信息,收集的信息如下:
简化结果如下: