Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Service Yaml Error
#1
I tried to create  this kubectl service.yaml file and it failed with the following error:

Error from server (BadRequest): error when creating "service.yaml": service in version "v1" cannot be handled as a Service: no kind "service" is registered for version "v1" in scheme "k8s.io/kubernetes/pkg/api/legacyscheme/scheme.go:29"


the file is as follows:

apiVersion: v1
kind: service
metadata:
  name: sample-service
spec:
  type: NodePort
  selector:
    app: nginx-app
  ports:
  - protocol: TCP
    targetPort: 80
    nodeport: 32002
    port: 80



any suggestions on how to resolve this issue?

Primus
Reply
#2
Try "Service" instead of "service".

Reference - https://kubernetes.io/docs/reference/kubectl/overview/ (Find "Service" on that page).
Reply
#3
Service didn't succeed. I'll keep looking.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Yaml Error Kumar Bala 1 77 06-13-2019, 07:52 AM
Last Post: Nishant

Forum Jump:


Users browsing this thread: 1 Guest(s)