在 Kubernetes 中我们可以使用不同的 API 版本请求资源:
kubectl get roles.v1.rbac.authorization.k8s.io foo -n bar -oyaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: foo
namespace: bar
rules:
- apiGroups:
- ""
resources:
- endpoints
- secrets
verbs:
- create
- get
- watch
- list
- update
kubectl get roles.v1beta1.rbac.authorization.k8s.io foo -n bar -oyaml
Warning: rbac.authorization.k8s.io/v1beta1 Role is deprecated in v1.17+, unavailable in v1.22+; use rbac.authorization.k8s.io/v1 Role
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
name: foo
namespace: bar
rules:
- apiGroups:
- ""
resources:
- endpoints
- secrets
verbs:
- create
- get
- watch
- list
- update
rbac.authorization.k8s.io/v1beta1
的 Kubernetes v1.22 是否会破坏已经创建/存储的资源?最佳答案
If a resource was stored when the newer API version (v1) did not exist yet, would this be a problem when the older API version (v1beta1) is removed?
Kubernetes 支持一个巨大的弹性弃用系统,它允许您及时创建、迁移和维护 API 版本,但是(跳到您的下一个问题,您有时应该手动将 API 版本升级到最新版本)
可以查看Kubernetes Deprecation Policy guide ,这是保持集群处于工作状态的非常重要的部分。
主要规则:
您还可以查看描述一系列后续版本支持哪些 API 版本的表格。
Would upgrading to Kubernetes v1.22, which removes rbac.authorization.k8s.io/v1beta1, break already created/stored resources?
我认为是的,您必须根据 1.22 RBAC deprecation resources 执行一些操作
How are resource transformations between different API versions handled?
检查 What to do
Test with deprecated APIs disabled
Locate use of deprecated APIs
Migrate to non-deprecated APIs
https://stackoverflow.com/questions/69914039/
相关文章:
python - 如何将路径参数传递给 Pydantic 模型?
json - 通过 Postman 使用 PUT 请求更新 Contentful 帖子
swift - 我们如何在 SwiftUI 中制作自定义 GeometryReader?
node.js - 在不使用 NVM for Windows 的情况下在 Windows 上安装多个
jooq - jooq record 取数据时是否使用列索引?
networking - float IP 在 Digital Ocean 上的使用
angular - 检测关闭浏览器 Angular 12 的事件