Welcome to the Linux Foundation Forum!

Lab 13.3. How to fix metrics-server "no matches for kind "APIService"" error?

Hi!

I'm stuck on lab 13.3, step 3:

[08:32][email protected][metrics-server]$ kubectl create -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml
clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created
clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created
rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created
serviceaccount/metrics-server created
deployment.apps/metrics-server created
service/metrics-server created
clusterrole.rbac.authorization.k8s.io/system:metrics-server created
clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created
error: unable to recognize "https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml": no matches for kind "APIService" in version "apiregistration.k8s.io/v1beta1"

I've seen "Be aware as new versions are released there may be some changes to the process and
the created objects" but could not fix it anyway.

Could anybody help?

Answers

  • serewicz
    serewicz Posts: 971

    Hello,

    What version of the software are you using? This is what I see when I run the steps with a setup as declared in the lab:

    [email protected]:~# cd metrics-server/ ; less README.md
    [email protected]:~/metrics-server# kubectl create -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml
    clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created
    clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created
    rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created
    Warning: apiregistration.k8s.io/v1beta1 APIService is deprecated in v1.19+, unavailable in v1.22+; use apiregistration.k8s.io/v1 APIService
    apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created
    serviceaccount/metrics-server created
    deployment.apps/metrics-server created
    service/metrics-server created
    clusterrole.rbac.authorization.k8s.io/system:metrics-server created
    clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created
    [email protected]:~/metrics-server#

  • ahailes
    ahailes Posts: 5

    I got the same error and the following seemed to fix it:
    1) run kubectl delete -f https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.3.7/components.yaml to delete the components created by the 0.3.7 file
    2) run kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml as suggested in the project README.

    The problem seems to be that apiregistration.k8s.io is out of beta, and fully deprecated as of kubernetes version 1.22, as noted in serewicz's output. The version I'm on is 1.22 and I believe that's what the course is expecting us to be on at this point. So it should probably be updated to not tell us to use a components file that won't work with our version.

  • goosecoder
    goosecoder Posts: 1
    edited November 22

    I agree, it seems the lessons need some updates, in one previous lesson lab we upgraded our instances/nodes to kubernetes 1.22.1, at this point that yaml is expected to be compatible with that k8s version. Thanks for posting the url of the compatible yaml.

  • serewicz
    serewicz Posts: 971

    Hello,

    Step 2 of exercise 13.3 mentions the software changes and to reference the current README.md file for updated information.

    Step 3 of exercise 13.3 says

    "Be aware as new versions are released there may be some changes to the process and
    the created objects. Use the components.yaml to create the objects."

    Should one read the README and follow the most current directions the labs work. At least as of today they do. With dynamic software there are times when an update or change causes an issue, and one would need to revisit the steps when the new fix is produced.

    Regards,

Categories

Upcoming Training