Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostpath-provisioner: unexpected error getting claim reference: selfLink was empty, can't make reference #113

Closed
dreyTee opened this issue Sep 1, 2021 · 5 comments

Comments

@dreyTee
Copy link

dreyTee commented Sep 1, 2021

Is this a request for help?: yes


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BugReport

Version of Helm and Kubernetes:
k8s: 1.21.3
helm: 3.6.3

Which chart: hostpath-provisioner

What happened:
Provisioner doesn't provision PVs:

I0901 10:41:21.403079       1 controller.go:926] provision "local-ns/s3" class "SomeName": started
E0901 10:41:21.410537       1 controller.go:943] provision "local-ns/s3" class "SomeName": unexpected error getting claim reference: selfLink was empty, can't make reference

Googled and found similar issue in nfs provisioner (kubernetes-sigs/nfs-subdir-external-provisioner#25).
k8s from v1.20.0 changed default behaviour and started using RemoveSelfLink=true
Workaround for kube-apiserver was to pass --feature-gates=RemoveSelfLink=false as argument or load via kubectl apply -f. It worked until k8s v1.21.0
Now I can't make hostpath-provisioner work with kind cluster.

What you expected to happen:
Provisioner should provision PVs.

How to reproduce it (as minimally and precisely as possible):

  1. start kind cluster with default settings
  2. helm install hostpath-provisioner (any way of installation could be used, use --set storageClass.name="SomeName")
  3. add a PVC request for a storage class "SomeName"

Anything else we need to know:
Any help will be appreciated.

@dreyTee dreyTee changed the title unexpected error getting claim reference: selfLink was empty, can't make reference hostpath-provisioner: unexpected error getting claim reference: selfLink was empty, can't make reference Sep 1, 2021
@rimusz
Copy link
Owner

rimusz commented Sep 8, 2021

I'm not sure how I can help here as it is based on kubernetes-sigs/sig-storage-lib-external-provisioner/hostpath-provisioner example project which wasn't updated for the last 3 years except the go version

@tuananhnguyen-ct
Copy link
Contributor

@rimusz it might be related to rimusz/hostpath-provisioner#8 which I'm taking a look into.

@rimusz
Copy link
Owner

rimusz commented Sep 8, 2021

@tuananhnguyen-ct please try tag v0.2.5 I have built it for testing on 1.21.x
rimusz/hostpath-provisioner@c890bee

@rimusz
Copy link
Owner

rimusz commented Sep 8, 2021

I did run tests on kind:

$ kubectl version --short
Client Version: v1.22.1
Server Version: v1.21.1

$ helm upgrade --install hostpath-provisioner -n hostpath-provisioner center/hostpath-provisioner --set image.tag=v0.2.5
Release "hostpath-provisioner" has been upgraded. Happy Helming!
NAME: hostpath-provisioner
LAST DEPLOYED: Wed Sep  8 14:06:20 2021
NAMESPACE: hostpath-provisioner
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
The Hostpath Provisioner service has now been installed.

A storage class named 'hostpath' has now been created
and is available to provision dynamic volumes.

You can use this storageclass by creating a `PersistentVolumeClaim` with the
correct storageClassName attribute. For example:

    ---
    kind: PersistentVolumeClaim
    apiVersion: v1
    metadata:
      name: test-dynamic-volume-claim
    spec:
      storageClassName: "hostpath"
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 100Mi

$ kubectl apply pvc-test.yaml
persistentvolumeclaim/test-dynamic-volume-claim created

$ kubectl get pvc
NAME                        STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
test-dynamic-volume-claim   Bound    pvc-fd7fc554-c83e-4696-a284-8779e405f381   100Mi      RWO            hostpath       22s

Screenshot 2021-09-08 at 14 10 35

Looking good, I'm going to merge my PR rimusz/hostpath-provisioner#10

@rimusz
Copy link
Owner

rimusz commented Sep 8, 2021

Fixed in #114

@rimusz rimusz closed this as completed Sep 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants