From f68fd6f67b12538d7f7277400238cf663f8d6495 Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Tue, 12 Oct 2021 19:15:46 -0400 Subject: [PATCH] wip --- charts/gotify/Chart.yaml | 2 +- charts/gotify/templates/configmap.yaml | 29 +++++-------------------- charts/gotify/templates/deployment.yaml | 18 ++++++--------- charts/gotify/templates/secrets.yaml | 10 +++++---- charts/gotify/templates/service.yaml | 6 ++--- charts/gotify/values.yaml | 28 +++++++++++++++++++++++- 6 files changed, 50 insertions(+), 43 deletions(-) diff --git a/charts/gotify/Chart.yaml b/charts/gotify/Chart.yaml index d55fc78..90a637b 100644 --- a/charts/gotify/Chart.yaml +++ b/charts/gotify/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.1 +version: 0.0.3 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/gotify/templates/configmap.yaml b/charts/gotify/templates/configmap.yaml index caec460..8cf45af 100644 --- a/charts/gotify/templates/configmap.yaml +++ b/charts/gotify/templates/configmap.yaml @@ -1,27 +1,10 @@ apiVersion: v1 kind: ConfigMap metadata: - # TODO: truc full name ici ? - name: "gotify" - # Pas de labels ? + name: {{ include "gotify.fullname" . }} + labels: + {{- include "gotify.labels" . | nindent 4 }} +{{- with .Values.env }} data: - GOTIFY_DATABASE_CONNECTION: data/gotify.db - GOTIFY_DATABASE_DIALECT: sqlite3 - GOTIFY_PASSSTRENGTH: "10" - GOTIFY_PLUGINSDIR: data/plugins - GOTIFY_SERVER_KEEPALIVEPERIODSECONDS: "0" - GOTIFY_SERVER_LISTENADDR: "" - GOTIFY_SERVER_PORT: "80" - GOTIFY_SERVER_RESPONSEHEADERS: 'X-Custom-Header: "custom value"' - GOTIFY_SERVER_SSL_CERTFILE: "" - GOTIFY_SERVER_SSL_CERTKEY: "" - GOTIFY_SERVER_SSL_ENABLED: "false" - GOTIFY_SERVER_SSL_LETSENCRYPT_ACCEPTTOS: "false" - GOTIFY_SERVER_SSL_LETSENCRYPT_CACHE: certs - GOTIFY_SERVER_SSL_LETSENCRYPT_ENABLED: "false" - GOTIFY_SERVER_SSL_LISTENADDR: "" - GOTIFY_SERVER_SSL_PORT: "443" - GOTIFY_SERVER_SSL_REDIRECTTOHTTPS: "true" - GOTIFY_SERVER_STREAM_PINGPERIODSECONDS: "45" - GOTIFY_UPLOADEDIMAGESDIR: data/images - TZ: America/Los_Angeles + {{- toYaml . | nindent 2 }} +{{- end }} diff --git a/charts/gotify/templates/deployment.yaml b/charts/gotify/templates/deployment.yaml index 89bbd05..b218138 100644 --- a/charts/gotify/templates/deployment.yaml +++ b/charts/gotify/templates/deployment.yaml @@ -1,9 +1,9 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "fullname" . }} + name: {{ include "gotify.fullname" . }} labels: - {{- include "labels" . | nindent 4 }} + {{- include "gotify.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} @@ -11,7 +11,7 @@ spec: # TODO: il manque strategy.type = RollingUpdate selector: matchLabels: - {{- include "selectorLabels" . | nindent 6 }} + {{- include "gotify.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -19,7 +19,7 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "selectorLabels" . | nindent 8 }} + {{- include "gotify.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -34,11 +34,11 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - env: + envFrom: - configMapRef: - name: {{ include "fullname" . }} + name: {{ include "gotify.fullname" . }} - secretRef: - name: {{ include "fullname" . }} + name: {{ include "gotify.fullname" . }} ports: - name: http containerPort: 80 @@ -51,10 +51,6 @@ spec: httpGet: path: / port: http - # TODO: pas de volume mount ? - # TODO: ça sert à quoi encore ça ? :) - #resources: - # {{- toYaml .Values.resources | nindent 12 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/gotify/templates/secrets.yaml b/charts/gotify/templates/secrets.yaml index dbd6101..1ac6e1a 100644 --- a/charts/gotify/templates/secrets.yaml +++ b/charts/gotify/templates/secrets.yaml @@ -1,8 +1,10 @@ apiVersion: v1 kind: Secret metadata: - # TODO: pas de label ici ? - name: {{ $fullName }} + name: {{ include "gotify.fullname" . }} + labels: + {{- include "gotify.labels" . | nindent 4 }} +type: Opaque data: - user: {{ .Values.user }} - pass: {{ .Values.pass }} + user: {{ .Values.user | b64enc | quote }} + pass: {{ .Values.pass | b64enc | quote }} diff --git a/charts/gotify/templates/service.yaml b/charts/gotify/templates/service.yaml index c00186b..d0edd4d 100644 --- a/charts/gotify/templates/service.yaml +++ b/charts/gotify/templates/service.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "fullname" . }} + name: {{ include "gotify.fullname" . }} labels: - {{- include "labels" . | nindent 4 }} + {{- include "gotify.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: @@ -12,4 +12,4 @@ spec: protocol: TCP name: http selector: - {{- include "selectorLabels" . | nindent 4 }} + {{- include "gotify.selectorLabels" . | nindent 4 }} diff --git a/charts/gotify/values.yaml b/charts/gotify/values.yaml index 771aed6..7eb71bd 100644 --- a/charts/gotify/values.yaml +++ b/charts/gotify/values.yaml @@ -15,6 +15,9 @@ nameOverride: "" fullnameOverride: "" automountServiceAccountToken: false +user: "admin" +pass: "admin" + serviceAccount: # Specifies whether a service account should be created create: false @@ -61,7 +64,7 @@ ingress: ingressroute: enabled: false host: 'chart-example.local' - adminauth: 'dXNlcjpwYXNzd29yZA==' + adminauth: '' tls: [] annotations: {} @@ -89,3 +92,26 @@ nodeSelector: {} tolerations: [] affinity: {} + +# TODO: pv/pvc for sqlite +env: + GOTIFY_DATABASE_CONNECTION: data/gotify.db + GOTIFY_DATABASE_DIALECT: sqlite3 + GOTIFY_PASSSTRENGTH: "10" + GOTIFY_PLUGINSDIR: data/plugins + GOTIFY_SERVER_KEEPALIVEPERIODSECONDS: "0" + GOTIFY_SERVER_LISTENADDR: "" + GOTIFY_SERVER_PORT: "80" + #GOTIFY_SERVER_RESPONSEHEADERS: 'X-Custom-Header: "custom value"' + #GOTIFY_SERVER_SSL_CERTFILE: "" + #GOTIFY_SERVER_SSL_CERTKEY: "" + #GOTIFY_SERVER_SSL_ENABLED: "false" + #GOTIFY_SERVER_SSL_LETSENCRYPT_ACCEPTTOS: "false" + #GOTIFY_SERVER_SSL_LETSENCRYPT_CACHE: certs + ##GOTIFY_SERVER_SSL_LETSENCRYPT_ENABLED: "false" + #GOTIFY_SERVER_SSL_LISTENADDR: "" + #GOTIFY_SERVER_SSL_PORT: "443" + #GOTIFY_SERVER_SSL_REDIRECTTOHTTPS: "true" + GOTIFY_SERVER_STREAM_PINGPERIODSECONDS: "45" + GOTIFY_UPLOADEDIMAGESDIR: data/images + TZ: America/New_York