Skip to content

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

Description

@marzhall

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions