From b843918398477d458d93115620d79184214c96d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Milo=C5=A1evi=C4=87?= Date: Thu, 21 May 2020 15:50:17 +0200 Subject: [PATCH] NOISSUE - Scale up nats, envoy, authn, things and mqtt (#41) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * scale to 3 nats, envoy, authn, things and mqtt Signed-off-by: Ivan Milošević * Add size of scale to helm values Add scaling to README Signed-off-by: Ivan Milošević * remove highlights from configuration table in readme Signed-off-by: Ivan Milošević --- charts/mainflux/README.md | 29 +++++++++++-------- .../templates/adapter_mqtt-deployment.yaml | 1 + .../mainflux/templates/authn-deployment.yaml | 1 + charts/mainflux/templates/envoy.yaml | 1 + .../mainflux/templates/things-deployment.yaml | 1 + charts/mainflux/values.yaml | 3 ++ 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/charts/mainflux/README.md b/charts/mainflux/README.md index 84c00ead..6ab30b39 100644 --- a/charts/mainflux/README.md +++ b/charts/mainflux/README.md @@ -15,18 +15,21 @@ Helm Chart for the Mainflux IoT Platform The following table lists the configurable parameters and their default values. -| Parameter | Description | Default | -| -------------------------------------- | -------------------------------------------------------------------------- | -------------- | -| `defaults.logLevel` | Log level | `debug` | -| `defaults.image.pullPolicy` | Docker Image Pull Policy | `IfNotPresent` | -| `defaults.image.repository` | Docker Image Repository | `mainflux` | -| `defaults.image.tag` | Docker Image Tag | `0.10.0` | -| `nginx_internal.mtls.tls` | TLS secret which contains the server cert/key | `''` | -| `nginx_internal.mtls.intermediate_crt` | Generic secret which contains the intermediate cert used to verify clients | `''` | -| `ingress.enabled` | Should the Nginx Ingress be created | `true` | -| `ingress.hostname` | Hostname for the Nginx Ingress | `''` | -| `ingress.tls.hostname` | Hostname of the Nginx Ingress certificate | `''` | -| `ingress.tls.secret` | TLS secret for the Nginx Ingress | `''` | +| Parameter | Description | Default | +| ------------------------------------ | -------------------------------------------------------------------------- | ------------ | +| defaults.logLevel | Log level | debug | +| defaults.image.pullPolicy | Docker Image Pull Policy | IfNotPresent | +| defaults.image.repository | Docker Image Repository | mainflux | +| defaults.image.tag | Docker Image Tag | 0.10.0 | +| defaults.replicaCount | Replicas of MQTT adapter, Things, Envoy and Authn | 3 | +| nginx_internal.mtls.tls | TLS secret which contains the server cert/key | | +| nginx_internal.mtls.intermediate_crt | Generic secret which contains the intermediate cert used to verify clients | | +| ingress.enabled | Should the Nginx Ingress be created | true | +| ingress.hostname | Hostname for the Nginx Ingress | | +| ingress.tls.hostname | Hostname of the Nginx Ingress certificate | | +| ingress.tls.secret | TLS secret for the Nginx Ingress | | +| nats.maxPayload | Maximum payload size in bytes that the NATS server will accept | 268435456 | +| nats.replicaCount | NATS replicas | 3 | All Mainflux services can have their `logLevel`, `image.pullPolicy`, `image.repository` and `image.tag` overridden. The names of the services are: @@ -41,4 +44,6 @@ All Mainflux services can have their `logLevel`, `image.pullPolicy`, `image.repo - influxdb_writer - infuxdb_reader +By default scale of MQTT adapter, Things, Envoy, Authn and NATS will be set to 3. It's recommended that you set this values to number of your nodes in Kubernetes cluster, i.e. `--set defaults.replicaCount=3 --set nats.replicaCount=3` + **Note:** make sure you run `helm install` with `--dependency-update` flag! diff --git a/charts/mainflux/templates/adapter_mqtt-deployment.yaml b/charts/mainflux/templates/adapter_mqtt-deployment.yaml index d10a152f..7adaa815 100644 --- a/charts/mainflux/templates/adapter_mqtt-deployment.yaml +++ b/charts/mainflux/templates/adapter_mqtt-deployment.yaml @@ -203,6 +203,7 @@ kind: StatefulSet metadata: name: {{ .Release.Name }}-adapter-mqtt spec: + replicas: {{ .Values.defaults.replicaCount }} serviceName: {{ .Release.Name }}-adapter-mqtt selector: matchLabels: diff --git a/charts/mainflux/templates/authn-deployment.yaml b/charts/mainflux/templates/authn-deployment.yaml index 863a7908..761d8a47 100644 --- a/charts/mainflux/templates/authn-deployment.yaml +++ b/charts/mainflux/templates/authn-deployment.yaml @@ -6,6 +6,7 @@ kind: Deployment metadata: name: {{ .Release.Name }}-authn spec: + replicas: {{ .Values.defaults.replicaCount }} selector: matchLabels: app: {{ .Release.Name }} diff --git a/charts/mainflux/templates/envoy.yaml b/charts/mainflux/templates/envoy.yaml index 330f2f1d..b95fd2ea 100644 --- a/charts/mainflux/templates/envoy.yaml +++ b/charts/mainflux/templates/envoy.yaml @@ -101,6 +101,7 @@ kind: Deployment metadata: name: {{ .Release.Name }}-envoy spec: + replicas: {{ .Values.defaults.replicaCount }} selector: matchLabels: app: {{ .Release.Name }} diff --git a/charts/mainflux/templates/things-deployment.yaml b/charts/mainflux/templates/things-deployment.yaml index 768ce082..45e57937 100644 --- a/charts/mainflux/templates/things-deployment.yaml +++ b/charts/mainflux/templates/things-deployment.yaml @@ -6,6 +6,7 @@ kind: Deployment metadata: name: {{ .Release.Name }}-things spec: + replicas: {{ .Values.defaults.replicaCount }} selector: matchLabels: app: {{ .Release.Name }} diff --git a/charts/mainflux/values.yaml b/charts/mainflux/values.yaml index 0246be46..795665b7 100644 --- a/charts/mainflux/values.yaml +++ b/charts/mainflux/values.yaml @@ -7,6 +7,8 @@ defaults: pullPolicy: "IfNotPresent" repository: "mainflux" tag: "0.10.0" + # Replicas of MQTT adapter, NATS, Things, Envoy and Authn + replicaCount: 3 ingress: enabled: true @@ -82,6 +84,7 @@ nats: clusterAuth: enabled: false maxPayload: 268435456 + replicaCount: 3 postgresql-users: name: postgresql-users