默认情况下,Kubernetes 允许在集群之间更改 API group version ,只要升级是单个版本(例如 v1 -> v2beta1), 跳转到多个版本(例如 v1 -> v3)不是现成的, 这就是 Velero 启用 API group version 功能可以在升级期间提供帮助的地方.
目前启用 API group version 功能处于测试阶段,启用可以通过安装 Velero 带有功能标志,--features=EnableAPIGroupVersions.
有关 Kubernetes API 版本兼容性的最新信息,在开始升级、迁移或还原之前,应始终查看源集群版本和目标集群版本的 Kubernetes release notes, 如果 Kubernetes API 版本之间存在差异,使用启用 API group version 功能来帮助缓解兼容性问题.
注,在使用此功能时注意检查 Kubernetes 与 velero 兼用性
// Kubernetes version
$ kubectl get no
NAME STATUS ROLES AGE VERSION
ubuntu Ready control-plane 138d v1.24.3
// Velero version
$ velero version
Client:
Version: v1.10.0
Git commit: 367f563072659f0bcd809bc33507fd75cd722344
Server:
Version: v1.10.0
$ velero install \
--provider aws \
--plugins velero/velero-plugin-for-aws:v1.2.1 \
--bucket velero-backups \
--secret-file /root/velero/credentials-velero \
--use-volume-snapshots=false \
--features=EnableAPIGroupVersions \
--backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://192.168.86.129:32001
CustomResourceDefinition/backuprepositories.velero.io: attempting to create resource
CustomResourceDefinition/backuprepositories.velero.io: attempting to create resource client
CustomResourceDefinition/backuprepositories.velero.io: already exists, proceeding
CustomResourceDefinition/backuprepositories.velero.io: created
CustomResourceDefinition/backups.velero.io: attempting to create resource
CustomResourceDefinition/backups.velero.io: attempting to create resource client
CustomResourceDefinition/backups.velero.io: already exists, proceeding
CustomResourceDefinition/backups.velero.io: created
CustomResourceDefinition/backupstoragelocations.velero.io: attempting to create resource
CustomResourceDefinition/backupstoragelocations.velero.io: attempting to create resource client
CustomResourceDefinition/backupstoragelocations.velero.io: already exists, proceeding
CustomResourceDefinition/backupstoragelocations.velero.io: created
CustomResourceDefinition/deletebackuprequests.velero.io: attempting to create resource
CustomResourceDefinition/deletebackuprequests.velero.io: attempting to create resource client
CustomResourceDefinition/deletebackuprequests.velero.io: already exists, proceeding
CustomResourceDefinition/deletebackuprequests.velero.io: created
CustomResourceDefinition/downloadrequests.velero.io: attempting to create resource
...
DaemonSet/node-agent: already exists, proceeding
DaemonSet/node-agent: created
Velero is installed! ⛵ Use 'kubectl logs deployment/velero -n velero' to view the status.
以上命名完成 Velero 安装并启用加入 API 组版本功能
$ vim ./restoreResourcesVersionPriority
rockbands.music.example.io=v2beta1,v2beta2
orchestras.music.example.io=v2,v3alpha1
subscriptions.operators.coreos.com=v2,v1
# kubectl create configmap enableapigroupversions --from-file=/root/velero/restoreResourcesVersionPriority -n velero
configmap/enableapigroupversions created
$ kubectl get configmap enableapigroupversions -n velero
NAME DATA AGE
enableapigroupversions 1 56s
$ kubectl describe configmap enableapigroupversions -n velero
Name: enableapigroupversions
Namespace: velero
Labels: <none>
Annotations: <none>
Data
====
restoreResourcesVersionPriority:
----
rockbands.music.example.io=v2beta1,v2beta2
orchestras.music.example.io=v2,v3alpha1
subscriptions.operators.coreos.com=v2,v1
BinaryData
====
Events: <none>
以上已完成对 Velero 组版本功能的配置!
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。