kube-vip/kube-vip-cloud-provider

issue with missing version in the kube-vip-cloud-provider:v0.0.9 image

raphaelpoumarede opened this issue · 8 comments

Hello I'm using a tool to setup my K8s cluster which rely on the kube-vip-cloud-provider.
We have an ansible task runing the following command:

kubectl apply -f https://raw.githubusercontent.com/kube-vip/kube-vip-cloud-provider/main/manifest/kube-vip-cloud-controller.yaml

Until last week it was working fine, but this morning I noticed that the pod was failing to get the "running" state.

Here is the pod's error :

panic: version string "" doesn't match expected regular expression: "^v(\d+\.\d+\.\d+)"                                                                                                                            │
│                                                                                                                                                                                                                    │
│ goroutine 1 [running]:                                                                                                                                                                                             │
│ k8s.io/component-base/metrics.parseVersion({{0x0, 0x0}, {0x0, 0x0}, {0x1f44b17, 0x0}, {0x1c97daf, 0xb}, {0x0, 0x0}, ...})                                                                                          │
│     /go/pkg/mod/k8s.io/component-base@v0.25.4/metrics/version_parser.go:47 +0x274                                                                                                                                  │
│ k8s.io/component-base/metrics.newKubeRegistry({{0x0, 0x0}, {0x0, 0x0}, {0x1f44b17, 0x0}, {0x1c97daf, 0xb}, {0x0, 0x0}, ...})                                                                                       │
│     /go/pkg/mod/k8s.io/component-base@v0.25.4/metrics/registry.go:320 +0x119                                                                                                                                       │
│ k8s.io/component-base/metrics.NewKubeRegistry()                                                                                                                                                                    │
│     /go/pkg/mod/k8s.io/component-base@v0.25.4/metrics/registry.go:335 +0x78                                                                                                                                        │
│ k8s.io/component-base/metrics/legacyregistry.init()                                                                                                                                                                │
│     /go/pkg/mod/k8s.io/component-base@v0.25.4/metrics/legacyregistry/registry.go:29 +0x1d                                                                                                                          │
│ Stream closed EOF for kube-system/kube-vip-cloud-provider-578d9b7bf7-z6t4f (kube-vip-cloud-provider) `

When I used the previous version of kube-vip-cloud-provider manifest (v0.0.8), in my kubectl apply command:

https://raw.githubusercontent.com/kube-vip/kube-vip-cloud-provider/v0.0.8/manifest/kube-vip-cloud-controller.yaml

Then I was able to have a running pod. It seems to me that the issue come from this recent commit : 71f730d

I could be wrong but the error looks like the "version" ARG was not passed when the new docker image was built, which caused the error above when trying to run the image defined in the kube-vip-cloud-controller.yaml manisfest.

Thanks

pionar commented

The same here #94

I made fresh installation and I have the same problem. Right now v0.0.9 is impossible to use.

Thanks. Let me look into it

I need to check how release job is done. when I tried locally to build image with make image-amd64-build-only it does shows version is correct

I0122 17:27:50.416745       1 serving.go:348] Generated self-signed cert in-memory
W0122 17:27:51.071651       1 client_config.go:617] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I0122 17:27:51.072111       1 controllermanager.go:145] Version: v0.0.9

In the release job log it somehow passed empty version

#38 [linux/arm64 builder 5/5] RUN --mount=type=cache,target=/root/.cache/go-build     --mount=type=cache,target=/go/pkg/mod     --mount=type=cache,target=/root/.local/share/golang     CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w -extldflags -static -X k8s.io/component-base/version.gitVersion= -s" -o kube-vip-cloud-provider
#38 ...

Pushing dev tag to test this now #96

Ok the dev job looks good
https://github.com/kube-vip/kube-vip-cloud-provider/actions/runs/7615359814/job/20739705540

#39 ...
#37 [linux/amd64 builder 5/5] RUN --mount=type=cache,target=/root/.cache/go-build     --mount=type=cache,target=/go/pkg/mod     --mount=type=cache,target=/root/.local/share/golang     CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w -extldflags -static -X k8s.io/component-base/version.gitVersion=v0.0.9-alpha" -o kube-vip-cloud-provider
#37 DONE 254.6s
#40 [linux/amd64 stage-1 2/2] COPY --from=builder /src/kube-vip-cloud-provider /
#40 DONE 0.2s
#38 [linux/arm64 builder 5/5] RUN --mount=type=cache,target=/root/.cache/go-build     --mount=type=cache,target=/go/pkg/mod     --mount=type=cache,target=/root/.local/share/golang     CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w -extldflags -static -X k8s.io/component-base/version.gitVersion=v0.0.9-alpha" -o kube-vip-cloud-provider     <---- -----------------------version

Cutting new v0.0.9 release again.

Verified now the 0.0.9 release works

provider-578d9b7bf7-9f8vl
I0122 20:01:19.174030       1 serving.go:348] Generated self-signed cert in-memory
W0122 20:01:19.487691       1 client_config.go:617] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
I0122 20:01:19.488463       1 provider.go:59] Watching configMap for pool config with name: 'kubevip', namespace: 'kube-system'
I0122 20:01:19.488620       1 controllermanager.go:145] Version: v0.0.9