{"id":309554,"date":"2020-09-07T09:00:33","date_gmt":"2020-09-07T09:00:33","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=309554"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-09-07T09:00:33","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=309554","title":{"rendered":"\u041f\u0440\u043e\u0441\u0442\u043e\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 CRD \u0432 Kubernetes \u0438 \u043a\u0430\u043a \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/515138\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/co\/as\/gz\/coasgzodwwn17ewl6tf4g-f0nra.jpeg\"><\/div>\n<p><a href=\"https:\/\/www.deviantart.com\/maryanion\/art\/Space-766634367\"><i>Space by maryanion<\/i><\/a><\/p>\n<p>  <b>CRD (Custom Resource Definition)<\/b> \u2014 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 Kubernetes, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <a href=\"https:\/\/mcs.mail.ru\/\">Kubernetes aaS \u043e\u0442 Mail.ru<\/a> \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435, \u043a\u0430\u043a \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CRD<\/h2>\n<p>  CRD \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u00ab\u0424\u0440\u0443\u043a\u0442\u044b\u00bb, \u0432 \u043d\u0435\u0439 \u043c\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439: \u00ab\u044f\u0431\u043b\u043e\u043a\u043e\u00bb, \u00ab\u0431\u0430\u043d\u0430\u043d\u00bb, \u00ab\u0430\u043f\u0435\u043b\u044c\u0441\u0438\u043d\u00bb. \u0423 \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0435\u0441\u0442\u044c \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0441 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0430\u043c\u0438 \u0444\u0440\u0443\u043a\u0442\u043e\u0432, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u00ab\u0441\u043b\u0430\u0434\u043e\u0441\u0442\u044c\u00bb, \u00ab\u0432\u043a\u0443\u0441\u00bb \u0438 \u00ab\u0432\u0435\u0441\u00bb.<\/p>\n<p>  \u0422\u0430\u043a \u0432\u043e\u0442, CRD \u043f\u043e\u0445\u043e\u0436\u0430 \u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u00ab\u0424\u0440\u0443\u043a\u0442\u044b\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ru\/9j\/er\/ru9jersbz1svevwsoon6yinof1w.png\"><\/p>\n<p>  CR (Custom resource) \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u00ab\u044f\u0431\u043b\u043e\u043a\u043e\u00bb \u0438\u043b\u0438 \u00ab\u0431\u0430\u043d\u0430\u043d\u00bb. \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f CRD (\u0442\u0430\u0431\u043b\u0438\u0446\u044b), \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c CR (\u0437\u0430\u043f\u0438\u0441\u0438). <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/f8\/rz\/nv\/f8rznvyv9r3jq3qbjomt6widji8.png\"><\/p>\n<p>  CRD \u043d\u0443\u0436\u0435\u043d, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432\u0441\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u0445\u043e\u0442\u044f\u0442 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 Kubernetes. \u0424\u043e\u0440\u043c\u0430\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u043c, \u0430 CRD \u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 Kubernetes \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044f \u0438\u043c\u0435\u043d\u0430 \u0438 \u0442\u0438\u043f\u044b \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043a\u0430\u043a \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, IT-\u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u0445\u043e\u0447\u0435\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CRD \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u0441\u043f\u0438\u0441\u043e\u043a \u043e\u0442\u0434\u0435\u043b\u043e\u0432, \u0433\u0440\u0430\u0444\u0438\u043a \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043b\u0438 \u0447\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0435.<\/p>\n<h2>\u041a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c CRD<\/h2>\n<p>  \u041a\u0430\u043a \u0443\u0436\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c, CRD \u2014 \u044d\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430. \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0435\u0435 \u0444\u043e\u0440\u043c\u0430\u0442: \u0438\u043c\u0435\u043d\u0430 \u0438 \u0442\u0438\u043f\u044b \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432. \u0412 CRD \u044d\u0442\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 YAML \u0438\u043b\u0438 JSON. \u0422\u0430\u043a\u0436\u0435 CR \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445 YAML \u0438\u043b\u0438 JSON.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jw\/hq\/ef\/jwhqefknrb1oosqvouuqnsdb2ik.png\"><\/p>\n<p>  \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 CRD \u0438\u0437\u043d\u0443\u0442\u0440\u0438:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cm\/ee\/0o\/cmee0ojga1yggrkputdegchouh4.png\"><\/p>\n<p>  CRD \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0442\u0440\u0438 \u0447\u0430\u0441\u0442\u0438: \u043e\u0431\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c, \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430:<\/p>\n<ol>\n<li><b>\u041e\u0431\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c.<\/b> \u041a\u0430\u043a \u0438 \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445 Kubernetes, \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 CRD (<code>name: &quot;fruit-crd&quot;<\/code>), <code>apiVersion<\/code> \u0438 <code>kind<\/code>.<\/li>\n<li><b>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/b> \u0418\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b (<code>kind: &quot;fruit&quot;<\/code>), \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0441\u0442\u0440\u043e\u0447\u043d\u043e\u0435 \u0438\u043c\u044f \u0434\u043b\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 (<code>simpler: &quot;fruits&quot;<\/code>), \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e (<code>plural: &quot;fruits&quot;<\/code>)<\/li>\n<li><b>\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u0430.<\/b> \u0418\u043c\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u0430 (<code>&quot;sweetness&quot;<\/code>), \u0442\u0438\u043f \u0441\u0442\u043e\u043b\u0431\u0446\u0430 (<code>&quot;boolean&quot;, &quot;string&quot;, &quot;integer&quot;, &quot;object&quot;<\/code>), \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b (<code>\u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b: &lt;\u0438\u043c\u044f \u0434\u043e\u0447\u0435\u0440\u043d\u0435\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u044b&gt;<\/code>). \u041e\u043d\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0444\u043e\u0440\u043c\u0430\u0442\u0443 OpenAPISpecification, \u0432\u0435\u0440\u0441\u0438\u044f 3.<\/li>\n<\/ol>\n<p>  \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e CRD \u2014 <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/extend-kubernetes\/custom-resources\/custom-resource-definitions\/#create-a-customresourcedefinition\">\u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435<\/a>.<\/p>\n<h2>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b CRD<\/h2>\n<p>  \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 CRD \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430? \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c.<\/p>\n<p>  \u042f \u043d\u0435 \u0445\u043e\u0447\u0443 \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0430\u0442 CRD, \u0438 \u043c\u043d\u0435 \u043d\u0443\u0436\u0435\u043d \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043f\u0438\u0448\u0443 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0438 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u2014 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f CRD.<\/p>\n<p>  \u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435: \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043f\u0430\u0440\u044b \u0438\u043c\u0435\u043d \u0438 \u0442\u0438\u043f\u043e\u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hl\/wo\/kg\/hlwokgb7r9xw-ykqmybtqglz9q0.png\"><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e YML <a href=\"https:\/\/github.com\/onelittlenightmusic\/k8sasdb\">\u043c\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/a> \u0432 Kubernetes \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e CRD. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430, \u043d\u043e \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0439, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code class=\"bash\">kubectl apply -f https:\/\/raw.githubusercontent.com\/onelittlenightmusic\/k8sasdb\/master\/install.yaml <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u0447\u0442\u043e Pod \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f:<\/p>\n<pre><code class=\"bash\">kubectl get pod -n k8sasdb-system NAME                                         READY   STATUS    RESTARTS   AGE k8sasdb-controller-manager-9dbf54b4f-hzrt9   2\/2     Running   0          8s <\/code><\/pre>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 CR-\u0437\u0430\u043f\u0438\u0441\u0435\u0439 <a href=\"https:\/\/github.com\/onelittlenightmusic\/k8sasdb\/tree\/master\/test\">\u043e\u0442\u0441\u044e\u0434\u0430<\/a>.<\/p>\n<p>  \u0422\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 CRD. \u0421\u043b\u0435\u0432\u0430: \u043e\u0431\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u0441\u043f\u0440\u0430\u0432\u0430 \u2014 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/nf\/7d\/8p\/nf7d8po3itbzp5ua3zusa0awkpg.png\"><\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u044f \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 CR (YAML \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0444\u0440\u0443\u043a\u0442\u0430).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hl\/wo\/kg\/hlwokgb7r9xw-ykqmybtqglz9q0.png\"><br \/>  <i>\u041f\u0440\u0438\u043c\u0435\u0440 CR \u00ab\u0424\u0440\u0443\u043a\u0442\u00bb<\/i><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">kubectl create -f fruit.yaml <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/s_\/8v\/es\/s_8ves2z3umxkat_cid0jn-xw0c.png\"><\/p>\n<p>  \u0423\u0441\u043f\u0435\u0448\u043d\u043e: CRD \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 = \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ua\/0j\/hm\/ua0jhm8nwyv38uel6f2kauigj44.png\"><\/p>\n<p>  \u042d\u0442\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 SQL-\u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>CREATE TABLE fruits;<\/code>.<\/p>\n<h3>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">kubectl create -f apple.yaml <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jf\/v4\/d9\/jfv4d93loki4-hy4uavjhulaway.png\"><\/p>\n<p>  \u0423\u0441\u043f\u0435\u0448\u043d\u043e: CR \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 = \u0437\u0430\u043f\u0438\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0430. \u042d\u0442\u043e \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 SQL-\u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>INSERT INTO fruits values('apple', ...);<\/code>.<\/p>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0435\u0439<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">kubectl get fruits <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jw\/vr\/hw\/jwvrhwdh171o-afifhuotbdiyqm.png\"><\/p>\n<p>  \u0423\u0441\u043f\u0435\u0448\u043d\u043e: \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0435 CR \u0438 \u0432\u0441\u0435 \u0441\u0442\u043e\u043b\u0431\u0446\u044b \u0434\u043b\u044f \u043d\u0438\u0445. \u042d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442 SQL-\u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>SELECT * FROM fruits;<\/code>.<\/p>\n<h3>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">kubectl get fruit apple <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/fn\/os\/nu\/fnosnu0ajgkh0_a_cplnymzjhfk.png\"><\/p>\n<p>  \u0423\u0441\u043f\u0435\u0448\u043d\u043e. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00ab\u0431\u0430\u043d\u0430\u043d\u00bb. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 \u044d\u043a\u0432\u0438\u0432\u0430\u043b\u0435\u043d\u0442\u043d\u0430 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0443 <code>SELECT * FROM fruits WHERE name = 'apple';<\/code>.<\/p>\n<h3>\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u0438<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">kubectl delete fruit apple <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/hs\/1f\/wc\/hs1fwcvvxv5nll9mzf3lq-zgitq.png\"><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0441\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430 \u0444\u0440\u0443\u043a\u0442\u043e\u0432 \u043d\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u00abapple\u00bb.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xe\/hf\/fh\/xehffhg3jsusvuv0a5j3oxxtxwi.png\"><\/p>\n<p>  \u0423\u0441\u043f\u0435\u0448\u043d\u043e. \u0410\u043d\u0430\u043b\u043e\u0433 \u0432 SQL: <code>DELETE FROM fruits WHERE name = 'banana';<\/code>.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  CRD \u2014 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0432 Kubernetes. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 CRD \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 CR. \u0422\u0430\u043a\u0436\u0435 \u0432 CRD \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c \u0441\u0445\u0435\u043c\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438 \u0442\u0438\u043f\u044b \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432. \u041e\u0441\u0432\u043e\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u044b CRD, CR \u0438 kubectl, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0432 Kubernetes \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  \u041d\u0435 \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u044f\u0442\u044c\u0441\u044f: \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u043f\u043e\u043c\u043d\u0438\u0442\u0435 \u0444\u043e\u0440\u043c\u0430\u0442 CRD, \u0432\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440. \u041c\u043e\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 \u0441 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 <a href=\"https:\/\/github.com\/onelittlenightmusic\/k8sasdb\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<p>  \u0427\u0442\u043e \u0435\u0449\u0435 \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c:<\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/502828\/\">\u041a\u0430\u043a \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c kubectl: \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e<\/a>.<\/li>\n<li><a href=\"https:\/\/mcs.mail.ru\/blog\/tri-urovnya-avtomasshtabirovaniya-v-kubernetes-kak-ikh-effektivno-ispolzovat\">\u0422\u0440\u0438 \u0443\u0440\u043e\u0432\u043d\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 Kubernetes: \u043a\u0430\u043a \u0438\u0445 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c<\/a>.<\/li>\n<li><a href=\"https:\/\/tele.click\/k8s_mail\">\u041d\u0430\u0448 \u043a\u0430\u043d\u0430\u043b \u0412\u043e\u043a\u0440\u0443\u0433 Kubernetes \u0432 \u0422\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0435<\/a>.<\/li>\n<\/ol>\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\/mailru\/blog\/515138\/\"> https:\/\/habr.com\/ru\/company\/mailru\/blog\/515138\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/mailru\/blog\/515138\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/co\/as\/gz\/coasgzodwwn17ewl6tf4g-f0nra.jpeg\"><\/div>\n<p><a href=\"https:\/\/www.deviantart.com\/maryanion\/art\/Space-766634367\"><i>Space by maryanion<\/i><\/a><\/p>\n<p>  <b>CRD (Custom Resource Definition)<\/b> \u2014 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 \u0432 Kubernetes, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043d\u043e\u0441\u0438\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <a href=\"https:\/\/mcs.mail.ru\/\">Kubernetes aaS \u043e\u0442 Mail.ru<\/a> \u043f\u0435\u0440\u0435\u0432\u0435\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u0442\u0430\u043a\u043e\u0435, \u043a\u0430\u043a \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c.  <\/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-309554","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309554","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=309554"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/309554\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=309554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=309554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=309554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}