Skip to content

Latest commit

 

History

History
86 lines (69 loc) · 2.49 KB

README.md

File metadata and controls

86 lines (69 loc) · 2.49 KB

Eclipse Ditto :: Kubernetes

This folder contains example yaml files which can be used to start Eclipse Ditto with its backing Database - MongoDB - and a reverse proxy - nginx - in front of the HTTP and WebSocket API.

Configure nginx

The nginx's configuration is located in the nginx.conf file and contains a "Basic authentication" for accessing the HTTP and WebSocket API. The users for this sample authentication are configured in the nginx.httpasswd file also located in this directory.

In order to add a new entry to this file, use the "openssl passwd" tool to create a hashed password:

openssl passwd -quiet
 Password: <enter password>
 Verifying - Password: <enter password>

Append the printed hash in the nginx.httpasswd file placing the username who shall receive this password in front like this:

ditto:A6BgmB8IEtPTs

Requirements

Start Eclipse Ditto

Start Minikube

minikube start 

Apply the pod reader role

This is necessary for the pods to access the Kubernetes API and then build the akka cluster.

cd <DITTO_PATH>
kubectl apply -f deployment/kubernetes/pod-reader-role.yaml

Create configuration mappings

kubectl create configmap nginx-conf --from-file=deployment/kubernetes/nginx/nginx.conf
kubectl create configmap nginx-cors --from-file=deployment/kubernetes/nginx/nginx-cors.conf
kubectl create configmap nginx-htpasswd --from-file=deployment/kubernetes/nginx/nginx.htpasswd
kubectl create configmap nginx-index --from-file=deployment/kubernetes/nginx/index.html
kubectl create configmap swagger-ui-api --from-file=$PWD/documentation/src/main/resources/openapi

Start Eclipse Ditto

Start MongoDB

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

Start Ditto services

kubectl apply -f deployment/kubernetes/ditto/ditto-cluster.yaml
# Start ditto services with an alternative version e.g. 0-SNAPSHOT
# cat kubernetes/ditto/ditto-cluster.yaml | sed s/latest/0-SNAPSHOT/ | kubectl apply -f -

Start Swagger UI

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

Start Reverse Proxy (nginx)

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

Use Eclipse Ditto

minikube service ditto

Use Minikube Dashboard

minikube dashboard

Have Fun!