I am creating namespace using kubectl
with yaml
. The following is my yaml
configuration
apiVersion: v1
kind: Namespace
metadata:
name: "slackishapp"
labels:
name: "slackishapp"
But, when I run kubectl create -f ./slackish-namespace-manifest.yaml
, I got an error like the following
error: SchemaError(io.k8s.api.autoscaling.v2beta2.PodsMetricStatus): invalid object doesn't have additional properties.
What goes wrong on my yaml
? I am reading about it on the documentation as well. I don't see any difference with my configuration.
If --resource-version is specified and does not match the current resource version on the server the command will fail. Use "kubectl api-resources" for a complete list of supported resources. $ kubectl annotate [--overwrite] (-f FILENAME | TYPE NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--resource-version=version]
Path to the kubectl configuration ("kubeconfig") file. Default: "$HOME/.kube/config" When set to false, turns off extra HTTP headers detailing invoked kubectl command (Kubernetes version v1.22 or later) kubectl certificate - Modify certificate resources. kubectl cp - Copy files and directories to and from containers.
Attempting to kubectl applya manifest whose resources have been previously modified using kubectl edit(see steps to reproduce below) raises a validation error.
$ kubectl set env RESOURCE/NAME KEY_1=VAL_1 ... KEY_N=VAL_N If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.
There is nothing wrong with your yaml but I suspect you have the wrong version of kubectl.
kubectl needs to be within 1 minor from the cluster you are using as described here.
You can check your versions with
kubectl version
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With