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

Applying the example HelloKnative.yaml file is met with "error: unable to recognize "deploy/k8s/HelloKnative.yaml": no matches for kind "Service" in version "serving.knative.dev/v1alpha1" #23

Open
marzhall opened this issue Nov 15, 2022 · 1 comment

Comments

@marzhall
Copy link

marzhall commented Nov 15, 2022

Hi All,

I'm working through the example in this repository, and unfortunately have hit an issue when applying the HelloKnative yaml file to a local k8s cluster created using kind. This may be a pebcak, but hopefully you can help me chase down the issue.

The context:

I've set up a k8s cluster using kind, and then followed the Install by using KNative Operator page to install KNative on my local cluster.

The output of the status commands in that document are:

$: kubectl get KnativeServing knative-serving -n knative-serving
  1 #!/bin/bash
NAME              VERSION   READY     REASON
knative-serving   1.8.0     True      

and

$: kubectl get deployment -n knative-serving
NAME                     READY     UP-TO-DATE   AVAILABLE   AGE
3scale-kourier-gateway   1/1       1            1           134m
activator                1/1       1            1           153m
autoscaler               1/1       1            1           153m
autoscaler-hpa           1/1       1            1           153m
controller               1/1       1            1           153m
domain-mapping           1/1       1            1           153m
domainmapping-webhook    1/1       1            1           153m
net-kourier-controller   1/1       1            1           134m
webhook                  1/1       1            1           153m

I then switched to this repository. I uploaded a docker image to my kind cluster of an image that serves on port 8080 like the given example:

$: kind load docker-image apiserve:latest
Image: "" with ID "sha256:e69c8945cdd93920647824db2c10a62adc3e1c71c2f78f698dac38fa31190de0" not yet present on node "kind-control-plane", loading...

And then created a yaml file for the image:

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: apiserv-test
  namespace: default
spec:
  template:
    spec:
      containers:
        - image: apiserve:latest

and placed it in the file HelloKnative.yaml.

Notably, this differs from the example in this repo in one way: instead of pulling from dockerhub, it uses the local image. I could be incorrect, but I don't believe this should impact the error I'm receiving.

The error:

After performing kubectl apply --filename deploy/k8s/HelloKnative.yaml, I receive the error described in the title:

$: kubectl apply --filename deploy/k8s/HelloKnative.yaml 
error: unable to recognize "deploy/k8s/HelloKnative.yaml": no matches for kind "Service" in version "serving.knative.dev/v1alpha1"

Notes:

I did find someone else experiencing this error in another repo here, with a different context. The assertion in that repo is that the schema used in this example repo is out of date, however when I attempted to use the schema described in the link that may have been updated, the application fails as well. To be clear, the second approach I tried was:

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: apiserv-test
  namespace: default
spec:
  runLatest:
    configuration:
      revisionTemplate:
        spec:
          container:
            - image: apiserve:latest

This also failed with:

$:  kubectl apply --filename deploy/k8s/HelloKnative.yaml 
error: unable to recognize "deploy/k8s/HelloKnative.yaml": no matches for kind "Service" in version "serving.knative.dev/v1alpha1"

which matches my understanding of the error, since it seems the issue is that there's no schema called "Service" at all, regardless of its sub-layout.

Let me know if this is enough information to help, or if you could use more.

Thanks!

Marshall

@marzhall
Copy link
Author

marzhall commented Nov 15, 2022

Note - I found a solution:

Replacing serving.knative.dev/v1alpha1 with apiVersion: serving.knative.dev/v1 solves the issue.

I found this via the documentation here.

Depending on how this repo should be treated, I'd suppose either the repo should be updated with a PR or deleted so as to not confuse other devs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant