{"id":352847,"date":"2024-05-20T22:16:27","date_gmt":"2024-05-20T22:16:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=352847"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=352847","title":{"rendered":"<span>\u041a\u0430\u043a \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0434\u0435\u043d\u044c\u0433\u0438 \u043d\u0430 Interzone Egress. Part 1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u043a\u043e\u043b\u043b\u0435\u0433\u0438! <\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u043a\u0438\u043d \u041d\u0438\u043a\u043e\u043b\u0430\u0439 \u0438 \u044d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0441\u0442. \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0442\u0440\u0443\u0436\u0443\u0441\u044c \u0432 \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u0438 DevOps Engineer \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Altenar. \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043e \u0442\u043e\u043c , \u043a\u0430\u043a \u044f \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043b \u0434\u0435\u043d\u0435\u0433 \u0441\u0432\u043e\u0435\u043c\u0443 \u043b\u044e\u0431\u0438\u043c\u043e\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u043e\u0434\u0430\u0442\u0435\u043b\u044e. <\/p>\n<h3>\u041d\u0430 \u0447\u0442\u043e \u043c\u044b \u0442\u0440\u0430\u0442\u0438\u043c 3k$ \u0432 \u043c\u0435\u0441\u044f\u0446 ?  <\/h3>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/052\/88e\/727\/05288e72710bc1e957a743a0b2ebd4c8.png\" width=\"1011\" height=\"312\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/052\/88e\/727\/05288e72710bc1e957a743a0b2ebd4c8.png\"\/><\/figure>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u0443\u0441\u043b\u0443\u0433\u0438 GCP \u043c\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 , \u0447\u0442\u043e \u043f\u043b\u0430\u0442\u0438\u043c 3k$ \u043d\u0430 Inter Zone Egress. \u041a\u0430\u043a \u0443 \u043b\u044e\u0431\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438 \u0431\u0435\u0440\u0435\u0436\u043b\u0438\u0432\u044b\u0445 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e 2 \u0432\u043e\u043f\u0440\u043e\u0441\u0430:<\/p>\n<ol>\n<li>\n<p>\u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Inter Zone Egress ?  <\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u043d\u0430\u043c \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ? <\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u0430\u0448 \u043f\u043e\u043a\u043e\u0440\u043d\u044b\u0439 \u0441\u043b\u0443\u0433\u0430 \u0432\u0437\u044f\u043b \u043d\u0430 \u0441\u0435\u0431\u044f \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p><a href=\"https:\/\/cloud.google.com\/vpc\/network-pricing\" rel=\"noopener noreferrer nofollow\"><u>\u0413\u0443\u0433\u043b\u043e\u0432\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/u><\/a> \u043d\u0430\u043c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 , \u0447\u0442\u043e \u044d\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 VM (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 k8s) , \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0430\u0444\u0438\u043a\u0430\u00a0 &#8212; \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043d\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d70\/832\/727\/d7083272722bf2fdd93aed093adc3aad.png\" width=\"1073\" height=\"660\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d70\/832\/727\/d7083272722bf2fdd93aed093adc3aad.png\"\/><\/figure>\n<p>\u0418\u0442\u043e\u0433\u043e:\u00a0 \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 , \u0447\u0442\u043e \u0437\u0430 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0432 \u0433\u0443\u0433\u043b\u0435 \u043d\u0430\u0434\u043e \u043f\u043b\u0430\u0442\u0438\u0442\u044c, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0433\u043e\u043c\u043e\u043d\u0438\u0442\u044c \u0438\u0445.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e<a href=\"https:\/\/cloud.google.com\/vpc\/docs\/using-flow-logs#enabling-vpc-flow-logs\" rel=\"noopener noreferrer nofollow\"> <u>\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c VPC \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/u><\/a> \u0432 \u0433\u0443\u0433\u043b\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0441\u0435\u0442\u0435\u0439. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0439\u0442\u0438 \u0432 Log Explorer \u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c logName:(&#171;projects\/your-project\/logs\/compute.googleapis.com%2Fvpc_flows&#187;).<\/p>\n<p>\u0412 \u043b\u043e\u0433\u0430\u0445 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7ee\/069\/95d\/7ee06995d31419cb813065bc18b9f942.png\" width=\"381\" height=\"245\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7ee\/069\/95d\/7ee06995d31419cb813065bc18b9f942.png\"\/><\/figure>\n<p>\u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f Egress , \u0442. \u0435. \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 ?\u00a0 \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0434\u0435\u0442 jsonPayload.reporter:  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e1a\/0f0\/040\/e1a0f0040a54726ee9150a1417292423.png\" width=\"1040\" height=\"489\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e1a\/0f0\/040\/e1a0f0040a54726ee9150a1417292423.png\"\/><\/figure>\n<p>\u041e\u043d \u0438\u043c\u0435\u0435\u0442 2 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u00abDEST\u00bb \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0438\u00a0 SRC \u0434\u043b\u044f \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0441\u044c Egress \u0442\u0440\u0430\u0444\u0438\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/468\/8ed\/d1b\/4688edd1b5a55994c9c6fafb5e75e471.png\" width=\"1045\" height=\"480\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/468\/8ed\/d1b\/4688edd1b5a55994c9c6fafb5e75e471.png\"\/><\/figure>\n<p><code>logName:(\"projects\/yourproject\/logs\/compute.googleapis.com%2Fvpc_flows\")\u00a0 AND\u00a0 jsonPayload.reporter = SRC<\/code><\/p>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u043e\u0441\u044c \u0432 2 \u0440\u0430\u0437\u0430 \u0438 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u044b \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0443\u0442\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c jsonPayload , \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043c\u043d\u044b\u0435 \u0433\u0443\u0433\u043b\u043e\u0432\u044b\u0435 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u043b\u0438 \u0442\u0443\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u0443 , \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u0435\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0442\u0440\u0430\u0444\u0438\u043a ?<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/7f1\/df1\/cf9\/7f1df1cf9369019e6e1f091090541e9d.png\" width=\"624\" height=\"585\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7f1\/df1\/cf9\/7f1df1cf9369019e6e1f091090541e9d.png\"\/><\/figure>\n<p>\u0418 \u0441\u043b\u0430\u0432\u0430 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0439 \u043c\u044b\u0441\u043b\u0438 \u2014 \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 dest_instance \u0438 src_instance \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435 \u043f\u0430\u043a\u0435\u0442\u0430, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 , \u0432 \u043a\u0430\u043a\u0438\u0445 \u0437\u043e\u043d\u0430\u0445 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f. \u041d\u0430\u0448 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u043e\u043d\u0430\u043c\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0423\u0432\u044b \u0434\u0432\u0438\u0436\u043e\u043a Log Explorer \u043d\u0435 \u0441\u043c\u043e\u0433 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u043c\u043e\u0438\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u043c \u043a \u0444\u043e\u0440\u043c\u0430\u0442\u0443 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.\u00a0 \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043e\u0431\u044a\u0435\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Log Analytics. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043b\u043e\u0433\u0430 \u0432 \u044d\u0442\u043e\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Log Analytics \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0434\u043b\u044f Log Bucket \u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u2014 \u044f<a href=\"https:\/\/cloud.google.com\/logging\/docs\/buckets#create_bucket\" rel=\"noopener noreferrer nofollow\"> <u>\u0441\u043e\u0437\u0434\u0430\u043b \u043d\u043e\u0432\u044b\u0439 Log Bucket<\/u><\/a><u> <\/u>\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u043d\u0430 \u043d\u0435\u0433\u043e<a href=\"https:\/\/cloud.google.com\/logging\/docs\/buckets#writing\" rel=\"noopener noreferrer nofollow\"> <u>SINK<\/u><\/a> \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0430.  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e8a\/83a\/280\/e8a83a2803f0e4180d0451b4d3119151.png\" width=\"1155\" height=\"242\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e8a\/83a\/280\/e8a83a2803f0e4180d0451b4d3119151.png\"\/><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e Log Analytics \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0430\u043a\u0435\u0442\u0430 \u0438 \u0436\u0434\u0435\u043c \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041d\u0443 \u0438 \u0441\u0430\u043c\u044b\u0439 \u0432\u043a\u0443\u0441\u043d\u044b\u0439 \u044d\u0442\u0430\u043f &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 sql \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a\u043e\u0439 \u0436\u0435 \u043e\u0431\u044a\u0435\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0442\u043a\u0443\u0434\u0430 \u0438 \u043a\u0443\u0434\u0430 ?<\/p>\n<p>\u041c\u0435\u043d\u044f \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430 \u0441\u0443\u043c\u043c\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 (json_payload.bytes_sent) , \u043f\u043e\u0434 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\/\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f (json_payload.src_gke_details.pod.pod_name)\/(json_payload.dest_instance.zone) , \u0437\u043e\u043d\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\/\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f (json_payload.src_instance.zone)\/(json_payload.dest_instance.zone) \u0438 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u2014 Egress Traffic ((json_payload.reporter) = &#171;SRC&#187;) \u0438 \u0447\u0442\u043e \u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043e\u043d\u044b.<\/p>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0432 \u044d\u0442\u0438 \u0432\u0432\u043e\u0434\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0437\u043c\u0443 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<p><code>SELECT<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0sum(cast(JSON_VALUE(json_payload.bytes_sent) as int)) \/ 1024\/1024\/1024 as Gb, JSON_VALUE(json_payload.dest_gke_details.pod.pod_name) as dest_pod , JSON_VALUE(json_payload.dest_instance.zone) as dest_zone ,JSON_VALUE(json_payload.src_gke_details.pod.pod_name) as src_pod, JSON_VALUE(json_payload.src_instance.zone) as src_zone<\/code><\/p>\n<p><code>FROM<\/code><\/p>\n<p><code>\u00a0\u00a0`yourproject.global.VPC-logs._AllLogs`<\/code><\/p>\n<p><code>WHERE<\/code><\/p>\n<p><code>\u00a0JSON_VALUE(json_payload.src_instance.zone) &lt;> JSON_VALUE(json_payload.dest_instance.zone)<\/code><\/p>\n<p><code>\u00a0\u00a0AND JSON_VALUE(json_payload.reporter) = \"SRC\"<\/code><\/p>\n<p><code>\u00a0\u00a0AND\u00a0 timestamp > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 24 HOUR)<\/code><\/p>\n<p><code>group by dest_pod, src_pod, dest_zone, src_zone<\/code><\/p>\n<p><code>orderby Gb desc<\/code><\/p>\n<p>\u0438 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:  <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8a8\/ad4\/d37\/8a8ad4d37670bc852d508ef0432f4a3c.png\" width=\"1308\" height=\"179\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8a8\/ad4\/d37\/8a8ad4d37670bc852d508ef0432f4a3c.png\"\/><\/figure>\n<p>\u0422.\u0435. \u043f\u043e\u0434\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0445\u043e\u0434\u044f\u0442 \u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0411\u0414 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u0437\u043e\u043d\u044b , \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u0444\u0438\u043a\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/277\/6b4\/ee3\/2776b4ee34dc3067e11649e54102350b.png\" width=\"1093\" height=\"373\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/277\/6b4\/ee3\/2776b4ee34dc3067e11649e54102350b.png\"\/><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e, \u0434\u0430\u043b\u0435\u0435 \u043e\u0431\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0411\u0414 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0437\u043e\u043d\u0435 , \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0430 \u0437\u0430\u0442\u0440\u0430\u0432\u043a\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 Inter Zone Egress \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0442\u0440\u0435\u0445\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/dfa\/796\/869\/dfa796869aedd1a7962a11eff40df737.png\" width=\"1183\" height=\"286\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/dfa\/796\/869\/dfa796869aedd1a7962a11eff40df737.png\"\/><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/756170\/\"> https:\/\/habr.com\/ru\/articles\/756170\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0443\u0432\u0430\u0436\u0430\u0435\u043c\u044b\u0435 \u043a\u043e\u043b\u043b\u0435\u0433\u0438! <\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0410\u043d\u043a\u0438\u043d \u041d\u0438\u043a\u043e\u043b\u0430\u0439 \u0438 \u044d\u0442\u043e \u043c\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u043e\u0441\u0442. \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u0442\u0440\u0443\u0436\u0443\u0441\u044c \u0432 \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u0438 DevOps Engineer \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 Altenar. \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u043e \u0442\u043e\u043c , \u043a\u0430\u043a \u044f \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u043b \u0434\u0435\u043d\u0435\u0433 \u0441\u0432\u043e\u0435\u043c\u0443 \u043b\u044e\u0431\u0438\u043c\u043e\u043c\u0443 \u0440\u0430\u0431\u043e\u0442\u043e\u0434\u0430\u0442\u0435\u043b\u044e. <\/p>\n<h3>\u041d\u0430 \u0447\u0442\u043e \u043c\u044b \u0442\u0440\u0430\u0442\u0438\u043c 3k$ \u0432 \u043c\u0435\u0441\u044f\u0446 ?  <\/h3>\n<figure class=\"full-width\"><\/figure>\n<p>\u0412\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u0437\u0430\u0442\u0440\u0430\u0442 \u043d\u0430 \u0443\u0441\u043b\u0443\u0433\u0438 GCP \u043c\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 , \u0447\u0442\u043e \u043f\u043b\u0430\u0442\u0438\u043c 3k$ \u043d\u0430 Inter Zone Egress. \u041a\u0430\u043a \u0443 \u043b\u044e\u0431\u043e\u0437\u043d\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0438 \u0431\u0435\u0440\u0435\u0436\u043b\u0438\u0432\u044b\u0445 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043e\u0432 \u0443 \u043d\u0430\u0441 \u0432\u043e\u0437\u043d\u0438\u043a\u043b\u043e 2 \u0432\u043e\u043f\u0440\u043e\u0441\u0430:<\/p>\n<ol>\n<li>\n<p>\u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 Inter Zone Egress ?  <\/p>\n<\/li>\n<li>\n<p>\u043a\u0430\u043a \u043d\u0430\u043c \u043c\u0438\u043d\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ? <\/p>\n<\/li>\n<\/ol>\n<p>\u0412\u0430\u0448 \u043f\u043e\u043a\u043e\u0440\u043d\u044b\u0439 \u0441\u043b\u0443\u0433\u0430 \u0432\u0437\u044f\u043b \u043d\u0430 \u0441\u0435\u0431\u044f \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430.<\/p>\n<p><a href=\"https:\/\/cloud.google.com\/vpc\/network-pricing\" rel=\"noopener noreferrer nofollow\"><u>\u0413\u0443\u0433\u043b\u043e\u0432\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f<\/u><\/a> \u043d\u0430\u043c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 , \u0447\u0442\u043e \u044d\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 VM (\u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 k8s) , \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u0442\u0440\u0430\u0444\u0438\u043a\u0430\u00a0 &#8212; \u043e\u043d \u0438\u043c\u0435\u0435\u0442 \u0440\u0430\u0437\u043d\u0443\u044e \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418\u0442\u043e\u0433\u043e:\u00a0 \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438 , \u0447\u0442\u043e \u0437\u0430 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0432 \u0433\u0443\u0433\u043b\u0435 \u043d\u0430\u0434\u043e \u043f\u043b\u0430\u0442\u0438\u0442\u044c, \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u0438 \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0443\u0433\u043e\u043c\u043e\u043d\u0438\u0442\u044c \u0438\u0445.<\/p>\n<p>\u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e<a href=\"https:\/\/cloud.google.com\/vpc\/docs\/using-flow-logs#enabling-vpc-flow-logs\" rel=\"noopener noreferrer nofollow\"> <u>\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c VPC \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/u><\/a> \u0432 \u0433\u0443\u0433\u043b\u0435 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0441\u0435\u0442\u0435\u0439. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0439\u0442\u0438 \u0432 Log Explorer \u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u0442\u044c logName:(&#171;projects\/your-project\/logs\/compute.googleapis.com%2Fvpc_flows&#187;).<\/p>\n<p>\u0412 \u043b\u043e\u0433\u0430\u0445 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u041a\u0430\u043a \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437 \u043d\u0438\u0445 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f Egress , \u0442. \u0435. \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u043c\u0438 ?\u00a0 \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0434\u0435\u0442 jsonPayload.reporter:  <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041e\u043d \u0438\u043c\u0435\u0435\u0442 2 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u00abDEST\u00bb \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0438\u00a0 SRC \u0434\u043b\u044f \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0435\u0441\u044c Egress \u0442\u0440\u0430\u0444\u0438\u043a:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p><code>logName:(\"projects\/yourproject\/logs\/compute.googleapis.com%2Fvpc_flows\")\u00a0 AND\u00a0 jsonPayload.reporter = SRC<\/code><\/p>\n<p>\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u043e\u0441\u044c \u0432 2 \u0440\u0430\u0437\u0430 \u0438 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u044b \u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043f\u0443\u0442\u0438.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u0441\u0442\u043e\u0438\u0442 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c jsonPayload , \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0443\u043c\u043d\u044b\u0435 \u0433\u0443\u0433\u043b\u043e\u0432\u044b\u0435 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u044b \u043f\u0440\u0438\u043a\u0440\u0443\u0442\u0438\u043b\u0438 \u0442\u0443\u0434\u0430 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0438\u043d\u0444\u0443 , \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u0435\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448 \u0442\u0440\u0430\u0444\u0438\u043a ?<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0418 \u0441\u043b\u0430\u0432\u0430 \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0439 \u043c\u044b\u0441\u043b\u0438 \u2014 \u0432 \u0431\u043b\u043e\u043a\u0430\u0445 dest_instance \u0438 src_instance \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u0435 \u043f\u0430\u043a\u0435\u0442\u0430, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 , \u0432 \u043a\u0430\u043a\u0438\u0445 \u0437\u043e\u043d\u0430\u0445 \u043e\u043d\u0438 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f. \u041d\u0430\u0448 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u0430\u043a \u0440\u0430\u0437 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0442\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u043e\u043d\u0430\u043c\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442. \u0423\u0432\u044b \u0434\u0432\u0438\u0436\u043e\u043a Log Explorer \u043d\u0435 \u0441\u043c\u043e\u0433 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u044c \u043c\u043e\u0438\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044f\u043c \u043a \u0444\u043e\u0440\u043c\u0430\u0442\u0443 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.\u00a0 \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u0435\u0434\u043c\u0435\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0438 \u043e\u0431\u044a\u0435\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b Log Analytics. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043b\u043e\u0433\u0430 \u0432 \u044d\u0442\u043e\u0442 \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Log Analytics \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0434\u043b\u044f Log Bucket \u0438 \u0443 \u043c\u0435\u043d\u044f \u043d\u0435 \u0431\u044b\u043b\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u2014 \u044f<a href=\"https:\/\/cloud.google.com\/logging\/docs\/buckets#create_bucket\" rel=\"noopener noreferrer nofollow\"> <u>\u0441\u043e\u0437\u0434\u0430\u043b \u043d\u043e\u0432\u044b\u0439 Log Bucket<\/u><\/a><u> <\/u>\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b \u043d\u0430 \u043d\u0435\u0433\u043e<a href=\"https:\/\/cloud.google.com\/logging\/docs\/buckets#writing\" rel=\"noopener noreferrer nofollow\"> <u>SINK<\/u><\/a> \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043b\u043e\u0433\u0430.  <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e Log Analytics \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0431\u0430\u043a\u0435\u0442\u0430 \u0438 \u0436\u0434\u0435\u043c \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041d\u0443 \u0438 \u0441\u0430\u043c\u044b\u0439 \u0432\u043a\u0443\u0441\u043d\u044b\u0439 \u044d\u0442\u0430\u043f &#8212; \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 sql \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u0430\u043a\u043e\u0439 \u0436\u0435 \u043e\u0431\u044a\u0435\u043c \u0442\u0440\u0430\u0444\u0438\u043a\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0442\u043a\u0443\u0434\u0430 \u0438 \u043a\u0443\u0434\u0430 ?<\/p>\n<p>\u041c\u0435\u043d\u044f \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430 \u0441\u0443\u043c\u043c\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0440\u0430\u0444\u0438\u043a\u0430 (json_payload.bytes_sent) , \u043f\u043e\u0434 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\/\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f (json_payload.src_gke_details.pod.pod_name)\/(json_payload.dest_instance.zone) , \u0437\u043e\u043d\u0430 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\/\u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f (json_payload.src_instance.zone)\/(json_payload.dest_instance.zone) \u0438 \u0433\u043b\u0430\u0432\u043d\u044b\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0432\u044b\u0431\u043e\u0440\u043a\u0438 \u2014 Egress Traffic ((json_payload.reporter) = &#171;SRC&#187;) \u0438 \u0447\u0442\u043e \u0443 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0435 \u0437\u043e\u043d\u044b.<\/p>\n<p>\u041f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0432 \u044d\u0442\u0438 \u0432\u0432\u043e\u0434\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u0437\u043c\u0443 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441:<\/p>\n<p><code>SELECT<\/code><\/p>\n<p><code>\u00a0\u00a0\u00a0sum(cast(JSON_VALUE(json_payload.bytes_sent) as int)) \/ 1024\/1024\/1024 as Gb, JSON_VALUE(json_payload.dest_gke_details.pod.pod_name) as dest_pod , JSON_VALUE(json_payload.dest_instance.zone) as dest_zone ,JSON_VALUE(json_payload.src_gke_details.pod.pod_name) as src_pod, JSON_VALUE(json_payload.src_instance.zone) as src_zone<\/code><\/p>\n<p><code>FROM<\/code><\/p>\n<p><code>\u00a0\u00a0`yourproject.global.VPC-logs._AllLogs`<\/code><\/p>\n<p><code>WHERE<\/code><\/p>\n<p><code>\u00a0JSON_VALUE(json_payload.src_instance.zone) &lt;> JSON_VALUE(json_payload.dest_instance.zone)<\/code><\/p>\n<p><code>\u00a0\u00a0AND JSON_VALUE(json_payload.reporter) = \"SRC\"<\/code><\/p>\n<p><code>\u00a0\u00a0AND\u00a0 timestamp > TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 24 HOUR)<\/code><\/p>\n<p><code>group by dest_pod, src_pod, dest_zone, src_zone<\/code><\/p>\n<p><code>orderby Gb desc<\/code><\/p>\n<p>\u0438 \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434:  <\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422.\u0435. \u043f\u043e\u0434\u044b \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0445\u043e\u0434\u044f\u0442 \u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0411\u0414 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0439 \u0437\u043e\u043d\u044b , \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0440\u043e\u0433\u043e\u0439 \u0442\u0440\u0430\u0444\u0438\u043a.<\/p>\n<p>\u0414\u043b\u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0445\u0435\u043c\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0430\u0444\u0438\u043a\u0430:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u043e, \u0434\u0430\u043b\u0435\u0435 \u043e\u0431\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u0411\u0414 \u0432 \u0441\u0432\u043e\u0435\u0439 \u0437\u043e\u043d\u0435 , \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438.<\/p>\n<p>\u041d\u0430 \u0437\u0430\u0442\u0440\u0430\u0432\u043a\u0443 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0440\u0430\u0441\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 Inter Zone Egress \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u0442\u0440\u0435\u0445\u043c\u0435\u0441\u044f\u0447\u043d\u043e\u0439 \u043f\u0435\u0440\u0441\u043f\u0435\u043a\u0442\u0438\u0432\u0435:<\/p>\n<figure class=\"full-width\"><\/figure>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/756170\/\"> https:\/\/habr.com\/ru\/articles\/756170\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-352847","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352847","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=352847"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/352847\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=352847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=352847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=352847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}