0

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.

hope1976
  • 7
  • 2
  • 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](https://kubernetes.io/blog/2019/07/18/api-deprecations-in-1-16/). – mario Feb 09 '21 at 23:19

2 Answers2

0

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.

stmaute
  • 91
  • 3
0

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.

mario
  • 9,858
  • 1
  • 26
  • 42