Skip to content

Commit

Permalink
Add rocket.chat (helm#752)
Browse files Browse the repository at this point in the history
* Add rocket.chat

* Add additional maintainers beyond the github org

* Fix mongo dependency

* Improved Labels, Chart Defaults, Notes
* Add labels to pod for proper kubectl selection
* Allow chart to be installed with no values set
* Improved output notes

* add helm chart to suggested install command

* Add deploy platform environment variable

* Add Instance IP to pod env variable to make scaling easier

* Switch app name to use app's name

* Update to latest Rocket.Chat version

* Remove else from ROOT_URL, its not needed
  • Loading branch information
pierreozoux authored and Vic Iglesias committed Jul 5, 2017
1 parent 07976ea commit 8d9003c
Show file tree
Hide file tree
Showing 12 changed files with 331 additions and 0 deletions.
1 change: 1 addition & 0 deletions stable/rocketchat/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git
22 changes: 22 additions & 0 deletions stable/rocketchat/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: rocketchat
version: 0.0.1
description: Prepare to take off with the ultimate chat platform, experience the next level of team communications
keywords:
- chat
- communication
- http
- web
- application
- nodejs
- javascript
- meteor
home: https://rocket.chat/
icon: https://cdn-www.rocket.chat/images/logo/logo.svg
sources:
- https://github.com/RocketChat/Docker.Official.Image/
maintainers:
- name: RocketChat
email: buildmaster@rocket.chat
- name: geekgonecrazy
- name: pierreozoux
engine: gotpl
11 changes: 11 additions & 0 deletions stable/rocketchat/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dependencies:
- alias: ""
condition: ""
enabled: false
import-values: null
name: mongodb
repository: https://kubernetes-charts.storage.googleapis.com/
tags: null
version: 0.4.7
digest: sha256:e76c2327ca138151bcc776ae4b46197069026fb14f1c2386e446f91f5488593b
generated: 2017-06-29T11:26:54.116252379-05:00
4 changes: 4 additions & 0 deletions stable/rocketchat/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies:
- name: mongodb
version: 0.4.7
repository: https://kubernetes-charts.storage.googleapis.com/
27 changes: 27 additions & 0 deletions stable/rocketchat/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Rocket.Chat can be accessed via port 80 on the following DNS name from within your cluster:

- http://{{ template "fullname" . }}.{{ .Release.Namespace }}

You can easily connect to the remote instance from your browser. Forward the webserver port to localhost:8888

- kubectl port-forward --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath='{ .items[0].metadata.name }') 8888:3000

You can also connect to the container running Rocket.Chat. To open a shell session in the pod run the following:

- kubectl exec -i -t --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath='{.items[0].metadata.name}') /bin/sh

To trail the logs for the Rocket.Chat pod run the following:

- kubectl logs -f --namespace {{ .Release.Namespace }} $(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath='{ .items[0].metadata.name }')

{{- if .Values.ingress.enabled }}

Rocket.Chat will be available at the URL:

- http://{{ .Values.host }}
{{ else }}

To expose Rocket.Chat via an Ingress you need to set host and enable ingress.

helm install --set host=chat.yourdomain.com --set ingress.enabled=true stable/rocketchat
{{- end -}}
24 changes: 24 additions & 0 deletions stable/rocketchat/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "mongodb.fullname" -}}
{{- printf "%s-%s" .Release.Name "mongodb" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
73 changes: 73 additions & 0 deletions stable/rocketchat/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
replicas: 1
template:
metadata:
labels:
app: {{ template "name" . }}
release: "{{ .Release.Name }}"
spec:
containers:
- name: {{ template "fullname" . }}
image: "{{ .Values.image }}"
imagePullPolicy: {{ default "" .Values.imagePullPolicy | quote }}
env:
- name: DEPLOY_PLATFORM
value: helm-chart
- name: INSTANCE_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: MONGO_URL
{{ if .Values.mongodb.mongodbUsername }}
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: mongo-uri
{{ else }}
value: mongodb://{{ template "mongodb.fullname" . }}:27017/rocketchat
{{ end }}
{{ if .Values.host }}
- name: ROOT_URL
value: https://{{ .Values.host }}
{{ end }}
- name: MAIL_URL
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: mail-url
{{- range $key, $value := .Values.config }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
ports:
- name: http
containerPort: 3000
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 20
timeoutSeconds: 5
resources:
{{ toYaml .Values.resources | indent 10 }}
volumeMounts:
- name: rocket-data
mountPath: /app/uploads
volumes:
- name: rocket-data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "fullname" . }}
{{- else }}
emptyDir: {}
{{- end }}

31 changes: 31 additions & 0 deletions stable/rocketchat/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if .Values.ingress.enabled -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- if .Values.ingress.tls }}
kubernetes.io/tls-acme: "true"
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
- hosts:
- {{ .Values.host }}
secretName: {{ template "fullname" . }}-tls
{{- end }}
rules:
- host: {{ .Values.host }}
http:
paths:
- path: /
backend:
serviceName: {{ template "fullname" . }}
servicePort: 3000
{{- end -}}
21 changes: 21 additions & 0 deletions stable/rocketchat/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{- if .Values.persistence.enabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
{{- if .Values.persistence.storageClass }}
volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- end -}}
15 changes: 15 additions & 0 deletions stable/rocketchat/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "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 }}
17 changes: 17 additions & 0 deletions stable/rocketchat/templates/svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
ports:
- name: http
port: 3000
targetPort: http
selector:
app: {{ template "name" . }}
release: "{{ .Release.Name }}"
85 changes: 85 additions & 0 deletions stable/rocketchat/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
## Rocket Chat image version
## ref: https://hub.docker.com/r/library/rocket.chat/tags/
##
image: rocket.chat:0.56

## Specify a imagePullPolicy
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
##
# imagePullPolicy:

## 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

##
## MongoDB chart configuration
##
mongodb:
## 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:
# mongodbPassword:
# mongodbDatabase:
## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
enabled: true
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
##
# storageClass:
accessMode: ReadWriteOnce
size: 8Gi

## Enable persistence using Persistent Volume Claims
## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
##
persistence:
enabled: true
## If defined, volume.beta.kubernetes.io/storage-class: <storageClass>
##
# storageClass:
accessMode: ReadWriteOnce
size: 8Gi

## Configure resource requests and limits
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
##
# resources:
# requests:
# memory: 512Mi
# cpu: 300m

## Configure the ingress object to hook into existing infastructure
### ref : http://kubernetes.io/docs/user-guide/ingress/
###
ingress:
enabled: false
tls: false
annotations:
kubernetes.io/ingress.class: "nginx"

0 comments on commit 8d9003c

Please sign in to comment.