kubernetes – error while doing “kubectl apply -f …” apiVersion v1?

the error:

Error from server (BadRequest): error when creating “client-node-port.yaml”: Service in version “v1” cannot be handled as a Service: strict decoding error: unknown field “spec.ports[0].ports”

apiVersion: v1
kind: Service
metadata:
  name: client-node-port
spec:
  type: NodePort
  ports:
    - ports: 3050
      targetPort: 3000
      nodePort: 31515
  selector:
    component: web

this is the file “client-node-port.yaml”, I also have a file named “client-pod.yaml” that is kind: pod

Read more here: Source link