创建heapster服务的时候,create的时候报错
来源:1-7 安装dashboard和heapster并验证集群安装结果
qq_慕娘3544206
2021-10-21
您好,我目前使用的kubernetes版本是1.16的版本,在这个版本有个问题,这个版本的extensions/v1beta1已经取消了对"Deployment"的支持了,但是在创建heapster服务的时候,就出现了下面这个问题,这种问题我该怎么解决呢
**[root@k8smaster kube-config]# kubectl create -f influxdb
service/monitoring-grafana created
serviceaccount/heapster created
service/heapster created
service/monitoring-influxdb created
unable to recognize "influxdb/grafana.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
unable to recognize "influxdb/heapster.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"
unable to recognize "influxdb/influxdb.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"**
但是我如果使用了网上的方式,将“extensions/v1beta1”修改为“apps/v1”的话,就出现了另一个问题,如下:
[root@k8smaster kube-config]# kubectl create -f influxdb
serviceaccount/heapster created
error validating "influxdb/grafana.yaml": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false
error validating "influxdb/heapster.yaml": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false
error validating "influxdb/influxdb.yaml": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false
这种情况我该怎么解决呢,1.16以后的版本应该如何修改这三个yaml文件呢,或者还是说,后续的版本都不支持heapster这个插件了呢。
1回答
-
tonybai
2021-10-21
亲,很遗憾heapster已经被作废很久了。从kubernetes 1.13开始就不再支持。你的是1.16版本的k8s,显然heapster没有与1.16版本做过集成测试。我个人也建议你使用heapster官方的建议,使用metrics-server等插件替代。heapster这块并不是k8s学习过程必须安装的插件,因此建议你略过这段继续后续章节学习。等学习完毕后,再回来安装metrics-server等插件。k8s演进较快,再新的k8s课程都不可能跟得上其演进步伐,因此我们的策略就是以静制动,多去了解基本概念、原理与运作机制,无需在一个插件上阻碍太久。祝你学习愉快!
00
相似问题