I created the below ns.yaml file:
apiVersion: v1
kind: Namespace
metadata:
Name: testnsI am getting the below error.
error: error validating "ns.yaml": error validating data: ValidationError(Namespace.metadata): unknown field "Name" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta; if you choose to ignore these errors, turn validation off with --validate=falseThe root cause is clear in the error logs: unknown field "Name" in io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta;
This means you need to use name instead of Name.
For more info about YAML format of Kubernetes object Namespace metadata, run the following command :
kubectl explain namespace.metadataAnd you will get amazing documentation.