I am trying to apply a simple Pod configuration using kubectl apply -f nginx.yaml, but I’m encountering an authentication error. Here’s the content of my nginx.yaml file:
apiVersion: v1
kind: Pod
metadata:
name: nginx
spec:
containers:
- name: nginx-container
image: nginx
When I run the command, I get the following error:
error: error validating “nginx.yaml”: error validating data: failed to
download openapi: Authentication required; if you choose to ignore these errors, turn validation
off with –validate=false
I am using kubectl to manage a Kubernetes cluster.
The nginx.yaml file is correctly formatted, as far as I can tell.