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

chore: Add Helm chart for open event #6904

Merged
merged 2 commits into from
Apr 14, 2020
Merged
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
4 changes: 4 additions & 0 deletions charts/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: open-event
description: A generated Helm Chart for open-event
version: 0.0.1
apiVersion: v1
1 change: 1 addition & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This chart was created by Kompose
Binary file added charts/charts/postgresql-8.6.10.tgz
Binary file not shown.
Binary file added charts/charts/redis-10.5.14.tgz
Binary file not shown.
9 changes: 9 additions & 0 deletions charts/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 10.5.14
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 8.6.10
digest: sha256:de67d778c0dfdc8c34628e2ef41e39c41bafc4a9a6d39a79a8522107a5b44066
generated: "2020-03-29T16:29:15.534092+08:00"
7 changes: 7 additions & 0 deletions charts/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dependencies:
- name: redis
version: 10.5.14
repository: "@bitnami"
- name: postgresql
version: 8.6.10
repository: "@bitnami"
28 changes: 28 additions & 0 deletions charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "open-event.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 "open-event.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s" $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "open-event.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
16 changes: 16 additions & 0 deletions charts/templates/celery-claim0-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: celery-static
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{.Values.celery.storage.static.size}}
16 changes: 16 additions & 0 deletions charts/templates/celery-claim1-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: celery-generated
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{.Values.celery.storage.generated.size}}
45 changes: 45 additions & 0 deletions charts/templates/celery-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: celery
spec:
replicas: {{.Values.celery.replicas}}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-postgres
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-postgres
spec:
containers:
- name: {{.Values.celery.name}}
image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
args:
- celery
{{- if .Values.env }}
env:
{{- toYaml .Values.env | nindent 10 }}
{{end}}
volumeMounts:
- name: celery-static
mountPath: /data/app/static

- name: celery-generated
mountPath: /data/app/generated

volumes:
- name: celery-static
persistentVolumeClaim:
claimName: celery-static
- name: celery-generated
persistentVolumeClaim:
claimName: celery-generated
36 changes: 36 additions & 0 deletions charts/templates/frontend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.frontend.enable }}
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-frontend
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: {{.Values.frontend.name}}
spec:
replicas: {{.Values.frontend.replicas}}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-frontend
strategy:
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-frontend
spec:
containers:
{{- if .Values.env }}
- env:
{{- toYaml .Values.env | nindent 8 }}
{{- end }}
image: "{{ .Values.frontend.image.repo }}:{{ .Values.frontend.image.tag }}"
imagePullPolicy: {{ .Values.frontend.imagePullPolicy }}
name: {{ .Values.frontend.name }}
ports:
- name: {{ .Values.frontend.serviceName }}
containerPort: {{ .Values.frontend.servicePort }}
protocol: TCP
{{end}}
20 changes: 20 additions & 0 deletions charts/templates/frontend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{{- if .Values.frontend.enable }}
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-frontend
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: {{ .Values.frontend.serviceName }}
spec:
type: {{ .Values.frontend.serviceType }}
ports:
- port: {{ .Values.frontend.exportPort }}
protocol: TCP
targetPort: {{ .Values.frontend.servicePort }}
selector:
app.kubernetes.io/name: {{ include "open-event.name" . }}-frontend
{{end}}
19 changes: 19 additions & 0 deletions charts/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.frontend.enable }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
kubernetes.io/tls-acme: "true"
name: {{ template "open-event.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-frontend
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
spec:
backend:
serviceName: {{ .Values.frontend.serviceName }}
servicePort: {{ .Values.frontend.exportPort }}
{{end}}
16 changes: 16 additions & 0 deletions charts/templates/web-claim0-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: server-static
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{.Values.server.storage.static.size}}
16 changes: 16 additions & 0 deletions charts/templates/web-claim1-persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: server-generated
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{.Values.server.storage.generated.size}}
49 changes: 49 additions & 0 deletions charts/templates/web-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-server
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: open-event-server
spec:
replicas: {{.Values.server.replicas}}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-server
strategy:
type: {{.Values.server.strategy}}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-server
spec:
containers:
- name: {{.Values.server.name}}
image: "{{ .Values.image.repo }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.imagePullPolicy }}
{{- if .Values.env }}
env:
{{- toYaml .Values.env | nindent 8 }}
{{- end }}
volumeMounts:
- name: server-static
mountPath: /data/app/static
- name: server-generated
mountPath: /data/app/generated
ports:
- name: rest
containerPort: {{ .Values.server.containerPort }}
protocol: TCP
volumes:
- name: server-static
persistentVolumeClaim:
claimName: server-static
- name: server-generated
persistentVolumeClaim:
claimName: server-generated
restartPolicy: {{.Values.server.restartPolicy}}


17 changes: 17 additions & 0 deletions charts/templates/web-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/name: {{ include "open-event.name" . }}-web
helm.sh/chart: {{ include "open-event.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/part-of: {{ include "open-event.name" . }}
name: open-event-server
spec:
ports:
- name: rest
port: {{ .Values.server.servicePort }}
targetPort: {{ .Values.server.containerPort }}
selector:
app.kubernetes.io/name: {{ include "open-event.name" . }}-web
Loading