Kubeedge on Kataocoda - no matches for kind "Node" in version "v1"

9/29/2019

I am following Kubeedge v1.0.0 deployment on Katacoda and on executing the following command.

kubectl apply -f $GOPATH/src/github.com/kubeedge/kubeedge/build/node.json -s <kubedge-node-ip-address>:8080 

It gives me an error

error: unable to recognize "/root/kubeedge/src/github.com/kubeedge/kubeedge/build/node.json": no matches for kind "Node" in version "v1"

Tried searching for this error but found no relevant answers. Anyone has idea on to get through this?

Below is the content of my node.json file

{
  "kind": "Node",
  "apiVersion": "v1",
  "metadata": {
    "name": "edge-node-1",
    "labels": {
      "name": "edge-node",
      "node-role.kubernetes.io/edge": ""
    }
  }
} 
-- Nitesh Ratnaparkhe
katacoda
kubernetes

1 Answer

9/30/2019

I have reproduced it in Katakoda and in my case it works perfectly. I recommend you to go through the tutorial once again and take each step carefully.

You need to pay attention for step 7. Change metadata.name to the name of the edge node:

vim $GOPATH/src/github.com/kubeedge/kubeedge/build/node.json

{
  "kind": "Node",
  "apiVersion": "v1",
  "metadata": {
    "name": "edge-node",
    "labels": {
      "name": "edge-node",
      "node-role.kubernetes.io/edge": ""
    }
  }
}

Then, execute following command, where you need to change IP address:

kubectl apply -f $GOPATH/src/github.com/kubeedge/kubeedge/build/node.json -s <kubedge-node-ip-address>:8080

Another command to check if a correct API version was used, is:

kubectl explain node -s <kubedge-node-ip-address>:8080

After successful creation of node you should see:

node/edge-node created
-- muscat
Source: StackOverflow