开发者社区 > 云原生 > 正文

blade创建k8s节点cpu无法使用

./blade create k8s node-cpu fullload --name blade-2 --cpu-percent 80 --kubeconfig ~/.kube/config kubectl apply -f chaosblade_cpu_load.yaml

我试图使用示例yml或命令来满载节点cpu,但它无法工作

after kubectl apply -f k8s_chaosblade-operator_chaosblade-operator-779d8c7d8-cgbv5_kube-system_121ef6b0-1708-11ea-9d28-0242ac120003_0{"level":"error","ts":1575517295.069692,"logger":"kubebuilder.controller","msg":"Reconciler error","controller":"chaosblade-controller","request":"/cpu-load","error":"ChaosBlade.chaosblade.io "cpu-load" is invalid: []: Invalid value: map[string]interface {}{"kind":"ChaosBlade", "apiVersion":"chaosblade.io/v1alpha1", "metadata":map[string]interface {}{"creationTimestamp":"2019-12-05T03:41:35Z", "annotations":map[string]interface {}{"kubectl.kubernetes.io/last-applied-configuration":"{"apiVersion":"chaosblade.io/v1alpha1","kind":"ChaosBlade","metadata":{"annotations":{},"name":"cpu-load","namespace":""},"spec":{"experiments":[{"action":"fullload","desc":"increase node cpu load by names","matchers":[{"name":"names","value":["blade-2"]},{"name":"cpu-percent","value":["80"]}],"scope":"node","target":"cpu"}]}}\n"}, "namespace":"", "clusterName":"", "finalizers":[]interface {}{"finalizer.chaosblade.io"}, "selfLink":"/apis/chaosblade.io/v1alpha1/chaosblades/cpu-load", "resourceVersion":"120987", "generation":1, "name":"cpu-load", "uid":"22994c61-1711-11ea-9d28-0242ac120003"}, "spec":map[string]interface {}{"experiments":[]interface {}{map[string]interface {}{"matchers":[]interface {}{map[string]interface {}{"value":[]interface {}{"blade-2"}, "name":"names"}, map[string]interface {}{"name":"cpu-percent", "value":[]interface {}{"80"}}}, "scope":"node", "target":"cpu", "action":"fullload", "desc":"increase node cpu load by names"}}}, "status":map[string]interface {}{"expStatuses":interface {}(nil)}}: validation failure list:\nstatus.expStatuses in body must be of type array: "null"","stacktrace":"github.com/go-logr/zapr.(*zapLogger).Error\n\tchaosblade-operator/vendor/github.com/go-logr/zapr/zapr.go:128\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\tchaosblade-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:217\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func1\n\tchaosblade-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:158\nk8s.io/apimachinery/pkg/util/wait.JitterUntil.func1\n\tchaosblade-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133\nk8s.io/apimachinery/pkg/util/wait.JitterUntil\n\tchaosblade-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:134\nk8s.io/apimachinery/pkg/util/wait.Until\n\tchaosblade-operator/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:88"}

[root@blade-1 chaosblade-0.4.0]# ./blade create k8s node-cpu fullload --name blade-2 --cpu-percent 80 --kubeconfig ~/.kube/config unknown flag: --name

[root@blade-1 chaosblade-0.4.0]# ./blade create k8s node-cpu fullload blade-2 --cpu-percent 80 --kubeconfig ~/.kube/config {"code":800,"success":false,"error":"chaosblades.chaosblade.io "5743fa3974eecd76" not found","result":{"uid":"5743fa3974eecd76","success":false,"error":"chaosblades.chaosblade.io "5743fa3974eecd76" not found","statuses":[{"id":"5743fa3974eecd76","state":"Error","kind":"","error":"chaosblades.chaosblade.io "5743fa3974eecd76" not found","success":false}]}}

环境信息

[root@blade-1 ~]# docker version Client: Version: 17.03.2-ce API version: 1.27 Go version: go1.7.5 Git commit: f5ec1e2 Built: Tue Jun 27 02:21:36 2017 OS/Arch: linux/amd64

Server: Version: 17.03.2-ce API version: 1.27 (minimum version 1.12) Go version: go1.7.5 Git commit: f5ec1e2 Built: Tue Jun 27 02:21:36 2017 OS/Arch: linux/amd64 Experimental: false

Kubernetes v1.10.11

[root@blade-1 chaosblade-0.4.0]# kubectl get pod -n kube-system -o wide | grep chaosblade chaosblade-operator-779d8c7d8-cgbv5 1/1 Running 0 5h 172.28.36.7 blade-2

原提问者GitHub用户wwwnay

展开
收起
码字王 2023-06-12 17:18:59 109 0
1 条回答
写回答
取消 提交回答
  • 参考:https://chaosblade-io.gitbook.io/chaosblade-help-zh-cn/blade-create-k8s-node-cpu

    原回答者GitHub用户xcaspar

    2023-06-12 17:37:57
    赞同 展开评论 打赏

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

相关产品

  • 容器服务Kubernetes版
  • 相关电子书

    更多
    基于ACK One 实现简单的跨云协同 让业务管理更高效 立即下载
    通过 ACK 智能化运维体系获得集群自动化诊断和自愈能力 立即下载
    RDS SQL Server CPU高使用率性能优化 立即下载

    相关镜像