This repository has been archived by the owner on Jul 30, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from QJoly/joplin
Creation of the Joplin chart
- Loading branch information
Showing
11 changed files
with
343 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
apiVersion: v1 | ||
name: joplin | ||
description: Joplin is an open source note-taking app. Capture your thoughts and securely access them from any device. | ||
version: 0.0.1 | ||
version: 0.2.1 | ||
appVersion: "2.9.7-beta" | ||
keywords: | ||
- joplin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
|
||
_ _ _ | ||
| | ___ _ __ | (_)_ __ | ||
_ | |/ _ \| ‘_ \| | | ‘_ \ | ||
| |_| | (_) | |_) | | | | | | | ||
\___/ \___/| .__/|_|_|_| |_| | ||
|_| | ||
|
||
You have just deployed {{ .Chart.Name }}. | ||
|
||
To find out more about the release, try : | ||
|
||
$ helm status {{ .Release.Name }} | ||
$ helm get all {{ .Release.Name }} | ||
———– | ||
To connect to the application, here are the default identifiers | ||
|
||
mail: admin@localhost | ||
password: admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "joplin.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 "joplin.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- $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 }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "joplin.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "joplin.labels" -}} | ||
helm.sh/chart: {{ include "joplin.chart" . }} | ||
{{ include "joplin.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "joplin.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "joplin.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "joplin.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "joplin.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
{{- if .Values.persistence.enabled -}} | ||
{{- if not .Values.persistence.pvcClaim }} | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
io.kompose.service: db | ||
name: joplin-beta-db | ||
{{- include "joplin.labels" . | nindent 4 }} | ||
name: {{ .Chart.Name }} | ||
spec: | ||
storageClassName: "longhorn" | ||
{{- if .Values.persistence.storageClassName }} | ||
storageClassName: "{{ .Values.persistence.storageClassName }}" | ||
{{ else }} | ||
|
||
{{- end }} | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 4Gi | ||
storage: {{ .Values.persistence.size }} | ||
status: {} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,84 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: joplin-app | ||
name: {{ .Chart.Name }}-app | ||
labels: | ||
{{- include "joplin.labels" . | nindent 4 }} | ||
spec: | ||
replicas: 1 | ||
replicas: {{ .Values.replicaCount }} | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
app: joplin-app | ||
app: {{ .Chart.Name }}-app | ||
strategy: {} | ||
template: | ||
metadata: | ||
labels: | ||
app: joplin-app | ||
app: {{ .Chart.Name }}-app | ||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 8 }} | ||
containers: | ||
- env: | ||
- name: APP_BASE_URL | ||
value: http://localhost:22300 | ||
value: {{ .Values.joplin.base_url }} | ||
- name: APP_PORT | ||
value: "22300" | ||
- name: DB_CLIENT | ||
value: pg | ||
{{- if .Values.mailer.enabled }} | ||
- name: MAILER_ENABLED | ||
value: "0" | ||
value: "1" | ||
- name: MAILER_HOST | ||
value: smtp.domain.tld | ||
value: "{{ .Values.mailer.host }}" | ||
- name: MAILER_NOREPLY_EMAIL | ||
value: [email protected] | ||
value: {{ .Values.mailer.noreplymail }} | ||
- name: MAILER_NOREPLY_NAME | ||
value: joplin-server | ||
value: {{ .Values.mailer.noreplyname }} | ||
- name: MAILER_PORT | ||
value: "25" | ||
value: "{{ .Values.mailer.port }}" | ||
- name: MAILER_SECURITY | ||
value: none | ||
value: {{ .Values.mailer.security }} | ||
- name: MAILER_AUTH_USER | ||
value: {{ .Values.mailer.user }} | ||
- name: MAILER_AUTH_PASSWORD | ||
value: {{ .Values.mailer.password }} | ||
{{- else }} | ||
- name: MAILER_ENABLED | ||
value: "0" | ||
{{- end }} | ||
- name: POSTGRES_DATABASE | ||
value: joplin | ||
value: {{ .Values.database.dbname }} | ||
- name: POSTGRES_HOST | ||
value: joplin-db | ||
value: {{ .Chart.Name }}-db | ||
- name: POSTGRES_PASSWORD | ||
value: veryhugepasswordhere | ||
value: {{ .Values.database.dbpassword }} | ||
- name: POSTGRES_PORT | ||
value: "5432" | ||
- name: POSTGRES_USER | ||
value: joplin | ||
image: joplin/server:2.9.7-beta | ||
value: {{ .Values.database.dbuser }} | ||
image: "{{ .Values.image.joplin.repository }}:{{ .Values.image.joplin.tag }}" | ||
name: joplin-app | ||
ports: | ||
- containerPort: 22300 | ||
resources: {} | ||
restartPolicy: Always | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
status: {} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: joplin-db | ||
name: {{ .Chart.Name }}-db | ||
labels: | ||
{{- include "joplin.labels" . | nindent 4 }} | ||
spec: | ||
ports: | ||
- name: "5432" | ||
- name: "postgresql" | ||
port: 5432 | ||
targetPort: 5432 | ||
targetPort: {{ .Values.service.database.port }} | ||
selector: | ||
app: joplin-db | ||
app: {{ .Chart.Name }}-db | ||
status: | ||
loadBalancer: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{{- if .Values.ingress.enabled -}} | ||
{{- if not .Values.ingress.isIngressRoute -}} | ||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} | ||
apiVersion: networking.k8s.io/v1 | ||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} | ||
apiVersion: networking.k8s.io/v1beta1 | ||
{{- else -}} | ||
apiVersion: extensions/v1beta1 | ||
{{- end }} | ||
kind: Ingress | ||
metadata: | ||
name: {{ .Chart.Name }}-ingress | ||
labels: | ||
{{- include "joplin.labels" . | nindent 4 }} | ||
{{- with .Values.ingress.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} | ||
ingressClassName: {{ .Values.ingress.className }} | ||
{{- end }} | ||
{{- if .Values.ingress.tls }} | ||
tls: | ||
{{- range .Values.ingress.tls }} | ||
- hosts: | ||
{{- range .hosts }} | ||
- {{ . | quote }} | ||
{{- end }} | ||
secretName: {{ .secretName }} | ||
{{- end }} | ||
{{- end }} | ||
rules: | ||
- host: {{ .Values.ingress.domain }} | ||
http: | ||
paths: | ||
- path: "/" | ||
pathType: Prefix | ||
backend: | ||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} | ||
service: | ||
name: {{ .Chart.Name }}-app | ||
port: | ||
number: 22300 | ||
{{- else }} | ||
serviceName: {{ .Chart.Name }}-app | ||
servicePort: 22300 | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.