0

I'm learning to use the metrics server it everything was going ok, I am using Docker for desktop and I installed the metrics server and the "top" command works fine but when I try to query the API using the following command

kubectl get --raw /apis/metrics.k8s.io/v1beta1/nodes/ | jq

I get

Error from server (NotFound): the server could not find the requested resource

I've been looking into this problem for a while, Tried altering the command but nothing worked I get the same Error

I thought the installation was the issue, But everything is configured right I think, When I run

 kubectl describe apiservice v1beta1.metrics.k8s.io

I Get

Name:         v1beta1.metrics.k8s.io
Namespace:
Labels:       k8s-app=metrics-server
Annotations:  <none>
API Version:  apiregistration.k8s.io/v1
Kind:         APIService
Metadata:
  Creation Timestamp:  2022-08-08T11:52:17Z
  Managed Fields:
    API Version:  apiregistration.k8s.io/v1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        f:conditions:
          .:
          k:{"type":"Available"}:
            .:
            f:lastTransitionTime:
            f:message:
            f:reason:
            f:status:
            f:type:
    Manager:      kube-apiserver
    Operation:    Update
    Subresource:  status
    Time:         2022-08-08T11:52:17Z
    API Version:  apiregistration.k8s.io/v1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:labels:
          .:
          f:k8s-app:
      f:spec:
        f:group:
        f:groupPriorityMinimum:
        f:insecureSkipTLSVerify:
        f:service:
          .:
          f:name:
          f:namespace:
          f:port:
        f:version:
        f:versionPriority:
    Manager:      kubectl-create
    Operation:    Update
    Time:         2022-08-08T11:52:17Z
    API Version:  apiregistration.k8s.io/v1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
    Manager:         kubectl-client-side-apply
    Operation:       Update
    Time:            2022-08-09T21:32:11Z
  Resource Version:  2821127
  UID:               43dc8cdb-6e61-4e15-b9d7-e18136da230f
Spec:
  Group:                     metrics.k8s.io
  Group Priority Minimum:    100
  Insecure Skip TLS Verify:  true
  Service:
    Name:            metrics-server
    Namespace:       kube-system
    Port:            443
  Version:           v1beta1
  Version Priority:  100
Status:
  Conditions:
    Last Transition Time:  2022-08-09T13:50:09Z
    Message:               all checks passed
    Reason:                Passed
    Status:                True
    Type:                  Available
Events:                    <none>
David Maze
  • 130,717
  • 29
  • 175
  • 215

1 Answers1

-1

SOLVED

I'm on a windows machine but I use bash because it's easier for me but for some reason that I don't really understand everything worked fine on the windows command prompt (CMD)

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 23 '22 at 18:04