{"id":17748,"date":"2022-07-24T15:29:04","date_gmt":"2022-07-24T06:29:04","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=17748"},"modified":"2023-05-27T21:10:10","modified_gmt":"2023-05-27T12:10:10","slug":"%e3%80%90kubernetes%e3%80%91%e3%80%8cnamespace%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=17748","title":{"rendered":"\u3010Kubernetes\u3011\u300cNamespace\u300d\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>Namespace\u3068\u306f\uff1f<\/h2>\n<p>\u540c\u4e00\u306e\u7269\u7406\u30af\u30e9\u30b9\u30bf\u30fc\u4e0a\u3067\u8907\u6570\u306e\u4eee\u60f3\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u52d5\u4f5c\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002(\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u5206\u96e2\u3057\u3066\u8907\u6570\u306e\u30e6\u30fc\u30b6\u30fc\u3067\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u5206\u5272\u3059\u308b\u624b\u6cd5\u3068\u3082\u8a00\u3048\u307e\u3059\u3002)<\/p>\n<h3>\u4eee\u60f3\u30af\u30e9\u30b9\u30bf\u30fc\u3068\u306f\uff1f<\/h3>\n<p>\u5b9f\u969b\u306b\u306f\u540c\u3058\u30de\u30b7\u30f3\u4e0a\u3067\u52d5\u3044\u3066\u3044\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u304c\u3001\u4eee\u60f3\u7684\u306b\u74b0\u5883\u304c\u5206\u3051\u3089\u308c\u3066\u3044\u308b\u72b6\u614b\u306e\u3053\u3068\u3067\u3059\u3002<\/p>\n<h2>\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9<\/h2>\n<p>\u6570\u5341\u4eba\u898f\u6a21\u3067\u958b\u767a\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5834\u5408\u306f\u30c1\u30fc\u30e0\u3054\u3068\u306bNamespace\u3092\u5207\u308a\u5206\u3051\u305f\u308a\u3057\u3066\u4f7f\u3063\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<h2>\u4f8b<\/h2>\n<pre class=\"lang:default decode:true \">\u521d\u671fNamespace\r\n  default\r\n  kube-system\r\n\u7279\u5b9a\u306e\u76ee\u7684\r\n  monitoring\r\n  frontend\r\n  backend\r\n\u30c1\u30fc\u30e0\r\n\u74b0\u5883\r\n  production\r\n  development<\/pre>\n<h3>\u521d\u671fNamespace<\/h3>\n<h4>default<\/h4>\n<p>\u30c7\u30d5\u30a9\u30eb\u30c8\u306eNamespace\u3002\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u306f\u3053\u306e\u4e0b\u306bObject\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<h4>kube-system<\/h4>\n<p>Kubernetes\u306e\u30b7\u30b9\u30c6\u30e0\u306b\u3088\u3063\u3066\u4f5c\u6210\u3055\u308c\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u305f\u3081\u306eNamespace<\/p>\n<ul>\n<li>kube-proxy<\/li>\n<li>coredns<\/li>\n<li>metrics-server<\/li>\n<li>kube-state-metrics<\/li>\n<li>node-exporter<\/li>\n<\/ul>\n<h4>kube-public<\/h4>\n<p>\u8a8d\u8a3c\u3055\u308c\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u3092\u542b\u3080\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u8aad\u307f\u53d6\u308a\u53ef\u80fd<\/p>\n<h4>kube-node-lease<\/h4>\n<p>Lease\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u305f\u3081\u306eNamespace<\/p>\n<h2>Namespace\u306e\u8a2d\u5b9a<\/h2>\n<p>\u30ea\u30bd\u30fc\u30b9\u95a2\u9023\u306e\u8a2d\u5b9a\uff08Resource Quotas\u3001Limit Ranges\uff09\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<h2>Namespace\u3092\u5207\u308a\u5206\u3051\u308b\u30e1\u30ea\u30c3\u30c8<\/h2>\n<h3>\u5236\u9650\u3092\u3064\u3051\u308c\u308b\u3002<\/h3>\n<h4>Pod\u3001\u30b3\u30f3\u30c6\u30ca\u306e\u30ea\u30bd\u30fc\u30b9\u7bc4\u56f2\u8a2d\u5b9a<\/h4>\n<p>\u8a2d\u5b9a\u30df\u30b9\u306e\u9632\u6b62<\/p>\n<ul>\n<li>Pod\u3001\u30b3\u30f3\u30c6\u30ca\u306b\u30e1\u30e2\u30ea\u3084\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u4e0a\u9650\u4e0b\u9650\u3092\u8a2d\u5b9a<\/li>\n<li>\u30b3\u30f3\u30c6\u30ca\u30fc\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30e1\u30e2\u30ea\u3001CPU\u8a2d\u5b9a<\/li>\n<\/ul>\n<h4>Namespace\u5168\u4f53\u306e\u7dcf\u30ea\u30bd\u30fc\u30b9\u5236\u9650<\/h4>\n<p>\u7279\u5b9a\u306eNamespace\u3060\u3051\u30ea\u30bd\u30fc\u30b9\u3092\u4f7f\u3044\u3059\u304e\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<ul>\n<li>Namespace\u5185\u306e\u30e1\u30e2\u30ea\u3001CPU\u5408\u8a08\u306e\u4e0a\u9650<\/li>\n<li>Pod\u306a\u3069Object\u6570\u306e\u4e0a\u9650<\/li>\n<\/ul>\n<h4>\u6a29\u9650(RBAC)\u7ba1\u7406<\/h4>\n<p>\u30c1\u30fc\u30e0\u3054\u3068\u306b\u7279\u5b9aNamespace\u3078\u306e\u6a29\u9650\u4e0d\u53ef\u3002\u5404\u30c1\u30fc\u30e0\u3054\u3068\u306b\u6a29\u9650\u3092\u5206\u5272\u3057\u3066\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5411\u4e0a\u306b\u6d3b\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u7279\u5b9a\u306eNamespace\u5185\u306e\u30ea\u30bd\u30fc\u30b9\u306b\u9650\u3063\u3066\u6a29\u9650\u3092\u4ed8\u4e0e<\/li>\n<\/ul>\n<h2>Namespace\u306e\u4f5c\u6210<\/h2>\n<h3>\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u6210<\/h3>\n<pre class=\"lang:default decode:true\">kubectl create\/delete namespace [namespace\u540d]<\/pre>\n<h3>yaml\u304b\u3089\u4f5c\u6210<\/h3>\n<pre class=\"lang:default decode:true \">kubectl apply -f \u30d5\u30a1\u30a4\u30eb\u540d.yaml<\/pre>\n<h3>\u78ba\u8a8d<\/h3>\n<pre class=\"lang:default decode:true  \">kubectl get ns<\/pre>\n","protected":false},"excerpt":{"rendered":"Namespace\u3068\u306f\uff1f \u540c\u4e00\u306e\u7269\u7406\u30af\u30e9\u30b9\u30bf\u30fc\u4e0a\u3067\u8907\u6570\u306e\u4eee\u60f3\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u52d5\u4f5c\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002(\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u5206\u96e2\u3057\u3066\u8907\u6570\u306e\u30e6\u30fc\u30b6\u30fc\u3067\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u5206\u5272\u3059\u308b\u624b\u6cd5\u3068\u3082\u8a00\u3048\u307e\u3059\u3002) \u4eee\u60f3\u30af\u30e9\u30b9\u30bf\u30fc\u3068\u306f\uff1f \u5b9f\u969b\u306b\u306f\u540c\u3058\u30de\u30b7\u30f3\u4e0a\u3067\u52d5 [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[114],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/17748"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17748"}],"version-history":[{"count":11,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/17748\/revisions"}],"predecessor-version":[{"id":20319,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/17748\/revisions\/20319"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17748"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}