{"id":670,"date":"2024-12-15T23:07:19","date_gmt":"2024-12-15T14:07:19","guid":{"rendered":"https:\/\/blog.homi.run\/?p=670"},"modified":"2024-12-15T23:07:51","modified_gmt":"2024-12-15T14:07:51","slug":"argo-cd%e3%81%a7prune%e3%81%95%e3%82%8c%e3%81%aa%e3%81%84namespace%e3%82%92%e4%b8%80%e7%b7%92%e3%81%ab%e5%89%8a%e9%99%a4%e3%81%99%e3%82%8b%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e3%82%b3%e3%83%b3","status":"publish","type":"post","link":"https:\/\/blog.homi.run\/?p=670","title":{"rendered":"Argo CD\u3067Prune\u3055\u308c\u306a\u3044namespace\u3092\u4e00\u7dd2\u306b\u524a\u9664\u3059\u308b\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u3063\u305f"},"content":{"rendered":"\n<pre class=\"wp-block-verse\">\u3053\u306e\u8a18\u4e8b\u306f<a href=\"https:\/\/adventar.org\/calendars\/10036\" target=\"_blank\" rel=\"noopener\" title=\"\ud83c\udf85GMO\u30da\u30d1\u30dc \u30a8\u30f3\u30b8\u30cb\u30a2 Advent Calendar 2024\">\ud83c\udf85GMO\u30da\u30d1\u30dc \u30a8\u30f3\u30b8\u30cb\u30a2 Advent Calendar 2024<\/a>\u306e15\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\uff01<\/pre>\n\n\n\n<p>\u6628\u65e5\u306fugo\u304f\u3093\u306e\u300c<a href=\"https:\/\/zenn.dev\/yu_9\/articles\/7d372e293b260e\" target=\"_blank\" rel=\"noopener\" title=\"SUZURI API\u3092\u7528\u3044\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u6642\u306b\u7d30\u304b\u306aTips\u96c6\">SUZURI API\u3092\u7528\u3044\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u6642\u306b\u7d30\u304b\u306aTips\u96c6<\/a>\u300d\u3067\u3057\u305f\uff01<\/p>\n\n\n\n<p>SUZURI API\u306e\u3053\u3060\u308f\u308a\u304c\u3088\u304f\u5206\u304b\u308b\u8a18\u4e8b\u3067\u3001\u81ea\u5206\u3082\u306a\u306b\u304b\u9023\u643a\u3057\u3066\u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3057\u305f\uff01<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u6628\u5e74\u306b\u5f15\u304d\u7d9a\u304d\u3001\u4eca\u56de\u3082\u5fc5\u8981\u306b\u8feb\u3089\u308c\u3066\u5b9f\u88c5\u3057\u305f\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8a71\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-homirun-039-s-blog wp-block-embed-homirun-039-s-blog\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"SVQ8pl3TV0\"><a href=\"https:\/\/blog.homi.run\/?p=647\">PersistentVolume\u306e\u540d\u524d\u306bsuffix\u3092\u4ed8\u4e0e\u3059\u308b\u3060\u3051\u306eKubernetes\u306e\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4f5c\u3063\u305f<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;PersistentVolume\u306e\u540d\u524d\u306bsuffix\u3092\u4ed8\u4e0e\u3059\u308b\u3060\u3051\u306eKubernetes\u306e\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4f5c\u3063\u305f&#8221; &#8212; homirun&#039;s Blog\" src=\"https:\/\/blog.homi.run\/?p=647&#038;embed=true#?secret=lwcutuejWQ#?secret=SVQ8pl3TV0\" data-secret=\"SVQ8pl3TV0\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f5c\u3063\u305f\u3082\u306e<\/h2>\n\n\n\n<p><code>namespace-cleaner.homi.run\/managed: \"true\"<\/code>\u304cmetadata.labels\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308bApplication\u30ea\u30bd\u30fc\u30b9\u304c\u524a\u9664\u3055\u308c\u305f\u969b\u306b\u7d10\u3065\u304fNamespace\u3092\u524a\u9664\u3057\u3066\u304f\u308c\u308b\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3002<\/p>\n\n\n\n<p>Argo CD\u306eapplication\u30ea\u30bd\u30fc\u30b9\u4ee5\u5916\u3067\u3042\u307e\u308a\u4f7f\u3046\u30d3\u30b8\u30e7\u30f3\u304c\u898b\u3048\u306a\u304b\u3063\u305f\u306e\u3067\u4eca\u56de\u306f\u305d\u308c\u4ee5\u5916\u306f\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u306a\u3044\u3067\u3059\u3002<\/p>\n\n\n<p><a href=\"https:\/\/github.com\/homirun\/namespace-cleaner\"><img decoding=\"async\" src=\"https:\/\/gh-card.dev\/repos\/homirun\/namespace-cleaner.svg\"><\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f55\u304c\u5b09\u3057\u3044\u306e\u304b<\/h2>\n\n\n\n<p>Argo CD\u306b\u306fsyncOptions\u3067<a href=\"https:\/\/argo-cd.readthedocs.io\/en\/stable\/user-guide\/sync-options\/#create-namespace\" target=\"_blank\" rel=\"noopener\" title=\"CreateNamespace\">CreateNamespace<\/a>\u3068\u3044\u3046\u306e\u304c\u3042\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u6709\u52b9\u5316\u3059\u308b\u3068\u30ea\u30bd\u30fc\u30b9\u306esync\u6642\u306bnamespace\u3092\u4f5c\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n\n\n<p><script src=\"https:\/\/gist.github.com\/homirun\/e06064d33946bc68272184cd5db82f56.js\"><\/script><\/p>\n\n\n\n<p>\u4f8b\u3048\u3070applicationSet\u3092\u5229\u7528\u3057\u3066\u4f55\u304b\u3092\u30c8\u30ea\u30ac\u30fc\u306b\u3001\u958b\u767a\u74b0\u5883\u306e\u3088\u3046\u306aapplication\u30ea\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3068\u3044\u3063\u305f\u4f7f\u3044\u65b9\u3092\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u306b\u3088\u308a\u4e8b\u524d\u306bnamespace\u3092\u7528\u610f\u3057\u306a\u304f\u3066\u3082\u30a8\u30e9\u30fc\u306b\u306a\u3089\u305a\u306bsync\u3067\u304d\u308b\u308f\u3051\u3067\u3059\u304c\u3001\u9006\u306bapplication\u3092\u524a\u9664\u3059\u308b\u3068\u304d\u306b\u306fprune\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3053\u3053\u3067\u4f5c\u3089\u308c\u305fnamespace\u306f\u524a\u9664\u3055\u308c\u307e\u305b\u3093\u3002\u4f5c\u308b\u3068\u304d\u306f\u81ea\u52d5\u306a\u306e\u306b\u524a\u9664\u307e\u3067\u306f\u9762\u5012\u3092\u898b\u3066\u304f\u308c\u306a\u3044\u306e\u3067\u4f55\u3082\u3057\u306a\u3051\u308c\u3070\u7a7a\u306enamespace\u304c\u6b8b\u3063\u305f\u307e\u307e\u306b\u306a\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u78ba\u304b\u306bnamespace\u3092\u524a\u9664\u3057\u3066\u3057\u307e\u3046\u3068\u305d\u306e\u4e0a\u3067\u52d5\u304f\u30ea\u30bd\u30fc\u30b9\u3082\u57fa\u672c\u5168\u90e8\u6d88\u3048\u3066\u3057\u307e\u3046\u306e\u3067\u30ea\u30b9\u30af\u3067\u306f\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u958b\u767a\u74b0\u5883\u306e\u3088\u3046\u306a\u4f7f\u3063\u3066\u306f\u6368\u3066\u308b\u3088\u3046\u306anamespace\u306e\u5834\u5408\u306f\u305d\u3093\u306a\u4e8b\u3092\u6c17\u306b\u3057\u306a\u304f\u3066\u826f\u3044\u306e\u3067\u96d1\u306b\u81ea\u52d5\u3067\u6d88\u3048\u3066\u307b\u3057\u3044\u306e\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u3044\u65b9<\/h2>\n\n\n\n<p>pull\u3057\u3066\u304d\u3066\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u30af\u30e9\u30b9\u30bf\u3078apply<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>kubectl apply -k config\/manager -k config\/rbac<\/code><\/pre><\/div>\n\n\n\n<p>namespace\u304c\u4e00\u7dd2\u306b\u6d88\u3048\u3066\u307b\u3057\u3044application\u30ea\u30bd\u30fc\u30b9\u306blabel\u3092\u8ffd\u52a0\u3057\u305f\u3089OK<\/p>\n\n\n<p><script src=\"https:\/\/gist.github.com\/homirun\/e6609a0abe916a83716f3ea74f4757be.js\"><\/script><\/p>\n\n\n\n<p>application\u30ea\u30bd\u30fc\u30b9\u304c\u6d88\u3048\u305f\u3089\u4e00\u7dd2\u306bspec.destination.namespace\u306b\u6307\u5b9a\u3055\u308c\u305fnamespace\u304c\u524a\u9664\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4ed5\u7d44\u307f<\/h2>\n\n\n\n<p>\u3081\u3061\u3083\u304f\u3061\u3083\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u30b7\u30f3\u30d7\u30eb\u306a\u306e\u3067\u7c21\u5358\u306b\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u306fKubernetes\u306e <a href=\"https:\/\/kubernetes.io\/ja\/docs\/concepts\/overview\/working-with-objects\/finalizers\/\">finalizers<\/a>\u306e\u4ed5\u7d44\u307f\u3092\u4f7f\u3063\u3066\u6a5f\u80fd\u3092\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>finalizers\u306f\u3001\u30ea\u30bd\u30fc\u30b9\u304c\u524a\u9664\u3055\u308c\u308b\u524d\u306b\u7279\u5b9a\u306e\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002\u30ea\u30bd\u30fc\u30b9\u524a\u9664\u6642\u306bfinalizers\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u3068\u3001\u305d\u306e\u51e6\u7406\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u524a\u9664\u306f\u4fdd\u7559\u3055\u308c\u307e\u3059\u3002\u305d\u3057\u3066\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306f\u76e3\u8996\u3057\u3066\u3044\u308b\u30ea\u30bd\u30fc\u30b9\u304c\u524a\u9664\u3055\u308c\u3088\u3046\u3068\u3057\u3066\u3044\u308b\u306e\u3092\u691c\u77e5\u3057\u3066\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u51e6\u7406\u3092\u5b9f\u884c\u3057\u305f\u3042\u3068\u306bfinalizers\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u3067\u5b89\u5168\u306b\u95a2\u9023\u30ea\u30bd\u30fc\u30b9\u306e\u524a\u9664\u3092\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<p><script src=\"https:\/\/gist.github.com\/homirun\/495c189810ca26808337ad3d1e3e5787.js\"><\/script><\/p>\n\n\n\n<p>\u4eca\u56de\u306fArgo CD\u306eapplications\u30ea\u30bd\u30fc\u30b9\u306bfinalizers\u3092\u81ea\u52d5\u3067\u4ed8\u4e0e\u3057\u3001finalizers\u306e\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7\u51e6\u7406\u3068\u3057\u3066namespace\u3092\u524a\u9664\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f<code>namespace-cleaner.homi.run\/managed: \"true\"<\/code>\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u308b\u30ea\u30bd\u30fc\u30b9\u306b\u5bfe\u3057\u3066<code>namespace-cleaner.homi.run\/finalizer<\/code>\u3092\u4ed8\u4e0e\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n<p><script src=\"https:\/\/gist.github.com\/homirun\/c229286dfa49a381ceb1b21564e2b55a.js\"><\/script><\/p>\n\n\n\n<p>\u305d\u3057\u3066\u30ea\u30bd\u30fc\u30b9\u306b\u5bfe\u3057\u3066\u524a\u9664\u51e6\u7406\u304c\u59cb\u307e\u308b\u3068\u4ed8\u4e0e\u3055\u308c\u308bDeletionTimestamp\u304c\u5b58\u5728\u3057\u3001\u304b\u3064finalizers\u3082\u5b58\u5728\u3057\u3066\u3044\u308b\u30ea\u30bd\u30fc\u30b9\u304c\u5b58\u5728\u3057\u3066\u3044\u308c\u3070spec.destination.namespace\u3092\u307f\u3066\u6307\u5b9a\u3055\u308c\u305fnamespace\u3092\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n\n\n<p><script src=\"https:\/\/gist.github.com\/homirun\/0f48628683fa356c0d25ea4da72df52f.js\"><\/script><\/p>\n\n\n\n<p>\u6700\u5f8c\u306bfinalizer\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u5024\u3092\u524a\u9664\u3059\u308b\u3053\u3068\u3067application\u30ea\u30bd\u30fc\u30b9\u306e\u524a\u9664\u3082\u5b8c\u4e86\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u308c\u304c\u4e00\u9023\u306e\u6d41\u308c\u3067\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u307e\u3068\u3081<\/h2>\n\n\n\n<p>\u4eca\u56de\u5b9f\u88c5\u3057\u305f\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f7f\u3046\u3053\u3068\u3067\u5b89\u5168\u306b\u4e0d\u8981\u306anamespace\u3092\u81ea\u52d5\u7684\u306b\u524a\u9664\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002(\u3082\u3057\u304b\u3057\u305f\u3089\u3082\u3063\u3068\u7c21\u5358\u306a\u65b9\u6cd5\u304c\u3042\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u304c&#8230;)<\/p>\n\n\n\n<p>1\u5e74\u3076\u308a\u306b\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u5b9f\u88c5\u3057\u307e\u3057\u305f\u304c\u3001\u4ee5\u524d\u3088\u308a\u683c\u6bb5\u306b\u65e9\u304f\u5b9f\u88c5\u3092\u7d42\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u3066\u6210\u9577\u3092\u5b9f\u611f\u3067\u304d\u305f\u6c17\u304c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u660e\u65e5\u306e\u300c<a href=\"https:\/\/adventar.org\/calendars\/10036\" target=\"_blank\" rel=\"noopener\" title=\"\ud83c\udf85GMO\u30da\u30d1\u30dc \u30a8\u30f3\u30b8\u30cb\u30a2 Advent Calendar 2024\">\ud83c\udf85GMO\u30da\u30d1\u30dc \u30a8\u30f3\u30b8\u30cb\u30a2 Advent Calendar 2024<\/a>\u300d\u306fdai\u3055\u3093\u3067\u3059\uff01\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3057\u307e\u3059<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u306e\u8a18\u4e8b\u306f\ud83c\udf85GMO\u30da\u30d1\u30dc \u30a8\u30f3\u30b8\u30cb\u30a2 Advent Calendar 2024\u306e15\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\uff01 \u6628\u65e5\u306fugo\u304f\u3093\u306e\u300cSUZURI API\u3092\u7528\u3044\u305f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u6642\u306b\u7d30\u304b\u306aTips\u96c6\u300d\u3067\u3057\u305f\uff01 SUZURI A &hellip; <a href=\"https:\/\/blog.homi.run\/?p=670\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Argo CD\u3067Prune\u3055\u308c\u306a\u3044namespace\u3092\u4e00\u7dd2\u306b\u524a\u9664\u3059\u308b\u30ab\u30b9\u30bf\u30e0\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u3063\u305f&#8221;\u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[],"class_list":["post-670","post","type-post","status-publish","format-standard","hentry","category-6","category-7"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/670","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=670"}],"version-history":[{"count":13,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/670\/revisions"}],"predecessor-version":[{"id":686,"href":"https:\/\/blog.homi.run\/index.php?rest_route=\/wp\/v2\/posts\/670\/revisions\/686"}],"wp:attachment":[{"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.homi.run\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}