{"id":646,"date":"2020-09-20T23:01:39","date_gmt":"2020-09-20T15:01:39","guid":{"rendered":"https:\/\/www.myway5.com\/?p=646"},"modified":"2023-07-05T21:24:38","modified_gmt":"2023-07-05T13:24:38","slug":"kubernetes-gc","status":"publish","type":"post","link":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/","title":{"rendered":"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236"},"content":{"rendered":"<h2>\u4e00\u3001\u6982\u8ff0<\/h2>\n<p>\u4e00\u4e2a\u8fd0\u884c\u4e2d\u7684 kubernetes \u96c6\u7fa4\uff0c\u5b58\u50a8\u4e86\u975e\u5e38\u591a\u7684\u76f8\u4e92\u5173\u8054\u7684\u8d44\u6e90\uff0c\u6bd4\u5982\u6211\u4eec\u5e38\u7528\u7684 deployment\uff0creplicaset \u548c pod\uff0c\u5c31\u662f\u4e00\u7ec4\u6709\u5173\u8054\u7684\u8d44\u6e90\u3002\u6211\u4eec\u5728\u521b\u5efa deployment \u65f6\uff0c\u76f8\u5173\u7684\u63a7\u5236\u5668\u5c31\u4f1a\u81ea\u52a8\u521b\u5efa\u51fa replicaset\uff0c\u4e4b\u540e replicaset \u7684\u63a7\u5236\u5668\u53c8\u4f1a\u521b\u5efa\u51fa pod \u6765\u8fd0\u884c\u6211\u4eec\u90e8\u7f72\u7684\u670d\u52a1\u3002\u90a3\u4e48\u540c\u6837\u7684\uff0c\u6211\u4eec\u80af\u5b9a\u4e5f\u5e0c\u671b\u5728\u5220\u9664 deployment \u4e4b\u540e\uff0c\u4f1a\u81ea\u52a8\u5220\u9664 replicaset \u548c pod\u3002\u8fd9\u4e2a\u673a\u5236\u5c31\u53eb\u505a\u5783\u573e\u56de\u6536\uff08\u4e0b\u9762\u7b80\u79f0 GC\uff09\u3002<\/p>\n<p>\u5728\u65e9\u671f\u7684\u7248\u672c\u4e2d\uff0cGC \u662f\u7531\u5ba2\u6237\u7aef\u5b9e\u73b0\u7684\uff0c\u6bd4\u5982\u4f7f\u7528 <code>kubectl delete deployment nginx<\/code> \u8fd9\u6837\u7684\u547d\u4ee4\uff0ckubectl \u4f1a\u5220\u9664 pod \u548c replicaset\u3002\u4f46\u662f\u8fd9\u79cd\u65b9\u5f0f\u589e\u52a0\u4e86\u5ba2\u6237\u7aef\u7684\u5b9e\u73b0\u590d\u6742\u5ea6\uff0c\u4e0d\u5229\u4e8e\u7edf\u4e00\u7ba1\u7406\u3002\u56e0\u6b64\u63d0\u51fa\u4e86\u5728\u670d\u52a1\u7aef\u5b9e\u73b0 GC \u7684\u9700\u6c42\u3002\u5b9e\u73b0 GC \u6709\u4e09\u4e2a\u4e3b\u8981\u76ee\u6807\uff0c\u6211\u4eec\u5728\u4e4b\u540e\u5206\u6790\u7684\u65f6\u5019\uff0c\u4e5f\u4e3b\u8981\u662f\u56f4\u7ed5\u8fd9\u4e09\u4e2a\u4e3b\u8981\u76ee\u6807\u8fdb\u884c\u3002<\/p>\n<ul>\n<li>\u5728\u670d\u52a1\u7aef\u652f\u6301\u7ea7\u8054\u5220\u9664<\/li>\n<li>\u4e2d\u5fc3\u5316\u7ea7\u8054\u5220\u9664\u7684\u903b\u8f91\uff0c\u800c\u4e0d\u662f\u5206\u5e03\u5728\u5404\u4e2a\u7ec4\u4ef6\u5185<\/li>\n<li>\u53ef\u4ee5\u9009\u62e9\u4e0d\u5220\u9664\u88ab\u4f9d\u8d56\u7684\u8d44\u6e90\u3002\u5982\u53ea\u5220\u9664 deployment\uff0c\u4f46\u662f\u4fdd\u7559 replicaset \u548c pod<\/li>\n<\/ul>\n<p>kubernetes \u7684 GC \u662f\u5728 controller manager \u4e2d\uff0c\u4f5c\u4e3a\u4e00\u4e2a\u5355\u72ec\u7684 controller \u6765\u5b9e\u73b0\u7684\u3002\u5b83\u901a\u8fc7 discovery client \u6765\u52a8\u6001\u53d1\u73b0\u5e76\u76d1\u542c\u96c6\u7fa4\u4e2d\u6240\u6709\u652f\u6301 <code>delete<\/code>,<code>list<\/code>\u548c<code>watch<\/code>\u7684\u8d44\u6e90\u3002\u7136\u540e\u6784\u9020\u8d44\u6e90\u4e4b\u95f4\u7684\u5173\u7cfb\u56fe\u6765\u8bb0\u5f55\u8d44\u6e90\u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\u3002<\/p>\n<h2>\u4e8c\u3001\u9884\u5907\u77e5\u8bc6<\/h2>\n<p>\u4e3a\u4e86\u66f4\u597d\u7684\u9610\u8ff0 kubernetes \u7684 GC \u673a\u5236\uff0c\u8fd9\u91cc\u5148\u5c06\u4e00\u4e9b k8s \u57fa\u672c\u77e5\u8bc6\u505a\u4e00\u4e9b\u9610\u8ff0\u3002<\/p>\n<ul>\n<li>finalizer: finalizer \u53ef\u4ee5\u7ffb\u8bd1\u4e3a\u7ec8\u7ed3\u671f\u3002\u662f\u4e00\u79cd\u7528\u6765\u4fdd\u8bc1\u8d44\u6e90\u5728\u88ab\u5220\u9664\u4e4b\u524d\uff0c\u80fd\u591f\u6709\u673a\u4f1a\u505a\u4e00\u4e9b\u6e05\u7406\u5de5\u4f5c\u7684\u673a\u5236\u3002<\/li>\n<li>kubernetes \u7684\u5220\u9664\u4f20\u64ad\u7b56\u7565\u6709\u4e09\u79cd\uff1a\n<ol>\n<li>Orphan. \u8fd9\u79cd\u7b56\u7565\u4e0b\uff0c\u4f1a\u4fdd\u7559\u88ab\u4f9d\u8d56\u7684\u8d44\u6e90\u3002\u5982\u53ea\u5220\u9664 deployment\uff0c\u4f46\u662f\u4fdd\u7559 replicaset \u548c pod\u3002<\/li>\n<li>Background. \u4ece etcd \u4e2d\u5220\u9664\u8d44\u6e90\uff0c\u88ab\u4f9d\u8d56\u7684\u8d44\u6e90\u7531 GC \u673a\u5236\u6765\u5220\u9664\u3002<\/li>\n<li>Foreground. apiserver \u4e0d\u4f1a\u5220\u9664\u8be5\u8d44\u6e90\u3002\u800c\u662f\u5728\u5b83\u7684 finalizer \u4e2d\u6dfb\u52a0 foregroundDeletion\uff0c\u5e76\u4e14\u8bbe\u7f6e\u5f53\u524d\u7684\u5220\u9664\u65f6\u95f4\u6233\u3002\u7136\u540e GC \u4f1a\u5148\u4ece etcd \u4e2d\u5220\u9664\u6709 <code>ownerReference.blockOwnerDeletion=true<\/code> \u7684\u88ab\u4f9d\u8d56\u8d44\u6e90\u3002\u6700\u540e\u518d\u5220\u9664\u5f53\u524d\u8d44\u6e90\u3002<\/li>\n<\/ol>\n<\/li>\n<li>UID\u3002k8s \u4e2d\u7684\u6bcf\u4e2a\u8d44\u6e90\u90fd\u6709\u4e00\u4e2a\u552f\u4e00\u7684 UID\u3002\u8fd9\u4e2a UID \u5728\u6574\u4e2a\u96c6\u7fa4\u7684\u751f\u547d\u5468\u671f\u4e2d\uff0c\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u8d44\u6e90\u6765\u8bf4\u90fd\u662f\u552f\u4e00\u7684\u3002\u6240\u6709\u5728\u6807\u8bb0\u8d44\u6e90\u7684\u4f9d\u8d56\u5173\u7cfb\u65f6\uff0c\u9700\u8981\u4f7f\u7528 UID\u3002<\/li>\n<li>ownerReferences\u3002\u6bcf\u4e2a\u8d44\u6e90\u7684 metadata \u4e2d\u90fd\u4f1a\u6709\u8fd9\u4e2a\u5b57\u6bb5\uff0c\u5b83\u662f\u4e00\u4e2a\u6570\u7ec4\uff0c\u7528\u6765\u8868\u793a\u8be5\u8d44\u6e90\u7684 owner \u6709\u54ea\u4e9b\u3002\u6bcf\u5f53 owner \u8d44\u6e90\u88ab\u5220\u9664\uff0c\u5c31\u4f1a\u4ece\u8fd9\u4e2a\u6570\u7ec4\u4e2d\u79fb\u9664\u3002\u5f53\u6240\u6709\u7684 owner \u90fd\u88ab\u5220\u9664\u540e\uff0cGC \u5c31\u4f1a\u56de\u6536\u8be5\u8d44\u6e90\u3002<\/li>\n<li>Dependents\u3002\u5982\u679c\u4e00\u7ec4\u8d44\u6e90 G \u7684 ownerReference \u6307\u5411\u67d0\u4e2a\u5177\u4f53\u7684\u8d44\u6e90 A\u3002\u90a3\u4e2a A \u7684 dependents \u5c31\u662f G<\/li>\n<\/ul>\n<h2>\u4e09\u3001\u5783\u573e\u56de\u6536\u7684\u5b9e\u73b0\u673a\u5236<\/h2>\n<p>kubernetes \u7684 GC \u4e3b\u8981\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a<\/p>\n<ul>\n<li>GraphBuilder \u4e3b\u8981\u7528\u6765\u4f7f\u7528 monitors \u76d1\u542c apiserver \u4e0a\u7684\u6240\u6709\u8d44\u6e90\uff0c\u901a\u8fc7\u5c06\u6240\u6709\u8d44\u6e90\u7684\u4e8b\u4ef6\u63d2\u5165\u5230 graphChanges \u961f\u5217\u4e2d\uff0c\u7136\u540e\u8c03\u7528 <code>processGraphChanges<\/code> \u65b9\u6cd5\uff0c\u4ece\u961f\u5217\u4e2d\u4f9d\u6b21\u53d6\u51fa\u5143\u7d20\uff0c\u6784\u5efa\u8d44\u6e90\u4e4b\u95f4\u7684\u4f9d\u8d56\u5173\u7cfb\u3002\u5e76\u6839\u636e\u60c5\u51b5\u63d2\u5165\u5230 attemptToDelete \u6216 attemptToOrphan \u961f\u5217\u4e2d\u3002<\/li>\n<li>GarbageCollector \u8d1f\u8d23\u4ece attemptToDelete \u548c attemptToOrphan \u961f\u5217\u4e2d\u53d6\u51fa\u8d44\u6e90\uff0c\u7136\u540e\u901a\u8fc7\u4e00\u7cfb\u5217\u8d1f\u8d23\u7684\u8fc7\u7a0b\uff0c\u5224\u65ad\u662f\u5426\u80fd\u5220\u9664\uff0c\u5e76\u8fdb\u884c\u76f8\u5173\u7684\u5904\u7406\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64\uff0c\u5bf9\u4e8e\u5783\u573e\u56de\u6536\u5b9e\u73b0\u673a\u5236\u7684\u5206\u6790\uff0c\u4e3b\u8981\u4ece\u8fd9\u4e24\u90e8\u5206\u8fdb\u884c\u3002<\/p>\n<h3>3.1 graph builder \u7684\u5b9e\u73b0<\/h3>\n<p>graph builder \u53ef\u4ee5\u770b\u505a\u662f\u96c6\u7fa4\u8d44\u6e90\u72b6\u6001\u7684\u7ef4\u62a4\u8005\u3002\u5176\u672c\u8eab\u5e76\u4e0d\u4f1a\u901a\u8fc7 apiserver \u4fee\u6539\u4efb\u4f55\u7684\u8d44\u6e90\u3002\u5176\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-go line-numbers\">\/\/ GraphBuilder \u5904\u7406 informers \u63d0\u4f9b\u7684\u4e8b\u4ef6\uff0c\u66f4\u65b0 uidToNode\uff0c\u4f7f\u7528 LRU \u7f13\u5b58\u4f9d\u8d56\u8d44\u6e90\uff0c\u5e76\u5c06\n\/\/ \u8d44\u6e90\u9001\u5165\u5230 attemptToDelete \u548c attemptToOrphan \u961f\u5217\ntype GraphBuilder struct {\n    restMapper meta.RESTMapper\n\n  \/\/ \u6bcf\u4e2a monitor \u90fd\u4f1a list\/watches \u4e00\u4e2a\u8d44\u6e90\uff0c\u7ed3\u679c\u4f1a\u88ab\u5bfc\u5165\u5230 dependencyGraphBuilder \u4e2d\u00b7\n    monitors    monitors\n    monitorLock sync.RWMutex\n\n    informersStarted &lt;-chan struct{}\n    stopCh &lt;-chan struct{}\n    running bool\n\n    metadataClient metadata.Interface\n  \/\/ monitors \u662f\u8be5\u961f\u5217\u7684\u751f\u4ea7\u8005\uff0cgraphBuilder \u6839\u636e\u8fd9\u4e9b\u6539\u53d8\u6765\u4fee\u6539\u5185\u5b58\u4e2d\u7684 graph\n    graphChanges workqueue.RateLimitingInterface\n  \/\/ \u8d44\u6e90 uid \u5bf9\u5e94\u5230 graph \u4e2d\u7684 node\n    uidToNode *concurrentUIDToNode\n  \/\/ GraphBuilder \u662f attemptToDelete \u548c attemptToOrphan \u7684\u751f\u4ea7\u8005\uff0cGC \u662f\u6d88\u8d39\u8005\u3002\n    attemptToDelete workqueue.RateLimitingInterface\n    attemptToOrphan workqueue.RateLimitingInterface\n  \/\/ GraphBuilder \u548c GC \u5171\u4eab absentOwnerCache. \u76ee\u524d\u5df2\u77e5\u7684\u4e0d\u5b58\u5728\u7684\u5bf9\u8c61\u4f1a\u88ab\u6dfb\u52a0\u5230\u7f13\u5b58\u4e2d\n    absentOwnerCache *UIDCache\n    sharedInformers  controller.InformerFactory\n    ignoredResources map[schema.GroupResource]struct{}\n}\n<\/code><\/pre>\n<p>\u7ec4\u6210 graph \u7684 node \u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-go line-numbers\">\/\/ \u5355\u7ebf\u7a0b\u7684 GraphBuilder.processGraphChanges() \u662f nodes \u7684\u552f\u4e00 writer\u3002\u591a\u7ebf\u7a0b\u7684 GarbageCollector.attemptToDeleteItem() \u8bfb\u53d6 nodes\u3002\ntype node struct {\n    identity objectReference\n    dependentsLock sync.RWMutex\n    \/\/ dependents \u662f\u5f53\u524d node \u7684\u4f9d\u8d56\u8d44\u6e90\u3002\u6bd4\u5982\u5f53\u524d node \u662f replicaset\uff0c\u90a3\u4e48\u8fd9\u91cc\u9762\u4fdd\u5b58\u7684\u5e94\u8be5\u5c31\u662f\u591a\u4e2a pod\n    dependents map[*node]struct{}\n    \/\/ this is set by processGraphChanges() if the object has non-nil DeletionTimestamp\n    \/\/ and has the FinalizerDeleteDependents.\n    deletingDependents     bool\n    deletingDependentsLock sync.RWMutex\n    \/\/ this records if the object's deletionTimestamp is non-nil.\n    beingDeleted     bool\n    beingDeletedLock sync.RWMutex\n    \/\/ this records if the object was constructed virtually and never observed via informer event\n    virtual     bool\n    virtualLock sync.RWMutex\n    \/\/ when processing an Update event, we need to compare the updated\n    \/\/ ownerReferences with the owners recorded in the graph.\n    owners []metav1.OwnerReference\n}\n<\/code><\/pre>\n<p>GraphBuilder \u4f1a\u548c apiserver \u540c\u6b65 monitors\uff0c\u7136\u540e\u4e3a\u6bcf\u79cd\u8d44\u6e90\u521b\u5efa\u4e00\u4e2a monitor\uff0c\u901a\u8fc7 informer \u540c\u6b65\u8d44\u6e90\u7684\u72b6\u6001\u3002\u6240\u6709\u7684\u8d44\u6e90\u90fd\u4f1a\u76f4\u63a5\u8fdb\u5165 graphChanges \u961f\u5217\u3002\u7136\u540e\u5728 processGraphChanges \u65b9\u6cd5\u4e2d\u7edf\u4e00\u5904\u7406\u3002<\/p>\n<p><strong>\u5bf9\u4e8e Add \u548c Update \u4e8b\u4ef6\uff1a<\/strong><\/p>\n<ul>\n<li>\u5982\u679c\u5f53\u524d\u8d44\u6e90\u4e0d\u5b58\u5728 graph \u4e2d\uff0c\u5c31\u4f1a\u5b9e\u4f8b\u5316\u51fa\u4e00\u4e2a Node \u5bf9\u8c61\uff0c\u52a0\u5165\u5230 graph \u4e2d\u3002\u7136\u540e\u5c06\u8be5 node \u52a0\u5165\u5230\u5176 owners \u7684 dependents \u6570\u7ec4\u4e2d\u3002 \u8fd9\u91cc\u6709\u4e00\u4e2a\u7ec6\u8282\uff0c\u5c31\u662f\u6709\u53ef\u80fd\u51fa\u73b0\u4e00\u79cd\u60c5\u51b5\uff0c\u5f53\u524d node \u6240\u4ee3\u8868\u7684\u8d44\u6e90\u901a\u8fc7 informer \u88ab\u540c\u6b65\u5230\u672c\u5730\u7f13\u5b58\u4e2d\uff0c\u4f46\u662f\u5176 owner \u8fd8\u6ca1\u6709\u88ab\u540c\u6b65\u8fc7\u6765\u3002\u8fd9\u6837\u66f4\u65b0 owners \u7684 dependents \u5c31\u4f1a\u6709\u9057\u6f0f\u3002\u56e0\u6b64\u6bcf\u4e2a node \u90fd\u6709\u4e00\u4e2a virtual \u5b57\u6bb5\uff0c\u5728 owner \u8fd8\u6ca1\u6709\u88ab\u540c\u6b65\u65f6\uff0c\u5b9e\u4f8b\u5316\u4e00\u4e2a\u865a\u62df\u7684 owner node \u52a0\u5165\u5230 graph \u4e2d\u3002\u5e76\u4e14\u5c06\u8fd9\u4e2a\u865a\u62df node \u6dfb\u52a0\u5230 attemptToDelete \u961f\u5217\u4e2d\uff0c\u7531\u4e4b\u540e\u7684 GC \u5904\u7406\u3002\u5982\u679c\u8fd9\u4e2a\u865a\u62df node \u5728\u4e4b\u540e\u88ab processGraphChanges \u53d1\u73b0\u4e86\uff0c\u5c31\u4f1a\u8c03\u7528 markObserved() \u5c06 virtual \u7f6e\u4e3a false\u3002<\/li>\n<li>\u5982\u679c\u5df2\u7ecf\u5b58\u5728\u4e86\uff0c\u90a3\u4e48\u5c31\u8981\u6bd4\u5bf9\u65b0\u65e7\u8d44\u6e90\u7684 ownerReferences \u7684\u53d8\u5316\u60c5\u51b5\u3002\u8fd9\u91cc\u4f1a\u8ba1\u7b97\u51fa added, removed \u548c changed\u3002ownerReferences \u7684\u53d8\u5316\u53ef\u80fd\u4f1a\u5e26\u6765\u4ee5\u4e0b\u8981\u5904\u7406\u7684\u60c5\u51b5\u3002\n<ul>\n<li>\u4e4b\u524d\u63d0\u5230 Foreground \u7684\u5220\u9664\uff0cownerReference \u5e26\u6709 blockOwnerDeletion=true \u7684\u8d44\u6e90\u4f1a block \u7684 owner \u7684\u5220\u9664\u3002\u90a3\u4e48\u8fd9\u91cc\u56e0\u4e3a ownerReferences \u7684\u53d8\u5316\uff0c\u9700\u8981\u505a\u4ee5\u4e0b\u4e24\u70b9\uff1a<\/li>\n<li>\u5bf9\u4e8e removed \u7684 ownerReference\uff0c\u5982\u679c blockOwnerDeletion \u4e3a true\u3002\u5c31\u8bf4\u660e\u5f53\u524d\u4e0d\u5141\u8bb8\u518d block \u8be5 node owner \u7684\u5220\u9664\u3002\u56e0\u6b64\u5c06 owner \u653e\u5230 attemptToDelete \u961f\u5217\u4e2d\uff0c\u7b49\u5f85 GC \u7684\u5904\u7406\u3002<\/li>\n<li>\u5bf9\u4e8e\u66f4\u65b0\u7684 ownerReference\uff0c\u5982\u679c\u4e4b\u524d  blockOwnerDeletion \u4e3a true\uff0c\u73b0\u5728\u4e3a false\uff0c\u90a3\u4e48\u4e5f\u8981\u52a0\u5165\u5230 attemptToDelete \u961f\u5217\u3002<\/li>\n<li>\u5bf9\u4e8e added \u548c removed\uff0c\u90fd\u9700\u8981\u66f4\u65b0\u5bf9\u5e94\u7684 owner node \u7684 dependents\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u65e0\u8bba\u662f Add \u8fd8\u662f Update \u4e8b\u4ef6\uff0c\u90fd\u4f1a\u8c03\u7528 <code>processTransitions<\/code> \u65b9\u6cd5\uff0c\n<ul>\n<li>\u5982\u679c old object \u6ca1\u6709\u88ab\u5220\u9664\u6216\u8005\u6ca1\u6709 orphan finalizer\uff0c\u4f46\u662f new object \u88ab\u5220\u9664\u4e86\u6216\u8005\u6709 orphan finalizer\uff0c\u5c31\u4f1a\u5c06\u8be5\u8282\u70b9\u63d2\u5165\u5230 attemptToOrphan \u961f\u5217\u3002<\/li>\n<li>\u5982\u679c old object \u6ca1\u6709\u88ab\u5220\u9664\u6216\u8005\u6ca1\u6709 foregroundDeletion finalizer\uff0c\u4f46\u662f new object \u88ab\u5220\u9664\u4e86\u6216\u8005\u6709 foregroundDeletion finalizer\uff0c\u5c31\u4f1a\u5c06\u8be5\u8282\u70b9\u7684 dependents \u90fd\u63d2\u5165\u5230 attemptToDelete \u961f\u5217\uff0c\u518d\u5c06\u8282\u70b9\u63d2\u5165\u5230 attemptToDelete \u961f\u5217\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>\u5bf9\u4e8e\u5220\u9664\u4e8b\u4ef6<\/strong>\uff1a<\/p>\n<ul>\n<li>\u4f1a\u4ece\u5f53\u524d\u7684 graph \u4e2d\u79fb\u9664\u8be5 node\u3002\u8d77\u59cb\u5c31\u662f\u4ece uidToNode \u4e2d\u5220\u9664\u8be5 node\uff0c\u7136\u540e\u66f4\u65b0\u6240\u6709\u7684 owner \u7684 dependents\u3002<\/li>\n<li>\u5982\u679c\u5f53\u524d node \u7684 dependents \u5927\u4e8e 0\uff0c\u5c31\u5c06\u5f53\u524d node \u6dfb\u52a0\u5230 absentOwnerCache \u4e2d\u3002<\/li>\n<li>\u5c06\u8be5 node \u7684 dependents \u5c06\u5165\u5230 attemptToDelete \u961f\u5217\u4e2d\uff08\u5783\u573e\u56de\u6536\uff09\u3002<\/li>\n<li>\u6700\u540e\uff0c\u4ece\u8be5 node \u4e2d\u627e\u5230\u5904\u4e8e deletingDependents=true \u72b6\u6001\u7684 owner\uff0c\u4e5f\u63d2\u5165\u5230 attemptToDelete \u961f\u5217\u4e2d\u3002\u8fd9\u91cc\u662f\u4e3a\u4e86\u8ba9 GC \u68c0\u67e5\u8be5 owner \u662f\u4e0d\u662f\u6240\u6709\u7684 dependents \u90fd\u88ab\u5220\u9664\u4e86\uff0c\u5982\u679c\u662f\uff0c\u5c31\u5c06\u8be5 owner \u4e5f\u5220\u9664\uff08\u8fd9\u91cc owner \u5904\u4e8e deletingDependents\uff0c\u8bf4\u660e\u4f7f\u7528\u4e86 foregroundDeletion\uff0c\u56e0\u6b64\u9700\u8981\u5148\u5220\u9664 dependents\uff0c\u518d\u5220\u9664 owner\uff09\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64\u53ef\u4ee5\u77e5\u9053\uff0c\u4ee5\u4e0b\u72b6\u6001\u7684\u8d44\u6e90\u4f1a\u88ab\u63d2\u5165\u5230 attemptToDelete \u961f\u5217\u4e2d\uff1a<\/p>\n<ul>\n<li>finalizers \u4e2d\u6709 foregroundDelete<\/li>\n<li>owner \u7684 finalizers \u4e2d\u6709 foregroundDelete<\/li>\n<li>owner \u8d44\u6e90\u88ab\u5220\u9664<\/li>\n<li>Dependents \u4e2d\u6709\u8d44\u6e90\u88ab\u5220\u9664\uff0c\u5e76\u4e14\u5f53\u524d\u72b6\u6001\u8fd8\u4e0d\u662f\u6b63\u5728\u5220\u9664 deletingDependents<\/li>\n<li>owner \u5904\u4e8e deletingDependents<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u72b6\u6001\u7684\u8d44\u6e90\u4f1a\u88ab\u63d2\u5165\u5230 attemptToOrphan \u961f\u5217\u4e2d\uff1a<\/p>\n<ul>\n<li>finalizers \u4e2d\u6709 orphan<\/li>\n<\/ul>\n<h3>3.2 GarbageCollector \u7684\u5b9e\u73b0<\/h3>\n<p>\u5728 3.1 \u4e2d\u63d0\u5230\uff0cGC \u4f1a\u6d88\u8d39 GraphBuilder \u7684 attemptToDelete \u548c attemptToOrphan \u961f\u5217\uff0c\u6765\u6267\u884c delete \u6216 orphan \u64cd\u4f5c\u3002\u56e0\u6b64\u6211\u4eec\u8fd9\u91cc\u4e3b\u8981\u5173\u5fc3\uff0c\u4ec0\u4e48\u6837\u7684\u8d44\u6e90\u53ef\u4ee5\u88ab GC delete \u6216\u8005 orphan\u3002<\/p>\n<h4>3.2.1 attemptToDeleteItem<\/h4>\n<ul>\n<li>\u5bf9\u4e8e DeletionTimestamp \u4e0d\u4e3a\u7a7a\uff0c\u5e76\u4e14\u4e0d\u5904\u4e8e\u5220\u9664 dependents \u7684\u8d44\u6e90\u3002\u76f4\u63a5\u8df3\u8fc7\u5904\u7406\u6d41\u7a0b\u3002<\/li>\n<li>\u5982\u679c\u8d44\u6e90\u5904\u4e8e deletingDependents \u72b6\u6001\uff0c\u5219\u7edf\u8ba1 <code>blockOwnerDeletion=true<\/code>\u7684 dependents \u4e2a\u6570\u3002\n<ul>\n<li>\u5982\u679c\u4e3a 0\uff0c\u8bf4\u660e\u5f53\u524d\u8d44\u6e90\u53ef\u4ee5\u5220\u9664\u4e86\uff0c\u5219\u79fb\u9664 foregroundDeletion \u8fd9\u4e2a finalizer \u5373\u53ef\u3002<\/li>\n<li>\u5426\u5219\u5c06 dependents \u63d2\u5165\u5230 attemptToDelete \u961f\u5217\u4e2d<\/li>\n<li>\u4e4b\u540e\u4f1a\u9000\u51fa\u8fd9\u4e2a\u5faa\u73af<\/li>\n<\/ul>\n<\/li>\n<li>\u5bf9\u8d44\u6e90\u7684 ownerReferences \u8fdb\u884c\u5206\u7c7b\n<ul>\n<li>Dangling: owner \u5bf9\u5e94\u7684\u8d44\u6e90\u5b9e\u9645\u5df2\u7ecf\u4e0d\u5b58\u5728\u4e86\u3002<\/li>\n<li>waitingForDependentsDeletion: owner \u7684 DeletionTimeStamp \u4e0d\u4e3a\u7a7a\uff0c\u4f46\u662f\u6709 foregroundDeletion\uff0c\u6240\u4ee5\u6b63\u5728\u7b49\u5f85 dependents \u5220\u9664<\/li>\n<li>solid: owner \u5b58\u5728\uff0c\u5e76\u4e14\u4e0d\u662f waitingForDependentsDeletion<\/li>\n<\/ul>\n<\/li>\n<li>\u5982\u679c solid \u4e0d\u4e3a\u7a7a\uff0c\u90a3\u4e48\u5f53\u524d\u8d44\u6e90\u5c31\u4e0d\u80fd\u88ab GC\uff0c\u56e0\u6b64\u53ea\u9700\u8981\u901a\u8fc7 patch \u6765\u79fb\u9664 dangling \u548c waitingForDependentsDeletion \u7684 ownerReferences<\/li>\n<li>\u5982\u679c waitingForDependentsDeletion \u4e0d\u4e3a\u7a7a\u5e76\u4e14\u5f53\u524d\u8d44\u6e90\u7684 dependents \u4e0d\u4e3a\u7a7a\u3002\u8fd9\u4e2a\u5224\u65ad\u7528\u6765\u5904\u7406\u5faa\u73af\u4f9d\u8d56\u7684\u5f02\u5e38\u60c5\u51b5\uff0c\u56e0\u4e3a\u5f53\u524d\u8d44\u6e90\u5e76\u4e0d\u5904\u4e8e\u5220\u9664\u72b6\u6001\u4e14\u6709 dependents\uff0c\u5176 owner \u53c8\u5728\u7b49\u5f85\u8be5 item \u7684\u5220\u9664\uff0c\u8bf4\u660e\u8fd9\u91cc\u6709\u4e00\u4e2a\u5faa\u73af\u4f9d\u8d56\u3002\u89e3\u51b3\u529e\u6cd5\u5c31\u662f\u901a\u8fc7 patch \u53bb\u66f4\u6539\u8be5\u8d44\u6e90\u7684 blockOwnerDeletion \u4e3a false\u3002<\/li>\n<li>\u5982\u679c\u4e0a\u9762\u4e24\u79cd\u60c5\u51b5\u90fd\u4e0d\u662f\u3002\u5c31\u4f1a\u6839\u636e\u5f53\u524d\u8d44\u6e90\u7684 finalizer \u6765\u5220\u9664\u8d44\u6e90\n<ul>\n<li>orphan<\/li>\n<li>foreground<\/li>\n<li>Background<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u56e0\u6b64\u53ef\u4ee5\u5f97\u51fa\uff0c\u4ee5\u4e0b\u72b6\u6001\u7684\u8d44\u6e90\u4f1a\u88ab GC \u8c03\u7528\u5220\u9664\u8bf7\u6c42\uff1a<\/p>\n<ul>\n<li>\u8d44\u6e90\u5904\u4e8e deletingDependents \u72b6\u6001\uff0c\u4e14\u5176\u6ca1\u6709 dependents \u7684 blockOwnerDeletion \u4e3a true\u3002\u5148\u79fb\u9664 foregroundDeletion finalizer\uff0c\u7136\u540e\u5220\u9664<\/li>\n<li>\u8d44\u6e90\u7684 owner \u548c dependents \u90fd\u6709 blockOwnerDeletion\u3002\u5982\u679c dependents \u5904\u4e8e deletingDependents \u72b6\u6001\u3002\u4e3a\u4e86\u9632\u6b62\u5b58\u5728\u5faa\u73af\u4f9d\u8d56\uff0c\u4f1a\u5148\u628a owner \u7684 unblock\u3002\u7136\u540e\u4f7f\u7528 foreground \u6765\u5220\u9664\u5f53\u524d\u8d44\u6e90\u3002<\/li>\n<li>\u8d44\u6e90\u6ca1\u6709 solid \u7684 owner\uff0c\u90a3\u4e48\u8fd9\u4e2a\u8d44\u6e90\u5c31\u662f\u5e94\u8be5\u88ab\u7ea7\u8054\u5220\u9664\u7684\u8d44\u6e90\u3002\u6240\u4ee5\u6839\u636e\u8be5\u8d44\u6e90\u7684 finalizer \u6765\u5220\u9664\u3002\u9ed8\u8ba4\u4f7f\u7528 background \u7684\u65b9\u5f0f\u5220\u9664\u3002<\/li>\n<\/ul>\n<h4>3.2.2 attemptToOrphan<\/h4>\n<p>orphan \u662f\u9632\u6b62\u67d0\u4e9b\u60c5\u51b5\u4e0b\u8d44\u6e90\u88ab GC \u56de\u6536\u7684\u65b9\u5f0f\u3002attemptToOrphan \u7684\u903b\u8f91\u8981\u7b80\u77ed\u4e00\u4e9b\uff0c\u5982\u4e0b\uff1a<\/p>\n<ul>\n<li>\u79fb\u9664 dependents \u5bf9\u5f53\u524d\u8d44\u6e90 ownerReferences<\/li>\n<li>\u79fb\u9664\u8be5\u8d44\u6e90\u7684 orphan finalizer \uff08\u8fd9\u4e2a\u66f4\u65b0\u4e8b\u4ef6\u4f1a\u88ab GraphBuilder \u83b7\u53d6\u5230\uff0c\u7136\u540e\u8be5\u8d44\u6e90\u7b26\u5408\u8fdb\u5165 attemptToDelete \u961f\u5217\u7684\u6761\u4ef6\u3002\u4e4b\u540e\u518d\u7531 GC \u7684\u5904\u7406\uff0c\u6700\u7ec8\u4f1a\u88ab\u5220\u9664\u3002\uff09<\/li>\n<\/ul>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u6839\u636e\u4ee5\u4e0a\u6d41\u7a0b\uff0c\u9644\u4e0a\u81ea\u5df1\u6574\u7406\u7684\u4e00\u4e2a\u6574\u4f53\u7684 GC \u6d41\u7a0b\u56fe<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png\" alt=\"k8s-gc\" \/><\/p>\n<h2>\u53c2\u8003<\/h2>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/kubernetes\/community\/blob\/master\/contributors\/design-proposals\/api-machinery\/garbage-collection.md#orphaning-the-descendants-with-orphan-finalizer\">garbage collection<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u6982\u8ff0 \u4e00\u4e2a\u8fd0\u884c\u4e2d\u7684 kubernetes \u96c6\u7fa4\uff0c\u5b58\u50a8\u4e86\u975e\u5e38\u591a\u7684\u76f8\u4e92\u5173\u8054\u7684\u8d44\u6e90\uff0c\u6bd4\u5982\u6211\u4eec\u5e38\u7528\u7684 deploy &hellip; <a href=\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[122,104],"class_list":["post-646","post","type-post","status-publish","format-standard","hentry","category-k8s","tag-gc","tag-k8s"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236 - \u4e00\u53ea\u5b89\u9759\u7684\u732b<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u6982\u8ff0 \u4e00\u4e2a\u8fd0\u884c\u4e2d\u7684 kubernetes \u96c6\u7fa4\uff0c\u5b58\u50a8\u4e86\u975e\u5e38\u591a\u7684\u76f8\u4e92\u5173\u8054\u7684\u8d44\u6e90\uff0c\u6bd4\u5982\u6211\u4eec\u5e38\u7528\u7684 deploy &hellip; \u7ee7\u7eed\u9605\u8bfbkubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/\" \/>\n<meta property=\"og:site_name\" content=\"\u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"article:published_time\" content=\"2020-09-20T15:01:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-05T13:24:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png\" \/>\n<meta name=\"author\" content=\"jiangpengfei\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"jiangpengfei\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/\"},\"author\":{\"name\":\"jiangpengfei\",\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"headline\":\"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236\",\"datePublished\":\"2020-09-20T15:01:39+00:00\",\"dateModified\":\"2023-07-05T13:24:38+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/\"},\"wordCount\":296,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png\",\"keywords\":[\"gc\",\"k8s\"],\"articleSection\":[\"k8s\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/\",\"url\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/\",\"name\":\"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png\",\"datePublished\":\"2020-09-20T15:01:39+00:00\",\"dateModified\":\"2023-07-05T13:24:38+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#primaryimage\",\"url\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png\",\"contentUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png\",\"width\":2792,\"height\":2071},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.myway5.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.myway5.com\/#website\",\"url\":\"https:\/\/www.myway5.com\/\",\"name\":\"\u4e00\u53ea\u5b89\u9759\u7684\u732b\",\"description\":\"\u60f3\u5565\u5462\",\"publisher\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.myway5.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\",\"name\":\"jiangpengfei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g\",\"caption\":\"jiangpengfei\"},\"logo\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.myway5.com\/index.php\/author\/joyme\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/","og_locale":"zh_CN","og_type":"article","og_title":"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","og_description":"\u4e00\u3001\u6982\u8ff0 \u4e00\u4e2a\u8fd0\u884c\u4e2d\u7684 kubernetes \u96c6\u7fa4\uff0c\u5b58\u50a8\u4e86\u975e\u5e38\u591a\u7684\u76f8\u4e92\u5173\u8054\u7684\u8d44\u6e90\uff0c\u6bd4\u5982\u6211\u4eec\u5e38\u7528\u7684 deploy &hellip; \u7ee7\u7eed\u9605\u8bfbkubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236","og_url":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/","og_site_name":"\u4e00\u53ea\u5b89\u9759\u7684\u732b","article_published_time":"2020-09-20T15:01:39+00:00","article_modified_time":"2023-07-05T13:24:38+00:00","og_image":[{"url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png","type":"","width":"","height":""}],"author":"jiangpengfei","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"jiangpengfei","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#article","isPartOf":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/"},"author":{"name":"jiangpengfei","@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"headline":"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236","datePublished":"2020-09-20T15:01:39+00:00","dateModified":"2023-07-05T13:24:38+00:00","mainEntityOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/"},"wordCount":296,"commentCount":1,"publisher":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png","keywords":["gc","k8s"],"articleSection":["k8s"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/","url":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/","name":"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","isPartOf":{"@id":"https:\/\/www.myway5.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#primaryimage"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png","datePublished":"2020-09-20T15:01:39+00:00","dateModified":"2023-07-05T13:24:38+00:00","breadcrumb":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#primaryimage","url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png","contentUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/09\/k8s-garbage-collection.png","width":2792,"height":2071},{"@type":"BreadcrumbList","@id":"https:\/\/www.myway5.com\/index.php\/2020\/09\/20\/kubernetes-gc\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.myway5.com\/"},{"@type":"ListItem","position":2,"name":"kubernetes \u4e2d\u7684\u5783\u573e\u56de\u6536\u673a\u5236"}]},{"@type":"WebSite","@id":"https:\/\/www.myway5.com\/#website","url":"https:\/\/www.myway5.com\/","name":"\u4e00\u53ea\u5b89\u9759\u7684\u732b","description":"\u60f3\u5565\u5462","publisher":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.myway5.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685","name":"jiangpengfei","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.myway5.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g","caption":"jiangpengfei"},"logo":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/image\/"},"url":"https:\/\/www.myway5.com\/index.php\/author\/joyme\/"}]}},"views":7076,"_links":{"self":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/comments?post=646"}],"version-history":[{"count":2,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/646\/revisions"}],"predecessor-version":[{"id":650,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/646\/revisions\/650"}],"wp:attachment":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/media?parent=646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/categories?post=646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/tags?post=646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}