Интервал кубе-обезьяны (тестирование хаоса)

Я внедряю Kube-monkey в свой кластер разработки Kubernetes и вижу, что POD завершаются каждые 30 секунд.

Может ли кто-нибудь помочь мне установить интервал завершения POD в Kube-monkey (Chaos Monkey для кластеров Kubernetes) на другое время?

Я попытался установить параметр interval в файле yaml kube-monkey (как показано ниже), чтобы прерывать POD каждые 5 минут, но не работает.

config:
  dryRun: false
  whitelistedNamespaces:
    - "default"
  debug:
    enabled: true
    interval: 5m0s
    schedule_immediate_kill: true```


Couldn't find any resources online on setting the termination interval as well.
Could someone please guide me on how to set this?
Thanks a lot!

person Tina    schedule 21.05.2021    source источник


Ответы (2)


Если вы видите официальную диаграмму helm values.yaml, там нет ключа interval. так как вы сохранили schedule_immediate_kill : TRUE время уничтожения по умолчанию будет 30S

https://github.com/asobti/kube-monkey/blob/master/helm/kubemonkey/values.yaml

вы можете изменить время интервала, используя schedule_delay

[debug]
enabled = true
schedule_delay=30
force_should_kill = true
schedule_immediate_kill = true

вместо interval используйте schedule_delay.

однако интервал работает с Kubethanos: https://jaxenter.com/kubernetes-chaos-kubethanos-164798.html вы можете передать ключ-значение в качестве параметра.

person Harsh Manvar    schedule 21.05.2021

Файл параметров golang покажет нам, какие конфигурации мы можем изменить: https://raw.githubusercontent.com/asobti/kube-monkey/master/config/param/param.go

package param

const (
    // DryRun logs but does not terminate pods
    // Type: bool
    // Default: true
    DryRun = "kubemonkey.dry_run"

    // Timezone specifies the timezone to use when
    // scheduling Pod terminations
    // Type: string
    // Default: America/Los_Angeles
    Timezone = "kubemonkey.time_zone"

    // RunHour specifies the hour of the weekday
    // when the scheduler should run to schedule terminations
    // Must be less than StartHour, and [0,23]
    // Type: int
    // Default: 8
    RunHour = "kubemonkey.run_hour"

    // StartHour specifies the hour beginning at
    // which pod terminations may occur
    // Should be set to a time when service owners are expected
    // to be available
    // Must be less than EndHour, and [0, 23]
    // Type: int
    // Default: 10
    StartHour = "kubemonkey.start_hour"

    // EndHour specifies the end hour beyond which no pod
    // terminations will occur
    // Should be set to a time when service owners are
    // expected to be available
    // Must be [0,23]
    // Type: int
    // Default: 16
    EndHour = "kubemonkey.end_hour"

    // GracePeriodSec specifies the amount of time in
    // seconds a pod is given to shut down gracefully,
    // before Kubernetes does a hard kill
    // Type: int
    // Default: 5
    GracePeriodSec = "kubemonkey.graceperiod_sec"

    // WhitelistedNamespaces specifies a list of
    // namespaces where terminations are valid
    // Default is defined by metav1.NamespaceDefault
    // To allow all namespaces use [""]
    // Type: list
    // Default: [ "default" ]
    WhitelistedNamespaces = "kubemonkey.whitelisted_namespaces"

    // BlacklistedNamespaces specifies a list of namespaces
    // for which terminations should never
    // be carried out.
    // Default is defined by metav1.NamespaceSystem
    // To block no namespaces use [""]
    // Type: list
    // Default: [ "kube-system" ]
    BlacklistedNamespaces = "kubemonkey.blacklisted_namespaces"

    // ClusterAPIServerHost specifies the host URL for Kubernetes
    // cluster APIServer. Use this config if the apiserver IP
    // address provided by in-cluster config
    // does not work for you because your certificate does not
    // contain the right SAN
    // Type: string
    // Default: No default. If not specified, URL provided
    // by in-cluster config is used
    ClusterAPIServerHost = "kubernetes.host"

    // DebugEnabled enables debug mode
    // Type: bool
    // Default: false
    DebugEnabled = "debug.enabled"

    // DebugScheduleDelay delays duration
    // in sec after kube-monkey is launched
    // after which scheduling is run
    // Use when debugging to run scheduling sooner
    // Type: int
    // Default: 30
    DebugScheduleDelay = "debug.schedule_delay"

    // DebugForceShouldKill guarantees terminations
    // to be scheduled for all eligible Deployments,
    // i.e., probability of kill = 1
    // Type: bool
    // Default: false
    DebugForceShouldKill = "debug.force_should_kill"

    // DebugScheduleImmediateKill schedules pod terminations
    // sometime in the next 60 sec to facilitate
    // debugging (instead of the hours specified by
    // StartHour and EndHour)
    // Type: bool
    // Default: false
    DebugScheduleImmediateKill = "debug.schedule_immediate_kill"

    // NotificationsEnabled enables reporting of attacks to an HTTP endpoint
    // Type: bool
    // Default: false
    NotificationsEnabled = "notifications.enabled"

    // NotificationsReportSchedule enables reporting of attack schedule to an HTTP endpoint
    // Type: bool
    // Default: false
    NotificationsReportSchedule = "notifications.reportSchedule"

    // NotificationsAttacks reports attacks to an HTTP endpoint
    // Type: config.Receiver struct
    // Default: Receiver{}
    NotificationsAttacks = "notifications.attacks"
)
person vgeorge    schedule 01.06.2021