0

We had an issue with clusterctl move (cluster api).

clusterctl -n org-foo move --to-kubeconfig=.kubeconfigs/.foo-1-kubeconfig
Performing move...
Discovering Cluster API objects
Error: failed to get object graph: failed to check for provisioned infrastructure: action failed after 9 attempts: error reading Cluster /: an empty namespace may not be set when a resource name is provided
make: *** [Makefile:167: create-cluster-from-cluster-yaml] Error 1

The reason was a outdated ownerRef.

Is there a way to check all objects in my cluster and report all broken ownerRefs?

guettli
  • 3,591
  • 17
  • 72
  • 123
  • This **[official document](https://kubernetes.io/docs/concepts/overview/working-with-objects/owners-dependents/)** explains the relation between owner and dependent objects in kubernetes. It also explains the cases which makes an ownerRef invalid and steps to be taken for finding invalid ownerRefences, go through this for more information. – Kranthiveer Dontineni Aug 24 '23 at 10:27
  • @KranthiveerDontineni thank you for the link. `kubectl get events -A --field-selector=reason=OwnerRefInvalidNamespace` is only about "invalid namespace". There could be other invalid references, like not existing UUIDs. – guettli Aug 24 '23 at 15:20
  • [Garbage collectors](https://kubernetes.io/docs/concepts/architecture/garbage-collection) in kubernetes will contain the information about orphaned objects, I think this might help you in finding the invalid owner UUID or deleted owner details. I will try to check if I can find more information on the same. – Kranthiveer Dontineni Aug 25 '23 at 06:52
  • Hi \`gurttli\` are your queries addressed if you are still having some queries revert back here.. – Kranthiveer Dontineni Aug 28 '23 at 03:28
  • @KranthiveerDontineni thank you for asking. I want to write a Go programm to analyze all resource in my small cluster. At the moment focused on conditions, but ownerRef checking is something which I will look at after that. https://github.com/guettli/check-conditions – guettli Aug 29 '23 at 18:58

0 Answers0