In kubernetes apiserver, what's the function of 'SetSelfLink' when we get or list resources

11/16/2016

In kube-apiserver, when we get or list a resource, in resthandler.go it will set the 'SelfLink', it will result in little performance loss. I wonder what's the meaning of it, ObjectMeta.SelfLink has already been set in etcd, why reset it? Thanks.

-- Bling
kubernetes

1 Answer

11/17/2016

You're right, its redundant and unnecessary. It shouldn't be set especially when we persisting items to disk (etcd). SelfLink is only useful for kube clients and not for the apiserver.

Indeed, this is an issue being tracked in the kubernetes repo here: https://github.com/kubernetes/kubernetes/issues/2797

-- Matt Rickard
Source: StackOverflow