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来关联