Ao executar o comando: kubectl create -f deployment.yaml
Obtive o erro: error: unable to recognize "deployment.yaml": no matches for kind "Deployment" in version "apps/v1beta1"
Executei o comando: kubectl api-versions
E tentei as outras versões de apis mas continuou dando erro.
Minha versão do Minikube é o v1.4.0
O comando kubectl version
retornou:
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:27:17Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
O arquivo yaml é esse:
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: aplicacao-deployment
spec:
template:
metadata:
name: aplicacao
spec:
containers:
- name: container-aplicacao-loja
image: rafanercessian/aplicacao-loja:v1
ports:
- containerPort: 80
Porque está acontecendo isso?