{"id":293112,"date":"2019-08-08T09:00:32","date_gmt":"2019-08-08T09:00:32","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=293112"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=293112","title":{"rendered":"\u0411\u0435\u0441\u043f\u0440\u043e\u0441\u0442\u043e\u0439\u043d\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f MongoDB \u0432 Kubernetes"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bs\/yp\/j2\/bsypj2ufj_cj0l5tjgzoxumac_e.png\"><\/p>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043d\u0430\u0448 <a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/450662\/\">\u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b<\/a> \u043f\u0440\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e RabbitMQ \u0438 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 MongoDB. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 Kubernetes \u0438 MongoDB, \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u044f. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043f\u0440\u0435\u0436\u043d\u0438\u0435: \u043f\u0435\u0440\u0435\u043d\u043e\u0441 MongoDB \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e\/\u0436\u0435\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Kubernetes \u0438\u043b\u0438 \u0436\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 MongoDB \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes (\u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d \u0432 \u0434\u0440\u0443\u0433\u043e\u0435).<a name=\"habracut\"><\/a><\/p>\n<p>  \u041d\u0430\u0448 \u0440\u0435\u0446\u0435\u043f\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442 \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 MongoDB (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437 3 \u0443\u0437\u043b\u043e\u0432 \u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u043b\u0438\u0431\u043e \u0443\u0436\u0435 \u0432 K8s, \u043b\u0438\u0431\u043e \u043d\u0430 \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445), \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0440\u0430\u0437\u043c\u0435\u0449\u0451\u043d\u043d\u043e\u0435 \u0432 Kubernetes:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/8d\/k8\/ny\/8dk8nyfnonyyonbrulniylesb6s.png\"><\/p>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432 \u043d\u043e\u0432\u044b\u0439 production \u0432 Kubernetes?<\/p>\n<h2>\u0422\u0435\u043e\u0440\u0438\u044f<\/h2>\n<p>  \u041e\u0431\u0449\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u0435\u043d \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c\u0443 \u0432 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441 RabbitMQ.<\/p>\n<p>  \u0412\u0430\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u0435\u0437\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u0447\u0442\u043e\u0431\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0441 MongoDB \u0438 Kubernetes \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438\u0441\u044c \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u0442\u0438. \u0423\u0437\u043b\u044b \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e IP \u0441\u0442\u0430\u0440\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 (\u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0435 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 MongoDB) \u0438 \u043f\u043e DNS-\u0438\u043c\u0435\u043d\u0430\u043c pod\u2019\u043e\u0432 \u0441 MongoDB \u0432 K8s. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430 \u0436\u0435\u043b\u0435\u0437\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 (\u0441\u043e \u0441\u0442\u0430\u0440\u044b\u043c\u0438 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044f\u043c\u0438) \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0434\u043e pod\u2019\u043e\u0432, \u0430 \u0437\u0430\u0442\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0438\u0445 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 DNS-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0435\u0433\u043e \u0432 Kubernetes (\u0438\u043b\u0438 \u0436\u0435 \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0432 <code>\/etc\/hosts<\/code>, \u0445\u043e\u0442\u044f \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043b\u0443\u0447\u0448\u0435 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c).<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0448\u0430\u0433 \u2014 \u043f\u043e\u0434\u043d\u044f\u0442\u044c \u043a\u043b\u0430\u0441\u0442\u0435\u0440 MongoDB \u0432 pod\u2019\u0430\u0445 Kubernetes. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0411\u0414 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 3 \u0443\u0437\u043b\u043e\u0432 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c pod\u2019\u0435 K8s \u2014 \u0432\u043f\u0440\u043e\u0447\u0435\u043c, \u0438\u0445 \u0447\u0438\u0441\u043b\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u0438\u043c. \u0412 ConfigMap\u2019\u0435 \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438: \u0442\u043e\u0433\u0434\u0430 \u0443\u0437\u043b\u044b MongoDB, \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0435\u0441\u044f \u0432 pod\u2019\u0430\u0445 \u0432 K8s, \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u043d\u0443\u0442 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043d\u0438\u043c.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u0432\u0441\u0435 pod\u2019\u044b \u043f\u043e\u0434\u043d\u0438\u043c\u0443\u0442\u0441\u044f, \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440 MongoDB \u0438\u0437 6 \u0443\u0437\u043b\u043e\u0432:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6b\/7s\/eu\/6b7seucfvwnqtdziyhuod0huiru.png\"><\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e pod\u2019\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u043b\u0433\u043e \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 pod \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438, \u0430 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u0430.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u043e\u0432\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 MongoDB:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nf\/_b\/cc\/nf_bcckhuh6ia3xgxzrzcozpmla.png\"><\/p>\n<p>  \u0418 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043b\u0438\u0448\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0435 \u0443\u0437\u043b\u044b \u0438\u0437 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0435\u0437\u0434 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u0432\u0435\u0440\u0448\u0451\u043d\u043d\u044b\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nn\/fm\/sq\/nnfmsqgo7zxio4avng2ubnzcm3w.png\"><\/p>\n<p>  \u0422\u0430\u043a\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u043c\u044b \u0447\u0430\u0441\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u0432 production \u0438 \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043c\u043e\u0434\u0443\u043b\u044f \u043a <a href=\"https:\/\/github.com\/flant\/addon-operator\">addon-operator<\/a> (\u044d\u0442\u0443 \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u043c\u044b <a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/449096\/\">\u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0430\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043b\u0438<\/a>), \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0442\u044c \u0442\u0438\u043f\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 MongoDB \u043f\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430\u043c. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0441\u0432\u043e\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u043c\u044b \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u0432 \u0441\u043a\u043e\u0440\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0430 \u043f\u043e\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u0438 \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f addon-operator.<\/p>\n<h2>\u041f\u0440\u043e\u0431\u0443\u0435\u043c \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/h2>\n<p>  <\/p>\n<h3>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>  \u0420\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b:<\/p>\n<ul>\n<li> \u041a\u043b\u0430\u0441\u0442\u0435\u0440 Kubernetes (\u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u0438 minikube);<\/li>\n<li> \u041a\u043b\u0430\u0441\u0442\u0435\u0440 MongoDB (\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043d\u0430 bare metal, \u0438 \u0441\u0434\u0435\u043b\u0430\u043d \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432 Kubernetes \u0438\u0437 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e Helm-\u0447\u0430\u0440\u0442\u0430).<\/li>\n<\/ul>\n<p>  \u0412 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u043c \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0441 MongoDB \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u0432\u0430\u043d <code>mongo-old<\/code> \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 \u0442\u043e\u043c \u0436\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 Kubernetes, \u0433\u0434\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0438 \u043d\u043e\u0432\u044b\u0439 (<code>mongo-new<\/code>).<\/p>\n<h3>\u0413\u043e\u0442\u043e\u0432\u0438\u043c \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440<\/h3>\n<p>  1. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u00ab\u0441\u0442\u0430\u0440\u044b\u0439\u00bb (\u0442.\u0435. \u043f\u043e\u0434\u043b\u0435\u0436\u0430\u0449\u0438\u0439 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438) \u043a\u043b\u0430\u0441\u0442\u0435\u0440 MongoDB \u043f\u0440\u044f\u043c\u043e \u0432 Kubernetes (\u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0438 \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 \u0432\u043d\u0435 K8s). \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0430\u0447\u0430\u0435\u043c Helm-\u0447\u0430\u0440\u0442:<\/p>\n<pre><code class=\"bash\">helm fetch --untar stable\/mongodb-replicaset<\/code><\/pre>\n<p>  \u2026 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e, \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0432 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"plaintext\">auth:   enabled: true   adminUser: mongo   adminPassword: pa33w0rd   # metricsUser: metrics   # metricsPassword: password   # key: keycontent   # existingKeySecret:   # existingAdminSecret:   # exisitingMetricsSecret:<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0432 <code>values.yaml<\/code> \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435.<\/p>\n<p>  2. \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0447\u0430\u0440\u0442:<\/p>\n<pre><code class=\"bash\">helm install . --name mongo-old --namespace mongo-old<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u0430\u044f \u00ab\u0441\u0442\u0430\u0440\u0430\u044f\u00bb \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044f MongoDB:<\/p>\n<pre><code class=\"bash\">kubectl --namespace=mongo-old get pods<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4r\/zz\/98\/4rzz98piyayem0kpw2jcdqrdb_q.png\"><\/p>\n<p>  \u0417\u0430\u0439\u0434\u0435\u043c \u0432 pod \u0441 \u0435\u0451 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443:<\/p>\n<pre><code class=\"bash\">kubectl --namespace=mongo-old exec -ti mongo-old-mongodb-replicaset-0 mongo use admin db.auth('mongo','password') use music db.artists.insert({ artistname: \"The Tea Party\" }) show dbs<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vn\/4d\/ld\/vn4dldit0pmgpb_3mz4hhbhhgjq.png\"><\/p>\n<p>  \u0417\u0430\u0445\u043e\u0434\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 pod&#8217;\u044b, \u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>mongo-old-mongodb-replicaset-0<\/code>. \u0412\u043f\u0440\u043e\u0447\u0435\u043c, \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 Helm-\u0447\u0430\u0440\u0442\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430, \u043a\u0430\u043a \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c <code>MASTER_POD<\/code>. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 (\u0434\u043b\u044f <code>mongo-old<\/code> \u0438\u0437 3 \u0443\u0437\u043b\u043e\u0432) \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"bash\">for ((i = 0; i &lt; 3; ++i)); do kubectl exec --namespace mongo-old mongo-old-mongodb-replicaset-$i -- sh -c 'mongo --eval=\"printjson(rs.isMaster())\"'; done<\/code><\/pre>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0442\u0430\u0440\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 MongoDB, \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0438\u0442\u044c\u0441\u044f, \u0433\u043e\u0442\u043e\u0432\u0430.<\/p>\n<h3>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0451\u043c \u043d\u043e\u0432\u0443\u044e \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044e MongoDB, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 Kubernetes \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0432 production.<\/p>\n<p>  <i><b>NB<\/b>: \u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u044f MongoDB, \u0447\u0442\u043e \u0438 \u0440\u0430\u043d\u044c\u0448\u0435. \u0412 \u0438\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u0442\u044c \u0440\u0438\u0441\u043a \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438.<\/i><\/p>\n<p>  \u041f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u043e\u043c (\u0433\u0434\u0435 \u043c\u044b \u0438\u043c\u0438\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u00ab\u0441\u0442\u0430\u0440\u0443\u044e\u00bb \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 MongoDB), \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u044b\u0439 Helm-\u0447\u0430\u0440\u0442 (\u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <code>helm fetch<\/code>) \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u0444\u0430\u0439\u043b <code>init\/on-start.sh<\/code>, \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043d\u0435\u0433\u043e \u043d\u0430 165 \u0441\u0442\u0440\u043e\u043a\u0435 \u0430\u0434\u0440\u0435\u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u0430, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435 (\u0438\u043b\u0438 \u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u0432\u0430\u043c \u043f\u043e \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 MongoDB \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445):<\/p>\n<pre><code class=\"bash\">peers='mongo-old-mongodb-replicaset-0.mongo-old-mongodb-replicaset.mongo-old.svc.cluster.local:27017'<\/code><\/pre>\n<p>  \u041c\u044b \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043d\u043e\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 MongoDB:<\/p>\n<pre><code class=\"bash\">helm install . --name mongo-new --namespace mongo-new<\/code><\/pre>\n<p>  \u0414\u043e\u0436\u0438\u0434\u0430\u0435\u043c\u0441\u044f, \u043f\u043e\u043a\u0430 \u0441\u0442\u0430\u0440\u0442\u0443\u044e\u0442 \u0432\u0441\u0435 pod\u2019\u044b (\u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043d\u043e\u0433\u043e, \u0442\u043e \u0438\u0445 \u0437\u0430\u043f\u0443\u0441\u043a \u043c\u043e\u0436\u0435\u0442 \u0434\u043b\u0438\u0442\u044c\u0441\u044f \u0447\u0430\u0441\u0430\u043c\u0438):<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ml\/nd\/qq\/mlndqqjwkem8wb2jaoqm2f-v9ca.png\"><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043b\u0430\u0435\u043c <code>exec<\/code> \u0432 \u043d\u043e\u0432\u044b\u0439 pod \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u0431\u0430\u0437:<\/p>\n<pre><code class=\"bash\">kubectl --namespace=mongo-new exec -ti mongo-new-mongodb-replicaset-0 mongo<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/np\/du\/rd\/npdurd5ummgmodiawop0bi2c4w8.png\"><\/p>\n<p>  \u0414\u0432\u0430 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u044b \u0432 \u043e\u0434\u0438\u043d, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 6 \u0443\u0437\u043b\u043e\u0432.<\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0443\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440, \u043d\u043e \u0434\u043b\u044f \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0448\u0430\u0433\u043e\u0432.<\/p>\n<p>  \u0418\u0437 \u0444\u0430\u0439\u043b\u0430 <code>init\/on-start.sh<\/code> \u0432 \u043d\u043e\u0432\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0443\u0431\u0438\u0440\u0430\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<pre><code class=\"bash\">peers='mongo-old-mongodb-replicaset-0.mongo-old-mongodb-replicaset.mongo-old.svc.cluster.local:27017'<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u0434\u0435\u043c \u0432 \u0441\u0442\u0430\u0440\u044b\u0439 \u043c\u0430\u0441\u0442\u0435\u0440 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 \u0438 \u00ab\u0441\u0432\u0435\u0440\u0433\u043d\u0435\u043c\u00bb \u0435\u0433\u043e \u2014 \u0442\u043e\u0433\u0434\u0430 \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0441\u0442\u0435\u0440. \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 pod \u0441 \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c MongoDB:<\/p>\n<pre><code class=\"bash\">kubectl --namespace=mongo-old exec -ti mongo-old-mongodb-replicaset-0 mongo use admin db.auth('mongo','password')<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b \u0443 \u0443\u0437\u043b\u043e\u0432 \u0438 \u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0430\u0441\u0442\u0435\u0440\u0430:<\/p>\n<pre><code class=\"bash\">cfg = rs.conf() cfg.members[5].priority = 2 rs.reconfig(cfg) rs.stepDown(120)<\/code><\/pre>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0438\u0439 \u0443\u0437\u0435\u043b \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b \u0431\u044b\u0442\u044c \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u2014 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0443\u0442 \u0432\u044b\u0431\u043e\u0440\u044b \u043d\u043e\u0432\u043e\u0433\u043e. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043f\u043e\u043c\u0435\u043d\u044f\u043b\u0438 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u044b, \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0441\u0442\u0430\u043d\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0443\u0437\u0435\u043b.<\/p>\n<p>  <i><b>NB<\/b>: \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0443 \u0432\u0441\u0435\u0445 \u0443\u0437\u043b\u043e\u0432 MongoDB \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0440\u0430\u0432\u0435\u043d 1. \u0412\u044b\u0448\u0435 \u043c\u044b \u043f\u043e\u0434\u043d\u0438\u043c\u0430\u0435\u043c \u0434\u043e 2 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u0443 \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c \u0443\u0437\u043b\u0430. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u0431\u0449\u0438\u043c \u043c\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0442\u043e\u0447\u043d\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u043b\u0435\u043d \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u044d\u0442\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u0432 MongoDB, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0432 <a href=\"https:\/\/docs.mongodb.com\/manual\/tutorial\/adjust-replica-set-member-priority\/\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>.<\/i><\/p>\n<p>  \u041e\u0442\u043a\u043b\u044e\u0447\u0438\u043c \u0441\u0442\u0430\u0440\u0443\u044e \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u044e MongoDB, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0437\u0430\u0439\u0434\u0435\u043c \u0432 \u043c\u0430\u0441\u0442\u0435\u0440 \u043d\u043e\u0432\u043e\u0439 \u0438 \u0443\u0434\u0430\u043b\u0438\u043c \u0441\u0442\u0430\u0440\u044b\u0435 \u0443\u0437\u043b\u044b:<\/p>\n<pre><code class=\"bash\">rs.remove(\"mongo-old-mongodb-replicaset-0.mongo-old-mongodb-replicaset.mongo-old.svc.cluster.local:27017\") rs.remove(\"mongo-old-mongodb-replicaset-1.mongo-old-mongodb-replicaset.mongo-old.svc.cluster.local:27017\") rs.remove(\"mongo-old-mongodb-replicaset-2.mongo-old-mongodb-replicaset.mongo-old.svc.cluster.local:27017\")<\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430\u043a\u043e\u043d\u0447\u0435\u043d\u043d\u043e\u0439: \u043c\u044b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u043b\u0438\u0441\u044c \u0441\u043e \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 MongoDB \u043d\u0430 \u043d\u043e\u0432\u044b\u0439!<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u043d\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 MongoDB \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0435\u0445\u0430\u0442\u044c \u0432 \u043d\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440.<\/p>\n<p>  \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043d\u044e\u0430\u043d\u0441 \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u0435 \u2014 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0430 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043d\u043e\u0432\u044b\u0445 pod&#8217;\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u0441\u0442\u0430\u0440\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 MongoDB, \u0435\u0441\u043b\u0438 \u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0435 K8s, \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0438\u0445 \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0432 DNS (\u0438\u043b\u0438 <code>\/etc\/hosts<\/code>). \u0412 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u0438 \u0448\u0430\u0433\u0438 \u043d\u0435 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0438\u0441\u044c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u043b\u0430 \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430\u043c\u0438 \u0438\u043c\u0451\u043d \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 Kubernetes-\u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430.<\/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> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/450662\/\">\u0411\u0435\u0441\u043f\u0440\u043e\u0441\u0442\u043e\u0439\u043d\u0430\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044f RabbitMQ \u0432 Kubernetes<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/431500\/\">\u0411\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 Kubernetes (\u043e\u0431\u0437\u043e\u0440 \u0438 \u0432\u0438\u0434\u0435\u043e \u0434\u043e\u043a\u043b\u0430\u0434\u0430)<\/a>\u00bb;<\/li>\n<li> \u00ab<a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/417509\/\">K8s tips &amp; tricks: \u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c bootstrap \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445<\/a>\u00bb.<\/li>\n<\/ul>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/461149\/\"> https:\/\/habr.com\/ru\/company\/flant\/blog\/461149\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/bs\/yp\/j2\/bsypj2ufj_cj0l5tjgzoxumac_e.png\"><\/p>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u043d\u0430\u0448 <a href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/450662\/\">\u043d\u0435\u0434\u0430\u0432\u043d\u0438\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b<\/a> \u043f\u0440\u043e \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u044e RabbitMQ \u0438 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 MongoDB. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0435\u043c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432 Kubernetes \u0438 MongoDB, \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u0438\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0430\u043b\u043b\u044f\u0446\u0438\u0438 \u0432 \u0434\u0440\u0443\u0433\u0443\u044e \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0435\u0437 \u043f\u0440\u043e\u0441\u0442\u043e\u044f. \u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438 \u043f\u0440\u0435\u0436\u043d\u0438\u0435: \u043f\u0435\u0440\u0435\u043d\u043e\u0441 MongoDB \u0438\u0437 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e\/\u0436\u0435\u043b\u0435\u0437\u043d\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432 Kubernetes \u0438\u043b\u0438 \u0436\u0435 \u043f\u0435\u0440\u0435\u043d\u043e\u0441 MongoDB \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 Kubernetes (\u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d \u0432 \u0434\u0440\u0443\u0433\u043e\u0435).<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-293112","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293112","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=293112"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/293112\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=293112"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=293112"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=293112"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}