Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow external nats #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rocketchat/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- name: nats
repository: https://nats-io.github.io/k8s/helm/charts
version: 0.15.x
condition: microservices.enabled
condition: microservices.nats.enabled
description: Prepare to take off with the ultimate chat platform, experience the next level of team communications
keywords:
- chat
Expand Down
28 changes: 17 additions & 11 deletions rocketchat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To install the chart with the release name `rocketchat`:
$ helm install rocketchat rocketchat/rocketchat --set mongodb.auth.passwords={rocketchatPassword},mongodb.auth.rootPassword=rocketchatRootPassword
```

If you got a registration token for [Rocket.Chat Cloud](https://cloud.rocket.chat), you can also include it:
If you got a registration token for [Rocket.Chat Cloud](https://cloud.rocket.chat), you can also include it:
```console
$ helm install rocketchat rocketchat/rocketchat --set mongodb.auth.passwords={rocketchatPassword},mongodb.auth.rootPassword=rocketchatRootPassword,registrationToken=<paste the token here>
```
Expand Down Expand Up @@ -125,7 +125,8 @@ The following table lists the configurable parameters of the Rocket.Chat chart a
| `microservices.streamHub.tolerations` | Pod tolerations | [] |
| `microservices.accounts.tolerations` | Pod tolerations | [] |
| `microservices.authorization.tolerations` | Pod tolerations | [] |
| `microservices.nats.replicas` | Idem | `1` |
| `microservices.nats.enabled` | Turn on and off nats |
| `microservices.nats.existingSecret` | use connection string for external nats deployment |
| `readinessProbe.enabled` | Turn on and off readiness probe | `true` |
| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `10` |
| `readinessProbe.periodSeconds` | How often to perform the probe | `15` |
Expand All @@ -141,7 +142,7 @@ The following table lists the configurable parameters of the Rocket.Chat chart a
| `podDisruptionBudget.enabled` | Enable or disable PDB for RC deployment | `true` |
| `podLabels` | Additional pod labels for the Rocket.Chat pods | `{}` |
| `podAnnotations` | Additional pod annotations for the Rocket.Chat pods | `{}` |
| `federation.enabled` | Enable Rocket.Chat federation (through matrix)
| `federation.enabled` | Enable Rocket.Chat federation (through matrix)
| `federation.host` | FQDN for your matrix instance
| `federation.image.repository` | Image repository to use for federation image, defaults to `matrixdotorg`
| `federation.image.registry` | Image registry to use for federation image, defaults to `docker.io`
Expand All @@ -160,37 +161,42 @@ $ helm install rocketchat -f values.yaml rocketchat/rocketchat
### Database Setup

Rocket.Chat uses a MongoDB instance to presist its data.
By default, the [MongoDB](https://github.com/bitnami/charts/tree/master/bitnami/mongodb) chart is deployed and a single MongoDB instance is created as the primary in a replicaset.
By default, the [MongoDB](https://github.com/bitnami/charts/tree/master/bitnami/mongodb) chart is deployed and a single MongoDB instance is created as the primary in a replicaset.
Please refer to this (MongoDB) chart for additional MongoDB configuration options.
If you are using chart defaults, make sure to set at least the `mongodb.auth.rootPassword` and `mongodb.auth.passwords` values.
If you are using chart defaults, make sure to set at least the `mongodb.auth.rootPassword` and `mongodb.auth.passwords` values.
> **WARNING**: The root credentials are used to connect to the MongoDB OpLog

#### Using an External Database

This chart supports using an existing MongoDB instance. Use the `` configuration options and disable MongoDB with `--set mongodb.enabled=false`

### External Nats

To use an external nats set `microservices.nats.enabled` to false. Then provide a secret with the connectionstring via `microservices.nats.existingSecret` expects the property in the secret to be `connectionString`

### Configuring Additional Environment Variables

```yaml
extraEnv: |
- name: MONGO_OPTIONS
value: '{"ssl": "true"}'
```

### Specifying aditional volumes

Sometimes, it's needed to include extra sets of files by means of exposing
them to the container as a mountpoint. The most common use case is the
inclusion of SSL CA certificates.
Sometimes, it's needed to include extra sets of files by means of exposing
them to the container as a mountpoint. The most common use case is the
inclusion of SSL CA certificates.

```yaml
extraVolumes:
extraVolumes:
- name: etc-certs
hostPath:
- path: /etc/ssl/certs
type: Directory
extraVolumeMounts:
extraVolumeMounts:
- mountPath: /etc/ssl/certs
name: etc-certs
name: etc-certs
readOnly: true
```

Expand Down
12 changes: 10 additions & 2 deletions rocketchat/templates/chat-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,16 @@ spec:
{{- end }}
# Environment variables for microservices option
{{- if .Values.microservices.enabled }}
{{- if .Values.microservices.nats.existingSecret }}
- name: TRANSPORTER
valueFrom:
secretKeyRef:
name: {{ .Values.microservices.nats.existingSecret }}
key: connectionString
{{- else}}
- name: TRANSPORTER
value: nats://{{ .Release.Name }}-nats:4222
{{- end}}
- name: MOLECULER_LOG_LEVEL
value: {{ .Values.microservices.logLevel | quote }}
- name: HEARTBEAT_INTERVAL
Expand Down Expand Up @@ -184,7 +192,7 @@ spec:
value: http://{{ template "rocketchat.fullname" . }}-synapse:8008
{{- else }}
value: https://{{ .Values.federation.host }}
{{- end }}
{{- end }}
- name: OVERWRITE_SETTING_Federation_Matrix_bridge_localpart
value: "rocket.cat"
{{end}}
Expand Down Expand Up @@ -226,7 +234,7 @@ spec:
mountPath: /tmp
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- name: tmp
emptyDir: {}
Expand Down
12 changes: 10 additions & 2 deletions rocketchat/templates/microservices-authorization-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,16 @@ spec:
name: {{ template "rocketchat.fullname" . }}
key: mongo-uri
{{- end }}
{{- if .Values.microservices.nats.existingSecret }}
- name: TRANSPORTER
valueFrom:
secretKeyRef:
name: {{ .Values.microservices.nats.existingSecret }}
key: connectionString
{{- else}}
- name: TRANSPORTER
value: nats://{{ .Release.Name }}-nats:4222
{{- end}}
- name: MOLECULER_LOG_LEVEL
value: {{ .Values.microservices.logLevel | quote }}
- name: HEARTBEAT_INTERVAL
Expand All @@ -63,10 +71,10 @@ spec:
value: 'yes'
- name: MS_METRICS
value: {{ .Values.prometheusScraping.enabled | default "false" | quote }}
volumeMounts:
volumeMounts:
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 8 }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml .Values.microservices.authorization.securityContext | nindent 10 }}
resources: {{- toYaml .Values.microservices.authorization.resources | nindent 10 }}
Expand Down
12 changes: 10 additions & 2 deletions rocketchat/templates/microservices-ddp-streamer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,16 @@ spec:
name: {{ template "rocketchat.fullname" . }}
key: mongo-uri
{{- end }}
{{- if .Values.microservices.nats.existingSecret }}
- name: TRANSPORTER
valueFrom:
secretKeyRef:
name: {{ .Values.microservices.nats.existingSecret }}
key: connectionString
{{- else}}
- name: TRANSPORTER
value: nats://{{ .Release.Name }}-nats:4222
{{- end}}
- name: MOLECULER_LOG_LEVEL
value: {{ .Values.microservices.logLevel | quote }}
- name: PORT
Expand All @@ -64,10 +72,10 @@ spec:
value: 'yes'
- name: MS_METRICS
value: {{ .Values.prometheusScraping.enabled | default "false" | quote }}
volumeMounts:
volumeMounts:
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 8 }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml .Values.microservices.ddpStreamer.securityContext | nindent 10 }}
resources: {{- toYaml .Values.microservices.ddpStreamer.resources | nindent 10 }}
Expand Down
12 changes: 10 additions & 2 deletions rocketchat/templates/microservices-presence-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,16 @@ spec:
name: {{ template "rocketchat.fullname" . }}
key: mongo-uri
{{- end }}
{{- if .Values.microservices.nats.existingSecret }}
- name: TRANSPORTER
valueFrom:
secretKeyRef:
name: {{ .Values.microservices.nats.existingSecret }}
key: connectionString
{{- else}}
- name: TRANSPORTER
value: nats://{{ .Release.Name }}-nats:4222
{{- end}}
- name: MOLECULER_LOG_LEVEL
value: {{ .Values.microservices.logLevel | quote }}
- name: HEARTBEAT_INTERVAL
Expand All @@ -63,10 +71,10 @@ spec:
value: 'yes'
- name: MS_METRICS
value: {{ .Values.prometheusScraping.enabled | default "false" | quote }}
volumeMounts:
volumeMounts:
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 8 }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml .Values.microservices.presence.securityContext | nindent 10 }}
resources: {{- toYaml .Values.microservices.presence.resources | nindent 10 }}
Expand Down
12 changes: 10 additions & 2 deletions rocketchat/templates/microservices-stream-hub-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,16 @@ spec:
name: {{ template "rocketchat.fullname" . }}
key: mongo-oplog-uri
{{- end }}
{{- if .Values.microservices.nats.existingSecret }}
- name: TRANSPORTER
valueFrom:
secretKeyRef:
name: {{ .Values.microservices.nats.existingSecret }}
key: connectionString
{{- else}}
- name: TRANSPORTER
value: nats://{{ .Release.Name }}-nats:4222
{{- end}}
- name: MOLECULER_LOG_LEVEL
value: {{ .Values.microservices.logLevel | quote }}
- name: HEARTBEAT_INTERVAL
Expand All @@ -73,10 +81,10 @@ spec:
value: 'yes'
- name: MS_METRICS
value: {{ .Values.prometheusScraping.enabled | default "false" | quote }}
volumeMounts:
volumeMounts:
{{- if .Values.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 8 }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml .Values.microservices.streamHub.securityContext | nindent 10 }}
resources: {{- toYaml .Values.microservices.streamHub.resources | nindent 10 }}
Expand Down
10 changes: 6 additions & 4 deletions rocketchat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extraEnv:
# Extra secret for Rocket.Chat, uncomment to use
# Usefull to store sensitive data for creating initial user (e.g. ADMIN_* env vars) or custom OAUTH settings (e.g. Accounts_OAuth_Custom_* env vars)
# extraSecret: "some-secret"

# Extra volumes for Rocket.Chat...
extraVolumes:
# - name: etc-certs
Expand Down Expand Up @@ -299,6 +299,10 @@ podDisruptionBudget:
microservices:
enabled: false

nats:
enabled: true
existingSecret: ''

logLevel: warn

heartbeatInterval: 10
Expand Down Expand Up @@ -360,9 +364,6 @@ microservices:
# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
tolerations: []

nats:
replicas: 1

## Parameters for each Kubernetes service
# NOTE: reserved for future usage still
presenceService:
Expand All @@ -375,6 +376,7 @@ microservices:
nats:
nats:
image: nats:2.4-alpine
replicas: 1

federation:
# host:
Expand Down