Facing issue while using kubectl run command

while using below command
kubectl run nginx-resources -n ch --image=nginx:stable --dry-run=client -o yaml > hw.yaml

I m facing below error
error: no matches for kind “Pod” in version “v1”

I have no idea whether it is env issue or command issue.
Please help on this issue.

Hi @venumadhav.hari,
Can you please share the manifest file and playground URL?

Regards,


I checked it and working for me without any issues.

Regards,

apiVersion: apps/v1
kind: Deployment
metadata:
  name: demoapp
  namespace: ch
  labels:
    app: demoapp
spec:
  replicas: 2
  selector:
    matchLabels:
      app: demoapp
  strategy: {}
  template:
    metadata:
      labels:
        app: demoapp
    spec:
      containers:
        - image: nginx
          name: nginx
          env:
            - name: NGINX_PORT
              value: "8080"
          ports:
            - containerPort: 80

Please give it one more try and let us know.

In my playground it is not working , I have tested in all versions playgrounds. any clue

Can you please run the below command on the playground terminal and share the output?

kubectl create -f one.yaml -v 8

Regards,

did the same got below error

kubectl create -f one.yaml -v 8
I1209 06:14:06.381526 10408 loader.go:373] Config loaded from file: /root/.kube/config
I1209 06:14:06.382928 10408 round_trippers.go:463] GET http://localhost:8080/openapi/v2?timeout=32s
I1209 06:14:06.382953 10408 round_trippers.go:469] Request Headers:
I1209 06:14:06.382964 10408 round_trippers.go:473] Accept: application/[email protected]+protobuf
I1209 06:14:06.382982 10408 round_trippers.go:473] User-Agent: kubectl/v1.26.0 (linux/amd64) kubernetes/b46a3f8
I1209 06:14:06.387427 10408 round_trippers.go:574] Response Status: 404 Not Found in 4 milliseconds
I1209 06:14:06.387461 10408 round_trippers.go:577] Response Headers:
I1209 06:14:06.387482 10408 round_trippers.go:580] Server: ttyd/1.6.3-3b174da (libwebsockets/4.1.6-)
I1209 06:14:06.387497 10408 round_trippers.go:580] Content-Type: text/html
I1209 06:14:06.387520 10408 round_trippers.go:580] Content-Length: 173
I1209 06:14:06.388517 10408 request.go:1154] Response Body:

404


I1209 06:14:06.388940 10408 round_trippers.go:463] GET http://localhost:8080/swagger-2.0.0.pb-v1?timeout=32s
I1209 06:14:06.388965 10408 round_trippers.go:469] Request Headers:
I1209 06:14:06.388996 10408 round_trippers.go:473] Accept: application/json, /
I1209 06:14:06.389019 10408 round_trippers.go:473] User-Agent: kubectl/v1.26.0 (linux/amd64) kubernetes/b46a3f8
I1209 06:14:06.389361 10408 round_trippers.go:574] Response Status: 404 Not Found in 0 milliseconds
I1209 06:14:06.389386 10408 round_trippers.go:577] Response Headers:
I1209 06:14:06.389398 10408 round_trippers.go:580] Server: ttyd/1.6.3-3b174da (libwebsockets/4.1.6-)
I1209 06:14:06.389408 10408 round_trippers.go:580] Content-Type: text/html
I1209 06:14:06.389417 10408 round_trippers.go:580] Content-Length: 173
I1209 06:14:06.389662 10408 request.go:1154] Response Body:

404


I1209 06:14:06.390605 10408 helpers.go:246] server response object: [{
“metadata”: {},
“status”: “Failure”,
“message”: “the server could not find the requested resource”,
“reason”: “NotFound”,
“details”: {
“causes”: [
{
“reason”: “UnexpectedServerResponse”,
“message”: “\u003chtml\u003e\u003chead\u003e\u003cmeta charset=utf-8 http-equiv="Content-Language" content="en"/\u003e\u003clink rel="stylesheet" type="text/css" href="/error.css"/\u003e\u003c/head\u003e\u003cbody\u003e\u003ch1\u003e404\u003c/h1\u003e\u003c/body\u003e\u003c/html\u003e”
}
]
},
“code”: 404
}]
Error from server (NotFound): the server could not find the requested resource

Same one.yaml i have executed with mentioned command
kubectl create -f one.yaml -v 8

but 404 is facing

Hi @venumadhav.hari,
That’s weird. I forwarded this to the team. They will check and will respond you.

Regards,

Thank you. I have been facing from long time may be couple of weeks. I think problem at my manifest file or command.

What do you mean “problem at my manifest file or command”? Did it resolve for you? @venumadhav.hari

Did you run this manifest file?

Used same manifest again but facing same below error

controlplane ~ ➜ kubectl apply -f demo.yaml
Error from server (NotFound): the server could not find the requested resource

attached manifest file for reference

implemented platform link : https://kodekloud.com/topic/playground-kubernetes-multi-node-latest/

Hi @venumadhav.hari,
Can you please record this from the tool and send us?

Hi

I have recorded and sent to feedback team. please verify under “Bug” categeroy. Please fix it ASAP.

Hi @venumadhav.hari,
I saw your recorded video, and I’d like to know why you are setting up the context without adding the cluster details.

That’s why you are having an issue.