k8s获取apiversion下面的对应可用资源
2021-01-29 13:15
标签:versions mon amp service 获取 jsonp set bind groups 输出结果大概如下: 2.命令获取 k8s获取apiversion下面的对应可用资源 标签:versions mon amp service 获取 jsonp set bind groups 原文地址:https://blog.51cto.com/lemonnews/2449991
for v in curl -ks https://<k8s-master>:<port>/apis | jq -r .groups[].versions[].groupVersion
;
do
for r in curl -ks "https://<k8s-master>:<port>/apis/${v}" | jq -r ‘.resources[]?.kind‘ | sort -u
;
do echo ${r} - ${v};
done ;
done
APIService - apiregistration.k8s.io/v1
APIService - apiregistration.k8s.io/v1beta1
DaemonSet - extensions/v1beta1
Deployment - extensions/v1beta1
DeploymentRollback - extensions/v1beta1
...
Role - rbac.authorization.k8s.io/v1
RoleBinding - rbac.authorization.k8s.io/v1
ClusterRole - rbac.authorization.k8s.io/v1beta1
ClusterRoleBinding - rbac.authorization.k8s.io/v1beta1
Role - rbac.authorization.k8s.io/v1beta1
RoleBinding - rbac.authorization.k8s.io/v1beta1
kubectl get roles --all-namespaces -o jsonpath=‘{.items[*].apiVersion}‘
文章标题:k8s获取apiversion下面的对应可用资源
文章链接:http://soscw.com/index.php/essay/48702.html