{"id":346910,"date":"2023-03-17T15:03:52","date_gmt":"2023-03-17T15:03:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=346910"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=346910","title":{"rendered":"<span>\u0425\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433 \u0441 Chaos Mesh<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bd0\/230\/dcf\/bd0230dcf3f778916f43a405c7ef80fe.png\" width=\"1680\" height=\"945\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bd0\/230\/dcf\/bd0230dcf3f778916f43a405c7ef80fe.png\"\/><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Chaos Mesh\u00a0\u2014 \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0445\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430 \u0432 Kubernetes. \u0412\u0441\u0435 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 <a href=\"https:\/\/gitlab.com\/rahasak-labs\/chaos-mesh\"><u>GitLab<\/u><\/a>. \u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u0447\u0438\u0442\u0430\u0442\u044c.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/875\/ca5\/607\/875ca5607e71b92f12ef073af55aedb5.jpg\" alt=\"\u00ab\u0421\u0440\u0435\u0434\u0438 \u0445\u0430\u043e\u0441\u0430 \u0435\u0441\u0442\u044c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438\u00bb, \u0421\u0443\u043d\u044c-\u0426\u0437\u044b\" title=\"\u00ab\u0421\u0440\u0435\u0434\u0438 \u0445\u0430\u043e\u0441\u0430 \u0435\u0441\u0442\u044c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438\u00bb, \u0421\u0443\u043d\u044c-\u0426\u0437\u044b\" width=\"855\" height=\"483\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/875\/ca5\/607\/875ca5607e71b92f12ef073af55aedb5.jpg\" data-blurred=\"true\"\/><\/p>\n<div><figcaption>\u00ab\u0421\u0440\u0435\u0434\u0438 \u0445\u0430\u043e\u0441\u0430 \u0435\u0441\u0442\u044c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438\u00bb, \u0421\u0443\u043d\u044c-\u0426\u0437\u044b<\/figcaption><\/div>\n<\/figure>\n<h2>\u0425\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/h2>\n<p><a href=\"https:\/\/www.gremlin.com\/community\/tutorials\/chaos-engineering-the-history-principles-and-practice\/\"><u>\u0425\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/u><\/a>\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u0432 \u043d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0442\u0440\u0435\u0441\u0441\u043e\u0432\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0430\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0441\u0431\u043e\u0438, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0432 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0435. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0441\u0431\u043e\u044f, \u043e\u0431\u0440\u0430\u0449\u0430\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435.<\/p>\n<p>\u0412\u043f\u0435\u0440\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0445\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b Netflix \u0432 2012\u00a0\u0433\u043e\u0434\u0443. \u041e\u043d\u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 <a href=\"https:\/\/netflix.github.io\/chaosmonkey\/\"><u>Chaos Monkey<\/u><\/a>\u00a0\u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043d\u043e\u0441\u0438\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0421 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0445\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430. Netflix \u0441\u043e\u0437\u0434\u0430\u043b\u0438 Chaos Monkey \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u043e Amazon Web Services, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0442\u0435\u0440\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 Amazon \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430. Chaos Monkey \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0435\u043b\u0438, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0430\u0434\u0451\u0436\u043d\u044b \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b \u043a \u043d\u0435\u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0441\u0431\u043e\u044f\u043c.<\/p>\n<h2>Chaos Mesh<\/h2>\n<p><a href=\"https:\/\/github.com\/pingcap\/chaos-mesh\"><u>Chaos Mesh<\/u><\/a>\u00a0\u2014 \u044d\u0442\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u0445\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430 \u0432 Kubernetes. Chaos Mesh \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0432 Kubernetes \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 pod\u2019\u043e\u0432, \u0441\u0435\u0442\u0438, \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0434\u0430\u0436\u0435 \u044f\u0434\u0440\u0430. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041c\u044b \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0438\u0434\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0438 \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0441\u0451\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0412 Chaos Mesh \u0435\u0441\u0442\u044c \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>Chaos Mesh \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Kubernetes CRD (Custom Resource Definition\u00a0\u2014 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432) \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043c\u0435\u0441\u0442\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u0431\u043e\u0435\u0432: \u0441\u0431\u043e\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0441\u0431\u043e\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u0441\u0431\u043e\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>1. Basic resource faults   1.1. PodChaos: simulates Pod failures, such as Pod node restart, Pod's persistent unavailablility, and certain container failures in a specific Pod.   1.2. NetworkChaos: simulates network failures, such as network latency, packet loss, packet disorder, and network partitions.   1.3. DNSChaos: simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned.   1.4. HTTPChaos: simulates HTTP communication failures, such as HTTP communication latency.   1.5. StressChaos: simulates CPU race or memory race.   1.6. IOChaos: simulates the I\/O failure of an application file, such as I\/O delays, read and write failures.   1.7. TimeChaos: simulates the time jump exception.   1.8. KernelChaos: simulates kernel failures, such as an exception of the application memory allocation.  2. Platform faults:   2.1. AWSChaos: simulates AWS platform failures, such as the AWS node restart.   2.2. GCPChaos: simulates GCP platform failures, such as the GCP node restart.  3. Application faults:   3.1. JVMChaos: simulates JVM application failures, such as the function call delay.<\/code><\/pre>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Chaos Mesh<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/medium.com\/rahasak\/replace-docker-desktop-with-minikube-and-hyperkit-on-macos-783ce4fb39e3\"><u>\u043a\u043b\u0430\u0441\u0442\u0435\u0440 Kubernetes \u043d\u0430 \u0431\u0430\u0437\u0435 Minikube<\/u><\/a> \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Chaos Mesh \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438), \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d Kubernetes chaos-testing. \u0414\u0430\u0448\u0431\u043e\u0440\u0434 Chaos Mesh \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 2333 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 NodePort.<\/p>\n<pre><code># install chaos mesh curl -sSL https:\/\/mirrors.chaos-mesh.org\/v2.0.3\/install.sh | bash  # check pods kubectl get po -n chaos-testing  >> output NAME                                        READY   STATUS    RESTARTS   AGE chaos-controller-manager-68769d9df9-qt2js   1\/1     Running   0          8m48s chaos-daemon-9nhcs                          1\/1     Running   0          8m49s chaos-dashboard-6677f99c44-dfjzg            1\/1     Running   0          8m48s  # check services kubectl get svc -n chaos-testing  >> output NAME                            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                       AGE chaos-daemon                    ClusterIP   None            &lt;none>        31767\/TCP,31766\/TCP           9m27s chaos-dashboard                 NodePort    10.104.10.190   &lt;none>        2333:31725\/TCP                9m27s chaos-mesh-controller-manager   ClusterIP   10.97.5.226     &lt;none>        443\/TCP,10081\/TCP,10080\/TCP   9m27s  ---  # access chaos mesh dashboard via NodePort service # dashboard run on port 2333 as NodePort service # dashboard can acess via NodePort port 2333 mapping port, in my case port 31725 http:\/\/&lt;minikube ip>:31725 http:\/\/192.168.64.17:31725\/dashboard  # access dashboard via port forward 3333 -> 2333 # now dashboard can access via localhost:3333 kubectl port-forward -n chaos-testing chaos-dashboard-6677f99c44-dfjzg 8888:2333 http:\/\/localhost:3333<\/code><\/pre>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/98a\/608\/77f\/98a60877fb4efa523603dc6ea80d4c12.jpg\" width=\"846\" height=\"491\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/98a\/608\/77f\/98a60877fb4efa523603dc6ea80d4c12.jpg\" data-blurred=\"true\"\/><\/figure>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0432 Chaos Mesh<\/h2>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0432 Chaos Mesh: \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 YAML. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430: <code>pod-failure<\/code>, <code>pod-kill<\/code>, <code>stress<\/code>, <code>http-abort<\/code>. \u0412 Chaos Mesh \u0438\u0445 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u00a0\u2014 \u0441\u043c. <a href=\"https:\/\/chaos-mesh.org\/docs\/\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e Chaos Mesh<\/u><\/a> \u0438 <a href=\"https:\/\/chaos-mesh.org\/interactive-tutorial\/\"><u>\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430<\/u><\/a>. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 nginx \u0438\u0437 \u0442\u0440\u0451\u0445 \u043d\u043e\u0434. \u0420\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 nginx:<\/p>\n<pre><code>apiVersion: v1 kind: Namespace metadata:   name: chaos  ---  apiVersion: v1 kind: Service metadata:   name: nginxservice   labels:     name: nginxservice   namespace: chaos spec:   ports:     - port: 80   selector:     app: nginx   type: LoadBalancer  ---  apiVersion: v1 kind: ReplicationController metadata:   name: nginx   namespace: chaos spec:   replicas: 3   selector:     app: nginx   template:     metadata:       name: nginx       labels:         app: nginx     spec:       containers:       - name: nginx         image: nginx         ports:         - containerPort: 80<\/code><\/pre>\n<pre><code># deploy nginx # it will create three node nginx cluster under namespace 'chaos' kubectl apply -f nginx-deployment.yaml  # view pods kubectl get pods -n chaos  NAME          READY   STATUS    RESTARTS   AGE nginx-bmgbr   1\/1     Running   0          36m nginx-wlr8x   1\/1     Running   0          36m nginx-z9sl7   1\/1     Running   0          36m  # get services kubectl get svc -n chaos  NAME           TYPE           CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE nginxservice   LoadBalancer   10.96.3.122   &lt;pending>     80:30773\/TCP   37m<\/code><\/pre>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441\u043e \u0441\u0431\u043e\u044f\u043c\u0438 pod\u2019\u0430<\/h2>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b PodChaos \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0441\u0431\u043e\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 pod\u2019\u043e\u0432 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e PodChaos \u0432\u0445\u043e\u0434\u044f\u0442 \u0442\u0438\u043f\u044b <code>pod-failure<\/code>, <code>pod-kill<\/code>, <code>container-kill<\/code>. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 Chaos Mesh \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 pod-failure \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 pod nginx, \u0438 pod \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 30\u00a0\u0441\u0435\u043a\u0443\u043d\u0434. \u0414\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 pod\u2019\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433 <code>labelSelectors<\/code>. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441\u043e \u0441\u0431\u043e\u044f\u043c\u0438 pod\u2019\u0430:<\/p>\n<pre><code>kind: PodChaos apiVersion: chaos-mesh.org\/v1alpha1 metadata:   name: chaos-failure   namespace: chaos spec:   selector:     namespaces:       - chaos     labelSelectors:       app: nginx   mode: one   action: pod-failure   duration: 30s   gracePeriod: 0<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply -f chaos-pod-failure.yaml<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 Chaos Mesh.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/087\/7f4\/c33\/0877f4c33941fc6d573ac8f9cb3eac92.jpg\" width=\"849\" height=\"495\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/087\/7f4\/c33\/0877f4c33941fc6d573ac8f9cb3eac92.jpg\" data-blurred=\"true\"\/><\/figure>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/77e\/aa2\/341\/77eaa2341e02187a027797ce55fb7486.jpg\" width=\"775\" height=\"450\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/77e\/aa2\/341\/77eaa2341e02187a027797ce55fb7486.jpg\" data-blurred=\"true\"\/><\/figure>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435\u043c pod\u2019\u0430<\/h2>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 Chaos Mesh \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 <code>pod-kill<\/code> \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 <code>pod nginx<\/code> \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442 pod. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435\u043c pod\u2019\u0430:<\/p>\n<pre><code>kind: PodChaos apiVersion: chaos-mesh.org\/v1alpha1 metadata:   name: chaos-kill   namespace: chaos spec:   selector:     namespaces:       - chaos     labelSelectors:       app: nginx   mode: one   action: pod-kill   duration: 30s   gracePeriod: 0<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply -f chaos-pod-kill.yaml<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 Chaos Mesh.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/ef6\/958\/3e2\/ef69583e229d15849217de54823f83ba.jpg\" width=\"840\" height=\"487\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef6\/958\/3e2\/ef69583e229d15849217de54823f83ba.jpg\" data-blurred=\"true\"\/><\/figure>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u043e\u0439<\/h2>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b <code>StressChaos<\/code> \u0432 Chaos Mesh \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 (<code>nginx<\/code>) \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c, \u0437\u0430\u043d\u044f\u0432 \u0434\u043e 256\u00a0\u041c\u0411.<\/p>\n<pre><code>kind: StressChaos apiVersion: chaos-mesh.org\/v1alpha1 metadata:   name: chaos-stress   namespace: chaos spec:   selector:     namespaces:       - chaos     labelSelectors:       app: nginx   mode: one   containerNames:     - ''   stressors:     memory:       workers: 4       size: '256MB'   duration: 60s<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply -f chaos-stress.yaml<\/code>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 Chaos Mesh:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/349\/4ef\/da5\/3494efda5a0f8e9274243a27e8d35ee1.jpg\" width=\"842\" height=\"489\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/349\/4ef\/da5\/3494efda5a0f8e9274243a27e8d35ee1.jpg\" data-blurred=\"true\"\/><\/figure>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435\u043c HTTP<\/h2>\n<p><code>HTTPChaos<\/code> \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u0431\u043e\u0439 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. HTTPChaos \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u044e \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439: <code>abort<\/code> (\u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435), <code>delay<\/code> (\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430), <code>replace<\/code> (\u0437\u0430\u043c\u0435\u043d\u0430) \u0438 <code>patch<\/code> (\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435). \u0412 \u044d\u0442\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 Chaos Mesh \u043a\u0430\u0436\u0434\u044b\u0435 10\u00a0\u043c\u0438\u043d\u0443\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 abort \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 pod \u043d\u0430 5\u00a0\u043c\u0438\u043d\u0443\u0442. \u0412 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b GET \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 80 \u043f\u043e \u043f\u0443\u0442\u0438 <code>\/api<\/code> \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u043c pod\u2019\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0440\u0432\u0430\u043d\u044b.<\/p>\n<pre><code>apiVersion: chaos-mesh.org\/v1alpha1 kind: HTTPChaos metadata:   name: chaos-http-abort spec:   mode: all   selector:     labelSelectors:       app: nginx   target: Request   port: 80   method: GET   path: \/api   abort: true   duration: 5m   scheduler:     cron: '@every 10m'<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply -f chaos-http-abort.yaml<\/code>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 Chaos Mesh.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/723034\/\"> https:\/\/habr.com\/ru\/company\/southbridge\/blog\/723034\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Chaos Mesh\u00a0\u2014 \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 \u0434\u043b\u044f \u0445\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430 \u0432 Kubernetes. \u0412\u0441\u0435 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0437 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043d\u0430 <a href=\"https:\/\/gitlab.com\/rahasak-labs\/chaos-mesh\"><u>GitLab<\/u><\/a>. \u041a\u043b\u043e\u043d\u0438\u0440\u0443\u0439\u0442\u0435 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0439\u0442\u0435 \u0447\u0438\u0442\u0430\u0442\u044c.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u00ab\u0421\u0440\u0435\u0434\u0438 \u0445\u0430\u043e\u0441\u0430 \u0435\u0441\u0442\u044c \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438\u00bb, \u0421\u0443\u043d\u044c-\u0426\u0437\u044b<\/figcaption><\/div>\n<\/figure>\n<h2>\u0425\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/h2>\n<p><a href=\"https:\/\/www.gremlin.com\/community\/tutorials\/chaos-engineering-the-history-principles-and-practice\/\"><u>\u0425\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433<\/u><\/a>\u00a0\u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043c\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442, \u043a\u0430\u043a \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u0435\u0434\u0451\u0442 \u0441\u0435\u0431\u044f \u0432 \u043d\u0435\u043f\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043d\u043d\u044b\u0445 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f\u0445. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0441\u0442\u0440\u0435\u0441\u0441\u043e\u0432\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0438 \u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043d\u0430\u0439\u0442\u0438 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0441\u0431\u043e\u0438, \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0441\u0442\u0440\u0430\u0448\u043d\u043e\u0435. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u0443\u0435\u043c \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u0435\u0441\u0442\u0438 \u0441\u0435\u0431\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u043e\u0433\u0434\u0430 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0435 \u0442\u0430\u043a. \u0417\u0430\u0442\u0435\u043c \u043c\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0432 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0435. \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0441\u0431\u043e\u044f, \u043e\u0431\u0440\u0430\u0449\u0430\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0438\u0437\u043d\u0430\u043a\u0438 \u0443\u0441\u043f\u0435\u0445\u0430 \u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u0438. \u041f\u043e\u0441\u043b\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043c\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u043c\u0438\u0440\u0435.<\/p>\n<p>\u0412\u043f\u0435\u0440\u0432\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0445\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b Netflix \u0432 2012\u00a0\u0433\u043e\u0434\u0443. \u041e\u043d\u0438 \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 <a href=\"https:\/\/netflix.github.io\/chaosmonkey\/\"><u>Chaos Monkey<\/u><\/a>\u00a0\u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043d\u043e\u0441\u0438\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u0431\u0438\u0437\u043d\u0435\u0441-\u0441\u0438\u0441\u0442\u0435\u043c\u0443. \u0421 \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430\u0441\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044f \u0445\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430. Netflix \u0441\u043e\u0437\u0434\u0430\u043b\u0438 Chaos Monkey \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0432 \u043e\u0431\u043b\u0430\u043a\u043e Amazon Web Services, \u0447\u0442\u043e\u0431\u044b \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0442\u0435\u0440\u044f \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u0430 Amazon \u043d\u0435 \u043f\u043e\u0432\u043b\u0438\u044f\u0435\u0442 \u043d\u0430 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433\u0430. Chaos Monkey \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0438\u043d\u0441\u0442\u0430\u043d\u0441\u044b \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d \u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u0447\u0442\u043e\u0431\u044b \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u0441\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0435\u043b\u0438, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u043d\u0430\u0434\u0451\u0436\u043d\u044b \u0438 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b \u043a \u043d\u0435\u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u0441\u0431\u043e\u044f\u043c.<\/p>\n<h2>Chaos Mesh<\/h2>\n<p><a href=\"https:\/\/github.com\/pingcap\/chaos-mesh\"><u>Chaos Mesh<\/u><\/a>\u00a0\u2014 \u044d\u0442\u043e \u043e\u0431\u043b\u0430\u0447\u043d\u0430\u044f \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u0445\u0430\u043e\u0441-\u0438\u043d\u0436\u0438\u043d\u0438\u0440\u0438\u043d\u0433\u0430 \u0432 Kubernetes. Chaos Mesh \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043e\u043a \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0432 Kubernetes \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 pod\u2019\u043e\u0432, \u0441\u0435\u0442\u0438, \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0438 \u0434\u0430\u0436\u0435 \u044f\u0434\u0440\u0430. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u044f\u043c\u043e \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435, \u043d\u0435 \u043c\u0435\u043d\u044f\u044f \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041c\u044b \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0438\u0434\u0438\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0438 \u043c\u043e\u0436\u0435\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u043a\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u043d\u0435\u0441\u0451\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. \u0412 Chaos Mesh \u0435\u0441\u0442\u044c \u0434\u0430\u0448\u0431\u043e\u0440\u0434 \u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u0432\u0435\u0431-\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>Chaos Mesh \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 Kubernetes CRD (Custom Resource Definition\u00a0\u2014 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432) \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0442\u0438\u043f\u043e\u0432, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043c\u0435\u0441\u0442\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0441\u0431\u043e\u0435\u0432: \u0441\u0431\u043e\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0441\u0431\u043e\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0438 \u0441\u0431\u043e\u0438 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>1. Basic resource faults   1.1. PodChaos: simulates Pod failures, such as Pod node restart, Pod's persistent unavailablility, and certain container failures in a specific Pod.   1.2. NetworkChaos: simulates network failures, such as network latency, packet loss, packet disorder, and network partitions.   1.3. DNSChaos: simulates DNS failures, such as the parsing failure of DNS domain name and the wrong IP address returned.   1.4. HTTPChaos: simulates HTTP communication failures, such as HTTP communication latency.   1.5. StressChaos: simulates CPU race or memory race.   1.6. IOChaos: simulates the I\/O failure of an application file, such as I\/O delays, read and write failures.   1.7. TimeChaos: simulates the time jump exception.   1.8. KernelChaos: simulates kernel failures, such as an exception of the application memory allocation.  2. Platform faults:   2.1. AWSChaos: simulates AWS platform failures, such as the AWS node restart.   2.2. GCPChaos: simulates GCP platform failures, such as the GCP node restart.  3. Application faults:   3.1. JVMChaos: simulates JVM application failures, such as the function call delay.<\/code><\/pre>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Chaos Mesh<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/medium.com\/rahasak\/replace-docker-desktop-with-minikube-and-hyperkit-on-macos-783ce4fb39e3\"><u>\u043a\u043b\u0430\u0441\u0442\u0435\u0440 Kubernetes \u043d\u0430 \u0431\u0430\u0437\u0435 Minikube<\/u><\/a> \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438. \u041f\u0440\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Chaos Mesh \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f (\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438), \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0451\u043d Kubernetes chaos-testing. \u0414\u0430\u0448\u0431\u043e\u0440\u0434 Chaos Mesh \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 2333 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 NodePort.<\/p>\n<pre><code># install chaos mesh curl -sSL https:\/\/mirrors.chaos-mesh.org\/v2.0.3\/install.sh | bash  # check pods kubectl get po -n chaos-testing  >> output NAME                                        READY   STATUS    RESTARTS   AGE chaos-controller-manager-68769d9df9-qt2js   1\/1     Running   0          8m48s chaos-daemon-9nhcs                          1\/1     Running   0          8m49s chaos-dashboard-6677f99c44-dfjzg            1\/1     Running   0          8m48s  # check services kubectl get svc -n chaos-testing  >> output NAME                            TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                       AGE chaos-daemon                    ClusterIP   None            &lt;none>        31767\/TCP,31766\/TCP           9m27s chaos-dashboard                 NodePort    10.104.10.190   &lt;none>        2333:31725\/TCP                9m27s chaos-mesh-controller-manager   ClusterIP   10.97.5.226     &lt;none>        443\/TCP,10081\/TCP,10080\/TCP   9m27s  ---  # access chaos mesh dashboard via NodePort service # dashboard run on port 2333 as NodePort service # dashboard can acess via NodePort port 2333 mapping port, in my case port 31725 http:\/\/&lt;minikube ip>:31725 http:\/\/192.168.64.17:31725\/dashboard  # access dashboard via port forward 3333 -> 2333 # now dashboard can access via localhost:3333 kubectl port-forward -n chaos-testing chaos-dashboard-6677f99c44-dfjzg 8888:2333 http:\/\/localhost:3333<\/code><\/pre>\n<figure class=\"full-width\"><\/figure>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0432 Chaos Mesh<\/h2>\n<p>\u0415\u0441\u0442\u044c \u0434\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0432 Chaos Mesh: \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 YAML. \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430: <code>pod-failure<\/code>, <code>pod-kill<\/code>, <code>stress<\/code>, <code>http-abort<\/code>. \u0412 Chaos Mesh \u0438\u0445 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u00a0\u2014 \u0441\u043c. <a href=\"https:\/\/chaos-mesh.org\/docs\/\"><u>\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043f\u043e Chaos Mesh<\/u><\/a> \u0438 <a href=\"https:\/\/chaos-mesh.org\/interactive-tutorial\/\"><u>\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430<\/u><\/a>. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 nginx \u0438\u0437 \u0442\u0440\u0451\u0445 \u043d\u043e\u0434. \u0420\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 nginx:<\/p>\n<pre><code>apiVersion: v1 kind: Namespace metadata:   name: chaos  ---  apiVersion: v1 kind: Service metadata:   name: nginxservice   labels:     name: nginxservice   namespace: chaos spec:   ports:     - port: 80   selector:     app: nginx   type: LoadBalancer  ---  apiVersion: v1 kind: ReplicationController metadata:   name: nginx   namespace: chaos spec:   replicas: 3   selector:     app: nginx   template:     metadata:       name: nginx       labels:         app: nginx     spec:       containers:       - name: nginx         image: nginx         ports:         - containerPort: 80<\/code><\/pre>\n<pre><code># deploy nginx # it will create three node nginx cluster under namespace 'chaos' kubectl apply -f nginx-deployment.yaml  # view pods kubectl get pods -n chaos  NAME          READY   STATUS    RESTARTS   AGE nginx-bmgbr   1\/1     Running   0          36m nginx-wlr8x   1\/1     Running   0          36m nginx-z9sl7   1\/1     Running   0          36m  # get services kubectl get svc -n chaos  NAME           TYPE           CLUSTER-IP    EXTERNAL-IP   PORT(S)        AGE nginxservice   LoadBalancer   10.96.3.122   &lt;pending>     80:30773\/TCP   37m<\/code><\/pre>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441\u043e \u0441\u0431\u043e\u044f\u043c\u0438 pod\u2019\u0430<\/h2>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b PodChaos \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u0441\u0431\u043e\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 pod\u2019\u043e\u0432 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432. \u0421\u0435\u0439\u0447\u0430\u0441 \u0432 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044e PodChaos \u0432\u0445\u043e\u0434\u044f\u0442 \u0442\u0438\u043f\u044b <code>pod-failure<\/code>, <code>pod-kill<\/code>, <code>container-kill<\/code>. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 Chaos Mesh \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 pod-failure \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 pod nginx, \u0438 pod \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 30\u00a0\u0441\u0435\u043a\u0443\u043d\u0434. \u0414\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 pod\u2019\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0444\u043b\u0430\u0433 <code>labelSelectors<\/code>. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441\u043e \u0441\u0431\u043e\u044f\u043c\u0438 pod\u2019\u0430:<\/p>\n<pre><code>kind: PodChaos apiVersion: chaos-mesh.org\/v1alpha1 metadata:   name: chaos-failure   namespace: chaos spec:   selector:     namespaces:       - chaos     labelSelectors:       app: nginx   mode: one   action: pod-failure   duration: 30s   gracePeriod: 0<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply -f chaos-pod-failure.yaml<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 Chaos Mesh.  <\/p>\n<figure class=\"full-width\"><\/figure>\n<figure class=\"full-width\"><\/figure>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435\u043c pod\u2019\u0430<\/h2>\n<p>\u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 Chaos Mesh \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 <code>pod-kill<\/code> \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 <code>pod nginx<\/code> \u0438 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0430\u0435\u0442 pod. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0435\u043d\u0438\u0435\u043c pod\u2019\u0430:<\/p>\n<pre><code>kind: PodChaos apiVersion: chaos-mesh.org\/v1alpha1 metadata:   name: chaos-kill   namespace: chaos spec:   selector:     namespaces:       - chaos     labelSelectors:       app: nginx   mode: one   action: pod-kill   duration: 30s   gracePeriod: 0<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply -f chaos-pod-kill.yaml<\/code>. \u041f\u043e\u0441\u043b\u0435 \u0440\u0430\u0437\u0432\u0451\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 Chaos Mesh.<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u043e\u0439<\/h2>\n<p>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b <code>StressChaos<\/code> \u0432 Chaos Mesh \u0441\u0438\u043c\u0443\u043b\u0438\u0440\u0443\u044e\u0442 \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 (<code>nginx<\/code>) \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u044f\u0442\u044c \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c, \u0437\u0430\u043d\u044f\u0432 \u0434\u043e 256\u00a0\u041c\u0411.<\/p>\n<pre><code>kind: StressChaos apiVersion: chaos-mesh.org\/v1alpha1 metadata:   name: chaos-stress   namespace: chaos spec:   selector:     namespaces:       - chaos     labelSelectors:       app: nginx   mode: one   containerNames:     - ''   stressors:     memory:       workers: 4       size: '256MB'   duration: 60s<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply -f chaos-stress.yaml<\/code>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 Chaos Mesh:<\/p>\n<figure class=\"full-width\"><\/figure>\n<h2>\u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0441 \u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435\u043c HTTP<\/h2>\n<p><code>HTTPChaos<\/code> \u0438\u043c\u0438\u0442\u0438\u0440\u0443\u0435\u0442 \u0441\u0431\u043e\u0439 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 HTTP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. HTTPChaos \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438\u043c\u0438\u0442\u0430\u0446\u0438\u044e \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439: <code>abort<\/code> (\u043f\u0440\u0435\u0440\u044b\u0432\u0430\u043d\u0438\u0435), <code>delay<\/code> (\u0437\u0430\u0434\u0435\u0440\u0436\u043a\u0430), <code>replace<\/code> (\u0437\u0430\u043c\u0435\u043d\u0430) \u0438 <code>patch<\/code> (\u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435). \u0412 \u044d\u0442\u043e\u043c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0435 Chaos Mesh \u043a\u0430\u0436\u0434\u044b\u0435 10\u00a0\u043c\u0438\u043d\u0443\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 abort \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 pod \u043d\u0430 5\u00a0\u043c\u0438\u043d\u0443\u0442. \u0412 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044b GET \u0447\u0435\u0440\u0435\u0437 \u043f\u043e\u0440\u0442 80 \u043f\u043e \u043f\u0443\u0442\u0438 <code>\/api<\/code> \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u043c pod\u2019\u0435 \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0435\u0440\u0432\u0430\u043d\u044b.<\/p>\n<pre><code>apiVersion: chaos-mesh.org\/v1alpha1 kind: HTTPChaos metadata:   name: chaos-http-abort spec:   mode: all   selector:     labelSelectors:       app: nginx   target: Request   port: 80   method: GET   path: \/api   abort: true   duration: 5m   scheduler:     cron: '@every 10m'<\/code><\/pre>\n<p>\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>kubectl apply -f chaos-http-abort.yaml<\/code>. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0435 Chaos Mesh.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/southbridge\/blog\/723034\/\"> https:\/\/habr.com\/ru\/company\/southbridge\/blog\/723034\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-346910","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346910","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=346910"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/346910\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=346910"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=346910"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=346910"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}