{"id":320312,"date":"2021-03-26T09:01:45","date_gmt":"2021-03-26T09:01:45","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320312"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320312","title":{"rendered":"\u042d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u044f MongoDB \u0432 Kubernetes: \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0438\u0445 \u043f\u043b\u044e\u0441\u044b \u0438 \u043c\u0438\u043d\u0443\u0441\u044b"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/18f\/cb3\/dea\/18fcb3dea584348ac77b4f4c807464c6.png\" width=\"780\" height=\"450\"><figcaption><\/figcaption><\/figure>\n<p>MongoDB \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 NoSQL\/\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u0438\u0440\u0435 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u0430\u0448\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0435\u0451 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0432 production. \u0417\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0445 \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0432 Kubernetes, \u0442\u0430\u043a \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c: \u043a\u0430\u043a\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Mongo \u0432 K8s \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442? \u0412 \u0447\u0435\u043c \u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438? \u041a\u0430\u043a \u043c\u044b \u0441\u0430\u043c\u0438 \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443?<\/p>\n<p>\u0412\u0435\u0434\u044c \u043d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442: \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e Kubernetes \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0432 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0435\u0437 \u0434\u043e\u043b\u0436\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u044b. \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0438 MongoDB \u0432 Kubernetes.<\/p>\n<h3>\u0413\u043b\u0430\u0432\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b<\/h3>\n<p>\u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0438 Mongo \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c:<\/p>\n<ol>\n<li>\n<p><strong>\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435<\/strong>. \u0414\u043b\u044f \u0433\u0438\u0431\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 Kubernetes \u0434\u043b\u044f Mongo \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0443\u0437\u043b\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c Mongo \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0443\u0437\u043b\u043e\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438\u043b\u0438 \u0438\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0441\u043a\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c iops (\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438). \u0415\u0441\u043b\u0438 \u0431\u0430\u0437\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e latency, \u0442\u043e \u043d\u0430 \u044d\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 <strong>requests \u0438 limits<\/strong> \u043d\u0430 pod\u2019\u0430\u0445 \u0441 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438 Mongo (\u0438 \u0441\u043e\u0441\u0435\u0434\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441 \u043d\u0438\u043c\u0438 pod\u2019\u0430\u043c\u0438 \u043d\u0430 \u0443\u0437\u043b\u0435). \u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0442\u043e \u2014 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Kubernetes \u0431\u043e\u043b\u0435\u0435 \u00ab\u043f\u0440\u0438\u0432\u0435\u0442\u043b\u0438\u0432\u00bb \u043a stateless-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u2014 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0432\u043e\u0437\u0440\u043e\u0441\u0448\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043d\u0430 \u0443\u0437\u043b\u0435 Kubernetes <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/administer-cluster\/out-of-resource\/\"><u>\u043d\u0430\u0447\u043d\u0435\u0442<\/u><\/a> \u0443\u0431\u0438\u0432\u0430\u0442\u044c pod\u2019\u044b \u0441 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438 Mongo \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435, \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u0432\u0434\u0432\u043e\u0439\u043d\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a pod \u0441 Mongo \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0437\u043b\u0435, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0439\u0442\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0412\u0441\u0451 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043b\u043e\u0445\u043e, \u0435\u0441\u043b\u0438 \u0443\u043f\u0430\u0432\u0448\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u0431\u044b\u043b\u0430 primary, \u0442.\u043a. \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0435\u0440\u0435\u0432\u044b\u0431\u043e\u0440\u0430\u043c: \u0432\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0441\u0442\u0430\u043d\u0435\u0442, \u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0433\u043e\u0442\u043e\u0432\u043e \u0438\/\u0438\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443: \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0432 Kubernetes \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0437\u043b\u044b \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 Mongo \u043d\u0430 \u0443\u0437\u043b\u044b \u0441 \u0431<em>\u043e<\/em>\u043b\u044c\u0448\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u041f\u043e\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e <strong>podDisruptionBudget<\/strong>, \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c pod\u2019\u044b \u0440\u0430\u0437\u043e\u043c, \u0441\u0442\u0430\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u043f\u043b\u0438\u043a \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0435\u0448\u0438\u0432 \u044d\u0442\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u0431\u0430\u0437\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u0449\u0438\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 Kubernetes. \u0412 \u043f\u043b\u0430\u043d\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043b\u0438\u0448\u044c \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u2014 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043f\u0440\u0438 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0442\u0438\u043f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043d\u0430 \u0432\u0430\u0448 \u0432\u044b\u0431\u043e\u0440: \u043e\u0442 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0434\u0438\u0441\u043a\u043e\u0432 \u0434\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441 \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u043f\u0430\u0441\u043e\u043c \u043f\u043e iops. \u0414\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0434\u0438\u0441\u043a\u0438, \u043d\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0432\u0441\u0451 \u0436\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u044e\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c. <a href=\"https:\/\/cloud.google.com\/compute\/docs\/disks\/#pdperformance\"><u>\u041f\u0440\u0438\u043c\u0435\u0440<\/u><\/a> \u0438\u0437 Google Cloud:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/309\/771\/720\/3097717207dd6b28ce6c9d233666025b.png\" width=\"866\" height=\"314\"><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/87d\/626\/4d9\/87d6264d9bdb8c9a7ca8bdb90fa4b7da.png\" width=\"851\" height=\"61\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 AWS <a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/ebs-volume-types.html\"><u>\u043a\u0430\u0440\u0442\u0438\u043d\u0430<\/u><\/a> \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0432\u0441\u0451 \u0435\u0449\u0451 \u0434\u0430\u043b\u0435\u043a\u0430 \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c09\/c03\/50d\/c09c0350d0bec1c0d08f97a3e14d0dd1.png\" width=\"1088\" height=\"753\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0435\u0449\u0451 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f MongoDB: \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b.<\/p>\n<h2>\u041a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c MongoDB \u0432 Kubernetes?<\/h2>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 (\u0438 Mongo \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c) \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432 \u0441\u043e StatefulSet \u0438 init-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u041d\u043e \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u00ab\u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0437\u0430 \u043d\u0430\u0441\u00bb.<\/p>\n<h3>1. Helm-\u0447\u0430\u0440\u0442 \u043e\u0442 Bitnami<\/h3>\n<p>\u0418 \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u2014 \u044d\u0442\u043e <a href=\"https:\/\/github.com\/bitnami\/charts\/tree\/master\/bitnami\/mongodb\"><u>Helm-\u0447\u0430\u0440\u0442 \u043e\u0442 Bitnami<\/u><\/a>. \u041e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d, \u0441\u043e\u0437\u0434\u0430\u043d \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u0427\u0430\u0440\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c MongoDB \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>standalone;<\/p>\n<\/li>\n<li>\n<p>Replica Set <em>(\u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u044f MongoDB; \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u043e ReplicaSet \u0432 Kubernetes, \u043d\u0430 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435)<\/em>;<\/p>\n<\/li>\n<li>\n<p>Replica Set + Arbiter.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 (\u0442.\u0435. \u043d\u0435\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439) <a href=\"https:\/\/hub.docker.com\/r\/bitnami\/mongodb\"><u>\u043e\u0431\u0440\u0430\u0437<\/u><\/a>.<\/p>\n<p>\u0427\u0430\u0440\u0442 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u043c\u0435\u0434\u0430\u043b\u0438: \u0438\u0437-\u0437\u0430 \u043e\u0431\u0438\u043b\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043d\u0451\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0438\u0434\u0435\u0442\u044c \u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0447\u0430\u0440\u0442\u0430 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f, \u2014 \u044d\u0442\u043e:<\/p>\n<p>1. \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L58-L60\"><u>Values.yaml#L58-L60<\/u><\/a>). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e <em>standalone<\/em>, \u043d\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 <em>replicaset<\/em>:<\/p>\n<pre><code class=\"json\">... architecture: replicaset ...<\/code><\/pre>\n<p>2. \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L442-L463\"><u>Values.yaml#L442-L463<\/u><\/a>):<\/p>\n<pre><code class=\"json\">... persistence:   enabled: true   storageClass: \"gp2\" # \u0443 \u043d\u0430\u0441 \u044d\u0442\u043e general purpose 2 \u0438\u0437 AWS   accessModes:     - ReadWriteOnce   size: 120Gi ...<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 <code>helm install<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 MongoDB \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439, \u043a\u0430\u043a \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u0437 Kubernetes:<\/p>\n<pre><code class=\"bash\">NAME: mongobitnami LAST DEPLOYED: Fri Feb 26 09:00:04 2021 NAMESPACE: mongodb STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: ** Please be patient while the chart is being deployed **  MongoDB(R) can be accessed on the following DNS name(s) and ports from within your cluster:      mongobitnami-mongodb-0.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017     mongobitnami-mongodb-1.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017     mongobitnami-mongodb-2.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017  To get the root password run:      export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace mongodb mongobitnami-mongodb -o jsonpath=\"{.data.mongodb-root-password}\" | base64 --decode)  To connect to your database, create a MongoDB(R) client container:      kubectl run --namespace mongodb mongobitnami-mongodb-client --rm --tty -i --restart='Never' --env=\"MONGODB_ROOT_PASSWORD=$MONGODB_ROOT_PASSWORD\" --image docker.io\/bitnami\/mongodb:4.4.4-debian-10-r0 --command -- bash  Then, run the following command:     mongo admin --host \"mongobitnami-mongodb-0.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017,mongobitnami-mongodb-1.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017,mongobitnami-mongodb-2.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017\" --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d \u0443\u0432\u0438\u0434\u0438\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0441 \u0430\u0440\u0431\u0438\u0442\u0440\u043e\u043c (\u043e\u043d <code>enabled<\/code> \u0432 \u0447\u0430\u0440\u0442\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e):<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2fb\/dd6\/944\/2fbdd6944993e153442e01121167b16a.png\" width=\"744\" height=\"69\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u0442\u0430\u043a\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u0430\u043c, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043d\u0435\u0451 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c PDB (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d). \u041c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0442\u0435\u0440\u044f\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 drain\u2019\u0430 \u0443\u0437\u043b\u043e\u0432 \u2014 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 1 \u0443\u0437\u043b\u0430 (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L430-L437\"><u>Values.yaml#L430-L437<\/u><\/a>):<\/p>\n<pre><code class=\"json\">... pdb:   create: true   maxUnavailable: 1 ...<\/code><\/pre>\n<p>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c requests \u0438 limits (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L350-L360\"><u>Values.yaml#L350-L360<\/u><\/a>):<\/p>\n<pre><code class=\"json\">... resources:   limits:     memory: 8Gi   requests:      cpu: 4     memory: 4Gi ...<\/code><\/pre>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0443 pod\u2019\u043e\u0432 \u0441 \u0431\u0430\u0437\u043e\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0445 pod\u2019\u043e\u0432 (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L326\"><u>Values.yaml#L326<\/u><\/a>).<\/p>\n<p>3. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0447\u0430\u0440\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0435\u0436\u0435\u0441\u0442\u043a\u043e\u0435 anti-affinity \u0434\u043b\u044f pod\u2019\u043e\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e scheduler \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c pod\u2019\u044b \u043d\u0430 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0443\u0437\u043b\u044b, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0442\u043e \u043d\u0430\u0447\u043d\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0442\u0443\u0434\u0430, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u043c\u0435\u0441\u0442\u043e.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0437\u043b\u043e\u0432 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c \u0434\u0432\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0443\u0437\u0435\u043b (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L270\"><u>Values.yaml#L270<\/u><\/a>):<\/p>\n<pre><code class=\"json\">... podAntiAffinityPreset: hard ...<\/code><\/pre>\n<p>\u0421\u0430\u043c \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0432 \u0447\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443:<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c StatefulSet \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0440\u0435\u043f\u043b\u0438\u043a \u0438 \u0434\u0432\u0443\u043c\u044f init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438: <em>volume-permissions<\/em> \u0438 <em>auto-discovery<\/em>.<\/p>\n<\/li>\n<li>\n<p><em>Volume-permissions<\/em> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043d\u0435\u0451.<\/p>\n<\/li>\n<li>\n<p><em>Auto-discovery<\/em> \u0436\u0434\u0451\u0442, \u043f\u043e\u043a\u0430 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0438 \u043f\u0438\u0448\u0435\u0442 \u0438\u0445 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 <code>shared_file<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u043f\u043e\u0434\u043c\u0435\u043d\u043e\u0439 <code>command<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f entrypoint\u2019\u0430 \u0438 <code>run.sh<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f <code>entrypoint.sh<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0441\u043a\u0430\u0434 \u0438\u0437 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0434\u0440\u0443\u0433 \u0432 \u0434\u0440\u0443\u0433\u0430 Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f MongoDB \u0447\u0435\u0440\u0435\u0437 \u0442\u0430\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">      mongodb_initialize() {         local persisted=false          info \"Initializing MongoDB...\"          rm -f \"$MONGODB_PID_FILE\"         mongodb_copy_mounted_config         mongodb_set_net_conf         mongodb_set_log_conf         mongodb_set_storage_conf          if is_dir_empty \"$MONGODB_DATA_DIR\/db\"; then                 info \"Deploying MongoDB from scratch...\"                 ensure_dir_exists \"$MONGODB_DATA_DIR\/db\"                 am_i_root &amp;&amp; chown -R \"$MONGODB_DAEMON_USER\" \"$MONGODB_DATA_DIR\/db\"                  mongodb_start_bg                 mongodb_create_users                 if [[ -n \"$MONGODB_REPLICA_SET_MODE\" ]]; then                 if [[ -n \"$MONGODB_REPLICA_SET_KEY\" ]]; then                         mongodb_create_keyfile \"$MONGODB_REPLICA_SET_KEY\"                         mongodb_set_keyfile_conf                 fi                 mongodb_set_replicasetmode_conf                 mongodb_set_listen_all_conf                 mongodb_configure_replica_set                 fi                 mongodb_stop         else                 persisted=true                 mongodb_set_auth_conf                 info \"Deploying MongoDB with persisted data...\"                 if [[ -n \"$MONGODB_REPLICA_SET_MODE\" ]]; then                 if [[ -n \"$MONGODB_REPLICA_SET_KEY\" ]]; then                         mongodb_create_keyfile \"$MONGODB_REPLICA_SET_KEY\"                         mongodb_set_keyfile_conf                 fi                 if [[ \"$MONGODB_REPLICA_SET_MODE\" = \"dynamic\" ]]; then                         mongodb_ensure_dynamic_mode_consistency                 fi                 mongodb_set_replicasetmode_conf                 fi         fi         mongodb_set_auth_conf         }<\/code><\/pre>\n<h3>2. \u00ab\u0423\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439\u00bb \u0447\u0430\u0440\u0442<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0435\u0449\u0435 \u0438 \u0441\u0442\u0430\u0440\u044b\u0439 <a href=\"https:\/\/github.com\/helm\/charts\/tree\/master\/stable\/mongodb-replicaset\"><u>\u0447\u0430\u0440\u0442 \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Helm<\/u><\/a>. \u041d\u044b\u043d\u0435 \u043e\u043d deprecated <em>(\u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0432\u044b\u0445\u043e\u0434\u043e\u043c Helm 3 \u2014 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0441\u043c. <\/em><a href=\"https:\/\/github.com\/helm\/charts\/issues\/21103\"><em><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/em><\/a><em>)<\/em>, \u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0434\u0440\u0443\u0433 \u043e\u0442 \u0434\u0440\u0443\u0433\u0430 \u0432 \u0441\u0432\u043e\u0438\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445 \u2014 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <a href=\"https:\/\/git.app.uib.no\/caleno\/helm-charts\/-\/tree\/master\/stable\/mongodb-replicaset\"><u>\u0437\u0434\u0435\u0441\u044c<\/u><\/a> \u0438\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043d\u043e\u0440\u0432\u0435\u0436\u0441\u043a\u0438\u0439 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442 <a href=\"https:\/\/www.uib.no\/\"><u>UiB<\/u><\/a>.<\/p>\n<p>\u042d\u0442\u043e\u0442 \u0447\u0430\u0440\u0442 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c Replica Set + Arbiter \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0439 \u043e\u0431\u0440\u0430\u0437 \u0432 init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445, \u043d\u043e \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442 \u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u0435\u043f\u043b\u043e\u044f \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430.&nbsp;<\/p>\n<p>\u041c\u044b \u0441\u0442\u0430\u043b\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0437\u0430\u0434\u043e\u043b\u0433\u043e \u0434\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d \u0441\u0442\u0430\u043b deprecated <em>(\u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e \u2014 10 \u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f 2020 \u0433\u043e\u0434\u0430)<\/em>. \u0417\u0430 \u043c\u0438\u043d\u0443\u0432\u0448\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0447\u0430\u0440\u0442 \u0441\u0438\u043b\u044c\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043b \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b. \u0414\u043b\u044f \u0441\u0432\u043e\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043c\u044b \u0441\u0438\u043b\u044c\u043d\u043e \u0443\u0440\u0435\u0437\u0430\u043b\u0438 \u0447\u0430\u0440\u0442, \u0441\u0434\u0435\u043b\u0430\u0432 \u0435\u0433\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u043c \u0438 \u0443\u0431\u0440\u0430\u0432 \u0432\u0441\u0451 \u043b\u0438\u0448\u043d\u0435\u0435: \u0448\u0430\u0431\u043b\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u0434\u0430\u0447.<\/p>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u0445\u043e\u0436\u0430 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u0447\u0430\u0440\u0442\u043e\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0439 \u043d\u0435 \u0431\u0443\u0434\u0443 \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043c\u0435\u0447\u0443, \u0447\u0442\u043e affinity \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e (<a href=\"https:\/\/github.com\/helm\/charts\/blob\/master\/stable\/mongodb-replicaset\/values.yaml#L108\"><u>Values.yaml#L108<\/u><\/a>):<\/p>\n<pre><code class=\"json\">      affinity:         podAntiAffinity:           requiredDuringSchedulingIgnoredDuringExecution:           - labelSelector:               matchLabels:                app: mongodb-replicaset<\/code><\/pre>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0445\u043e\u0436 \u0441 \u0447\u0430\u0440\u0442\u043e\u043c \u043e\u0442 Bitnami, \u043d\u043e \u043c\u0435\u043d\u0435\u0435 \u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d (\u043d\u0435\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0430\u0433\u0440\u043e\u043c\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438):<\/p>\n<p>1. Init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <em>copyconfig<\/em> \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433 \u0438\u0437 <code>configdb-readonly<\/code> (ConfigMap) \u0438 \u043a\u043b\u044e\u0447 \u0438\u0437 \u0441\u0435\u043a\u0440\u0435\u0442\u0430 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 (<code>emptyDir<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440).<\/p>\n<p>2. \u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 <code>unguiculus\/mongodb-install<\/code> \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <code>peer-finder<\/code> \u0432 <code>work-dir<\/code>.<\/p>\n<p>3. Init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 <em>bootstrap<\/em> \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>peer-finder<\/code> \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c <code>\/init\/on-start.sh<\/code> \u2014 \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u043f\u043e\u0434\u043d\u044f\u0442\u044b\u0445 \u0443\u0437\u043b\u043e\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0438\u0445 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Mongo.<\/p>\n<p>4. \u0421\u043a\u0440\u0438\u043f\u0442 <code>\/init\/on-start.sh<\/code> \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u043e\u0439 \u0435\u043c\u0443 \u0447\u0435\u0440\u0435\u0437 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f (\u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f SSL-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432\u2026), \u043f\u043b\u044e\u0441 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434 \u0441\u0442\u0430\u0440\u0442\u043e\u043c \u0431\u0430\u0437\u044b.<\/p>\n<p>5. \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0438\u0440\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442 \u043a\u0430\u043a:<\/p>\n<pre><code class=\"bash\">          args:             - -on-start=\/init\/on-start.sh             - \"-service=mongodb\" log \"Reading standard input...\" while read -ra line; do     if [[ \"${line}\" == *\"${my_hostname}\"* ]]; then         service_name=\"$line\"     fi     peers=(\"${peers[@]}\" \"$line\") done<\/code><\/pre>\n<p>6. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043f\u0438\u0440\u043e\u0432: \u043a\u0442\u043e \u0438\u0437 \u043d\u0438\u0445 \u2014 primary, \u0430 \u043a\u0442\u043e \u2014 master.<\/p>\n<ul>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435 primary, \u0442\u043e \u043f\u0438\u0440 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a primary \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0441\u0430\u043c\u044b\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0438\u0440, \u043e\u043d \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0431\u044f \u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c.<\/p>\n<\/li>\n<\/ul>\n<p>7. \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>8. \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0441\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 MongoDB.<\/p>\n<h3>3. \u041e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/h3>\n<p>\u0412 2020 \u0433\u043e\u0434\u0443 \u0432\u044b\u0448\u0435\u043b \u0432 \u0441\u0432\u0435\u0442 <a href=\"https:\/\/github.com\/mongodb\/mongodb-kubernetes-operator\"><u>\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 Kubernetes-\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/u><\/a> community-\u0432\u0435\u0440\u0441\u0438\u0438 MongoDB. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c, \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 MongoDB. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435 \u0447\u0430\u0440\u0442\u043e\u0432 \u0432 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435.<\/p>\n<p>\u041e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c community-\u0432\u0435\u0440\u0441\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430 \u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0438 \u043d\u0435 \u043f\u043e\u0434\u043b\u0435\u0436\u0438\u0442 \u0441\u0438\u043b\u044c\u043d\u043e\u0439 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u2014 \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0435\u0441\u043b\u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 \u0447\u0430\u0440\u0442\u0430\u043c\u0438, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432\u044b\u0448\u0435. \u042d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0438 enterprise-\u0440\u0435\u0434\u0430\u043a\u0446\u0438\u044f.<\/p>\n<p>\u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/019\/ed4\/a03\/019ed4a0305b94a8479f6c75ae5ee00d.png\" width=\"956\" height=\"724\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0447\u0435\u0440\u0435\u0437 Helm \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0430\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438 CRD (CustomResourceDefinition), \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 Kubernetes.<\/p>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 StatefulSet, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 pod\u2019\u044b \u0441 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 MongoDB. \u041a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u2014 \u0447\u043b\u0435\u043d ReplicaSet\u2019\u0430 \u0432 Kubernetes.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f sidecar-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0430\u0433\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c MongoDB \u0432 \u043a\u0430\u0436\u0434\u043e\u043c pod\u2019\u0435. \u041a\u043e\u043d\u0444\u0438\u0433 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 Kubernetes-\u0441\u0435\u043a\u0440\u0435\u0442\u0435.&nbsp;<\/p>\n<\/li>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f pod \u0441 \u043e\u0434\u043d\u0438\u043c init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438 \u0434\u0432\u0443\u043c\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438.<\/p>\n<ol>\n<li>\n<p>Init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0445\u0443\u043a\u0430, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0449\u0435\u0433\u043e \u0432\u0435\u0440\u0441\u0438\u044e MongoDB, \u0432 \u043e\u0431\u0449\u0438\u0439 empty-dir volume (\u0434\u043b\u044f \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440).<\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0434\u043b\u044f \u0430\u0433\u0435\u043d\u0442\u0430 MongoDB \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0441 \u0431\u0430\u0437\u043e\u0439: \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430, \u0440\u0435\u0441\u0442\u0430\u0440\u0442 \u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u0430\u0433\u0435\u043d\u0442\u043e\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0432 Custom Resource \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433 \u0434\u043b\u044f \u0441\u0430\u043c\u043e\u0439 MongoDB.<\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0443\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432:<\/p>\n<pre><code class=\"json\">--- apiVersion: mongodb.com\/v1 kind: MongoDBCommunity metadata:   name: example-mongodb spec:   members: 3   type: ReplicaSet   version: \"4.2.6\"   security:     authentication:       modes: [\"SCRAM\"]   users:     - name: my-user       db: admin       passwordSecretRef: # \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0441\u0435\u043a\u0440\u0435\u0442 \u043d\u0438\u0436\u0435 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u043e\u043b\u044f \u044e\u0437\u0435\u0440\u0430         name: my-user-password       roles:         - name: clusterAdmin           db: admin         - name: userAdminAnyDatabase           db: admin       scramCredentialsSecretName: my-scram  # \u0443\u0447\u0435\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u043a\u0440\u0435\u0442\u0430 # \u043f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0430, \u0441\u0435\u043a\u0440\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f --- apiVersion: v1 kind: Secret metadata:   name: my-user-password type: Opaque stringData:   password: 58LObjiMpxcjP1sMDW<\/code><\/pre>\n<p>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u043d \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u043f\u043b\u0438\u043a \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0432\u0432\u0435\u0440\u0445 \u0438 \u0432\u043d\u0438\u0437, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c upgrade \u0438 \u0434\u0430\u0436\u0435 downgrade, \u0434\u0435\u043b\u0430\u044f \u044d\u0442\u043e \u0431\u0435\u0441\u043f\u0440\u043e\u0441\u0442\u043e\u0439\u043d\u043e. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u0443\u043c\u0435\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0440\u043e\u043b\u0438 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n<p>\u041d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u043d \u0443\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u043c \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u043d\u0435\u0433\u043e \u043d\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0442\u0434\u0430\u0447\u0438 \u043c\u0435\u0442\u0440\u0438\u043a \u0432 Prometheus, \u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u2014 Replica Set (\u043d\u0435\u043b\u044c\u0437\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u0440\u0431\u0438\u0442\u0440\u0430). \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0442.\u043a. \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0435\u0433\u0443\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u0443\u044e \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430, \u0430 \u0441\u0430\u043c\u0430 \u043e\u043d\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430.<\/p>\n<p>\u041d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 community-\u0432\u0435\u0440\u0441\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u043c\u0435\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u043a\u0440\u0430\u0442\u043a\u0443\u044e \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e, \u043d\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u0445, \u0438 \u044d\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043f\u0440\u0438 \u0434\u0435\u0431\u0430\u0433\u0435 \u0442\u0435\u0445 \u0438\u043b\u0438 \u0438\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432.<\/p>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 enterprise-\u0432\u0435\u0440\u0441\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431<em>\u043e<\/em>\u043b\u044c\u0448\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u2014 \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e Replica Set\u2019\u043e\u0432, \u043d\u043e \u0438 shared-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0448\u0430\u0440\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438\u0437\u0432\u043d\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 (\u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c \u0438\u043c\u0435\u043d, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0438\u0437\u0432\u043d\u0435), \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0442.\u0434. \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043a \u043d\u0435\u043c\u0443 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0435.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0431\u0430\u0437\u044b \u0432\u043d\u0443\u0442\u0440\u0438 Kubernetes \u2014 \u044d\u0442\u043e \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043d\u0430 \u043e\u0434\u0438\u043d \u043b\u0430\u0434, \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u043e\u0434 \u043e\u0434\u043d\u0443 \u0441\u0440\u0435\u0434\u0443 \u0438 \u0433\u0438\u0431\u043a\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041e\u0434\u043d\u0430\u043a\u043e \u0431\u0435\u0437 \u0434\u043e\u043b\u0436\u043d\u043e\u0439 \u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0441\u0442\u0438, \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043a \u0434\u0435\u0442\u0430\u043b\u044f\u043c \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0433\u043e\u043b\u043e\u0432\u043d\u043e\u0439 \u0431\u043e\u043b\u044c\u044e <em>(\u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u044d\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Kubernetes, \u043d\u043e \u0438 \u0431\u0435\u0437 \u043d\u0435\u0433\u043e\u2026)<\/em>.<\/p>\n<p>\u0423 \u0440\u0430\u0437\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 MongoDB \u0435\u0441\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043b\u044e\u0441\u044b. \u0427\u0430\u0440\u0442\u044b \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u0432\u0430\u0448\u0438 \u043d\u0443\u0436\u0434\u044b, \u043d\u043e \u0432\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u0442\u0435\u0441\u044c \u0441 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 MongoDB \u0438\u043b\u0438 \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0443\u0437\u043b\u043e\u0432, \u0442.\u043a. \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0440\u0443\u0447\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c. \u0421\u043f\u043e\u0441\u043e\u0431 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0432 \u044d\u0442\u043e\u043c \u0441\u043c\u044b\u0441\u043b\u0435 \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u043f\u043e \u0434\u0440\u0443\u0433\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435, \u0432 \u0441\u0432\u043e\u0435\u0439 community-\u0440\u0435\u0434\u0430\u043a\u0446\u0438\u0438). \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043d\u0435 \u043d\u0430\u0448\u043b\u0438 \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438\u0437 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0438.<\/p>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0438 managed-\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f Mongo, \u043e\u0434\u043d\u0430\u043a\u043e \u043c\u044b \u0432 \u0441\u0432\u043e\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u043d\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u0430\u043c \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u00ab\u0447\u0438\u0441\u0442\u043e\u0433\u043e\u00bb Kubernetes.<em> \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b\u0438 <\/em><a href=\"https:\/\/github.com\/percona\/percona-server-mongodb-operator\"><em>Percona Kubernetes Operator for PSMDB<\/em><\/a><em>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 \u0432\u0430\u0440\u0438\u0430\u0446\u0438\u044e MongoDB \u043e\u0442 \u043e\u0434\u043d\u043e\u0438\u043c\u0451\u043d\u043d\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 (Percona Server for MongoDB).<\/em><\/p>\n<h2>P.S.<\/h2>\n<p>\u0427\u0438\u0442\u0430\u0439\u0442\u0435 \u0442\u0430\u043a\u0436\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0431\u043b\u043e\u0433\u0435:<\/p>\n<ul>\n<li>\n<p>\u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/461149\/\">\u0411\u0435\u0441\u043f\u0440\u043e\u0441\u0442\u043e\u0439\u043d\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f MongoDB \u0432 Kubernetes<\/a>\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/501424\/\">\u0418\u0437 \u0436\u0438\u0437\u043d\u0438 \u0441 Kubernetes: \u041a\u0430\u043a \u043c\u044b \u0432\u044b\u043d\u043e\u0441\u0438\u043b\u0438 \u0421\u0423\u0411\u0414 (\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e) \u0438\u0437 review-\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439 \u0432 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435<\/a>\u00bb;<\/p>\n<\/li>\n<li>\n<p>\u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/520616\/\">\u041e\u0431\u0437\u043e\u0440 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 PostgreSQL \u0434\u043b\u044f Kubernetes. \u0427\u0430\u0441\u0442\u044c 1: \u043d\u0430\u0448 \u0432\u044b\u0431\u043e\u0440 \u0438 \u043e\u043f\u044b\u0442<\/a>\u00bb. <\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p> \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\/flant\/blog\/549040\/\"> https:\/\/habr.com\/ru\/company\/flant\/blog\/549040\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>MongoDB \u2014 \u043e\u0434\u043d\u0430 \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 NoSQL\/\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u043e\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u0438\u0440\u0435 \u0432\u0435\u0431-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043d\u043e\u0433\u0438\u0435 \u043d\u0430\u0448\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0435\u0451 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u0445, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u0432 production. \u0417\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0438\u0445 \u0447\u0430\u0441\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0432 Kubernetes, \u0442\u0430\u043a \u0447\u0442\u043e \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c: \u043a\u0430\u043a\u0438\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 Mongo \u0432 K8s \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442? \u0412 \u0447\u0435\u043c \u0438\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438? \u041a\u0430\u043a \u043c\u044b \u0441\u0430\u043c\u0438 \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u0443?<\/p>\n<p>\u0412\u0435\u0434\u044c \u043d\u0435 \u0441\u0435\u043a\u0440\u0435\u0442: \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e Kubernetes \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432 \u0432 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0435\u0441\u043b\u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0435\u0437 \u0434\u043e\u043b\u0436\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0441\u0442\u0435\u0439, \u0447\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u044b. \u0422\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u043a\u0430\u0441\u0430\u0435\u0442\u0441\u044f \u0438 MongoDB \u0432 Kubernetes.<\/p>\n<h3>\u0413\u043b\u0430\u0432\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b<\/h3>\n<p>\u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043f\u0440\u0438 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0438 Mongo \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c:<\/p>\n<ol>\n<li>\n<p><strong>\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435<\/strong>. \u0414\u043b\u044f \u0433\u0438\u0431\u043a\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 Kubernetes \u0434\u043b\u044f Mongo \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043c\u0435\u0436\u0434\u0443 \u0443\u0437\u043b\u0430\u043c\u0438, \u0435\u0441\u043b\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c Mongo \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0443\u0437\u043b\u043e\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438\u043b\u0438 \u0438\u0445 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0438\u0441\u043a\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0441 \u0431\u043e\u043b\u0435\u0435 \u043d\u0438\u0437\u043a\u0438\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u043c iops (\u0432 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438). \u0415\u0441\u043b\u0438 \u0431\u0430\u0437\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u043e\u043d\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0438 \u0442\u0440\u0435\u0431\u0443\u044e\u0442\u0441\u044f \u0445\u043e\u0440\u043e\u0448\u0438\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043f\u043e latency, \u0442\u043e \u043d\u0430 \u044d\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0435 <strong>requests \u0438 limits<\/strong> \u043d\u0430 pod\u2019\u0430\u0445 \u0441 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438 Mongo (\u0438 \u0441\u043e\u0441\u0435\u0434\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441 \u043d\u0438\u043c\u0438 pod\u2019\u0430\u043c\u0438 \u043d\u0430 \u0443\u0437\u043b\u0435). \u0415\u0441\u043b\u0438 \u043d\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e, \u0442\u043e \u2014 \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 Kubernetes \u0431\u043e\u043b\u0435\u0435 \u00ab\u043f\u0440\u0438\u0432\u0435\u0442\u043b\u0438\u0432\u00bb \u043a stateless-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c \u2014 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u0432\u043e\u0437\u0440\u043e\u0441\u0448\u0435\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0435 \u043d\u0430 \u0443\u0437\u043b\u0435 Kubernetes <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/administer-cluster\/out-of-resource\/\"><u>\u043d\u0430\u0447\u043d\u0435\u0442<\/u><\/a> \u0443\u0431\u0438\u0432\u0430\u0442\u044c pod\u2019\u044b \u0441 \u0440\u0435\u043f\u043b\u0438\u043a\u0430\u043c\u0438 Mongo \u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0435, \u043c\u0435\u043d\u0435\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u0432\u0434\u0432\u043e\u0439\u043d\u0435 \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043f\u043e \u0442\u043e\u0439 \u043f\u0440\u0438\u0447\u0438\u043d\u0435, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a pod \u0441 Mongo \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u043c \u0443\u0437\u043b\u0435, \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0439\u0442\u0438 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f. \u0412\u0441\u0451 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043b\u043e\u0445\u043e, \u0435\u0441\u043b\u0438 \u0443\u043f\u0430\u0432\u0448\u0430\u044f \u0440\u0435\u043f\u043b\u0438\u043a\u0430 \u0431\u044b\u043b\u0430 primary, \u0442.\u043a. \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043f\u0435\u0440\u0435\u0432\u044b\u0431\u043e\u0440\u0430\u043c: \u0432\u0441\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432\u0441\u0442\u0430\u043d\u0435\u0442, \u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043a \u044d\u0442\u043e\u043c\u0443 \u0433\u043e\u0442\u043e\u0432\u043e \u0438\/\u0438\u043b\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443: \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0432 Kubernetes \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0443\u0437\u043b\u044b \u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 Mongo \u043d\u0430 \u0443\u0437\u043b\u044b \u0441 \u0431<em>\u043e<\/em>\u043b\u044c\u0448\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438. \u041f\u043e\u0442\u043e\u043c\u0443 \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0431\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u043e <strong>podDisruptionBudget<\/strong>, \u0447\u0442\u043e \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c pod\u2019\u044b \u0440\u0430\u0437\u043e\u043c, \u0441\u0442\u0430\u0440\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044f \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0435\u043f\u043b\u0438\u043a \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u0420\u0435\u0448\u0438\u0432 \u044d\u0442\u0438 \u0432\u044b\u0437\u043e\u0432\u044b \u0434\u043b\u044f \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043b\u0443\u0447\u0430\u044f, \u0432\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u0438 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u0431\u0430\u0437\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043e\u0431\u0449\u0438\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438 Kubernetes. \u0412 \u043f\u043b\u0430\u043d\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u0441\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043b\u0438\u0448\u044c \u043e\u0442 \u0442\u043e\u0433\u043e, \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0431\u0430\u0437\u044b \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u2014 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043f\u0440\u0438 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043b\u044e\u0431\u043e\u0439 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0442\u0438\u043f \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 \u043d\u0430 \u0432\u0430\u0448 \u0432\u044b\u0431\u043e\u0440: \u043e\u0442 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0434\u0438\u0441\u043a\u043e\u0432 \u0434\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0441 \u0432\u043d\u0443\u0448\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0437\u0430\u043f\u0430\u0441\u043e\u043c \u043f\u043e iops. \u0414\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB \u043f\u043e\u0434\u043e\u0439\u0434\u0443\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0434\u0438\u0441\u043a\u0438, \u043d\u043e \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u043e\u043d\u0438 \u0432\u0441\u0451 \u0436\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u044e\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u043c. <a href=\"https:\/\/cloud.google.com\/compute\/docs\/disks\/#pdperformance\"><u>\u041f\u0440\u0438\u043c\u0435\u0440<\/u><\/a> \u0438\u0437 Google Cloud:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0410 \u0442\u0430\u043a\u0436\u0435 \u043e\u043d\u0438 \u043c\u043e\u0433\u0443\u0442 \u0437\u0430\u0432\u0438\u0441\u0435\u0442\u044c \u043e\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 AWS <a href=\"https:\/\/docs.aws.amazon.com\/AWSEC2\/latest\/UserGuide\/ebs-volume-types.html\"><u>\u043a\u0430\u0440\u0442\u0438\u043d\u0430<\/u><\/a> \u0447\u0443\u0442\u044c \u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u0432\u0441\u0451 \u0435\u0449\u0451 \u0434\u0430\u043b\u0435\u043a\u0430 \u043e\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0435\u0449\u0451 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f MongoDB: \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440\u044b.<\/p>\n<h2>\u041a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u043d\u044f\u0442\u044c MongoDB \u0432 Kubernetes?<\/h2>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 (\u0438 Mongo \u0437\u0434\u0435\u0441\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c) \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0441\u0430\u043c\u043e\u043f\u0438\u0441\u043d\u044b\u043c\u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u044f\u043c\u0438, \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u043e\u0432 \u0441\u043e StatefulSet \u0438 init-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c. \u041d\u043e \u0434\u0430\u043b\u0435\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u00ab\u0434\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u0437\u0430 \u043d\u0430\u0441\u00bb.<\/p>\n<h3>1. Helm-\u0447\u0430\u0440\u0442 \u043e\u0442 Bitnami<\/h3>\n<p>\u0418 \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u0430\u0435\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u2014 \u044d\u0442\u043e <a href=\"https:\/\/github.com\/bitnami\/charts\/tree\/master\/bitnami\/mongodb\"><u>Helm-\u0447\u0430\u0440\u0442 \u043e\u0442 Bitnami<\/u><\/a>. \u041e\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u0435\u043d, \u0441\u043e\u0437\u0434\u0430\u043d \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u0427\u0430\u0440\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c MongoDB \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438:<\/p>\n<ol>\n<li>\n<p>standalone;<\/p>\n<\/li>\n<li>\n<p>Replica Set <em>(\u0437\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u0440\u043c\u0438\u043d\u043e\u043b\u043e\u0433\u0438\u044f MongoDB; \u0435\u0441\u043b\u0438 \u0440\u0435\u0447\u044c \u043f\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u043e ReplicaSet \u0432 Kubernetes, \u043d\u0430 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u044f\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435)<\/em>;<\/p>\n<\/li>\n<li>\n<p>Replica Set + Arbiter.<\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 (\u0442.\u0435. \u043d\u0435\u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439) <a href=\"https:\/\/hub.docker.com\/r\/bitnami\/mongodb\"><u>\u043e\u0431\u0440\u0430\u0437<\/u><\/a>.<\/p>\n<p>\u0427\u0430\u0440\u0442 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d. \u041e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0441\u0442\u043e\u0440\u043e\u043d\u0430 \u043c\u0435\u0434\u0430\u043b\u0438: \u0438\u0437-\u0437\u0430 \u043e\u0431\u0438\u043b\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0432 \u043d\u0451\u043c \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u0438\u0434\u0435\u0442\u044c \u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0432\u0430\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0447\u0430\u0440\u0442\u0430 \u043e\u0447\u0435\u043d\u044c \u0441\u0438\u043b\u044c\u043d\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u0430\u043c\u043e\u043c\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u0430.<\/p>\n<p>\u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u043d\u044f\u0442\u0438\u044f, \u2014 \u044d\u0442\u043e:<\/p>\n<p>1. \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443 (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L58-L60\"><u>Values.yaml#L58-L60<\/u><\/a>). \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u044d\u0442\u043e <em>standalone<\/em>, \u043d\u043e \u043d\u0430\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 <em>replicaset<\/em>:<\/p>\n<pre><code class=\"json\">... architecture: replicaset ...<\/code><\/pre>\n<p>2. \u0423\u043a\u0430\u0437\u0430\u0442\u044c \u0442\u0438\u043f \u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L442-L463\"><u>Values.yaml#L442-L463<\/u><\/a>):<\/p>\n<pre><code class=\"json\">... persistence:   enabled: true   storageClass: \"gp2\" # \u0443 \u043d\u0430\u0441 \u044d\u0442\u043e general purpose 2 \u0438\u0437 AWS   accessModes:     - ReadWriteOnce   size: 120Gi ...<\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0447\u0435\u0440\u0435\u0437 <code>helm install<\/code> \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 MongoDB \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439, \u043a\u0430\u043a \u043a \u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0438\u0437 Kubernetes:<\/p>\n<pre><code class=\"bash\">NAME: mongobitnami LAST DEPLOYED: Fri Feb 26 09:00:04 2021 NAMESPACE: mongodb STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: ** Please be patient while the chart is being deployed **  MongoDB(R) can be accessed on the following DNS name(s) and ports from within your cluster:      mongobitnami-mongodb-0.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017     mongobitnami-mongodb-1.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017     mongobitnami-mongodb-2.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017  To get the root password run:      export MONGODB_ROOT_PASSWORD=$(kubectl get secret --namespace mongodb mongobitnami-mongodb -o jsonpath=\"{.data.mongodb-root-password}\" | base64 --decode)  To connect to your database, create a MongoDB(R) client container:      kubectl run --namespace mongodb mongobitnami-mongodb-client --rm --tty -i --restart='Never' --env=\"MONGODB_ROOT_PASSWORD=$MONGODB_ROOT_PASSWORD\" --image docker.io\/bitnami\/mongodb:4.4.4-debian-10-r0 --command -- bash  Then, run the following command:     mongo admin --host \"mongobitnami-mongodb-0.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017,mongobitnami-mongodb-1.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017,mongobitnami-mongodb-2.mongobitnami-mongodb-headless.mongodb.svc.cluster.local:27017\" --authenticationDatabase admin -u root -p $MONGODB_ROOT_PASSWORD<\/code><\/pre>\n<p>\u0412 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d \u0443\u0432\u0438\u0434\u0438\u043c \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0441 \u0430\u0440\u0431\u0438\u0442\u0440\u043e\u043c (\u043e\u043d <code>enabled<\/code> \u0432 \u0447\u0430\u0440\u0442\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e):<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u043e \u0442\u0430\u043a\u0430\u044f \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0433\u043b\u0430\u0432\u043d\u044b\u043c \u0432\u044b\u0437\u043e\u0432\u0430\u043c, \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0432\u0435\u0442\u0443\u044e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 \u043d\u0435\u0451 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>1. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c PDB (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d). \u041c\u044b \u043d\u0435 \u0445\u043e\u0442\u0438\u043c \u0442\u0435\u0440\u044f\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 drain\u2019\u0430 \u0443\u0437\u043b\u043e\u0432 \u2014 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442\u044c \u0441\u0435\u0431\u0435 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 1 \u0443\u0437\u043b\u0430 (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L430-L437\"><u>Values.yaml#L430-L437<\/u><\/a>):<\/p>\n<pre><code class=\"json\">... pdb:   create: true   maxUnavailable: 1 ...<\/code><\/pre>\n<p>2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c requests \u0438 limits (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L350-L360\"><u>Values.yaml#L350-L360<\/u><\/a>):<\/p>\n<pre><code class=\"json\">... resources:   limits:     memory: 8Gi   requests:      cpu: 4     memory: 4Gi ...<\/code><\/pre>\n<p>\u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0443 pod\u2019\u043e\u0432 \u0441 \u0431\u0430\u0437\u043e\u0439 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u0440\u0443\u0433\u0438\u0445 pod\u2019\u043e\u0432 (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L326\"><u>Values.yaml#L326<\/u><\/a>).<\/p>\n<p>3. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0447\u0430\u0440\u0442 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043d\u0435\u0436\u0435\u0441\u0442\u043a\u043e\u0435 anti-affinity \u0434\u043b\u044f pod\u2019\u043e\u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e scheduler \u0431\u0443\u0434\u0435\u0442 \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0430\u0442\u044c pod\u2019\u044b \u043d\u0430 \u043e\u0434\u043d\u0438 \u0438 \u0442\u0435 \u0436\u0435 \u0443\u0437\u043b\u044b, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442, \u0442\u043e \u043d\u0430\u0447\u043d\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0442\u0443\u0434\u0430, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u043c\u0435\u0441\u0442\u043e.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0437\u043b\u043e\u0432 \u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043d\u0438 \u0432 \u043a\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u0432\u044b\u043d\u043e\u0441\u0438\u0442\u044c \u0434\u0432\u0435 \u0440\u0435\u043f\u043b\u0438\u043a\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u043d\u0430 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0443\u0437\u0435\u043b (<a href=\"https:\/\/github.com\/bitnami\/charts\/blob\/master\/bitnami\/mongodb\/values.yaml#L270\"><u>Values.yaml#L270<\/u><\/a>):<\/p>\n<pre><code class=\"json\">... podAntiAffinityPreset: hard ...<\/code><\/pre>\n<p>\u0421\u0430\u043c \u0436\u0435 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0432 \u0447\u0430\u0440\u0442\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443:<\/p>\n<ol>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c StatefulSet \u0441 \u043d\u0443\u0436\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0440\u0435\u043f\u043b\u0438\u043a \u0438 \u0434\u0432\u0443\u043c\u044f init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438: <em>volume-permissions<\/em> \u0438 <em>auto-discovery<\/em>.<\/p>\n<\/li>\n<li>\n<p><em>Volume-permissions<\/em> \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0430\u0432\u0430 \u043d\u0430 \u043d\u0435\u0451.<\/p>\n<\/li>\n<li>\n<p><em>Auto-discovery<\/em> \u0436\u0434\u0451\u0442, \u043f\u043e\u043a\u0430 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u0438 \u043f\u0438\u0448\u0435\u0442 \u0438\u0445 \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 <code>shared_file<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e\u0447\u043a\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043c\u0435\u0436\u0434\u0443 init-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c \u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 \u043f\u043e\u0434\u043c\u0435\u043d\u043e\u0439 <code>command<\/code>, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0434\u043b\u044f entrypoint\u2019\u0430 \u0438 <code>run.sh<\/code>.<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f <code>entrypoint.sh<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0441\u043a\u0430\u0434 \u0438\u0437 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0434\u0440\u0443\u0433 \u0432 \u0434\u0440\u0443\u0433\u0430 Bash-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0441 \u0432\u044b\u0437\u043e\u0432\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432 \u043d\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0438\u0442\u043e\u0433\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f MongoDB \u0447\u0435\u0440\u0435\u0437 \u0442\u0430\u043a\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"bash\">      mongodb_initialize() {         local persisted=false          info \"Initializing MongoDB...\"          rm -f \"$MONGODB_PID_FILE\"         mongodb_copy_mounted_config         mongodb_set_net_conf         mongodb_set_log_conf         mongodb_set_storage_conf          if is_dir_empty \"$MONGODB_DATA_DIR\/db\"; then                 info \"Deploying MongoDB from scratch...\"                 ensure_dir_exists \"$MONGODB_DATA_DIR\/db\"                 am_i_root &amp;&amp; chown -R \"$MONGODB_DAEMON_USER\" \"$MONGODB_DATA_DIR\/db\"                  mongodb_start_bg                 mongodb_create_users                 if [[ -n \"$MONGODB_REPLICA_SET_MODE\" ]]; then                 if [[ -n \"$MONGODB_REPLICA_SET_KEY\" ]]; then                         mongodb_create_keyfile \"$MONGODB_REPLICA_SET_KEY\"                         mongodb_set_keyfile_conf                 fi                 mongodb_set_replicasetmode_conf                 mongodb_set_listen_all_conf                 mongodb_configure_replica_set                 fi                 mongodb_stop         else                 persisted=true                 mongodb_set_auth_conf                 info \"Deploying MongoDB with persisted data...\"                 if [[ -n \"$MONGODB_REPLICA_SET_MODE\" ]]; then                 if [[ -n \"$MONGODB_REPLICA_SET_KEY\" ]]; then                         mongodb_create_keyfile \"$MONGODB_REPLICA_SET_KEY\"                         mongodb_set_keyfile_conf                 fi                 if [[ \"$MONGODB_REPLICA_SET_MODE\" = \"dynamic\" ]]; then                         mongodb_ensure_dynamic_mode_consistency                 fi                 mongodb_set_replicasetmode_conf                 fi         fi         mongodb_set_auth_conf         }<\/code><\/pre>\n<h3>2. \u00ab\u0423\u0441\u0442\u0430\u0440\u0435\u0432\u0448\u0438\u0439\u00bb \u0447\u0430\u0440\u0442<\/h3>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0443\u0442\u044c \u0433\u043b\u0443\u0431\u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0435\u0449\u0435 \u0438 \u0441\u0442\u0430\u0440\u044b\u0439 <a href=\"https:\/\/github.com\/helm\/charts\/tree\/master\/stable\/mongodb-replicaset\"><u>\u0447\u0430\u0440\u0442 \u0432 \u0433\u043b\u0430\u0432\u043d\u043e\u043c \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0438 Helm<\/u><\/a>. \u041d\u044b\u043d\u0435 \u043e\u043d deprecated <em>(\u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u0432\u044b\u0445\u043e\u0434\u043e\u043c Helm 3 \u2014 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 \u0441\u043c. <\/em><\/p>\n<\/div>\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-320312","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320312","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=320312"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320312\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320312"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}