Skip to content
gqlxj1987's Blog
Go back

k8s garbage collection

Edit page

原文链接

apiVersion: v1
kind: Namespace
metadata:
   name: postgres-namespace
   ownerReferences:
    - apiVersion: v1
      controller: true
      blockOwnerDeletion: true
      kind: Database
      name: postgres
      uid: 1552c2c2-8ea1-11e8-8289-02ee24bb8af6

ownerRefrences

when we delete the database called postgres, this should result in the automatic garbage collection of the namespace “postgres-namespace”.

kubectl get database postgres -oyaml | grep uid

通过ownerRefrence去关联不同scope之间的resouce,但始终都有一个uid来关联


Edit page
Share this post on:

Previous Post
APM调用链
Next Post
migrate rest to http/2