Folks, when running the following kubectl command:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: openvpn-data-claim
namespace: openvpn
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gierror: SchemaError(io.k8s.api.autoscaling.v1.Scale): invalid object doesn't have additional propertieskubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.9-gke.24", GitCommit:"39e41a8d6b7221b901a95d3af358dea6994b4a40", GitTreeState:"clean", BuildDate:"2020-02-29T01:24:35Z", GoVersion:"go1.12.12b4", Compiler:"gc", Platform:"linux/amd64"}According to Kubernetes Version Skew Policy:
kubectlis supported within one minor version (older or newer) ofkube-apiserver.IF
kube-apiserveris at 1.15:kubectlis supported at 1.16, 1.15, and 1.14.Note: If version skew exists between kube-apiserver instances in an HA cluster, for example
kube-apiserverinstances are at 1.15 and 1.14,kubectlwill support only 1.15 and 1.14 since any other versions would be more than one minor version skewed.
Even running a much newer client versions may give you some issues
kubectl run had a default behavior of creating deployments:❯ ./kubectl-110 run ubuntu --image=ubuntu
deployment.apps "ubuntu" createdkubectl run was deprecated to all generators except pods, here is an example with kubectl 1.16:❯ ./kubectl-116 run ubuntu --image=ubuntu --dry-run
kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
deployment.apps/ubuntu created (dry run)❯ ./kubectl-118 version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T11:56:40Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.9-gke.24", GitCommit:"39e41a8d6b7221b901a95d3af358dea6994b4a40", GitTreeState:"clean", BuildDate:"2020-02-29T01:24:35Z", GoVersion:"go1.12.12b4", Compiler:"gc", Platform:"linux/amd64"}
$ kubectl run --generator=deployment/apps.v1 ubuntu --image=ubuntu --dry-run=client
Flag --generator has been deprecated, has no effect and will be removed in the future.
pod/ubuntu created (dry run)
It ignored the flag and created only a pod. That flag is supported by kubernetes 1.15 as we saw in the test, but the kubectl 1.18 had significant changes that did not allowed running it.
Easily fixed by upgrading local kubectl with asdf.
asdf install kubectl 1.15.9