<p>Yesterday I created a new kubernetes cluster (v1.20.1, on prem) and I wanted to add NFS provisioning. The only NFS provisioner available (and still maintained) seems to be <a href="https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner" rel="nofollow noreferrer">https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner</a>.</p>
<p>It does say to use your own provisioner and the default (quay.io/external_storage/nfs-client-provisioner:latest) is two years old, but I don't have my own provisioner.</p>
<p>When I follow the deployment guide without the helm chart and check the nfs-client-provisioner log I see the following:</p>
<pre><code>I1220 22:20:44.160099       1 leaderelection.go:185] attempting to acquire leader lease  default/fuseim.pri-ifs...
E1220 22:21:01.598029       1 event.go:259] Could not construct reference to: '&amp;v1.Endpoints{TypeMeta:v1.TypeMeta{Kind:&quot;&quot;, APIVersion:&quot;&quot;}, ObjectMeta:v1.ObjectMeta{Name:&quot;fuseim.pri-ifs&quot;, GenerateName:&quot;&quot;, Namespace:&quot;default&quot;, SelfLink:&quot;&quot;, UID:&quot;c852ca40-471f-4019-a099-d72d32555022&quot;, ResourceVersion:&quot;134579&quot;, Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:63744022156, loc:(*time.Location)(0x1956800)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string{&quot;control-plane.alpha.kubernetes.io/leader&quot;:&quot;{\&quot;holderIdentity\&quot;:\&quot;nfs-client-provisioner-5999484954-n4tj7_94db294f-4261-11eb-9b30-c64536689731\&quot;,\&quot;leaseDurationSeconds\&quot;:15,\&quot;acquireTime\&quot;:\&quot;2020-12-20T01:21:01Z\&quot;,\&quot;renewTime\&quot;:\&quot;2020-12-20T01:21:01Z\&quot;,\&quot;leaderTransitions\&quot;:2}&quot;}, OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:&quot;&quot;}, Subsets:[]v1.EndpointSubset(nil)}' due to: 'selfLink was empty, can't make reference'. Will not report event: 'Normal' 'LeaderElection' 'nfs-client-provisioner-5999484954-n4tj7_94db294f-4261-11eb-9b30-c64536689731 became leader'
I1220 22:21:01.598123       1 leaderelection.go:194] successfully acquired lease default/fuseim.pri-ifs
I1220 22:21:01.598198       1 controller.go:631] Starting provisioner controller fuseim.pri/ifs_nfs-client-provisioner-5999484954-n4tj7_94db294f-4261-11eb-9b30-c64536689731!
I1220 22:21:01.709535       1 controller.go:680] Started provisioner controller fuseim.pri/ifs_nfs-client-provisioner-5999484954-n4tj7_94db294f-4261-11eb-9b30-c64536689731!
I1220 22:21:01.717419       1 controller.go:987] provision &quot;default/test-claim&quot; class &quot;managed-nfs-storage&quot;: started
E1220 22:21:01.720318       1 controller.go:1004] provision &quot;default/test-claim&quot; class &quot;managed-nfs-storage&quot;: unexpected error getting claim reference: selfLink was empty, can't make reference
I1220 22:36:01.615073       1 controller.go:987] provision &quot;default/test-claim&quot; class &quot;managed-nfs-storage&quot;: started
E1220 22:36:01.618195       1 controller.go:1004] provision &quot;default/test-claim&quot; class &quot;managed-nfs-storage&quot;: unexpected error getting claim reference: selfLink was empty, can't make reference
</code></pre>
<p>Is this a problem with my cluster or with this provisioner? I really have no clue.</p>
<p>I can also just ditch this provisioner, or even NFS, for something else. I just need storage per pod instance to work, e.g. volumeClaimTemplates, stored outside of my kubernetes cluster. If anyone has any suggestions, please let me know!</p>
<p>Thanks in advance,
Hendrik</p>

<p>You are seeing this error beacause of this: <a href="https://github.com/kubernetes/enhancements/issues/1164" rel="noreferrer">KEP-1164: Deprecate and Remove SelfLink</a></p>
<p>Quote from mentioned KEP:</p>
<blockquote>
<p>In v1.16, we will deprecate the SelfLink field in both ObjectMeta and
ListMeta objects by:
documenting in field definition that it is deprecated and is going to
be removed adding a release-note about field deprecation We will also
introduce a feature gate to allow disabling setting SelfLink fields
and opaque the logic setting it behind this feature gate.</p>
<p><strong>In v1.20 (12 months and 4 release from v1.16) we will switch off the feature gate</strong>
<strong>which will automatically disable setting SelfLinks. However it will</strong>
<strong>still be possible to revert the behavior by changing value of a</strong>
<strong>feature gate</strong>.</p>
<p>In v1.21, we will get rid of the whole code propagating those fields
and fields themselves. In the meantime, we will go over places
referencing that field (see below) and get rid of those too.</p>
</blockquote>
<p>As you see, you can enable it back with <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/" rel="noreferrer">featureGate</a>: <code>RemoveSelfLink=false</code> although its not recommented and SelfLink will be permamently removed in v1.21</p>
<p>Also check this issue on github: <a href="https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/issues/25" rel="noreferrer">Using Kubernetes v1.20.0, getting &quot;unexpected error getting claim reference: selfLink was empty, can't make reference</a></p>
