0

我正在尝试创建一个使用 chaostoolkit 创建节点的实验

用于实验的 yaml

version: 1.0.0
title: What happens if we create a node
description: All the instances are distributed among healthy nodes and the applications are healthy
tags:
- k8s
- deployment
- node
steady-state-hypothesis:
  title: Nodes are indestructible
  probes:
  - name: all-apps-are-healthy
    type: probe
    tolerance: true
    provider:
      type: python
      func: all_microservices_healthy
      module: chaosk8s.probes
      arguments:
        ns: qs-aks-dev
method:
- type: action
  name: create-node
  provider:
    type: python
    func: create_node
    module: chaosk8s.node.actions
  pauses:
    after: 10
~
~

执行实验时出现错误

Action: create-node
[2021-11-09 13:15:17 ERROR]   => failed: chaoslib.exceptions.ActivityFailed: Creating new node failed: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"Node \"\" is invalid: metadata.name: Required value: name or generateName is required","reason":"Invalid","details":{"kind":"Node","causes":[{"reason":"FieldValueRequired","message":"Required value: name or generateName is required","field":"metadata.name"}]},"code":422}

谁能帮我写这个实验

4

1 回答 1

0

我认为您以正确的方式使用它,但是

name: create-node
provider:
  func: create_node
  module: chaosk8s.node.actions
  type: python
type: action

但是,看起来它可能无法与前面提到的 AKS 一起使用。

由于某些云提供商的工作方式,您将无法在它们上有意义地使用它。例如在 GCE 上,这可能会失败。

阅读更多:https ://github.com/chaostoolkit/chaostoolkit-documentation/blob/master/sources/drivers/kubernetes.md#create_node

于 2021-11-10T05:15:17.683 回答