gpt4 book ai didi

kubernetes - k8s 中的哪个 API 组

转载 作者:行者123 更新时间:2023-12-02 11:29:38 25 4
gpt4 key购买 nike

我如何确定哪个 apiGroup任何给定的资源属于?

kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
namespace: default
name: thing
rules:
- apiGroups: ["<wtf goes here>"]
resources: ["deployments"]
verbs: ["get", "list"]
resourceNames: []

最佳答案

要获取 Kubernetes 集群支持的 API 资源:

 kubectl api-resources -o wide

example:
NAME SHORTNAMES APIGROUP NAMESPACED KIND VERBS
deployments deploy apps true Deployment [create delete deletecollection get list patch update watch]
deployments deploy extensions true Deployment [create delete deletecollection get list patch update watch]

要获取 Kubernetes 集群支持的 API 版本:
kubectl api-versions

您可以验证 f.e.部署:
kubectl explain deploy 

KIND: Deployment
VERSION: extensions/v1beta1

DESCRIPTION:
DEPRECATED - This group version of Deployment is deprecated by
apps/v1beta2/Deployment.

此外,您可以使用 api-version 进行调查:
kubectl explain deploy --api-version apps/v1

很快你就在你的 apiGroups 中指定了:
apiGroups: ["extensions", "apps"]

您还可以通过将选项传递给 --runtime-config 来使用(例如测试它是否适用于下一个 1.16 release)为您的集群配置这些设置。在 kube-apiserver .

其他资源:
  • api Resources :
  • Kubernetes Deprecation Policy
  • 其他值得注意的功能更新 for specific release please follow喜欢:
    Continued deprecation of extensions/v1beta1, apps/v1beta1, and apps/v1beta2 APIs; these extensions will be retired in 1.16!
  • 关于kubernetes - k8s 中的哪个 API 组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57821065/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com