cant create service in kubernetes. – kubectl apply -f nginx-service.yaml

get the error, so could you please help, i am very new in kubernetes. and gets the errors
C:\Windows\system32>kubectl apply -f nginx-service.yaml
Error from server (BadRequest): error when creating “nginx-service.yaml”: Service in version “v1” cannot be handled as a Service: strict decoding error: unknown field “spec.ports[0].protocols”

apiVersion: v2
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
– protocol: TCP
port: 80
targetPort: 8080

Read more here: Source link