Ginni
Ginni

Reputation: 11

Experiment to create node in kubernetes cluster(AKS) using chaos toolkit

I am trying to create an experiment for creating a node using chaostoolkit

yaml for experiment

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
~
~

getting below error while executing the experiment

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}

can anybody please help me to write this experiment

Upvotes: 1

Views: 186

Answers (1)

Harsh Manvar
Harsh Manvar

Reputation: 30180

i think you are using it the right way but

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

however, looks like there could be chances it wont work with AKS as mentioned.

Due to the way things work on certain cloud providers, you won't be able to use this meaningfully on them. For instance on GCE, this will likely fail.

Read more at : https://github.com/chaostoolkit/chaostoolkit-documentation/blob/master/sources/drivers/kubernetes.md#create_node

Upvotes: 0

Related Questions