Deployment of Ditto and MongoDB using kubectl fails because of unsupported version "extensions/v1beta1"

248 views Asked by At

I try to start Ditto using kubernetes/minikube by following the instructions in the projects README.txt. While deploying mongoDB and later the Ditto services with the command

kubectl apply -f deployment/kubernetes/mongodb/mongodb.yaml

I get the following error message:

error: unable to recognize "deployment/kubernetes/mongodb/mongodb.yaml": no matches for kind "Deployment" in version "extensions/v1beta1"

I think I have to change the version to "api/v1", but doing this causes the next error:

error: error validating "deployment/kubernetes/mongodb/mongodb.yaml": error validating data: ValidationError(Deployment.spec): missing required field "selector" in io.k8s.api.apps.v1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false

I use the following versions:

Ditto: release-1.5

minikube version: v1.14.1

kubectl client version: Major:"1", Minor:"19", GitVersion:"v1.19.2

kubectl server version: Major:"1", Minor:"19", GitVersion:"v1.19.2"

Does anybody knwo how I can fix this problem. I don't know which fields and which values I have to add to make the .yaml files working as expected.

Thank you very much in advance.

2

There are 2 answers

2
stmaute On BEST ANSWER

You can take a look at the files in this PR here: https://github.com/eclipse/ditto/tree/master/deployment/kubernetes/deploymentFiles

The deployment files are updated and now use apiVersion: apps/v1.

0
mario On

This is a Community Wiki answer so feel free to edit it and add any additional details you consider important.

I get the following error message:

error: unable to recognize "deployment/kubernetes/mongodb/mongodb.yaml": no matches for kind

"Deployment" in version "extensions/v1beta1"

I think I have to change the version to "api/v1", but doing this causes the next error ...

You should change the apiVersion in Deployment definition to apps/v1, not api/v1. It should work without any errors. And extensions/v1beta1 doesn't work because it was deprecated and is no longer served in k8s v1.16.