KubernetesPodChaosMonkeyThisrepositorycontainsaDockerfileandassociatedKubernetesconfigurationforaDeploymentthatwillrandomlydeletepodsinagivennamespace.ThisisimplementedinBashmostlybecauseI'mwritingitforalightningtalk.AnimagebuiltfromtheDockerfileinthisrepositoryisavailableonDockerHubasjnewland/kubernetes-pod-chaos-monkey.ConfigurationAfewenvironmentvariablesareavailableforconfiguration:DELAY:secondsbetweenselectinganddeletingapod.Defaultsto30.NAMESPACE:thenamespacetoselectapodfrom.Defaultstodefault.ExampleKubernetesconfigisincludedatconfig/kubernetes/production/deployment.yamlExample$kubectlapply-fconfig/kubernetes/production/deployment.yamldeployment"kubernetes-pod-chaos-monkey"created$kubectlgetpods|grepchaoskubernetes-pod-chaos-monkey-3294408070-6w6oh1/1Running019s$kubectllogskubernetes-pod-chaos-monkey-3294408070-6w6oh+:30+:default+true+xargs-t--no-run-if-emptykubectl--namespacedefaultdeletepod+head-n1+shuf+tr'''\n'+kubectl--namespacedefault-o'jsonpath={.items[*].metadata.name}'getpodskubectl--namespacedefaultdeletepoddd-agent-3hw6wpod"dd-agent-3hw6w"deleted+sleep30LicenseMIT声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态
评论