Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

first pass at chart for Zulip #5168

Closed
wants to merge 1 commit into from
Closed
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
21 changes: 21 additions & 0 deletions incubator/zulip/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
4 changes: 4 additions & 0 deletions incubator/zulip/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: zulipchat
name: zulip
version: 0.1.0
11 changes: 11 additions & 0 deletions incubator/zulip/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Zulip

[Zulip](https://zulipchat.com/), the world's most productive chat

Helm chart based on https://github.com/galexrt/docker-zulip

## Installation

Grab a copy of values.yaml, modify it as necessary, then install with `helm install -f value.yaml incubator/zulip`

After installation you will need to run `/opt/createZulipRealm.sh`. Instructions for doing so should be printed out during installation.
24 changes: 24 additions & 0 deletions incubator/zulip/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
1. Zulip should now be available on:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http://{{ . }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "zulip.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "zulip.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "zulip.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:80
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "zulip.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}

2. To create a realm so you can sign in:

kubectl -n {{ .Release.Namespace }} exec -it $(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "zulip.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") -c zulip /opt/createZulipRealm.sh

21 changes: 21 additions & 0 deletions incubator/zulip/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "zulip.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "zulip.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
81 changes: 81 additions & 0 deletions incubator/zulip/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "zulip.fullname" . }}
labels:
app: {{ template "zulip.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: 1
template:
metadata:
labels:
app: {{ template "zulip.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: redis
image: {{ .Values.redis.image }}
resources:
{{ toYaml .Values.redis.resources | indent 12 }}
volumeMounts:
- name: redis-persistent-storage
mountPath: /var/lib/redis
- name: memcached
image: {{ .Values.memcached.image }}
resources:
{{ toYaml .Values.memcached.resources | indent 12 }}
- name: rabbitmq
image: {{ .Values.rabbitmq.image }}
resources:
{{ toYaml .Values.rabbitmq.resources | indent 12 }}
env:
{{ toYaml .Values.rabbitmq.env | indent 12 }}
- name: postgresql
image: {{ .Values.postgresql.image }}
resources:
{{ toYaml .Values.postgresql.resources | indent 12 }}
env:
{{ toYaml .Values.postgresql.env | indent 12 }}
volumeMounts:
- name: postgresql-persistent-storage
mountPath: /var/lib/postgresql
- name: zulip
image: {{ .Values.zulip.image }}
resources:
{{ toYaml .Values.zulip.resources | indent 12 }}
env:
{{ toYaml .Values.zulip.env | indent 12 }}
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 443
name: https
protocol: TCP
volumeMounts:
- name: zulip-persistent-storage
mountPath: /data
# livenessProbe:
# httpGet:
# path: /login
# port: 443
# scheme: HTTP
# initialDelaySeconds: 120
# timeoutSeconds: 12
volumes:
- name: zulip-persistent-storage
persistentVolumeClaim:
claimName: {{ template "zulip.fullname" . }}-zulip
- name: redis-persistent-storage
persistentVolumeClaim:
claimName: {{ template "zulip.fullname" . }}-redis
- name: postgresql-persistent-storage
persistentVolumeClaim:
claimName: {{ template "zulip.fullname" . }}-postgresql
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
{{- end }}
31 changes: 31 additions & 0 deletions incubator/zulip/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "zulip.fullname" . -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "zulip.fullname" . }}
labels:
app: {{ template "zulip.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
annotations:
{{- range $key, $value := .Values.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
rules:
{{- range $host := .Values.ingress.hosts }}
- host: {{ $host }}
http:
paths:
- path: /
backend:
serviceName: {{ $serviceName }}
servicePort: 80
{{- end -}}
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
30 changes: 30 additions & 0 deletions incubator/zulip/templates/postgresql-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "zulip.fullname" . }}-postgresql
labels:
app: {{ template "zulip.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- if .Values.postgresql.persistence.annotations }}
annotations:
{{ toYaml .Values.postgresql.persistence.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.postgresql.persistence.selector }}
selector:
{{ toYaml .Values.postgresql.persistence.selector | indent 4 }}
{{- end }}
accessModes:
- {{ .Values.postgresql.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.postgresql.persistence.size | quote }}
{{- if .Values.postgresql.persistence.storageClass }}
{{- if (eq "-" .Values.postgresql.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.postgresql.persistence.storageClass }}"
{{- end }}
{{- end }}
30 changes: 30 additions & 0 deletions incubator/zulip/templates/redis-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "zulip.fullname" . }}-redis
labels:
app: {{ template "zulip.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- if .Values.redis.persistence.annotations }}
annotations:
{{ toYaml .Values.redis.persistence.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.redis.persistence.selector }}
selector:
{{ toYaml .Values.redis.persistence.selector | indent 4 }}
{{- end }}
accessModes:
- {{ .Values.redis.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.redis.persistence.size | quote }}
{{- if .Values.redis.persistence.storageClass }}
{{- if (eq "-" .Values.redis.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.redis.persistence.storageClass }}"
{{- end }}
{{- end }}
23 changes: 23 additions & 0 deletions incubator/zulip/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "zulip.fullname" . }}
labels:
app: {{ template "zulip.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 80
targetPort: 80
protocol: TCP
name: http
- port: 443
targetPort: 443
protocol: TCP
name: https
selector:
app: {{ template "zulip.name" . }}
release: {{ .Release.Name }}
30 changes: 30 additions & 0 deletions incubator/zulip/templates/zulip-pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "zulip.fullname" . }}-zulip
labels:
app: {{ template "zulip.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- if .Values.zulip.persistence.annotations }}
annotations:
{{ toYaml .Values.zulip.persistence.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.zulip.persistence.selector }}
selector:
{{ toYaml .Values.zulip.persistence.selector | indent 4 }}
{{- end }}
accessModes:
- {{ .Values.zulip.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.zulip.persistence.size | quote }}
{{- if .Values.zulip.persistence.storageClass }}
{{- if (eq "-" .Values.zulip.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.zulip.persistence.storageClass }}"
{{- end }}
{{- end }}
Loading