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

local path provisioner helper script does not support -a flag #9950

Closed
brandond opened this issue Apr 15, 2024 · 1 comment
Closed

local path provisioner helper script does not support -a flag #9950

brandond opened this issue Apr 15, 2024 · 1 comment
Assignees
Labels
area/local-storage kind/bug Something isn't working
Milestone

Comments

@brandond
Copy link
Member

brandond commented Apr 15, 2024

rancher/local-path-provisioner#360 added a new -a flag that is passed to the helper script.
The arg parser in our helper script throws an error because it only supports -m/-s/-p:

while getopts "m:s:p:" opt

time="2024-04-15T21:34:48Z" level=info msg="Illegal option -a"

We should probably stop parsing the args entirely, and just use the env vars instead, which have been available (and preferred over the args) since rancher/local-path-provisioner#177

$ k logs pod/local-path-provisioner-6c86858495-9lkr6 -n kube-system

I0415 18:42:38.079959       1 controller.go:811] Starting provisioner controller rancher.io/local-path_local-path-provisioner-6c86858495-9lkr6_62958260-9704-4ca4-ab3a-6038ed1fef65!
I0415 18:42:38.180437       1 controller.go:860] Started provisioner controller rancher.io/local-path_local-path-provisioner-6c86858495-9lkr6_62958260-9704-4ca4-ab3a-6038ed1fef65!
I0415 21:31:29.264836       1 controller.go:1337] provision "default/test-pvc" class "local-path": started
time="2024-04-15T21:31:29Z" level=info msg="Creating volume pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 at ip-1-1-23:/var/lib/rancher/k3s/storage/pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7_default_test-pvc"
time="2024-04-15T21:31:29Z" level=info msg="create the helper pod helper-pod-create-pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 into kube-system"
I0415 21:31:29.268005       1 event.go:298] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"test-pvc", UID:"1cfed247-e7e4-4da8-b7d7-ffcefe3288c7", APIVersion:"v1", ResourceVersion:"29078", FieldPath:""}): type: 'Normal' reason: 'Provisioning' External provisioner is provisioning volume for claim "default/test-pvc"
time="2024-04-15T21:31:32Z" level=info msg="Volume pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 has been created on ip-1-1-23:/var/lib/rancher/k3s/storage/pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7_default_test-pvc"
time="2024-04-15T21:31:32Z" level=info msg="Start of helper-pod-create-pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 logs"
time="2024-04-15T21:31:32Z" level=info msg="Illegal option -a"
time="2024-04-15T21:31:32Z" level=info msg="End of helper-pod-create-pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 logs"
I0415 21:31:32.343240       1 controller.go:1442] provision "default/test-pvc" class "local-path": volume "pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7" provisioned
I0415 21:31:32.343275       1 controller.go:1455] provision "default/test-pvc" class "local-path": succeeded
I0415 21:31:32.343283       1 volume_store.go:212] Trying to save persistentvolume "pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7"
I0415 21:31:32.349700       1 volume_store.go:219] persistentvolume "pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7" saved
I0415 21:31:32.349918       1 event.go:298] Event(v1.ObjectReference{Kind:"PersistentVolumeClaim", Namespace:"default", Name:"test-pvc", UID:"1cfed247-e7e4-4da8-b7d7-ffcefe3288c7", APIVersion:"v1", ResourceVersion:"29078", FieldPath:""}): type: 'Normal' reason: 'ProvisioningSucceeded' Successfully provisioned volume pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7
I0415 21:34:46.530546       1 controller.go:1471] delete "pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7": started
time="2024-04-15T21:34:46Z" level=info msg="Deleting volume pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 at ip-1-1-23:/var/lib/rancher/k3s/storage/pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7_default_test-pvc"
time="2024-04-15T21:34:46Z" level=info msg="create the helper pod helper-pod-delete-pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 into kube-system"
time="2024-04-15T21:34:48Z" level=info msg="Volume pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 has been deleted on ip-1-1-23:/var/lib/rancher/k3s/storage/pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7_default_test-pvc"
time="2024-04-15T21:34:48Z" level=info msg="Start of helper-pod-delete-pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 logs"
time="2024-04-15T21:34:48Z" level=info msg="Illegal option -a"
time="2024-04-15T21:34:48Z" level=info msg="End of helper-pod-delete-pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7 logs"
I0415 21:34:48.607227       1 controller.go:1486] delete "pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7": volume deleted
I0415 21:34:48.611467       1 controller.go:1531] delete "pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7": persistentvolume deleted
I0415 21:34:48.611485       1 controller.go:1536] delete "pvc-1cfed247-e7e4-4da8-b7d7-ffcefe3288c7": succeeded

Modified from a comment posted by @VestigeJ in #9834 (comment)

@VestigeJ
Copy link

VestigeJ commented Jun 3, 2024

Issue produced over here #9834 (comment)
Validated using COMMIT=79ba10f5ec88a2458b44f67d009b4ee071918e4d

$ kgp -n kube-system

NAME                                      READY   STATUS      RESTARTS   AGE
coredns-576bfc4dc7-rvspk                  1/1     Running     0          40s
helm-install-traefik-crd-6rj2w            0/1     Completed   0          41s
helm-install-traefik-gk2mp                0/1     Completed   1          41s
local-path-provisioner-86f46b7bf7-5k9rk   1/1     Running     0          40s
metrics-server-557ff575fb-8pfkv           1/1     Running     0          40s
svclb-traefik-ea6d4437-vfsdl              2/2     Running     0          25s
traefik-5fb479b77-cbqgc                   1/1     Running     0          25s

attn -
$ k logs pod/local-path-provisioner-86f46b7bf7-5k9rk -n kube-system

I0603 22:49:28.213635       1 controller.go:811] Starting provisioner controller rancher.io/local-path_local-path-provisioner-86f46b7bf7-5k9rk_e1e6a092-35b8-49f2-8c24-e4b2682f32ca!
I0603 22:49:28.314757       1 controller.go:860] Started provisioner controller rancher.io/local-path_local-path-provisioner-86f46b7bf7-5k9rk_e1e6a092-35b8-49f2-8c24-e4b2682f32ca!

$ k get deploy -n kube-system local-path-provisioner -o
jsonpath='{$.spec.template.spec.containers[:1].image}'

rancher/local-path-provisioner:v0.0.27

$ kgn -o wide

NAME              STATUS   ROLES                       AGE   VERSION                INTERNAL-IP    EXTERNAL-IP     OS-IMAGE                              KERNEL-VERSION              CONTAINER-RUNTIME
ip-1-1-1-58       Ready    control-plane,etcd,master   23m   v1.30.1+k3s-79ba10f5   1.1.1.58       18.218.113.56   SUSE Linux Enterprise Server 15 SP5   5.14.21-150500.53-default   containerd://1.7.17-k3s1

@VestigeJ VestigeJ closed this as completed Jun 3, 2024
@github-project-automation github-project-automation bot moved this from Peer Review to Done Issue in K3s Development Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/local-storage kind/bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

3 participants