From 8b53657d7411b26795f45d326544638b7eaccbad Mon Sep 17 00:00:00 2001 From: QJoly Date: Fri, 2 Dec 2022 10:47:51 +0100 Subject: [PATCH 01/17] Adding values.yml and disable ingressroute per default --- .../joplin/templates/joplin-ingressroute.yaml | 3 +- charts/joplin/values.yaml | 66 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 charts/joplin/values.yaml diff --git a/charts/joplin/templates/joplin-ingressroute.yaml b/charts/joplin/templates/joplin-ingressroute.yaml index beee37a..670324a 100644 --- a/charts/joplin/templates/joplin-ingressroute.yaml +++ b/charts/joplin/templates/joplin-ingressroute.yaml @@ -1,3 +1,4 @@ +{{- if .Values.ingress.enabled -}} apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: @@ -14,4 +15,4 @@ spec: port: 22300 tls: certResolver: letsencrypt - +{{- end}} diff --git a/charts/joplin/values.yaml b/charts/joplin/values.yaml new file mode 100644 index 0000000..ae8e85f --- /dev/null +++ b/charts/joplin/values.yaml @@ -0,0 +1,66 @@ +replicaCount: 1 + +image: + repository: joplin/server + pullPolicy: IfNotPresent + tag: 2.9.7-beta + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +serviceAccount: + create: false + annotations: {} + name: "" + +podAnnotations: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000 + +service: + type: ClusterIP + port: 80 + + +persistence: + storageClassName: "longhorn" + enabled: true + +ingress: + isIngressRoute: false + enabled: false + className: "" + annotations: {} + domain: ur_domain.tld + entrypoint: websecure + certresolver: letsencrypt + +resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + +nodeSelector: {} + +tolerations: [] + +affinity: {} From 3ba0768e8a5ed3bd5709364336d64aa8dafb97a4 Mon Sep 17 00:00:00 2001 From: QJoly Date: Fri, 2 Dec 2022 11:12:08 +0100 Subject: [PATCH 02/17] Ajout des fonctions helm --- charts/joplin/templates/_helpers.tpl | 62 ++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 charts/joplin/templates/_helpers.tpl diff --git a/charts/joplin/templates/_helpers.tpl b/charts/joplin/templates/_helpers.tpl new file mode 100644 index 0000000..97ad52e --- /dev/null +++ b/charts/joplin/templates/_helpers.tpl @@ -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 }} From 6df3563989d6fdf1634c9b3a12984a61198bac6b Mon Sep 17 00:00:00 2001 From: QJoly Date: Fri, 2 Dec 2022 11:12:59 +0100 Subject: [PATCH 03/17] Variabilisation des ports / autres --- charts/joplin/templates/joplin-db-deployment.yaml | 15 +++++++++++---- charts/joplin/templates/joplin-db-service.yaml | 8 ++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/charts/joplin/templates/joplin-db-deployment.yaml b/charts/joplin/templates/joplin-db-deployment.yaml index 6e2cfac..6c6ef14 100644 --- a/charts/joplin/templates/joplin-db-deployment.yaml +++ b/charts/joplin/templates/joplin-db-deployment.yaml @@ -5,15 +5,22 @@ metadata: spec: selector: matchLabels: - app: joplin-db + app: {{ .Chart.Name }}-db replicas: 1 strategy: type: Recreate template: metadata: labels: - app: joplin-db + app: {{ .Chart.Name }}-db spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "joplin.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - env: - name: POSTGRES_DB @@ -25,7 +32,7 @@ spec: - name: PGDATA value: /var/lib/postgresql/data/pgdata image: postgres:15 - name: joplin-db + name: {{ .Chart.Name }}-db ports: - containerPort: 5432 resources: {} @@ -37,5 +44,5 @@ spec: volumes: - name: db persistentVolumeClaim: - claimName: joplin-beta-db + claimName: joplin-pvc-db status: {} diff --git a/charts/joplin/templates/joplin-db-service.yaml b/charts/joplin/templates/joplin-db-service.yaml index b066771..03080b2 100644 --- a/charts/joplin/templates/joplin-db-service.yaml +++ b/charts/joplin/templates/joplin-db-service.yaml @@ -1,13 +1,13 @@ apiVersion: v1 kind: Service metadata: - name: joplin-db + name: {{ .Chart.Name }}-db spec: ports: - - name: "5432" + - name: "postgresql" port: 5432 - targetPort: 5432 + targetPort: {{ .Values.service.port }} selector: - app: joplin-db + app: {{ .Chart.Name }}-db status: loadBalancer: {} From f414dcb4734d3476156369a93a2e982821733be1 Mon Sep 17 00:00:00 2001 From: QJoly Date: Fri, 2 Dec 2022 18:20:52 +0100 Subject: [PATCH 04/17] =?UTF-8?q?Param=C3=A8tres=20de=20la=20base,=20suppr?= =?UTF-8?q?ession=20HPA=20&=20SA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charts/joplin/values.yaml | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/charts/joplin/values.yaml b/charts/joplin/values.yaml index ae8e85f..fb4abe0 100644 --- a/charts/joplin/values.yaml +++ b/charts/joplin/values.yaml @@ -1,18 +1,24 @@ replicaCount: 1 image: - repository: joplin/server - pullPolicy: IfNotPresent - tag: 2.9.7-beta + joplin: + repository: joplin/server + pullPolicy: IfNotPresent + tag: 2.9.7-beta + postgres: + repository: postgres + pullPolicy: IfNotPresent + tag: 15 + +database: + dbname: joplindb + dbuser: joplinuser + dbpassword: veryhugepasswordhere imagePullSecrets: [] nameOverride: "" fullnameOverride: "" -serviceAccount: - create: false - annotations: {} - name: "" podAnnotations: {} @@ -28,13 +34,20 @@ securityContext: # runAsUser: 1000 service: - type: ClusterIP - port: 80 + joplin: + type: ClusterIP + port: 22300 + database: + type: ClusterIP + port: 5432 persistence: storageClassName: "longhorn" enabled: true + size: "4Gi" +# Uncomment if you want to use an existing PVC +# pvcClaim: ur_pvc ingress: isIngressRoute: false @@ -53,12 +66,6 @@ resources: {} # cpu: 100m # memory: 128Mi -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - nodeSelector: {} tolerations: [] From 938ef41b3f713cf5dc3cb0b6bdb3706d7d0eb2d0 Mon Sep 17 00:00:00 2001 From: QJoly Date: Fri, 2 Dec 2022 18:21:24 +0100 Subject: [PATCH 05/17] =?UTF-8?q?PVC=20Cr=C3=A9=C3=A9=20si=20persistence?= =?UTF-8?q?=20activ=C3=A9e=20et=20si=20pvc=20non=20d=C3=A9j=C3=A0=20exista?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charts/joplin/templates/db-persistentvolumeclaim.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/charts/joplin/templates/db-persistentvolumeclaim.yaml b/charts/joplin/templates/db-persistentvolumeclaim.yaml index e0f604c..172092b 100644 --- a/charts/joplin/templates/db-persistentvolumeclaim.yaml +++ b/charts/joplin/templates/db-persistentvolumeclaim.yaml @@ -1,15 +1,19 @@ +{{- 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" accessModes: - ReadWriteOnce resources: requests: - storage: 4Gi + storage: {{ .Values.persistence.size }} status: {} +{{- end }} +{{- end }} \ No newline at end of file From fe24ca692bf63d4be60c9d267a3929313617885e Mon Sep 17 00:00:00 2001 From: QJoly Date: Fri, 2 Dec 2022 18:21:42 +0100 Subject: [PATCH 06/17] Usage des labels et des variables --- .../templates/joplin-app-deployment.yaml | 10 +++-- .../joplin/templates/joplin-app-service.yaml | 2 + .../templates/joplin-db-deployment.yaml | 45 +++++++++++++++---- .../joplin/templates/joplin-db-service.yaml | 4 +- .../joplin/templates/joplin-ingressroute.yaml | 2 + 5 files changed, 50 insertions(+), 13 deletions(-) diff --git a/charts/joplin/templates/joplin-app-deployment.yaml b/charts/joplin/templates/joplin-app-deployment.yaml index 0df5108..18daef7 100644 --- a/charts/joplin/templates/joplin-app-deployment.yaml +++ b/charts/joplin/templates/joplin-app-deployment.yaml @@ -2,6 +2,8 @@ apiVersion: apps/v1 kind: Deployment metadata: name: joplin-app + labels: + {{- include "joplin.labels" . | nindent 4 }} spec: replicas: 1 strategy: @@ -36,15 +38,15 @@ spec: - name: MAILER_SECURITY value: none - 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 + value: {{ .Values.database.dbuser }} image: joplin/server:2.9.7-beta name: joplin-app ports: diff --git a/charts/joplin/templates/joplin-app-service.yaml b/charts/joplin/templates/joplin-app-service.yaml index a6911c5..9b1faa0 100644 --- a/charts/joplin/templates/joplin-app-service.yaml +++ b/charts/joplin/templates/joplin-app-service.yaml @@ -2,6 +2,8 @@ apiVersion: v1 kind: Service metadata: name: joplin-app + labels: + {{- include "joplin.labels" . | nindent 4 }} spec: ports: - name: "22300" diff --git a/charts/joplin/templates/joplin-db-deployment.yaml b/charts/joplin/templates/joplin-db-deployment.yaml index 6c6ef14..cfbd093 100644 --- a/charts/joplin/templates/joplin-db-deployment.yaml +++ b/charts/joplin/templates/joplin-db-deployment.yaml @@ -2,6 +2,8 @@ apiVersion: apps/v1 kind: Deployment metadata: name: joplin-db + labels: + {{- include "joplin.labels" . | nindent 4 }} spec: selector: matchLabels: @@ -11,6 +13,10 @@ spec: type: Recreate template: metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} labels: app: {{ .Chart.Name }}-db spec: @@ -18,31 +24,54 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "joplin.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - env: - name: POSTGRES_DB - value: joplin + value: {{ .Values.database.dbname }} - name: POSTGRES_PASSWORD - value: veryhugepasswordhere + value: {{ .Values.database.dbpassword }} - name: POSTGRES_USER - value: joplin + value: {{ .Values.database.dbuser }} - name: PGDATA value: /var/lib/postgresql/data/pgdata - image: postgres:15 + image: "{{ .Values.image.joplin.repository }}:{{ .Values.image.joplin.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} name: {{ .Chart.Name }}-db ports: - containerPort: 5432 - resources: {} + livenessProbe: + tcpSocket: + path: / + port: 5432 + initialDelaySeconds: 190 + readinessProbe: + tcpSocket: + port: 5432 + resources: + {{- toYaml .Values.resources | nindent 12 }} +{{- if .Values.persistence.enabled }} volumeMounts: - mountPath: /var/lib/postgresql/data subPath: pgdata name: db - restartPolicy: Always volumes: - name: db persistentVolumeClaim: - claimName: joplin-pvc-db + claimName: {{ .Values.persistence.pvcClaim | default .Chart.Name }} +{{- end }} + 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: {} diff --git a/charts/joplin/templates/joplin-db-service.yaml b/charts/joplin/templates/joplin-db-service.yaml index 03080b2..8ae605b 100644 --- a/charts/joplin/templates/joplin-db-service.yaml +++ b/charts/joplin/templates/joplin-db-service.yaml @@ -2,11 +2,13 @@ apiVersion: v1 kind: Service metadata: name: {{ .Chart.Name }}-db + labels: + {{- include "joplin.labels" . | nindent 4 }} spec: ports: - name: "postgresql" port: 5432 - targetPort: {{ .Values.service.port }} + targetPort: {{ .Values.service.database.port }} selector: app: {{ .Chart.Name }}-db status: diff --git a/charts/joplin/templates/joplin-ingressroute.yaml b/charts/joplin/templates/joplin-ingressroute.yaml index 670324a..55f1a0c 100644 --- a/charts/joplin/templates/joplin-ingressroute.yaml +++ b/charts/joplin/templates/joplin-ingressroute.yaml @@ -3,6 +3,8 @@ apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: name: joplin-ingressroute + labels: + {{- include "joplin.labels" . | nindent 4 }} spec: entryPoints: - web From 9d843784db49da2bb738d4b5d9cdcac4142be75c Mon Sep 17 00:00:00 2001 From: QJoly Date: Fri, 2 Dec 2022 18:23:52 +0100 Subject: [PATCH 07/17] Fix: Path inconnu dans liveness --- charts/joplin/templates/joplin-db-deployment.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/joplin/templates/joplin-db-deployment.yaml b/charts/joplin/templates/joplin-db-deployment.yaml index cfbd093..bb49e56 100644 --- a/charts/joplin/templates/joplin-db-deployment.yaml +++ b/charts/joplin/templates/joplin-db-deployment.yaml @@ -43,7 +43,6 @@ spec: - containerPort: 5432 livenessProbe: tcpSocket: - path: / port: 5432 initialDelaySeconds: 190 readinessProbe: From 81462be89ce38606398a16f0296ddc6bb666bd61 Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 11:26:37 +0100 Subject: [PATCH 08/17] =?UTF-8?q?Mail=20+=20param=C3=A8tre=20Joplin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charts/joplin/values.yaml | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/charts/joplin/values.yaml b/charts/joplin/values.yaml index fb4abe0..91a3330 100644 --- a/charts/joplin/values.yaml +++ b/charts/joplin/values.yaml @@ -15,6 +15,21 @@ database: dbuser: joplinuser dbpassword: veryhugepasswordhere +joplin: + base_url: http://localhost:22300 + +mailer: + enabled: true + host: mailserver + noreplymail: noreply@mailserver + noreplyname: noreplyname@mailserver + port: 25 + user: usermail + password: password + security: none # none / TLS / STARTLS + + + imagePullSecrets: [] nameOverride: "" fullnameOverride: "" @@ -22,8 +37,8 @@ fullnameOverride: "" podAnnotations: {} -podSecurityContext: {} - # fsGroup: 2000 +podSecurityContext: + fsGroup: 2000 securityContext: # capabilities: @@ -43,19 +58,19 @@ service: persistence: - storageClassName: "longhorn" + storageClassName: "" # leave empty if you want to use default enabled: true - size: "4Gi" + size: "1Gi" # We recommend to allocate a minimum of 1GB if you do not use attachments # Uncomment if you want to use an existing PVC # pvcClaim: ur_pvc ingress: isIngressRoute: false - enabled: false + enabled: true className: "" annotations: {} domain: ur_domain.tld - entrypoint: websecure + entrypoint: websecure # Useless if you use ingressroute certresolver: letsencrypt resources: {} From 7703c196780bae00dd2c0de1ee7727f32bf94be2 Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 11:26:55 +0100 Subject: [PATCH 09/17] Variabilisation du storageClassName --- charts/joplin/templates/db-persistentvolumeclaim.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/joplin/templates/db-persistentvolumeclaim.yaml b/charts/joplin/templates/db-persistentvolumeclaim.yaml index 172092b..6844e48 100644 --- a/charts/joplin/templates/db-persistentvolumeclaim.yaml +++ b/charts/joplin/templates/db-persistentvolumeclaim.yaml @@ -8,7 +8,11 @@ metadata: {{- include "joplin.labels" . | nindent 4 }} name: {{ .Chart.Name }} spec: - storageClassName: "longhorn" +{{- if .Values.persistence.storageClassName }} + storageClassName: "{{ .Values.persistence.storageClassName }}" +{{ else }} + +{{- end }} accessModes: - ReadWriteOnce resources: From b46b6b693d3b1e2bbe5675c6bd3a9c9cf816541c Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 11:27:31 +0100 Subject: [PATCH 10/17] Mails, metadata, selector --- .../templates/joplin-app-deployment.yaml | 52 ++++++++++++++----- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/charts/joplin/templates/joplin-app-deployment.yaml b/charts/joplin/templates/joplin-app-deployment.yaml index 18daef7..0820ae5 100644 --- a/charts/joplin/templates/joplin-app-deployment.yaml +++ b/charts/joplin/templates/joplin-app-deployment.yaml @@ -1,42 +1,57 @@ 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: joplin-noreply@domain.tld + 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: {{ .Values.database.dbname }} - name: POSTGRES_HOST @@ -47,10 +62,23 @@ spec: value: "5432" - name: POSTGRES_USER value: {{ .Values.database.dbuser }} - image: joplin/server:2.9.7-beta + 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: {} + From 59bba3812e7043343d9ca1ddfe803a1ae4c82d51 Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 11:27:41 +0100 Subject: [PATCH 11/17] =?UTF-8?q?Erreur=20dans=20l'image=20utilis=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charts/joplin/templates/joplin-db-deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/joplin/templates/joplin-db-deployment.yaml b/charts/joplin/templates/joplin-db-deployment.yaml index bb49e56..044c9f6 100644 --- a/charts/joplin/templates/joplin-db-deployment.yaml +++ b/charts/joplin/templates/joplin-db-deployment.yaml @@ -35,8 +35,8 @@ spec: - name: POSTGRES_USER value: {{ .Values.database.dbuser }} - name: PGDATA - value: /var/lib/postgresql/data/pgdata - image: "{{ .Values.image.joplin.repository }}:{{ .Values.image.joplin.tag | default .Chart.AppVersion }}" + value: "/var/lib/postgresql/data/pgdata" + image: "{{ .Values.image.postgres.repository }}:{{ .Values.image.postgres.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} name: {{ .Chart.Name }}-db ports: From 954f833f366b47e26bcd5e51bda8b52f640cc4e7 Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 11:27:50 +0100 Subject: [PATCH 12/17] Ingress et Ingressroute --- charts/joplin/templates/joplin-ingress.yaml | 49 +++++++++++++++++++ .../joplin/templates/joplin-ingressroute.yaml | 14 +++--- 2 files changed, 56 insertions(+), 7 deletions(-) create mode 100644 charts/joplin/templates/joplin-ingress.yaml diff --git a/charts/joplin/templates/joplin-ingress.yaml b/charts/joplin/templates/joplin-ingress.yaml new file mode 100644 index 0000000..18eac9e --- /dev/null +++ b/charts/joplin/templates/joplin-ingress.yaml @@ -0,0 +1,49 @@ +{{- 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: "/" + 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 }} \ No newline at end of file diff --git a/charts/joplin/templates/joplin-ingressroute.yaml b/charts/joplin/templates/joplin-ingressroute.yaml index 55f1a0c..23b0735 100644 --- a/charts/joplin/templates/joplin-ingressroute.yaml +++ b/charts/joplin/templates/joplin-ingressroute.yaml @@ -1,20 +1,20 @@ {{- if .Values.ingress.enabled -}} +{{- if .Values.ingress.isIngressRoute -}} apiVersion: traefik.containo.us/v1alpha1 kind: IngressRoute metadata: - name: joplin-ingressroute + name: {{ .Chart.Name }}-ingressroute labels: {{- include "joplin.labels" . | nindent 4 }} spec: - entryPoints: - - web - - websecure + entryPoints: {{ .Values.ingress.entrypoint }} routes: - - match: Host(`ur_app`) + - match: Host(`{{ .Values.ingress.domain }} `) kind: Rule services: - - name: joplin-app + - name: {{ .Chart.Name }}-app port: 22300 tls: - certResolver: letsencrypt + certResolver: {{ .Values.ingress.certresolver }} +{{- end}} {{- end}} From 495023ec37cbf67967f7525c670cd44882aaeeda Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 11:28:15 +0100 Subject: [PATCH 13/17] =?UTF-8?q?Cr=C3=A9ation=20d'une=20note=20pour=20don?= =?UTF-8?q?ner=20user:pass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charts/joplin/templates/NOTES.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 charts/joplin/templates/NOTES.txt diff --git a/charts/joplin/templates/NOTES.txt b/charts/joplin/templates/NOTES.txt new file mode 100644 index 0000000..7f8deca --- /dev/null +++ b/charts/joplin/templates/NOTES.txt @@ -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 \ No newline at end of file From 600956b00f0f0f746b9e0b780bd9ce87aa70a1bb Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 11:36:36 +0100 Subject: [PATCH 14/17] Fix: ajouter prefix --- charts/joplin/templates/joplin-ingress.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/joplin/templates/joplin-ingress.yaml b/charts/joplin/templates/joplin-ingress.yaml index 18eac9e..4346003 100644 --- a/charts/joplin/templates/joplin-ingress.yaml +++ b/charts/joplin/templates/joplin-ingress.yaml @@ -35,6 +35,9 @@ spec: http: paths: - path: "/" + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: Prefix + {{- end }} backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: From da7e9c82f9fba553d920c5ae58b0da433319f0bb Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 11:58:31 +0100 Subject: [PATCH 15/17] prefix --- charts/joplin/templates/joplin-ingress.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/charts/joplin/templates/joplin-ingress.yaml b/charts/joplin/templates/joplin-ingress.yaml index 4346003..c957aee 100644 --- a/charts/joplin/templates/joplin-ingress.yaml +++ b/charts/joplin/templates/joplin-ingress.yaml @@ -35,9 +35,7 @@ spec: http: paths: - path: "/" - {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} pathType: Prefix - {{- end }} backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: From ab31f2e162ed583a765debbcde5ed3be6ab64179 Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 12:10:51 +0100 Subject: [PATCH 16/17] =?UTF-8?q?Domain=20r=C3=A9aliste?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charts/joplin/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/joplin/values.yaml b/charts/joplin/values.yaml index 91a3330..7a77256 100644 --- a/charts/joplin/values.yaml +++ b/charts/joplin/values.yaml @@ -69,7 +69,7 @@ ingress: enabled: true className: "" annotations: {} - domain: ur_domain.tld + domain: ur-domain.tld entrypoint: websecure # Useless if you use ingressroute certresolver: letsencrypt From 36f92983eb3165e6b5c478904aa8fd98ce804073 Mon Sep 17 00:00:00 2001 From: QJoly Date: Sun, 4 Dec 2022 12:14:10 +0100 Subject: [PATCH 17/17] =?UTF-8?q?Mettre=20=C3=A0=20jour=20version=20chart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- charts/joplin/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/joplin/Chart.yaml b/charts/joplin/Chart.yaml index 121360d..28efdd4 100644 --- a/charts/joplin/Chart.yaml +++ b/charts/joplin/Chart.yaml @@ -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