Kubernetes 1.16 弃用 daemonset、statefulset、deployments 和 replicasets

Kubernetes 1.16 deprecation of daemonset, statefulset, deployments and replicasets

1.16 弃用通知:

DaemonSet, Deployment, StatefulSet, and ReplicaSet resources will no longer
 be served from extensions/v1beta1, apps/v1beta1, or apps/v1beta2 in v1.16. Migrate to the apps/v1 API, available since v1.9. Existing persisted data 
can be retrieved through the apps/v1 API. For example, to convert a 
Deployment that currently uses apps/v1beta1, enter the following command. 

我有大约 10 个包含旧 api 版本的 helm 图表——datadog、nginx-ingress 等等。我不想升级这些不同的服务。有任何已知的解决方法吗?

您应该考虑一些选项:

  • 不更新任何东西,坚持使用 Kubernetes 1.15(不推荐,因为它比最新版本落后 4 个主要版本)

  • git clone 你的 repo 并在你的所有资源中将 apiVersion 更改为 apps/v1

  • 使用kubectl convert来改变apiVersion,例如:kubectl convert -f deployment.yaml --output-version apps/v1

值得一提的是,一些东西被弃用是有原因的,如果它们不再受支持,强烈建议不要坚持使用旧方法。