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

Install kube-state-metrics v2 in kubernetes 1.17 fails with error "unknown flag: --collectors" #1456

Closed
vukasin-nikodijevic opened this issue Apr 16, 2021 · 3 comments
Labels
helm kind/bug Categorizes issue or PR as related to a bug.

Comments

@vukasin-nikodijevic
Copy link

What happened:
Updated image tag to:

-         image: "k8s.gcr.io/kube-state-metrics/kube-state-metrics:v1.9.8"
+         image: "k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0-rc.1"

What you expected to happen:
kube-state-metrics pod start without any issue

How to reproduce it (as minimally and precisely as possible):
Just update image tag to v2.0.0-rc.1

Anything else we need to know?:

Environment:

  • kube-state-metrics version: v2.0.0-rc.1
  • Kubernetes version (use kubectl version):
Client Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.4", GitCommit:"e87da0bd6e03ec3fea7933c4b5263d151aafd07c", GitTreeState:"clean", BuildDate:"2021-02-22T19:05:30Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.16", GitCommit:"d88fadbd65c5e8bde22630d251766a634c7613b0", GitTreeState:"clean", BuildDate:"2020-12-18T15:59:27Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration: Azure AKS
  • Other info:

After installed, the ksm pod will go into CrashLoopBackOff state with following error log:

╰─➤  k logs kube-state-metrics-58c6d8d7b8-88b8r
unknown flag: --collectors
Usage of /kube-state-metrics:
unknown flag: --collectors
      --add_dir_header                   If true, adds the file directory to the header of the log messages
      --alsologtostderr                  log to standard error as well as files
.
.
.
.

If you check master branch --collectors option is still present without any conditioning based on the image version tag:
https://github.com/kubernetes/kube-state-metrics/blob/master/charts/kube-state-metrics/templates/deployment.yaml#L71

@vukasin-nikodijevic vukasin-nikodijevic added the kind/bug Categorizes issue or PR as related to a bug. label Apr 16, 2021
@lilic lilic added the helm label Apr 16, 2021
@lilic
Copy link
Member

lilic commented Apr 16, 2021

Thanks for your report, I assume this is done via helm? I don't know if helm chart is v2.0 ready, but this flag was renamed to --resources? cc @mrueg @tariq1890

Also I suggest using the k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0 as v2.0 is out now.

@mrueg
Copy link
Member

mrueg commented Apr 16, 2021

The helm chart is not upgraded yet and we will once we're migrated to the new repository.
Please track prometheus-community/helm-charts#839 and #1448 for further information.

@mrueg mrueg closed this as completed Apr 16, 2021
@vukasin-nikodijevic
Copy link
Author

@mrueg - any eta because this is real blocker for having KSM in Kubernetes v1.17+, in or without combination with kube-prometheus-stack.

Plz, be aware that 1.17 is pretty low version of kubernetes now days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
helm kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants