[stabel/rocketchat] Improve chart (#13619)

* [stable/rocketchat] Add new maintainer

Signed-off-by: Simon Rüegg <simon.ruegg@vshn.ch>

* [stable/rocketchat] Improve chart

Document all parameters in README, save MongoDB connection string in a
secret, add readiness probe, use tpl for extra env vars.

Signed-off-by: Simon Rüegg <simon.ruegg@vshn.ch>

* [stable/rocketchat] Update MongoDB dependency

Signed-off-by: Simon Rüegg <simon.ruegg@vshn.ch>

* [stable/rocketchat] Use new label format

Use the format defined by the Helm charts best practices [1].

[1] https://github.com/helm/helm/blob/master/docs/chart_best_practices/labels.md

Signed-off-by: Simon Rüegg <simon.ruegg@vshn.ch>

* [stable/rocketchat] Release new chart major version

Signed-off-by: Simon Rüegg <simon.ruegg@vshn.ch>
This commit is contained in:
Simon Rüegg
2019-05-14 06:13:12 -07:00
committed by Kubernetes Prow Robot
parent b4c658c966
commit 4826f74dbf
16 changed files with 274 additions and 130 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
name: rocketchat
version: 0.3.4
appVersion: 0.74.2
version: 1.0.0
appVersion: 0.74.3
description: Prepare to take off with the ultimate chat platform, experience the next
level of team communications
keywords:
@@ -22,4 +22,5 @@ maintainers:
- name: geekgonecrazy
- name: pierreozoux
- name: verwilst
- name: srueg
engine: gotpl
+2
View File
@@ -1,4 +1,6 @@
approvers:
- verwilst
- srueg
reviewers:
- verwilst
- srueg
+103 -14
View File
@@ -2,25 +2,114 @@
[Rocket.Chat](https://rocket.chat/) is free, unlimited and open source. Replace email, HipChat & Slack with the ultimate team chat software solution.
## Notes on installation and recommended settings
## TL;DR;
- This chart installs rocketchat chart (stable/rocketchat)
- This chart installs mongodb chart (stable/mongodb)
- Authentication for mongodb is enabled by default (usePassword : true)
### Please set your own mongodbUsername and mongodbPassword like this:
```bash
$ helm install --set mongodb.mongodbUsername=<your_username_here>,mongodb.mongodbPassword=<your_password_here> --name my-rocketchat stable/rocketchat
```console
$ helm install stable/rocketchat --set mongodb.mongodbPassword=$(echo -n $(openssl rand -base64 32))
```
### If you want to use another image set it like this:
```bash
$ helm install --set mongodb.mongodbUsername=<your_username_here>,mongodb.mongodbPassword=<your_password_here>,repository=<your_image> --name my-rocketchat stable/rocketchat
## Introduction
This chart bootstraps a [Rocket.Chat](https://rocket.chat/) Deployment on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. It provisions a fully featured Rocket.Chat installation.
For more information on Rocket.Chat and its capabilities, see its [documentation](https://rocket.chat/docs/).
## Prerequisites Details
The chart has an optional dependency on the [MongoDB](https://github.com/kubernetes/charts/tree/master/stable/mongodb) chart.
By default, the MongoDB chart requires PV support on underlying infrastructure (may be disabled).
## Installing the Chart
To install the chart with the release name `rocketchat`:
```console
$ helm install --name rocketchat stable/rocketchat
```
### If you want to install another version of rocket.chat image you can set the version like this:
```bash
$ helm install --set mongodb.mongodbUsername=<your_username_here>,mongodb.mongodbPassword=<your_password_here>,tag=0.74.2 --name my-rocketchat stable/rocketchat
## Uninstalling the Chart
To uninstall/delete the `rocketchat` deployment:
```console
$ helm delete rocketchat
```
## Configuration
The following table lists the configurable parameters of the Rocket.Chat chart and their default values.
Parameter | Description | Default
--- | --- | ---
`image.repository` | Image repository | `rocketchat/rocket.chat`
`image.tag` | Image tag | `0.74.2`
`image.pullPolicy` | Image pull policy | `IfNotPresent`
`host` | Hostname for Rocket.Chat. Also used for ingress (if enabled) | `""`
`replicaCount` | Number of replicas to run | `1`
`smtp.enabled` | Enable SMTP for sending mails | `false`
`smtp.username` | Username of the SMTP account | `""`
`smtp.password` | Password of the SMTP account | `""`
`smtp.host` | Hostname of the SMTP server | `""`
`smtp.port` | Port of the SMTP server | `587`
`extraEnv` | Extra environment variables for Rocket.Chat. Used with `tpl` function, so this needs to be a string | `""`
`externalMongodbUrl` | MongoDB URL if using an externally provisioned MongoDB | `""`
`mongodb.enabled` | Enable or disable MongoDB dependency. Refer to the [stable/mongodb docs](https://github.com/helm/charts/tree/master/stable/mongodb#configuration) for more information | `true`
`persistence.enabled` | Enable persistence using a PVC. This is not necessary if you're using the default (and recommended) [GridFS](https://rocket.chat/docs/administrator-guides/file-upload/) file storage | `false`
`persistence.storageClass` | Storage class of the PVC to use | `""`
`persistence.accessMode` | Access mode of the PVC | `ReadWriteOnce`
`persistence.size` | Size of the PVC | `8Gi`
`resources` | Pod resource requests and limits | `{}`
`securityContext.enabled` | Enable security context for the pod | `true`
`securityContext.runAsUser` | User to run the pod as | `999`
`securityContext.fsGroup` | fs group to use for the pod | `999`
`serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true`
`serviceAccount.name` | Name of the ServiceAccount to use. If not set and create is true, a name is generated using the fullname template | `""`
`ingress.enabled` | If `true`, an ingress is created | `false`
`ingress.annotations` | Annotations for the ingress | `{}`
`ingress.path` | Path of the ingress | `/`
`ingress.tls` | A list of [IngressTLS](https://kubernetes.io/docs/reference/federation/extensions/v1beta1/definitions/#_v1beta1_ingresstls) items | `[]`
`service.annotations` | Annotations for the Rocket.Chat service | `{}`
`service.labels` | Additional labels for the Rocket.Chat service | `{}`
`service.type` | The service type to use | `ClusterIP`
`service.port` | The service port | `80`
`service.nodePort` | The node port used if the service is of type `NodePort` | `""`
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
```bash
$ helm install --name rocketchat -f values.yaml stable/rocketchat
```
### HA Setup
To run Rocket.Chat with multiple replicas, you need a MongoDB replicaset. Additionally to setting `replicaCount` > 1, you also need to define the `MONGO_OPLOG_URL` env var via the `extraEnvs` parameter. See the [documentation](https://rocket.chat/docs/installation/docker-containers/high-availability-install/#guide-to-install-rocketchat-as-ha-with-mongodb-replicaset-as-backend) for more details.
### Database Setup
Rocket.Chat uses a MongoDB instance to presist its data.
By default, the [MongoDB](https://github.com/kubernetes/charts/tree/master/stable/mongodb) chart is deployed and configured as database.
Please refer to this chart for additional MongoDB configuration options.
Make sure to set at least the `mongodb.mongodbRootPassword`, `mongodb.mongodbUsername` and `mongodb.mongodbPassword` values.
#### Using an External Database
This chart supports using an existing MongoDB instance. Use the `` configuration options and disable MongoDB with `--set mongodb.enabled=false`
### Configuring Additional Environment Variables
```yaml
extraEnv: |
- name: MONGO_OPTIONS
value: '{"ssl": "true"}'
```
## Upgrading
### To 1.0.0
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
Use the workaround below to upgrade from versions previous to 1.0.0. The following example assumes that the release name is rocketchat:
```console
$ kubectl delete deployment rocketchat-rocketchat --cascade=false
```
+8
View File
@@ -0,0 +1,8 @@
host: rocketchat.example.com
ingress:
enabled: true
mongodb:
mongodbRootPassword: DdVMffX7Mj8ZrrmS5rHiWignyFqWp263bCexRktzCk
mongodbPassword: QBbUuRiPFEJf6oh2T7FXXxsUlzBxJRosnrVKEdrUyew
+3 -3
View File
@@ -1,6 +1,6 @@
dependencies:
- name: mongodb
repository: https://kubernetes-charts.storage.googleapis.com/
version: 5.1.4
digest: sha256:420bf2b07e91d09139e98906a20c1e179485d7225d47c1b5cc0b352a491850ce
generated: 2019-01-24T15:33:57.393572713+01:00
version: 5.17.0
digest: sha256:c652f27e186793717d2d819a64700424bcdebf454bf6148c1470ccaf76e89df8
generated: 2019-05-10T13:17:43.845078809+02:00
+1 -1
View File
@@ -1,5 +1,5 @@
dependencies:
- name: mongodb
version: 5.1.x
version: 5.x
repository: https://kubernetes-charts.storage.googleapis.com/
condition: mongodb.enabled
+7 -1
View File
@@ -23,6 +23,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- printf "%s-%s" .Release.Name "mongodb" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "rocketchat.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
@@ -33,4 +40,3 @@ Create the name of the service account to use
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
+25 -19
View File
@@ -3,17 +3,23 @@ kind: Deployment
metadata:
name: {{ template "rocketchat.fullname" . }}
labels:
app: {{ template "rocketchat.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
helm.sh/chart: {{ include "rocketchat.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "rocketchat.name" . }}
release: "{{ .Release.Name }}"
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
annotations:
checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }}
spec:
{{- if .Values.securityContext.enabled }}
securityContext:
@@ -21,7 +27,7 @@ spec:
runAsUser: {{ .Values.securityContext.runAsUser }}
{{- end }}
containers:
- name: {{ template "rocketchat.fullname" . }}
- name: rocketchat
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
@@ -32,29 +38,24 @@ spec:
fieldRef:
fieldPath: status.podIP
- name: MONGO_URL
{{ if .Values.mongodb.mongodbUsername }}
valueFrom:
secretKeyRef:
name: {{ template "rocketchat.fullname" . }}
key: mongo-uri
{{ else if .Values.mongodbURL }}
value: {{ .Values.mongodbURL }}
{{ else }}
value: mongodb://{{ template "rocketchat.mongodb.fullname" . }}:27017/rocketchat
{{ end }}
{{ if .Values.host }}
{{- if .Values.host }}
- name: ROOT_URL
value: https://{{ .Values.host }}
{{ end }}
{{- end }}
{{- if .Values.smtp.enabled }}
- name: MAIL_URL
valueFrom:
secretKeyRef:
name: {{ template "rocketchat.fullname" . }}
key: mail-url
{{- range $key, $value := .Values.config }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- with .Values.extraEnv }}
{{ tpl . $ | indent 8 }}
{{- end }}
ports:
- name: http
containerPort: 3000
@@ -64,6 +65,12 @@ spec:
port: http
initialDelaySeconds: 60
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /api/info
port: http
initialDelaySeconds: 10
timeoutSeconds: 5
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
@@ -77,4 +84,3 @@ spec:
{{- else }}
emptyDir: {}
{{- end }}
+21 -15
View File
@@ -1,29 +1,35 @@
{{- if .Values.ingress.enabled -}}
{{- $ingress := .Values.ingress -}}
{{- if $ingress.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "rocketchat.fullname" . }}
labels:
app: {{ template "rocketchat.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- with $ingress.annotations }}
annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- if .Values.ingress.tls }}
kubernetes.io/tls-acme: "true"
{{ toYaml . | indent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
helm.sh/chart: {{ include "rocketchat.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
{{- if $ingress.tls }}
tls:
{{- range $ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
- host: {{ .Values.host }}
http:
paths:
- path: /
- path: {{ $ingress.path }}
backend:
serviceName: {{ template "rocketchat.fullname" . }}
servicePort: 3000
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
servicePort: http
{{- end }}
{{- end -}}
+4 -4
View File
@@ -4,10 +4,10 @@ apiVersion: v1
metadata:
name: {{ template "rocketchat.fullname" . }}
labels:
app: {{ template "rocketchat.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
helm.sh/chart: {{ include "rocketchat.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
+24
View File
@@ -0,0 +1,24 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "rocketchat.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
helm.sh/chart: {{ include "rocketchat.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
type: Opaque
data:
{{- if .Values.smtp.enabled }}
mail-url: {{ printf "smtp://%s:%s@%s:%.0f" .Values.smtp.username .Values.smtp.password .Values.smtp.host .Values.smtp.port | b64enc | quote }}
{{- end }}
{{- if .Values.externalMongodbUrl }}
mongo-uri: {{ .Values.externalMongodbUrl | b64enc | quote }}
{{- else }}
{{- $fullname := include "mongodb.fullname" . -}}
{{- $username := required "Please specify a MongoDB username" .Values.mongodb.mongodbUsername }}
{{- $password := required "Please specify a MongoDB password" .Values.mongodb.mongodbPassword }}
{{- $port := .Values.mongodb.service.port }}
{{- $dbname := required "Please specify a MongoDB database" .Values.mongodb.mongodbDatabase }}
mongo-uri: {{ printf "mongodb://%s:%s@%s-mongodb:%.0f/%s" $username $password $fullname $port $dbname | b64enc | quote }}
{{- end }}
-15
View File
@@ -1,15 +0,0 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "rocketchat.fullname" . }}
labels:
app: {{ template "rocketchat.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
mail-url: {{ printf "smtp://%s:%s@%s:%s" .Values.config.SMTP_Username .Values.config.SMTP_Password .Values.config.SMTP_Host .Values.config.SMTP_Port | b64enc | quote }}
{{ if .Values.mongodb.mongodbUsername }}
mongo-uri: {{ printf "mongodb://%s:%s@%s-mongodb:27017/%s" .Values.mongodb.mongodbUsername .Values.mongodb.mongodbPassword .Release.Name .Values.mongodb.mongodbDatabase | b64enc | quote }}
{{ end }}
+30
View File
@@ -0,0 +1,30 @@
{{- $service := .Values.service -}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "rocketchat.fullname" . }}
{{- with $service.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
helm.sh/chart: {{ include "rocketchat.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with $service.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
type: {{ $service.type }}
ports:
- name: http
port: {{ $service.port }}
targetPort: http
{{- if and (eq "NodePort" $service.type) $service.nodePort }}
nodePort: {{ $service.nodePort }}
{{- end }}
protocol: TCP
selector:
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
@@ -3,9 +3,9 @@ apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: {{ template "rocketchat.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
app.kubernetes.io/name: {{ include "rocketchat.name" . }}
helm.sh/chart: {{ include "rocketchat.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
name: {{ template "rocketchat.serviceAccountName" . }}
{{- end -}}
-18
View File
@@ -1,18 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "rocketchat.fullname" . }}
labels:
app: {{ template "rocketchat.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
type: {{ .Values.service.type }}
ports:
- name: http
port: 3000
targetPort: http
selector:
app: {{ template "rocketchat.name" . }}
release: "{{ .Release.Name }}"
+39 -34
View File
@@ -3,54 +3,45 @@
##
image:
repository: rocketchat/rocket.chat
tag: 0.74.2
tag: 0.74.3
pullPolicy: IfNotPresent
## Host for the application
##
# host:
# Main RocketChat configuration:
config:
SMTP_Host:
SMTP_Port:
SMTP_Username:
SMTP_Password:
From_Email:
Jitsi_Enabled: false
Jitsi_Domain: meet.jit.si
Jitsi_URL_Room_Prefix: RocketChat
Jitsi_Open_New_Window: false
Jitsi_Enable_Channels: false
Jitsi_Chrome_Extension:
WebRTC_Enable_Channel: false
WebRTC_Enable_Private: false
WebRTC_Enable_Direct: false
replicaCount: 1
smtp:
enabled: false
username:
password:
host:
port: 587
# Extra env vars for Rocket.Chat:
extraEnv: # |
# - name: MONGO_OPTIONS
# value: '{"ssl": "true"}'
# - name: MONGO_OPLOG_URL
# value: mongodb://oploguser:password@rocket-1:27017/local&replicaSet=rs0
## MongoDB URL if using an externally provisioned MongoDB
mongodbURL: ~
externalMongodbUrl: # mongodb://user:password@localhost:27017/rocketchat
##
## MongoDB chart configuration
### ref https://github.com/helm/charts/tree/master/stable/mongodb#configuration
##
mongodb:
## Enable or disable MongoDB dependency completely.
enabled: true
## MongoDB admin password
### ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#setting-the-root-password-on-first-run
###
## mongodbRootPassword:
#
## MongoDB custom user and database
## ref: https://github.com/bitnami/bitnami-docker-mongodb/blob/master/README.md#creating-a-user-and-database-on-first-run
##
# mongodbUsername:
# mongodbRootPassword:
mongodbUsername: rocketchat
# mongodbPassword:
# mongodbDatabase:
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
mongodbDatabase: rocketchat
persistence:
enabled: true
## mongodb data Persistent Volume Storage Class
@@ -68,7 +59,7 @@ mongodb:
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
enabled: true
enabled: false
## rocketchat data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
@@ -106,12 +97,26 @@ serviceAccount:
###
ingress:
enabled: false
annotations:
kubernetes.io/ingress.class: "nginx"
annotations: {}
# kubernetes.io/ingress.class: "nginx"
path: /
tls:
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
service:
annotations: {}
# service.beta.kubernetes.io/aws-load-balancer-internal: "0.0.0.0/0"
labels: {}
# key: value
## ServiceType
## ref: https://kubernetes.io/docs/user-guide/services/#publishing-services---service-types
type: ClusterIP
## Optional static port assignment for service type NodePort.
# nodePort: 30000
port: 80