Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Metrics Server not available on a fresh install #7131

Closed
Metamogul opened this issue Mar 21, 2023 · 3 comments
Closed

Metrics Server not available on a fresh install #7131

Metamogul opened this issue Mar 21, 2023 · 3 comments

Comments

@Metamogul
Copy link

Environmental Info:
K3s Version:

k3s version v1.25.7+k3s1 (f7c20e23)
go version go1.19.6

Node(s) CPU architecture, OS, and Version:

Linux virtualpi3 5.10.0-21-arm64 #1 SMP Debian 5.10.162-1 (2023-01-21) aarch64 GNU/Linux

Cluster Configuration:

1 Single Server

Describe the bug:
When installing a k3s server via curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644 on a fresh debian-based system, the metrics server seems to be unavailabe. This is what kubectl get apiservices returns:

NAME                                   SERVICE                      AVAILABLE                   AGE
v1.admissionregistration.k8s.io        Local                        True                        12s
v1.                                    Local                        True                        12s
v1.authentication.k8s.io               Local                        True                        12s
v1.apiextensions.k8s.io                Local                        True                        12s
v1.apps                                Local                        True                        12s
v1.autoscaling                         Local                        True                        12s
v1.batch                               Local                        True                        12s
v2.autoscaling                         Local                        True                        12s
v1.authorization.k8s.io                Local                        True                        12s
v1.certificates.k8s.io                 Local                        True                        12s
v1.discovery.k8s.io                    Local                        True                        12s
v1.events.k8s.io                       Local                        True                        12s
v2beta2.autoscaling                    Local                        True                        12s
v1.coordination.k8s.io                 Local                        True                        12s
v1beta2.flowcontrol.apiserver.k8s.io   Local                        True                        12s
v1.node.k8s.io                         Local                        True                        12s
v1.networking.k8s.io                   Local                        True                        12s
v1beta1.flowcontrol.apiserver.k8s.io   Local                        True                        12s
v1.policy                              Local                        True                        12s
v1.rbac.authorization.k8s.io           Local                        True                        12s
v1beta1.storage.k8s.io                 Local                        True                        12s
v1.scheduling.k8s.io                   Local                        True                        12s
v1.storage.k8s.io                      Local                        True                        12s
v1.k3s.cattle.io                       Local                        True                        10s
v1.helm.cattle.io                      Local                        True                        10s
v1beta1.metrics.k8s.io                 kube-system/metrics-server   False (EndpointsNotFound)   7s

Subsequent commands that rely on the metrics server like kubectl top nodes fail, the given example with the output

Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)

Steps To Reproduce:

Install k3s via the command provided above on a fresh Dietpi install in a VM.

Expected behavior:

After the given install command I would expect k3s to install the metrics server that was not disabled.

Actual behavior:

The metrics server seems to be not reachable. This leads to the failure of other components relying on it. Since this is my starting point to teach myself the k8s framework, I don't have the slightest clue what has gone wrong here and how I could fix it.

Additional context / logs:

Output from install command provided above:

[INFO]  Finding release for channel stable
[INFO]  Using v1.25.7+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.25.7+k3s1/sha256sum-arm64.txt
[INFO]  Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.25.7+k3s1/k3s-arm64
[INFO]  Verifying binary download
[INFO]  Installing k3s to /usr/local/bin/k3s
[INFO]  Skipping installation of SELinux RPM
[INFO]  Creating /usr/local/bin/kubectl symlink to k3s
[INFO]  Creating /usr/local/bin/crictl symlink to k3s
[INFO]  Creating /usr/local/bin/ctr symlink to k3s
[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh
[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service
[INFO]  systemd: Enabling k3s unit
Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service.
[INFO]  systemd: Starting k3s
@brandond
Copy link
Contributor

Have you checked the actual Metrics Server pod logs to see why it's not available? You've checked everything except the actual application hosting the service.

@Metamogul
Copy link
Author

Can you help me? According to the documentation kubectl logs <podname> should return the logs, but if I enter the name of the pod (metrics-server-5f9f776df5-ncr9b) I just get:

Error from server (NotFound): pods "metrics-server-5f9f776df5-ncr9b" not found

I looks like the pod couldn't be created in the first place. This looks like a bigger issue to me.

@brandond
Copy link
Contributor

did you remember to specify the namespace?

@k3s-io k3s-io locked and limited conversation to collaborators Mar 21, 2023
@brandond brandond converted this issue into discussion #7132 Mar 21, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants