cluster-api icon indicating copy to clipboard operation
cluster-api copied to clipboard

Removing symbol table and DRAWF debugging info from release images and binaries

Open Sunnatillo opened this issue 2 months ago • 6 comments

What would you like to be added (User Story)?

We can remove symbol table and DRAWF debegging info from release images and binaries to significantly reduce the size of the images. Kubernetes does the same for release images: https://github.com/kubernetes/kubernetes/blob/9b9cd768a05782b6cfeef62bec7696b441d7ad93/build/root/Makefile#L89

Detailed Description

ldflags="$(LDFLAGS) -w -s"

Current images

kubeadm-control-plane-controller-amd64   97.4MB
kubeadm-bootstrap-controller-amd64      88.9MB
cluster-api-controller-amd64   		95.2MB

After removing DWARF and symbol table

kubeadm-control-plane-controller-amd64   67.7MB
kubeadm-bootstrap-controller-amd64      61.9MB
cluster-api-controller-amd64            66.3MB

Anything else you would like to add?

No response

Label(s) to be applied

/kind feature One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels.

Sunnatillo avatar Oct 14 '25 08:10 Sunnatillo

I am not sure if this considered as a feature but I could not find other suitable label.

Sunnatillo avatar Oct 14 '25 08:10 Sunnatillo

What is the size of the binaries/images with and without the flags? (just curious)

sbueringer avatar Oct 14 '25 08:10 sbueringer

What is the size of the binaries/images with and without the flags? (just curious)

Current images

kubeadm-control-plane-controller-amd64   97.4MB
kubeadm-bootstrap-controller-amd64      88.9MB
cluster-api-controller-amd64   		95.2MB

After removing DWARF and symbol table

kubeadm-control-plane-controller-amd64   67.7MB
kubeadm-bootstrap-controller-amd64      61.9MB
cluster-api-controller-amd64            66.3MB

30 percent reduction in image size

Sunnatillo avatar Oct 14 '25 08:10 Sunnatillo

Seems good to me. Please just link the place where k/k is doing it for reference

sbueringer avatar Oct 14 '25 08:10 sbueringer

Seems good to me. Please just link the place where k/k is doing it for reference

Updated the with the link

Sunnatillo avatar Oct 14 '25 08:10 Sunnatillo

/assign

Sunnatillo avatar Oct 14 '25 08:10 Sunnatillo