1
0
mirror of https://github.com/mainflux/mainflux.git synced 2025-04-27 13:48:49 +08:00

97 lines
1.8 KiB
Markdown
Raw Normal View History

# Deploy Mainflux on Kubernetes - WIP
Scripts to deploy Mainflux on Kubernetes (https://kubernetes.io). Work in progress. Not ready for deployment.
## Steps
2018-05-10 23:53:25 +02:00
### 1. Setup NATS
2018-05-10 23:53:25 +02:00
- Update `nats.conf` according to your needs.
2018-05-10 23:53:25 +02:00
- Create Kubernetes configmap to store NATS configuration:
```
2018-05-10 23:53:25 +02:00
kubectl create configmap nats-config --from-file k8s/nats/nats.conf
```
2018-05-10 23:53:25 +02:00
- Deploy NATS:
2018-05-10 23:53:25 +02:00
```
kubectl create -f k8s/nats/nats.yml
```
2018-05-10 23:53:25 +02:00
### 2. Setup Users service
2018-05-10 23:53:25 +02:00
- Deploy PostgreSQL service for Users service to use:
2018-05-10 23:53:25 +02:00
```
kubectl create -f k8s/mainflux/users-postgres.yml
```
2018-05-10 23:53:25 +02:00
- Deploy Users service:
2018-05-10 23:53:25 +02:00
```
kubectl create -f k8s/mainflux/users.yml
```
2018-05-10 23:53:25 +02:00
### 3. Setup Clients service
2018-05-10 23:53:25 +02:00
- Deploy PostgreSQL service for Clients service to use:
2018-05-10 23:53:25 +02:00
```
kubectl create -f k8s/mainflux/clients-postgres.yml
```
2018-05-10 23:53:25 +02:00
- Deploy Clients service:
```
2018-05-10 23:53:25 +02:00
kubectl create -f k8s/mainflux/clients.yml
```
### 4. Setup Normalizer service
2018-05-10 23:53:25 +02:00
- Deploy Normalizer service:
```
2018-05-10 23:53:25 +02:00
kubectl create -f k8s/mainflux/normalizer.yml
```
### 5. Setup adapter services
2018-05-10 23:53:25 +02:00
- Deploy adapter service:
2018-05-10 23:53:25 +02:00
```
kubectl create -f k8s/mainflux/<adapter_service_name>.yml
```
2018-05-10 23:53:25 +02:00
### 6. Setup Dashflux
2018-05-10 23:53:25 +02:00
- Deploy Dashflux service:
2018-05-10 23:53:25 +02:00
```
kubectl create -f k8s/mainflux/dashflux.yml
```
2018-05-10 23:53:25 +02:00
### 7. Setup NginX Reverse Proxy for Mainflux Services
2018-05-10 23:53:25 +02:00
- Create TLS server side certificate and keys:
2018-05-10 23:53:25 +02:00
```
kubectl create secret tls mainflux-secret --key k8s/nginx/certs/mainflux-server.key --cert k8s/nginx/certs/mainflux-server.crt
```
2018-05-10 23:53:25 +02:00
- Create Kubernetes configmap to store NginX configuration:
2018-05-10 23:53:25 +02:00
```
kubectl create configmap mainflux-nginx-config --from-file=k8s/nginx/default.conf
```
2018-05-10 23:53:25 +02:00
- Deploy NginX service:
2018-05-10 23:53:25 +02:00
```
kubectl create -f k8s/nginx/nginx.yml
```
2018-05-10 23:53:25 +02:00
### 8. Configure Internet Access
Configure NAT on your Firewall to forward ports 80 (HTTP) and 443 (HTTPS) to mainflux-nginx service