DevilKing's blog

冷灯看剑,剑上几分功名?炉香无需计苍生,纵一穿烟逝,万丈云埋,孤阳还照古陵

0%

k8s garbage collection

原文链接

1
2
3
4
5
6
7
8
9
10
11
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”.

1
kubectl get database postgres -oyaml | grep uid

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