k8s获取apiversion下面的对应可用资源
2021-01-14 08:15
标签:one auto png tor int ati ons ret rbac 在master的url地址后面增加api信息,收集的信息如下: 简化结果如下: k8s获取apiversion下面的对应可用资源 标签:one auto png tor int ati ons ret rbac 原文地址:https://www.cnblogs.com/lemanlai/p/12266946.html1- 获取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- 总结
[注: 标黄为常用的部分,可以看出,extensions/v1betal和v1适用百分之九十的场景]
文章标题:k8s获取apiversion下面的对应可用资源
文章链接:http://soscw.com/index.php/essay/41696.html