akash-gautam / bookstore-operator-golang

5 stars 6 forks source link

how to delete correlation resource? #1

Open damozhiying opened 4 years ago

damozhiying commented 4 years ago

thanks a lot ,from your blog learn more,now i have question,how to delete the Statefulset and svc when i delete BookStore example-bookstore

kubectl delete BookStore example-bookstore

the Statefulset and services reource not delete

damozhiying commented 4 years ago
kubectl describe StatefulSet example-bookstore

there is no ownerReferences field in StatefulSet pods has ownerReferences spce field,so delete StatefulSet can delete correlation pods

ownerReferences:
  - apiVersion: blog.velotio.com/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: BookStore
    name: example-bookstore
    uid: 0ef42889-deb4-11e9-ba56-42010a800256
  resourceVersion: "20295281"