From 0c2f1cf39e175b3966bf8db9cafd8e114f418bd5 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 20:21:18 +0800 Subject: [PATCH 001/363] Add image sources --- mika/clog/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index f9c16782..f5a27574 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -9,6 +9,7 @@ replicaCount: "" # Container images used for Clog. image: # Clog container image configurations. + # Source: https://github.com/irfanhakim-as/clog/pkgs/container/clog clog: # The registry where the Clog container image is hosted. # Default: "ghcr.io" @@ -23,6 +24,7 @@ image: # Default: "IfNotPresent" pullPolicy: "" # Ngrok container image configurations. + # Source: https://hub.docker.com/r/wernight/ngrok ngrok: # The registry where the Ngrok container image is hosted. # Default: "docker.io" From f89f266a156cb686ba34ba79f8f21471dca23dc9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 20:25:26 +0800 Subject: [PATCH 002/363] Add comment --- mika/clog/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index f5a27574..c175f5a0 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -45,6 +45,7 @@ image: # - name: "ghcr-token-secret" imagePullSecrets: [] +# Clog configurations. clog: # The name of the Clog service. # Default: "Clog" From a6cadb9e0cb6b8d89e946b435f21f837d3024139 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 20:25:34 +0800 Subject: [PATCH 003/363] Set only sample resource limits --- mika/clog/values.yaml | 44 ++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index c175f5a0..a0bf8b39 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -168,24 +168,26 @@ db: # Resource requirements and limits for Clog containers. resources: # Clog container resources. - clog: - # The minimum amount of resources required by Clog to run. - requests: - # The minimum amount of CPU resources required by Clog. - # Example: - # cpu: "20m" - cpu: "10m" - # The minimum amount of memory required by Clog. - # Example: - # memory: "250Mi" - memory: "100Mi" - # The maximum amount of resources allowed for Clog. - limits: - # The maximum amount of CPU resources allowed for Clog. - # Example: - # cpu: "50m" - cpu: "50m" - # The maximum amount of memory allowed for Clog. - # Example: - # memory: "450Mi" - memory: "200Mi" + # Example: + # clog: + # # The minimum amount of resources required by Clog to run. + # requests: + # # The minimum amount of CPU resources required by Clog. + # # Example: + # # cpu: "10m" + # cpu: "10m" + # # The minimum amount of memory required by Clog. + # # Example: + # # memory: "10Mi" + # memory: "100Mi" + # # The maximum amount of resources allowed for Clog. + # limits: + # # The maximum amount of CPU resources allowed for Clog. + # # Example: + # # cpu: "250m" + # cpu: "50m" + # # The maximum amount of memory allowed for Clog. + # # Example: + # # memory: "250Mi" + # memory: "200Mi" + clog: {} From c071b9627b9dda44cfdc32574f12cabcb772ac61 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 20:36:59 +0800 Subject: [PATCH 004/363] Move and add new ingress settings --- mika/clog/templates/configmap.yaml | 4 +-- mika/clog/templates/deployment.yaml | 2 +- mika/clog/templates/ingress.yaml | 6 ++-- mika/clog/values.yaml | 51 +++++++++++++++++++++-------- 4 files changed, 43 insertions(+), 20 deletions(-) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index 796b06a2..69101d70 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -1,13 +1,13 @@ {{- $name := .Values.clog.name | default "Clog" | toString | quote }} {{- $debug := .Values.clog.debug | default "false" | toString | quote }} {{- $cloudflared := .Values.clog.cloudflared.enabled }} -{{- $ingress := .Values.clog.ingress.enabled }} +{{- $ingress := .Values.ingress.enabled }} {{- $ngrok := .Values.clog.ngrok.enabled }} {{- $domain := "" -}} {{- if $cloudflared }} {{- $domain = .Values.clog.cloudflared.domain | default "localhost" | toString }} {{- else if $ingress }} -{{- $domain = .Values.clog.ingress.domain | default "localhost" | toString }} +{{- $domain = .Values.clog.domain | default "localhost" | toString }} {{- else }} {{- $domain = "localhost" }} {{- end }} diff --git a/mika/clog/templates/deployment.yaml b/mika/clog/templates/deployment.yaml index c30bc0c6..1a4415a6 100644 --- a/mika/clog/templates/deployment.yaml +++ b/mika/clog/templates/deployment.yaml @@ -8,7 +8,7 @@ {{- $ngrok_tag := .Values.image.ngrok.tag | default "latest" | toString }} {{- $ngrok_pullPolicy := .Values.image.ngrok.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $cloudflared := .Values.clog.cloudflared.enabled }} -{{- $ingress := .Values.clog.ingress.enabled }} +{{- $ingress := .Values.ingress.enabled }} {{- $ngrok := .Values.clog.ngrok.enabled }} {{- $persistence := .Values.clog.persistence.enabled }} apiVersion: apps/v1 diff --git a/mika/clog/templates/ingress.yaml b/mika/clog/templates/ingress.yaml index 8ec71ae0..0d6b4a6b 100644 --- a/mika/clog/templates/ingress.yaml +++ b/mika/clog/templates/ingress.yaml @@ -1,7 +1,7 @@ -{{- $ingress := .Values.clog.ingress.enabled }} +{{- $ingress := .Values.ingress.enabled }} {{- if $ingress }} -{{- $cluster_issuer := .Values.clog.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} -{{- $domain := .Values.clog.ingress.domain | default "localhost" | toString }} +{{- $cluster_issuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $domain := .Values.clog.domain | default "localhost" | toString }} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index a0bf8b39..dcf2d379 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -47,6 +47,10 @@ imagePullSecrets: [] # Clog configurations. clog: + # The ingress domain name that hosts the Clog server. + # Example: + # domain: "clog.example.com" + domain: "" # The name of the Clog service. # Default: "Clog" # Example: @@ -111,20 +115,6 @@ clog: # Example: # domain: "clog.example.com" domain: "" - # Clog Ingress configurations. - ingress: - # Specifies whether Clog should be hosted using an Ingress. - # Example: - # enabled: true - enabled: false - # The name of the cluster issuer for Ingress. - # Default: "letsencrypt-dns-prod" - clusterIssuer: "" - # Registered domain name for Clog. - # Default: "localhost" - # Example: - # domain: "clog.example.com" - domain: "" # Clog Ngrok configurations. ngrok: # Specifies whether Clog should run using an Ngrok tunnel. @@ -165,6 +155,39 @@ db: # port: "5432" port: "" +# Ingress configurations. +ingress: + # Specifies whether Ingress should be enabled for hosting Clog services. + # Example: + # enabled: true + enabled: false + # The name of the cluster issuer for Ingress. + # Default: "letsencrypt-dns-prod" + # Example: + # clusterIssuer: "letsencrypt-http-prod" + clusterIssuer: "" + # Additional configuration annotations to be added to the Ingress resource. + # Example: + # customAnnotations: + # # The prefix of the annotation. + # # Default: "nginx.ingress.kubernetes.io" + # # Example: + # # - prefix: "nginx.org" + # - prefix: "" + # # The name of the annotation. + # # Example: + # # name: "proxy-connect-timeout" + # name: "" + # # The value of the annotation. + # # Example: + # # value: "120" + # value: "" + customAnnotations: [] + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false + # Resource requirements and limits for Clog containers. resources: # Clog container resources. From bf21cde9c9b08a7807fd349509440211c3d57d9a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 20:40:13 +0800 Subject: [PATCH 005/363] Update ingress --- mika/clog/templates/ingress.yaml | 56 ++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/mika/clog/templates/ingress.yaml b/mika/clog/templates/ingress.yaml index 0d6b4a6b..4875c06f 100644 --- a/mika/clog/templates/ingress.yaml +++ b/mika/clog/templates/ingress.yaml @@ -1,7 +1,11 @@ {{- $ingress := .Values.ingress.enabled }} -{{- if $ingress }} -{{- $cluster_issuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} -{{- $domain := .Values.clog.domain | default "localhost" | toString }} +{{- $www := .Values.ingress.www }} +{{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $customAnnotations := .Values.ingress.customAnnotations }} +{{- $domain := .Values.clog.domain | toString }} +{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} +{{- if and $ingress $domain }} +--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -9,7 +13,7 @@ metadata: labels: {{- include "clog.labels" . | nindent 4 }} annotations: - cert-manager.io/cluster-issuer: {{ $cluster_issuer }} + cert-manager.io/cluster-issuer: {{ $clusterIssuer }} cert-manager.io/private-key-algorithm: "ECDSA" nginx.ingress.kubernetes.io/affinity: "cookie" nginx.ingress.kubernetes.io/affinity-mode: "persistent" @@ -18,21 +22,39 @@ metadata: nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" nginx.ingress.kubernetes.io/session-cookie-name: "route" nginx.org/client-max-body-size: "100m" + {{- range $customAnnotations }} + {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} + {{- end }} spec: ingressClassName: "nginx" rules: - - host: {{ $domain | quote }} - http: - paths: - - backend: - service: - name: {{ .Release.Name }}-clog-svc - port: - number: 80 - path: / - pathType: Prefix + - host: {{ $domain | quote }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-clog-svc + port: + name: clog + path: / + pathType: Prefix + {{- if $www }} + - host: {{ $wwwDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-clog-svc + port: + name: clog + path: / + pathType: Prefix + {{- end }} tls: - - hosts: - - {{ $domain | quote }} - secretName: {{ .Release.Name }}-clog-tls-cert + - hosts: + - {{ $domain | quote }} + {{- if $www }} + - {{ $wwwDomain }} + {{- end }} + secretName: {{ .Release.Name }}-clog-tls-cert {{- end }} From cc6524d7d8bcd0e19be823faeef436733af85b1e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 20:54:51 +0800 Subject: [PATCH 006/363] Move storage persistence values --- mika/clog/values.yaml | 162 ++++++++++++++++++++++++++++++++---------- 1 file changed, 123 insertions(+), 39 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index dcf2d379..c33f073c 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -65,45 +65,6 @@ clog: # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" secret: "" - # Clog storage persistence configurations. - persistence: - # Specifies whether Clog should persist its storage. - # Example: - # enabled: true - enabled: false - # The storage class name used for dynamically provisioning a persistent volume for the Clog storage. - # Default: "longhorn" - # Example: - # storageClassName: "longhorn" - storageClassName: "" - # Clog static files persistence configurations. - static: - # The amount of persistent storage allocated for Clog static files. - # Default: "50Mi" - # Example: - # storage: "1Gi" - storage: "" - # Clog media files persistence configurations. - media: - # The amount of persistent storage allocated for Clog media files. - # Default: "100Mi" - # Example: - # storage: "1Gi" - storage: "" - # Clog logs persistence configurations. - logs: - # The amount of persistent storage allocated for Clog logs. - # Default: "50Mi" - # Example: - # storage: "1Gi" - storage: "" - # Clog migration files persistence configurations. - migrations: - # The amount of persistent storage allocated for Clog migration files. - # Default: "20Mi" - # Example: - # storage: "1Gi" - storage: "" # Clog Cloudflare configurations. cloudflared: # Specifies whether Clog should run using a Cloudflare tunnel. @@ -188,6 +149,129 @@ ingress: # www: true www: false +# Storage configurations. +storage: + # Log storage configurations. + log: + # Specifies whether persistent storage should be provisioned for log storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the log storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" + # The path where the log storage should be mounted on the container. + # Default: "/config" + # Example: + # mountPath: "/log" + mountPath: "" + # The subpath within the log storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Data" + subPath: "" + # The default amount of persistent storage allocated for the log storage. + # Default: "1Gi" + # Example: + # storage: "10Gi" + storage: "" + # The storage class name used for dynamically provisioning a persistent volume for the log storage. + # Default: "longhorn" + # Example: + # storageClassName: "longhorn" + storageClassName: "" + # Media storage configurations. + media: + # Specifies whether persistent storage should be provisioned for media storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the media storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" + # The path where the media storage should be mounted on the container. + # Default: "/config" + # Example: + # mountPath: "/media" + mountPath: "" + # The subpath within the media storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Data" + subPath: "" + # The default amount of persistent storage allocated for the media storage. + # Default: "1Gi" + # Example: + # storage: "10Gi" + storage: "" + # The storage class name used for dynamically provisioning a persistent volume for the media storage. + # Default: "longhorn" + # Example: + # storageClassName: "longhorn" + storageClassName: "" + # Migration storage configurations. + migration: + # Specifies whether persistent storage should be provisioned for migration storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the migration storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" + # The path where the migration storage should be mounted on the container. + # Default: "/config" + # Example: + # mountPath: "/migration" + mountPath: "" + # The subpath within the migration storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Data" + subPath: "" + # The default amount of persistent storage allocated for the migration storage. + # Default: "1Gi" + # Example: + # storage: "10Gi" + storage: "" + # The storage class name used for dynamically provisioning a persistent volume for the migration storage. + # Default: "longhorn" + # Example: + # storageClassName: "longhorn" + storageClassName: "" + # Static storage configurations. + static: + # Specifies whether persistent storage should be provisioned for static storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the static storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" + # The path where the static storage should be mounted on the container. + # Default: "/config" + # Example: + # mountPath: "/static" + mountPath: "" + # The subpath within the static storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Data" + subPath: "" + # The default amount of persistent storage allocated for the static storage. + # Default: "1Gi" + # Example: + # storage: "10Gi" + storage: "" + # The storage class name used for dynamically provisioning a persistent volume for the static storage. + # Default: "longhorn" + # Example: + # storageClassName: "longhorn" + storageClassName: "" + # Resource requirements and limits for Clog containers. resources: # Clog container resources. From 2256cdc764e2fc5d990932e475d7d5d26bf361b3 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 21:30:57 +0800 Subject: [PATCH 007/363] Update default values --- mika/clog/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index c33f073c..e98c5dc4 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -172,7 +172,7 @@ storage: # subPath: "Data" subPath: "" # The default amount of persistent storage allocated for the log storage. - # Default: "1Gi" + # Default: "50Mi" # Example: # storage: "10Gi" storage: "" @@ -202,7 +202,7 @@ storage: # subPath: "Data" subPath: "" # The default amount of persistent storage allocated for the media storage. - # Default: "1Gi" + # Default: "100Mi" # Example: # storage: "10Gi" storage: "" @@ -232,7 +232,7 @@ storage: # subPath: "Data" subPath: "" # The default amount of persistent storage allocated for the migration storage. - # Default: "1Gi" + # Default: "20Mi" # Example: # storage: "10Gi" storage: "" @@ -262,7 +262,7 @@ storage: # subPath: "Data" subPath: "" # The default amount of persistent storage allocated for the static storage. - # Default: "1Gi" + # Default: "50Mi" # Example: # storage: "10Gi" storage: "" From b685c374f084e1639faeaf611a81a732c1f92519 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 21:31:08 +0800 Subject: [PATCH 008/363] Update pvc --- mika/clog/templates/pvc.yaml | 69 ++++++++++++++++++++++-------------- 1 file changed, 43 insertions(+), 26 deletions(-) diff --git a/mika/clog/templates/pvc.yaml b/mika/clog/templates/pvc.yaml index e3044e1b..d2ee581c 100644 --- a/mika/clog/templates/pvc.yaml +++ b/mika/clog/templates/pvc.yaml @@ -1,23 +1,36 @@ -{{- $static_storage := .Values.clog.persistence.static.storage | default "50Mi" | toString | quote }} -{{- $media_storage := .Values.clog.persistence.media.storage | default "100Mi" | toString | quote }} -{{- $logs_storage := .Values.clog.persistence.logs.storage | default "50Mi" | toString | quote }} -{{- $migrations_storage := .Values.clog.persistence.migrations.storage | default "20Mi" | toString | quote }} -{{- $storage_class_name := .Values.clog.persistence.storageClassName | default "longhorn" | toString | quote }} -{{- $persistence := .Values.clog.persistence.enabled }} -{{- if $persistence }} +{{- $logPersistence := .Values.storage.log.enabled }} +{{- $logAccessMode := .Values.storage.log.accessMode | default "ReadWriteMany" | toString | quote }} +{{- $logStorage := .Values.storage.log.storage | default "50Mi" | toString | quote }} +{{- $logStorageClassName := .Values.storage.log.storageClassName | default "longhorn" | toString | quote }} +{{- $mediaPersistence := .Values.storage.media.enabled }} +{{- $mediaAccessMode := .Values.storage.media.accessMode | default "ReadWriteMany" | toString | quote }} +{{- $mediaStorage := .Values.storage.media.storage | default "100Mi" | toString | quote }} +{{- $mediaStorageClassName := .Values.storage.media.storageClassName | default "longhorn" | toString | quote }} +{{- $migrationPersistence := .Values.storage.migration.enabled }} +{{- $migrationAccessMode := .Values.storage.migration.accessMode | default "ReadWriteMany" | toString | quote }} +{{- $migrationStorage := .Values.storage.migration.storage | default "20Mi" | toString | quote }} +{{- $migrationStorageClassName := .Values.storage.migration.storageClassName | default "longhorn" | toString | quote }} +{{- $staticPersistence := .Values.storage.static.enabled }} +{{- $staticAccessMode := .Values.storage.static.accessMode | default "ReadWriteMany" | toString | quote }} +{{- $staticStorage := .Values.storage.static.storage | default "50Mi" | toString | quote }} +{{- $staticStorageClassName := .Values.storage.static.storageClassName | default "longhorn" | toString | quote }} +{{- if $logPersistence }} +--- apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ .Release.Name }}-clog-static-pvc + name: {{ .Release.Name }}-clog-log-pvc labels: {{- include "clog.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $logAccessMode }} resources: requests: - storage: {{ $static_storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $logStorage }} + storageClassName: {{ $logStorageClassName }} +{{- end }} +{{- if $mediaPersistence }} --- apiVersion: v1 kind: PersistentVolumeClaim @@ -27,51 +40,55 @@ metadata: {{- include "clog.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $mediaAccessMode }} resources: requests: - storage: {{ $media_storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $mediaStorage }} + storageClassName: {{ $mediaStorageClassName }} +{{- end }} +{{- if $migrationPersistence }} --- apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ .Release.Name }}-clog-logs-pvc + name: {{ .Release.Name }}-clog-core-migration-pvc labels: {{- include "clog.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $migrationAccessMode }} resources: requests: - storage: {{ $logs_storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $migrationStorage }} + storageClassName: {{ $migrationStorageClassName }} --- apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ .Release.Name }}-clog-core-migrations-pvc + name: {{ .Release.Name }}-clog-money-migration-pvc labels: {{- include "clog.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $migrationAccessMode }} resources: requests: - storage: {{ $migrations_storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $migrationStorage }} + storageClassName: {{ $migrationStorageClassName }} +{{- end }} +{{- if $staticPersistence }} --- apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ .Release.Name }}-clog-money-migrations-pvc + name: {{ .Release.Name }}-clog-static-pvc labels: {{- include "clog.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $staticAccessMode }} resources: requests: - storage: {{ $migrations_storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $staticStorage }} + storageClassName: {{ $staticStorageClassName }} {{- end }} From b4f29d4c5228a72e801523fe2e0289deb2e3b9d2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 21:32:56 +0800 Subject: [PATCH 009/363] Update pvc names --- mika/clog/templates/deployment.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mika/clog/templates/deployment.yaml b/mika/clog/templates/deployment.yaml index 1a4415a6..902268c7 100644 --- a/mika/clog/templates/deployment.yaml +++ b/mika/clog/templates/deployment.yaml @@ -60,11 +60,11 @@ spec: mountPath: /static - name: {{ .Release.Name }}-clog-media mountPath: /clog/media - - name: {{ .Release.Name }}-clog-logs + - name: {{ .Release.Name }}-clog-log mountPath: /var/log/apache2 - - name: {{ .Release.Name }}-clog-core-migrations + - name: {{ .Release.Name }}-clog-core-migration mountPath: /clog/core/migrations - - name: {{ .Release.Name }}-clog-money-migrations + - name: {{ .Release.Name }}-clog-money-migration mountPath: /clog/money/migrations {{- end }} {{- if $ngrok }} @@ -102,13 +102,13 @@ spec: - name: {{ .Release.Name }}-clog-media persistentVolumeClaim: claimName: {{ .Release.Name }}-clog-media-pvc - - name: {{ .Release.Name }}-clog-logs + - name: {{ .Release.Name }}-clog-log persistentVolumeClaim: - claimName: {{ .Release.Name }}-clog-logs-pvc - - name: {{ .Release.Name }}-clog-core-migrations + claimName: {{ .Release.Name }}-clog-log-pvc + - name: {{ .Release.Name }}-clog-core-migration persistentVolumeClaim: - claimName: {{ .Release.Name }}-clog-core-migrations-pvc - - name: {{ .Release.Name }}-clog-money-migrations + claimName: {{ .Release.Name }}-clog-core-migration-pvc + - name: {{ .Release.Name }}-clog-money-migration persistentVolumeClaim: - claimName: {{ .Release.Name }}-clog-money-migrations-pvc + claimName: {{ .Release.Name }}-clog-money-migration-pvc {{- end }} From fb86ef986e24292ac9b0049120e026eececb8057 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:16:23 +0800 Subject: [PATCH 010/363] Update default mountpath --- mika/clog/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index e98c5dc4..07774461 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -163,7 +163,7 @@ storage: # accessMode: "ReadWriteOnce" accessMode: "" # The path where the log storage should be mounted on the container. - # Default: "/config" + # Default: "/var/log/apache2" # Example: # mountPath: "/log" mountPath: "" @@ -193,7 +193,7 @@ storage: # accessMode: "ReadWriteOnce" accessMode: "" # The path where the media storage should be mounted on the container. - # Default: "/config" + # Default: "/clog/media" # Example: # mountPath: "/media" mountPath: "" @@ -223,7 +223,7 @@ storage: # accessMode: "ReadWriteOnce" accessMode: "" # The path where the migration storage should be mounted on the container. - # Default: "/config" + # Default: "/clog/%s/migrations" # Example: # mountPath: "/migration" mountPath: "" @@ -253,7 +253,7 @@ storage: # accessMode: "ReadWriteOnce" accessMode: "" # The path where the static storage should be mounted on the container. - # Default: "/config" + # Default: "/static" # Example: # mountPath: "/static" mountPath: "" From dfd15d29a7febb8d32096d7e4f4cae22776b7f77 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:22:05 +0800 Subject: [PATCH 011/363] Update sample subpath --- mika/clog/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 07774461..7b0f8dc8 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -169,7 +169,7 @@ storage: mountPath: "" # The subpath within the log storage to mount to the container. Leave empty if not required. # Example: - # subPath: "Data" + # subPath: "Log" subPath: "" # The default amount of persistent storage allocated for the log storage. # Default: "50Mi" @@ -199,7 +199,7 @@ storage: mountPath: "" # The subpath within the media storage to mount to the container. Leave empty if not required. # Example: - # subPath: "Data" + # subPath: "Media" subPath: "" # The default amount of persistent storage allocated for the media storage. # Default: "100Mi" @@ -229,7 +229,7 @@ storage: mountPath: "" # The subpath within the migration storage to mount to the container. Leave empty if not required. # Example: - # subPath: "Data" + # subPath: "Migration" subPath: "" # The default amount of persistent storage allocated for the migration storage. # Default: "20Mi" @@ -259,7 +259,7 @@ storage: mountPath: "" # The subpath within the static storage to mount to the container. Leave empty if not required. # Example: - # subPath: "Data" + # subPath: "Static" subPath: "" # The default amount of persistent storage allocated for the static storage. # Default: "50Mi" From 153189c8e105cb3ecfb5103dceb835a194d53ae1 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:22:41 +0800 Subject: [PATCH 012/363] Update deployment --- mika/clog/templates/deployment.yaml | 78 +++++++++++++++++++++-------- 1 file changed, 56 insertions(+), 22 deletions(-) diff --git a/mika/clog/templates/deployment.yaml b/mika/clog/templates/deployment.yaml index 902268c7..9df6ccec 100644 --- a/mika/clog/templates/deployment.yaml +++ b/mika/clog/templates/deployment.yaml @@ -1,4 +1,8 @@ -{{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $ngrok := .Values.clog.ngrok.enabled }} +{{- $logPersistence := .Values.storage.log.enabled }} +{{- $mediaPersistence := .Values.storage.media.enabled }} +{{- $migrationPersistence := .Values.storage.migration.enabled }} +{{- $staticPersistence := .Values.storage.static.enabled }} {{- $clog_registry := .Values.image.clog.registry | default "ghcr.io" | toString }} {{- $clog_repository := .Values.image.clog.repository | default "irfanhakim-as/clog" | toString }} {{- $clog_tag := .Values.image.clog.tag | default .Chart.AppVersion | toString }} @@ -7,10 +11,16 @@ {{- $ngrok_repository := .Values.image.ngrok.repository | default "wernight/ngrok" | toString }} {{- $ngrok_tag := .Values.image.ngrok.tag | default "latest" | toString }} {{- $ngrok_pullPolicy := .Values.image.ngrok.pullPolicy | default "IfNotPresent" | toString | quote }} -{{- $cloudflared := .Values.clog.cloudflared.enabled }} -{{- $ingress := .Values.ingress.enabled }} -{{- $ngrok := .Values.clog.ngrok.enabled }} -{{- $persistence := .Values.clog.persistence.enabled }} +{{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString | quote }} +{{- $logSubPath := .Values.storage.log.subPath | toString }} +{{- $mediaMountPath := .Values.storage.media.mountPath | default "/clog/media" | toString | quote }} +{{- $mediaSubPath := .Values.storage.media.subPath | toString }} +{{- $migrationMountPath := .Values.storage.migration.mountPath | default "/clog/%s/migrations" | toString | quote }} +{{- $migrationSubPath := .Values.storage.migration.subPath | toString }} +{{- $staticMountPath := .Values.storage.static.mountPath | default "/static" | toString | quote }} +{{- $staticSubPath := .Values.storage.static.subPath | toString }} +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -55,17 +65,38 @@ spec: mountPath: /etc/apache2/sites-available/000-default.conf subPath: site-config.conf readOnly: true - {{- if $persistence }} - - name: {{ .Release.Name }}-clog-static - mountPath: /static - - name: {{ .Release.Name }}-clog-media - mountPath: /clog/media + {{- if $logPersistence }} - name: {{ .Release.Name }}-clog-log - mountPath: /var/log/apache2 + mountPath: {{ $logMountPath }} + {{- if $logSubPath }} + subPath: {{ $logSubPath | quote }} + {{- end }} + {{- end }} + {{- if $mediaPersistence }} + - name: {{ .Release.Name }}-clog-media + mountPath: {{ $mediaMountPath }} + {{- if $mediaSubPath }} + subPath: {{ $mediaSubPath | quote }} + {{- end }} + {{- end }} + {{- if $migrationPersistence }} - name: {{ .Release.Name }}-clog-core-migration - mountPath: /clog/core/migrations + mountPath: {{ printf $migrationMountPath "core" }} + {{- if $migrationSubPath }} + subPath: {{ $migrationSubPath | quote }} + {{- end }} - name: {{ .Release.Name }}-clog-money-migration - mountPath: /clog/money/migrations + mountPath: {{ printf $migrationMountPath "money" }} + {{- if $migrationSubPath }} + subPath: {{ $migrationSubPath | quote }} + {{- end }} + {{- end }} + {{- if $staticPersistence }} + - name: {{ .Release.Name }}-clog-static + mountPath: {{ $staticMountPath }} + {{- if $staticSubPath }} + subPath: {{ $staticSubPath | quote }} + {{- end }} {{- end }} {{- if $ngrok }} - name: ngrok @@ -92,19 +123,17 @@ spec: - name: {{ .Release.Name }}-clog-site-config configMap: name: {{ .Release.Name }}-clog-site-config - items: - - key: site-config.conf - path: site-config.conf - {{- if $persistence }} - - name: {{ .Release.Name }}-clog-static + {{- if $logPersistence }} + - name: {{ .Release.Name }}-clog-log persistentVolumeClaim: - claimName: {{ .Release.Name }}-clog-static-pvc + claimName: {{ .Release.Name }}-clog-log-pvc + {{- end }} + {{- if $mediaPersistence }} - name: {{ .Release.Name }}-clog-media persistentVolumeClaim: claimName: {{ .Release.Name }}-clog-media-pvc - - name: {{ .Release.Name }}-clog-log - persistentVolumeClaim: - claimName: {{ .Release.Name }}-clog-log-pvc + {{- end }} + {{- if $migrationPersistence }} - name: {{ .Release.Name }}-clog-core-migration persistentVolumeClaim: claimName: {{ .Release.Name }}-clog-core-migration-pvc @@ -112,3 +141,8 @@ spec: persistentVolumeClaim: claimName: {{ .Release.Name }}-clog-money-migration-pvc {{- end }} + {{- if $staticPersistence }} + - name: {{ .Release.Name }}-clog-static + persistentVolumeClaim: + claimName: {{ .Release.Name }}-clog-static-pvc + {{- end }} From 2b90e76b0cf42a851a11b885f3b0b6a493b85d77 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:33:31 +0800 Subject: [PATCH 013/363] Reorder key --- mika/clog/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index 69101d70..38e454a8 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -18,9 +18,9 @@ metadata: labels: {{- include "clog.labels" . | nindent 4 }} data: - SITE_NAME: {{ $name }} DEBUG: {{ $debug }} NGROK: {{ $ngrok | toString | quote }} + SITE_NAME: {{ $name }} {{- if or $cloudflared $ingress }} DOMAIN: {{ $domain | quote }} {{- end }} From b40b7036e73f63fa8b50d9d8e5d5cfb98f8cd573 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:33:45 +0800 Subject: [PATCH 014/363] Parse tostring first --- mika/clog/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index 38e454a8..6b2ae898 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -33,4 +33,4 @@ metadata: {{- include "clog.labels" . | nindent 4 }} data: site-config.conf: |- - {{- include "clog.site-config-conf" . | replace "DOMAIN" $domain | nindent 4 }} + {{- include "clog.site-config-conf" . | toString | replace "DOMAIN" $domain | nindent 4 }} From d87038d585431df8edb1722ce26578bbeda4b8d5 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:36:36 +0800 Subject: [PATCH 015/363] Update configmap values --- mika/clog/templates/configmap.yaml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index 6b2ae898..ed156f33 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -1,16 +1,9 @@ -{{- $name := .Values.clog.name | default "Clog" | toString | quote }} -{{- $debug := .Values.clog.debug | default "false" | toString | quote }} {{- $cloudflared := .Values.clog.cloudflared.enabled }} {{- $ingress := .Values.ingress.enabled }} {{- $ngrok := .Values.clog.ngrok.enabled }} -{{- $domain := "" -}} -{{- if $cloudflared }} -{{- $domain = .Values.clog.cloudflared.domain | default "localhost" | toString }} -{{- else if $ingress }} +{{- $debug := .Values.clog.debug | default "false" | toString | quote }} {{- $domain = .Values.clog.domain | default "localhost" | toString }} -{{- else }} -{{- $domain = "localhost" }} -{{- end }} +{{- $name := .Values.clog.name | default "Clog" | toString | quote }} apiVersion: v1 kind: ConfigMap metadata: From bacb1b69d67b7d6e12dcf7397c2042e5d0eaf5b6 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:37:16 +0800 Subject: [PATCH 016/363] Add separator --- mika/clog/templates/configmap.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index ed156f33..b7a1be70 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -4,6 +4,7 @@ {{- $debug := .Values.clog.debug | default "false" | toString | quote }} {{- $domain = .Values.clog.domain | default "localhost" | toString }} {{- $name := .Values.clog.name | default "Clog" | toString | quote }} +--- apiVersion: v1 kind: ConfigMap metadata: From 8803863e146b9bc1ba679a9ca79356edaace299a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:41:37 +0800 Subject: [PATCH 017/363] Add separator --- mika/clog/templates/secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/templates/secret.yaml b/mika/clog/templates/secret.yaml index 5ea5021d..fb96c2be 100644 --- a/mika/clog/templates/secret.yaml +++ b/mika/clog/templates/secret.yaml @@ -6,7 +6,7 @@ {{- $db_password := .Values.db.password | toString | b64enc }} {{- $db_host := .Values.db.host | toString | b64enc }} {{- $db_port := .Values.db.port | default "5432" | toString | b64enc }} -{{- $ngrok := .Values.clog.ngrok.enabled }} +--- apiVersion: v1 kind: Secret metadata: From 8221d0022eaa1fd7319a13998ea414425f36c05e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:41:44 +0800 Subject: [PATCH 018/363] Move key --- mika/clog/templates/secret.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mika/clog/templates/secret.yaml b/mika/clog/templates/secret.yaml index fb96c2be..862b9ea7 100644 --- a/mika/clog/templates/secret.yaml +++ b/mika/clog/templates/secret.yaml @@ -1,3 +1,4 @@ +{{- $ngrok := .Values.clog.ngrok.enabled }} {{- $secret := .Values.clog.secret | toString | b64enc }} {{- $token := .Values.clog.ngrok.token | toString | b64enc }} {{- $db_type := .Values.db.type | default "postgresql" | toString | b64enc }} @@ -16,12 +17,12 @@ metadata: type: Opaque data: SECRET_KEY: {{ $secret }} - {{- if $ngrok }} - NGROK_AUTH_TOKEN: {{ $token }} - {{- end }} DB_TYPE: {{ $db_type }} DB_NAME: {{ $db_name }} DB_USER: {{ $db_user }} DB_PASS: {{ $db_password }} DB_HOST: {{ $db_host }} DB_PORT: {{ $db_port }} + {{- if $ngrok }} + NGROK_AUTH_TOKEN: {{ $token }} + {{- end }} From dfc7304fe4af3092eec3534ebb2bd1fa32e4668b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:48:57 +0800 Subject: [PATCH 019/363] Move site-config.conf into its own tpl --- mika/clog/templates/_helpers.tpl | 34 ------------------------ mika/clog/templates/site-config.conf.tpl | 33 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 34 deletions(-) create mode 100644 mika/clog/templates/site-config.conf.tpl diff --git a/mika/clog/templates/_helpers.tpl b/mika/clog/templates/_helpers.tpl index 4a18a3d6..1140b352 100644 --- a/mika/clog/templates/_helpers.tpl +++ b/mika/clog/templates/_helpers.tpl @@ -60,37 +60,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - -{{/* -Apache site-config.conf template -*/}} -{{- define "clog.site-config-conf" -}} - - ServerName DOMAIN:443 - UseCanonicalName On - ServerAdmin support@mikahomelab.com - DocumentRoot /clog - WSGIScriptAlias / /clog/clog/wsgi.py - WSGIDaemonProcess DOMAIN python-path=/clog - WSGIProcessGroup DOMAIN - - - - Require all granted - - - - Alias /static /static - - Require all granted - - - Alias /media /clog/media - - Require all granted - - - ErrorLog /var/log/apache2/apache.error.log - CustomLog /var/log/apache2/apache.access.log combined - -{{- end }} diff --git a/mika/clog/templates/site-config.conf.tpl b/mika/clog/templates/site-config.conf.tpl new file mode 100644 index 00000000..84663025 --- /dev/null +++ b/mika/clog/templates/site-config.conf.tpl @@ -0,0 +1,33 @@ +{{/* +Apache site-config.conf template +*/}} +{{- define "clog.site-config-conf" -}} + + ServerName DOMAIN:443 + UseCanonicalName On + ServerAdmin support@mikahomelab.com + DocumentRoot /clog + WSGIScriptAlias / /clog/clog/wsgi.py + WSGIDaemonProcess DOMAIN python-path=/clog + WSGIProcessGroup DOMAIN + + + + Require all granted + + + + Alias /static /static + + Require all granted + + + Alias /media /clog/media + + Require all granted + + + ErrorLog /var/log/apache2/apache.error.log + CustomLog /var/log/apache2/apache.access.log combined + +{{- end }} From cb5da799cedda5dc7b16ba6010530b73e5b2bd9a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 22:53:07 +0800 Subject: [PATCH 020/363] Remove trailing spaces --- mika/clog/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 7b0f8dc8..b64535c7 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -55,16 +55,16 @@ clog: # Default: "Clog" # Example: # name: "Clog" - name: "" + name: "" # Specifies whether Clog should run in debug mode. # Default: false # Example: # debug: true - debug: "" + debug: "" # A 50-character secret key used for secure session management and cryptographic operations within the Clog service. # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" - secret: "" + secret: "" # Clog Cloudflare configurations. cloudflared: # Specifies whether Clog should run using a Cloudflare tunnel. From 61377b42d3e9780899a3c1c0ab9f6836d62b5215 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 23:02:32 +0800 Subject: [PATCH 021/363] Add serverAdmin setting --- mika/clog/values.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index b64535c7..ab7bc810 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -65,6 +65,11 @@ clog: # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" secret: "" + # The Apache server administrator email address. + # Default: "admin@example.com" + # Example: + # serverAdmin: "foo@example.com" + serverAdmin: "" # Clog Cloudflare configurations. cloudflared: # Specifies whether Clog should run using a Cloudflare tunnel. From 7dfe080a56caf98fd62d394024f6fea1f745a48f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 23:02:56 +0800 Subject: [PATCH 022/363] Update serverAdmin --- mika/clog/templates/configmap.yaml | 3 ++- mika/clog/templates/site-config.conf.tpl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index b7a1be70..e42f6464 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -3,6 +3,7 @@ {{- $ngrok := .Values.clog.ngrok.enabled }} {{- $debug := .Values.clog.debug | default "false" | toString | quote }} {{- $domain = .Values.clog.domain | default "localhost" | toString }} +{{- $serverAdmin = .Values.clog.serverAdmin | default "admin@example.com" | toString }} {{- $name := .Values.clog.name | default "Clog" | toString | quote }} --- apiVersion: v1 @@ -27,4 +28,4 @@ metadata: {{- include "clog.labels" . | nindent 4 }} data: site-config.conf: |- - {{- include "clog.site-config-conf" . | toString | replace "DOMAIN" $domain | nindent 4 }} + {{- include "clog.site-config-conf" . | toString | replace "DOMAIN" $domain | replace "SERVER_ADMIN" $serverAdmin | nindent 4 }} diff --git a/mika/clog/templates/site-config.conf.tpl b/mika/clog/templates/site-config.conf.tpl index 84663025..775d3deb 100644 --- a/mika/clog/templates/site-config.conf.tpl +++ b/mika/clog/templates/site-config.conf.tpl @@ -5,7 +5,7 @@ Apache site-config.conf template ServerName DOMAIN:443 UseCanonicalName On - ServerAdmin support@mikahomelab.com + ServerAdmin SERVER_ADMIN DocumentRoot /clog WSGIScriptAlias / /clog/clog/wsgi.py WSGIDaemonProcess DOMAIN python-path=/clog From 230541ce6fdf59df1731f1ac60ddbb1919f185d5 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 23:03:21 +0800 Subject: [PATCH 023/363] Move value --- mika/clog/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index e42f6464..cfb9741f 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -3,8 +3,8 @@ {{- $ngrok := .Values.clog.ngrok.enabled }} {{- $debug := .Values.clog.debug | default "false" | toString | quote }} {{- $domain = .Values.clog.domain | default "localhost" | toString }} -{{- $serverAdmin = .Values.clog.serverAdmin | default "admin@example.com" | toString }} {{- $name := .Values.clog.name | default "Clog" | toString | quote }} +{{- $serverAdmin = .Values.clog.serverAdmin | default "admin@example.com" | toString }} --- apiVersion: v1 kind: ConfigMap From 203051fbd86cd64247ccc720f7b36f5ad9fbb9ec Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 23:07:16 +0800 Subject: [PATCH 024/363] Reorder values --- mika/clog/values.yaml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index ab7bc810..00297a68 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -47,6 +47,11 @@ imagePullSecrets: [] # Clog configurations. clog: + # Specifies whether Clog should run in debug mode. + # Default: false + # Example: + # debug: true + debug: "" # The ingress domain name that hosts the Clog server. # Example: # domain: "clog.example.com" @@ -56,11 +61,6 @@ clog: # Example: # name: "Clog" name: "" - # Specifies whether Clog should run in debug mode. - # Default: false - # Example: - # debug: true - debug: "" # A 50-character secret key used for secure session management and cryptographic operations within the Clog service. # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" @@ -99,6 +99,15 @@ db: # Example: # type: "postgresql" type: "" + # The hostname or IP address of the Clog database server. + # Example: + # host: "clog.default.svc.cluster.local" + host: "" + # The port number on which the Clog database server is listening. + # Default: "5432" + # Example: + # port: "5432" + port: "" # The name of the database used by Clog. # Example: # name: "clog" @@ -111,15 +120,6 @@ db: # Example: # password: "password" password: "" - # The hostname or IP address of the Clog database server. - # Example: - # host: "clog.default.svc.cluster.local" - host: "" - # The port number on which the Clog database server is listening. - # Default: "5432" - # Example: - # port: "5432" - port: "" # Ingress configurations. ingress: From 8448e11b5c175aa4ae6fecf81454b1f25258123f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 23:10:03 +0800 Subject: [PATCH 025/363] Update sample type --- mika/clog/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 00297a68..d28b229c 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -97,7 +97,7 @@ db: # The type of the database used by Clog. # Default: "postgresql" # Example: - # type: "postgresql" + # type: "mysql" type: "" # The hostname or IP address of the Clog database server. # Example: From b34bd4decee4c303726034e6ff0beb7756c33438 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 23:12:59 +0800 Subject: [PATCH 026/363] Update sample port --- mika/clog/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index d28b229c..ee812f46 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -106,7 +106,7 @@ db: # The port number on which the Clog database server is listening. # Default: "5432" # Example: - # port: "5432" + # port: "3306" port: "" # The name of the database used by Clog. # Example: From f7fc6425d50635e0ab48a91444dc209af20c265a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 13 Jul 2024 23:18:16 +0800 Subject: [PATCH 027/363] Update service --- mika/clog/templates/service.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mika/clog/templates/service.yaml b/mika/clog/templates/service.yaml index 82be697c..f8cb241b 100644 --- a/mika/clog/templates/service.yaml +++ b/mika/clog/templates/service.yaml @@ -1,3 +1,7 @@ +{{- $nodePort := .Values.service.nodePort | toString }} +{{- $port := .Values.service.port | default "80" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +--- apiVersion: v1 kind: Service metadata: @@ -5,11 +9,14 @@ metadata: labels: {{- include "clog.labels" . | nindent 4 }} spec: - type: ClusterIP + type: {{ $type }} ports: - - port: 80 + - port: {{ int $port }} targetPort: clog + {{- if and (eq $type "NodePort") $nodePort }} + nodePort: {{ int $nodePort }} + {{- end }} protocol: TCP - name: {{ .Release.Name }}-clog + name: clog selector: {{- include "clog.selectorLabels" . | nindent 4 }} From 3725ac55331bcb1ad26aceb3caabc06cca69ccd3 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 00:10:38 +0800 Subject: [PATCH 028/363] Add service config --- mika/clog/values.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index ee812f46..13113c1d 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -154,6 +154,23 @@ ingress: # www: true www: false +# Service configurations. +service: + # The optional node port to expose when the service type is NodePort. + # Example: + # nodePort: "32000" + nodePort: "" + # The port on which the Clog server should listen. + # Default: "80" + # Example: + # port: "8080" + port: "" + # The type of service used for Clog services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" + # Storage configurations. storage: # Log storage configurations. From fd126125d962b12de044d5d5a27284fae8589bef Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 00:12:36 +0800 Subject: [PATCH 029/363] Update chart notes --- mika/clog/templates/NOTES.txt | 47 ++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/mika/clog/templates/NOTES.txt b/mika/clog/templates/NOTES.txt index a7bceb78..59e31a78 100644 --- a/mika/clog/templates/NOTES.txt +++ b/mika/clog/templates/NOTES.txt @@ -1,5 +1,46 @@ -Clog is now installed and configured for {{ .Release.Name | toString }}. +{{- $ingress := .Values.ingress.enabled }} +{{- $domain := .Values.clog.domain | toString }} +{{- $port := .Values.service.port | default "80" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +{{- $serviceName := printf "%s-clog-svc" .Release.Name | toString }} +{{- $serviceAddress := "" }} +Clog has been installed and configured for {{ .Release.Name | toString }} 🎉 -See the values.yaml file of this chart for more configuration options. +{{- if $ingress }} +{{- $serviceAddress = printf "https://%s" $domain | toString }} +{{- else if or (eq $type "ClusterIP") (eq $type "LoadBalancer") (eq $type "NodePort") }} -Please refer to the official documentation for more information on how to use Clog. +Please run the following command(s) to obtain the right address to the service: + + ```sh + {{- if eq $type "ClusterIP" }} + {{- $forwardPort := "8080" | toString }} + {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} + export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "clog.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} + {{- else if eq $type "LoadBalancer" }} + {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $port | toString }} + export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} --template "{{"{{- range (index .status.loadBalancer.ingress 0) }}{{ . }}{{- end }}"}}") + {{- else if eq $type "NodePort" }} + {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") + {{- end }} + ``` + +{{- end }} + +{{- if $serviceAddress }} + +Visit the following service at the provided address: + + - Clog: {{ $serviceAddress }} + +{{- else }} + + ⚠️ This chart may have no accessible services available + +{{- end }} + +For more information on how to use and configure Clog, please refer to the official documentation. \ No newline at end of file From 45c76d5aa7c22f98f293e9aeaf730c22cc843c3d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 04:18:25 +0800 Subject: [PATCH 030/363] Remove deprecated value --- mika/clog/values.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 13113c1d..063ee7ea 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -76,11 +76,6 @@ clog: # Example: # enabled: true enabled: false - # Registered domain name on Cloudflare used for Clog. - # Default: "localhost" - # Example: - # domain: "clog.example.com" - domain: "" # Clog Ngrok configurations. ngrok: # Specifies whether Clog should run using an Ngrok tunnel. From fd7771928ccef336e7d265db547603353db88bfe Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 04:20:40 +0800 Subject: [PATCH 031/363] Note default value --- mika/clog/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 063ee7ea..2128dec3 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -53,6 +53,7 @@ clog: # debug: true debug: "" # The ingress domain name that hosts the Clog server. + # Default: "localhost" # Example: # domain: "clog.example.com" domain: "" From f0d28f4fb9d754f90b400ee2b9aa1568d46cecde Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 04:22:47 +0800 Subject: [PATCH 032/363] Add keywords --- mika/clog/Chart.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/clog/Chart.yaml b/mika/clog/Chart.yaml index 267dad4a..762f3399 100644 --- a/mika/clog/Chart.yaml +++ b/mika/clog/Chart.yaml @@ -7,6 +7,8 @@ appVersion: "0.0.2-stable-r1" keywords: - "clog" - "blog" + - "money" + - "todo" home: "https://github.com/irfanhakim-as/clog" icon: "https://irfanhakim-as.github.io/charts/logos/clog.png" sources: From 9841dc246fe99d5dbe5b5f1fd65f388725456693 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 04:22:53 +0800 Subject: [PATCH 033/363] Update chart version --- mika/clog/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/Chart.yaml b/mika/clog/Chart.yaml index 762f3399..60ff79e2 100644 --- a/mika/clog/Chart.yaml +++ b/mika/clog/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: clog description: Creative blog, Career blog, Coin blog, you name it. type: application -version: 0.2.3 +version: 0.3.0 appVersion: "0.0.2-stable-r1" keywords: - "clog" From 6c3ea586143968c40d2285089733ab3327fd8033 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 04:34:22 +0800 Subject: [PATCH 034/363] Update section header --- template/chartName/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/chartName/README.md b/template/chartName/README.md index 318e3346..5b1bef80 100644 --- a/template/chartName/README.md +++ b/template/chartName/README.md @@ -14,7 +14,7 @@ A Helm chart for deploying ChartName. --- -## External dependencies +## Preflight checklist > [!IMPORTANT] > The following items are required to be set up prior to installing this chart. From cd08625c6c1124126499dd91705ff779bfb37e30 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 04:34:38 +0800 Subject: [PATCH 035/363] Set mounted items gid --- mika/clog/templates/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/clog/templates/deployment.yaml b/mika/clog/templates/deployment.yaml index 9df6ccec..d6909e6d 100644 --- a/mika/clog/templates/deployment.yaml +++ b/mika/clog/templates/deployment.yaml @@ -146,3 +146,5 @@ spec: persistentVolumeClaim: claimName: {{ .Release.Name }}-clog-static-pvc {{- end }} + securityContext: + fsGroup: 33 From 390f94116135fb960a34cbe70136864275ed8fcf Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 05:50:19 +0800 Subject: [PATCH 036/363] Update sample value --- template/chartName/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/chartName/values.yaml b/template/chartName/values.yaml index 6c2bc63b..d0a06057 100644 --- a/template/chartName/values.yaml +++ b/template/chartName/values.yaml @@ -148,7 +148,7 @@ storage: # The storage class name used for dynamically provisioning a persistent volume for the data storage. # Default: "longhorn" # Example: - # storageClassName: "longhorn" + # storageClassName: "smb" storageClassName: "" # Resource requirements and limits for ChartName containers. From 0886a9dff73e818d1e25fac92e8c094b6749c97a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 05:50:42 +0800 Subject: [PATCH 037/363] Update value descriptions --- template/chartName/README.md | 4 ++-- template/chartName/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/template/chartName/README.md b/template/chartName/README.md index 5b1bef80..b9c69f3d 100644 --- a/template/chartName/README.md +++ b/template/chartName/README.md @@ -148,8 +148,8 @@ A Helm chart for deploying ChartName. | replicaCount | string | `""` | The desired number of running replicas for ChartName. Default: `"1"`. | | resources.chartName | object | `{}` | ChartName container resources. | | service.nodePort | string | `""` | The optional node port to expose when the service type is NodePort. | -| service.port | string | `""` | The port on which the ChartName server should listen. Default: `"80"`. | -| service.type | string | `""` | The type of service used for ChartName services. Default: `"ClusterIP"`. | +| service.port | string | `""` | The port on which the ChartName server should listen for connections. Default: `"80"`. | +| service.type | string | `""` | The type of service used to expose ChartName services. Default: `"ClusterIP"`. | | storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteMany"`. | | storage.data.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for data storage. | | storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/config"`. | diff --git a/template/chartName/values.yaml b/template/chartName/values.yaml index d0a06057..17293395 100644 --- a/template/chartName/values.yaml +++ b/template/chartName/values.yaml @@ -107,12 +107,12 @@ service: # Example: # nodePort: "32000" nodePort: "" - # The port on which the ChartName server should listen. + # The port on which the ChartName server should listen for connections. # Default: "80" # Example: # port: "8080" port: "" - # The type of service used for ChartName services. + # The type of service used to expose ChartName services. # Default: "ClusterIP" # Example: # type: "NodePort" From ac3dd67a21562b33821467aed51af50dbea092a2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 05:51:18 +0800 Subject: [PATCH 038/363] Update value desc and sample values --- mika/clog/values.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 2128dec3..54ee48ad 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -57,40 +57,40 @@ clog: # Example: # domain: "clog.example.com" domain: "" - # The name of the Clog service. + # The full name of the Clog web application. # Default: "Clog" # Example: - # name: "Clog" + # name: "My Blog" name: "" # A 50-character secret key used for secure session management and cryptographic operations within the Clog service. # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" secret: "" - # The Apache server administrator email address. + # The email address displayed by Apache for server administration contact. # Default: "admin@example.com" # Example: # serverAdmin: "foo@example.com" serverAdmin: "" - # Clog Cloudflare configurations. + # Cloudflare Tunnel configurations. cloudflared: - # Specifies whether Clog should run using a Cloudflare tunnel. + # Specifies whether Cloudflare Tunnel should be enabled for hosting Clog services. # Example: # enabled: true enabled: false - # Clog Ngrok configurations. + # Ngrok configurations. ngrok: - # Specifies whether Clog should run using an Ngrok tunnel. + # Specifies whether Ngrok should be enabled for hosting Clog services. # Example: # enabled: true enabled: false - # Ngrok authentication token. + # The authentication token used to authenticate with Ngrok. # Example: # token: "s7Ed4IO23nw1HWRJwumSgcyB7BtcXr4ZYLtziJCDDLIVDv7uq" token: "" # Database configurations. db: - # The type of the database used by Clog. + # The database engine or backend being used by Clog. # Default: "postgresql" # Example: # type: "mysql" @@ -99,12 +99,12 @@ db: # Example: # host: "clog.default.svc.cluster.local" host: "" - # The port number on which the Clog database server is listening. + # The port number the Clog database server is listening for connections. # Default: "5432" # Example: # port: "3306" port: "" - # The name of the database used by Clog. + # The name of the database being used by Clog. # Example: # name: "clog" name: "" @@ -112,7 +112,7 @@ db: # Example: # user: "root" user: "" - # The password associated with the Clog database's user. + # The password associated with the Clog database user. # Example: # password: "password" password: "" @@ -156,12 +156,12 @@ service: # Example: # nodePort: "32000" nodePort: "" - # The port on which the Clog server should listen. + # The port on which the Clog server should listen for connections. # Default: "80" # Example: # port: "8080" port: "" - # The type of service used for Clog services. + # The type of service used to expose Clog services. # Default: "ClusterIP" # Example: # type: "NodePort" @@ -197,7 +197,7 @@ storage: # The storage class name used for dynamically provisioning a persistent volume for the log storage. # Default: "longhorn" # Example: - # storageClassName: "longhorn" + # storageClassName: "smb" storageClassName: "" # Media storage configurations. media: @@ -227,7 +227,7 @@ storage: # The storage class name used for dynamically provisioning a persistent volume for the media storage. # Default: "longhorn" # Example: - # storageClassName: "longhorn" + # storageClassName: "smb" storageClassName: "" # Migration storage configurations. migration: @@ -257,7 +257,7 @@ storage: # The storage class name used for dynamically provisioning a persistent volume for the migration storage. # Default: "longhorn" # Example: - # storageClassName: "longhorn" + # storageClassName: "smb" storageClassName: "" # Static storage configurations. static: @@ -287,7 +287,7 @@ storage: # The storage class name used for dynamically provisioning a persistent volume for the static storage. # Default: "longhorn" # Example: - # storageClassName: "longhorn" + # storageClassName: "smb" storageClassName: "" # Resource requirements and limits for Clog containers. From d1057b6fa8a5a3697dcccc76e1b1a36c07ad23b1 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 05:52:03 +0800 Subject: [PATCH 039/363] Update chart docs --- mika/clog/README.md | 248 ++++++++++++++++++++++++++++++-------------- 1 file changed, 171 insertions(+), 77 deletions(-) diff --git a/mika/clog/README.md b/mika/clog/README.md index 45e22bd9..0f57f144 100644 --- a/mika/clog/README.md +++ b/mika/clog/README.md @@ -1,131 +1,225 @@ -# [`clog`](https://github.com/irfanhakim-as/clog) 🔒 +# Clog + +> [!WARNING] +> This chart requires access to a private image registry. Please request access from the owner of the image repository. + +Creative blog, Career blog, Coin blog, you name it. ## Prerequisites +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + - Kubernetes 1.19+ - Helm 3.2.0+ +- Longhorn 1.4.1+ + +--- ## Preflight checklist -### Create image pull secret +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +### Image pull secret + +An image pull secret is required to access the private image registry that hosts the required image. + +1. If you have the necessary credentials, create a named image pull secret (i.e. `ghcr-token-secret`) in the `default` namespace: + + ```sh + kubectl create secret docker-registry ghcr-token-secret --docker-server= --docker-username= --docker-password= --docker-email= -n default + ``` + +2. Copy the image pull secret from the `default` namespace to the destination namespace: + + ```sh + kubectl get secret ghcr-token-secret -n default -o yaml | sed "s/namespace: .*/namespace: /" | kubectl apply -f - + ``` + +3. Add the name of the image pull secret to the `imagePullSecrets` array in your installation's values file: + + ```yaml + imagePullSecrets: + - name: "ghcr-token-secret" + ``` + +### Generate secret key + +A unique, secure secret key is required for each Clog installation. + +1. Generate a secret key using the following command: + + ```sh + python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' + ``` + +2. Set the generated secret key as the value of the `clog.secret` setting in your installation's values file: + + ```yaml + secret: "" + ``` + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: -Replace `$github-username`, `$github-pass`, `$github-email` and `$namespace` accordingly. + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` -```sh -kubectl create secret docker-registry ghcr-token-secret --docker-server=https://ghcr.io --docker-username="$github-username" --docker-password="$github-pass" --docker-email="$github-email" -n $namespace -``` +2. Update the repo to retrieve the latest versions of the packages: -### Generate secret key for [`clog.secret`](values.yaml) + ```sh + helm repo update + ``` -```sh -python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' -``` +--- -## How to add repo +## How to install or upgrade a chart release -Add the repo to your local helm client. +1. Get the values file of the Clog chart or an existing installation (release). -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` + Get the latest Clog chart values file for a new installation: -Update the repo to retrieve the latest versions of the packages. + ```sh + helm show values mika/clog > values.yaml + ``` -```sh -helm repo update -``` + Alternatively, get the values file of an existing Clog release: -## How to install + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` -### Create database + Replace `${releaseName}` and `${namespace}` accordingly. -Deploy [`mika/postgres-agent`](../postgres-agent/) with `postgres.mode.create` set to `true`. This step can be skipped if you have an existing PostgreSQL database. +2. Edit your Clog values file with the intended configurations: -### Prepare chart values + ```sh + nano values.yaml + ``` -Copy `values.yaml` from the chart you would like to install. + Pay extra attention to the descriptions and sample values provided in the chart values file. -```sh -cp mika/clog/values.yaml . -``` +3. Install a new release for Clog or upgrade an existing Clog release: -Edit `values.yaml` with the appropriate values. Refer to the [Configurations](#Configurations) section for available options. + ```sh + helm upgrade --install ${releaseName} mika/clog --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` -```sh -nano values.yaml -``` + Replace `${releaseName}` and `${namespace}` accordingly. -### Perform installation +4. Verify that your Clog release has been installed: -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -```sh -helm install $release_name mika/clog --namespace $namespace --create-namespace --values values.yaml --wait -``` + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. +--- -```sh -helm ls --namespace $namespace | grep "$release_name" -``` +## How to uninstall a chart release -## How to upgrade +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. -After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly. +1. Uninstall the desired release: -```sh -helm upgrade $release_name mika/clog --namespace $namespace --values values.yaml --wait -``` + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` -## How to uninstall + Replace `${releaseName}` and `${namespace}` accordingly. -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. +2. Verify that the release has been uninstalled: -```sh -helm uninstall $release_name --namespace $namespace --wait -``` + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -### Delete database + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. -Deploy [`mika/postgres-agent`](../postgres-agent/) with `postgres.mode.drop` set to `true`. +--- -## Configurations +## Chart configurations | Key | Type | Default | Description | |-----|------|---------|-------------| -| clog.cloudflared.domain | string | `""` | Registered domain name on Cloudflare used for Clog. Default: `"localhost"`. | -| clog.cloudflared.enabled | bool | `false` | Specifies whether Clog should run using a Cloudflare tunnel. | +| clog.cloudflared.enabled | bool | `false` | Specifies whether Cloudflare Tunnel should be enabled for hosting Clog services. | | clog.debug | string | `""` | Specifies whether Clog should run in debug mode. Default: `false`. | -| clog.ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | -| clog.ingress.domain | string | `""` | Registered domain name for Clog. Default: `"localhost"`. | -| clog.ingress.enabled | bool | `false` | Specifies whether Clog should be hosted using an Ingress. | -| clog.name | string | `""` | The name of the Clog service. Default: `"Clog"`. | -| clog.ngrok.enabled | bool | `false` | Specifies whether Clog should run using an Ngrok tunnel. | -| clog.ngrok.token | string | `""` | Ngrok authentication token. | -| clog.persistence.enabled | bool | `false` | Specifies whether Clog should persist its storage. | -| clog.persistence.logs.storage | string | `""` | The amount of persistent storage allocated for Clog logs. Default: `"50Mi"`. | -| clog.persistence.media.storage | string | `""` | The amount of persistent storage allocated for Clog media files. Default: `"100Mi"`. | -| clog.persistence.migrations.storage | string | `""` | The amount of persistent storage allocated for Clog migration files. Default: `"20Mi"`. | -| clog.persistence.static.storage | string | `""` | The amount of persistent storage allocated for Clog static files. Default: `"50Mi"`. | -| clog.persistence.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the Clog storage. Default: `"longhorn"`. | +| clog.domain | string | `""` | The ingress domain name that hosts the Clog server. Default: `"localhost"`. | +| clog.name | string | `""` | The full name of the Clog web application. Default: `"Clog"`. | +| clog.ngrok.enabled | bool | `false` | Specifies whether Ngrok should be enabled for hosting Clog services. | +| clog.ngrok.token | string | `""` | The authentication token used to authenticate with Ngrok. | | clog.secret | string | `""` | A 50-character secret key used for secure session management and cryptographic operations within the Clog service. | +| clog.serverAdmin | string | `""` | The email address displayed by Apache for server administration contact. Default: `"admin@example.com"`. | | db.host | string | `""` | The hostname or IP address of the Clog database server. | -| db.name | string | `""` | The name of the database used by Clog. | -| db.password | string | `""` | The password associated with the Clog database's user. | -| db.port | string | `""` | The port number on which the Clog database server is listening. Default: `"5432"`. | -| db.type | string | `""` | The type of the database used by Clog. Default: `"postgresql"`. | +| db.name | string | `""` | The name of the database being used by Clog. | +| db.password | string | `""` | The password associated with the Clog database user. | +| db.port | string | `""` | The port number the Clog database server is listening for connections. Default: `"5432"`. | +| db.type | string | `""` | The database engine or backend being used by Clog. Default: `"postgresql"`. | | db.user | string | `""` | The username or user account for accessing the Clog database. | | image.clog.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Clog container image. Default: `"IfNotPresent"`. | | image.clog.registry | string | `""` | The registry where the Clog container image is hosted. Default: `"ghcr.io"`. | | image.clog.repository | string | `""` | The name of the repository that contains the Clog container image used. Default: `"irfanhakim-as/clog"`. | -| image.clog.tag | string | `""` | The tag that specifies the version of the Clog container image used. Default: `"Chart appVersion"`. | +| image.clog.tag | string | `""` | The tag that specifies the version of the Clog container image used. Default: `Chart appVersion`. | | image.ngrok.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Ngrok container image. Default: `"IfNotPresent"`. | | image.ngrok.registry | string | `""` | The registry where the Ngrok container image is hosted. Default: `"docker.io"`. | | image.ngrok.repository | string | `""` | The name of the repository that contains the Ngrok container image used. Default: `"wernight/ngrok"`. | | image.ngrok.tag | string | `""` | The tag that specifies the version of the Ngrok container image used. Default: `"latest"`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | -| replicaCount | string | `""` | The desired number of running replicas for Clog. Default: `"1"`. | -| resources.clog.limits.cpu | string | `"50m"` | The maximum amount of CPU resources allowed for Clog. | -| resources.clog.limits.memory | string | `"200Mi"` | The maximum amount of memory allowed for Clog. | -| resources.clog.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by Clog. | -| resources.clog.requests.memory | string | `"100Mi"` | The minimum amount of memory required by Clog. | +| ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | +| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. | +| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Clog services. | +| ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | +| replicaCount | string | `""` | The desired number of running replicas for Clog. | +| resources.clog | object | `{}` | Resource requirements and limits for Clog containers. | +| service.nodePort | string | `""` | The optional node port to expose when the service type is NodePort. | +| service.port | string | `""` | The port on which the Clog server should listen for connections. Default: `"80"`. | +| service.type | string | `""` | The type of service used to expose Clog services. Default: `"ClusterIP"`. | +| storage.log.accessMode | string | `""` | The access mode defining how the log storage can be mounted. Default: `"ReadWriteMany"`. | +| storage.log.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for log storage. | +| storage.log.mountPath | string | `""` | The path where the log storage should be mounted on the container. Default: `"/var/log/apache2"`. | +| storage.log.storage | string | `""` | The default amount of persistent storage allocated for the log storage. Default: `"50Mi"`. | +| storage.log.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the log storage. Default: `"longhorn"`. | +| storage.log.subPath | string | `""` | The subpath within the log storage to mount to the container. Leave empty if not required. | +| storage.media.accessMode | string | `""` | The access mode defining how the media storage can be mounted. Default: `"ReadWriteMany"`. | +| storage.media.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for media storage. | +| storage.media.mountPath | string | `""` | The path where the media storage should be mounted on the container. Default: `"/clog/media"`. | +| storage.media.storage | string | `""` | The default amount of persistent storage allocated for the media storage. Default: `"100Mi"`. | +| storage.media.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the media storage. Default: `"longhorn"`. | +| storage.media.subPath | string | `""` | The subpath within the media storage to mount to the container. Leave empty if not required. | +| storage.migration.accessMode | string | `""` | The access mode defining how the migration storage can be mounted. Default: `"ReadWriteMany"`. | +| storage.migration.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for migration storage. | +| storage.migration.mountPath | string | `""` | The path where the migration storage should be mounted on the container. Default: `"/clog/%s/migrations"`. | +| storage.migration.storage | string | `""` | The default amount of persistent storage allocated for the migration storage. Default: `"20Mi"`. | +| storage.migration.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the migration storage. Default: `"longhorn"`. | +| storage.migration.subPath | string | `""` | The subpath within the migration storage to mount to the container. Leave empty if not required. | +| storage.static.accessMode | string | `""` | The access mode defining how the static storage can be mounted. Default: `"ReadWriteMany"`. | +| storage.static.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for static storage. | +| storage.static.mountPath | string | `""` | The path where the static storage should be mounted on the container. Default: `"/static"`. | +| storage.static.storage | string | `""` | The default amount of persistent storage allocated for the static storage. Default: `"50Mi"`. | +| storage.static.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the static storage. Default: `"longhorn"`. | +| storage.static.subPath | string | `""` | The subpath within the static storage to mount to the container. Leave empty if not required. | \ No newline at end of file From 6fec8e24630a2809c1cc43b77ac2fc973b6251bf Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 05:53:30 +0800 Subject: [PATCH 040/363] Add link to project --- mika/clog/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/README.md b/mika/clog/README.md index 0f57f144..cbc976ad 100644 --- a/mika/clog/README.md +++ b/mika/clog/README.md @@ -1,4 +1,4 @@ -# Clog +# [Clog](https://github.com/irfanhakim-as/clog) > [!WARNING] > This chart requires access to a private image registry. Please request access from the owner of the image repository. From 102da2cc0841b46c7d16059895792ebf23e684e1 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 05:54:57 +0800 Subject: [PATCH 041/363] Minor wording update --- mika/clog/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/clog/README.md b/mika/clog/README.md index cbc976ad..78f6d94f 100644 --- a/mika/clog/README.md +++ b/mika/clog/README.md @@ -1,7 +1,7 @@ # [Clog](https://github.com/irfanhakim-as/clog) > [!WARNING] -> This chart requires access to a private image registry. Please request access from the owner of the image repository. +> This chart requires access to a private image registry, please request access from the owner of the repository. Creative blog, Career blog, Coin blog, you name it. From 99721de9f1f920289d0a64b1e4669b5fc72371ef Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 14 Jul 2024 12:07:55 +0800 Subject: [PATCH 042/363] Fix wrong var set operator --- mika/clog/templates/configmap.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index cfb9741f..fa3b333f 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -2,9 +2,9 @@ {{- $ingress := .Values.ingress.enabled }} {{- $ngrok := .Values.clog.ngrok.enabled }} {{- $debug := .Values.clog.debug | default "false" | toString | quote }} -{{- $domain = .Values.clog.domain | default "localhost" | toString }} +{{- $domain := .Values.clog.domain | default "localhost" | toString }} {{- $name := .Values.clog.name | default "Clog" | toString | quote }} -{{- $serverAdmin = .Values.clog.serverAdmin | default "admin@example.com" | toString }} +{{- $serverAdmin := .Values.clog.serverAdmin | default "admin@example.com" | toString }} --- apiVersion: v1 kind: ConfigMap From 3dd0831445b9a1415991d1a4404bf7ff59789b31 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 12:52:07 +0800 Subject: [PATCH 043/363] Update value desc --- mika/cloudflareddns/values.yaml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index ae626443..2917b465 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -2,24 +2,25 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -# The desired number of running replicas for cloudflareddns. +# The desired number of running replicas for Cloudflare DDNS. # Default: "1" replicaCount: "" -# Container images used for cloudflareddns. +# Container images used for Cloudflare DDNS. image: - # cloudflareddns container image configurations. + # Cloudflare DDNS container image configurations. + # Source: https://hub.docker.com/r/timothyjmiller/cloudflare-ddns cloudflareddns: - # The registry where the cloudflareddns container image is hosted. + # The registry where the Cloudflare DDNS container image is hosted. # Default: "docker.io" registry: "" - # The name of the repository that contains the cloudflareddns container image used. + # The name of the repository that contains the Cloudflare DDNS container image used. # Default: "timothyjmiller/cloudflare-ddns" repository: "" - # The tag that specifies the version of the cloudflareddns container image used. + # The tag that specifies the version of the Cloudflare DDNS container image used. # Default: Chart appVersion tag: "" - # The policy that determines when Kubernetes should pull the cloudflareddns container image. + # The policy that determines when Kubernetes should pull the Cloudflare DDNS container image. # Default: "IfNotPresent" pullPolicy: "" @@ -29,9 +30,9 @@ image: # - name: "ghcr-token-secret" imagePullSecrets: [] -# cloudflareddns configurations. +# Cloudflare DDNS configurations. cloudflareddns: - # The path to the cloudflareddns configuration directory. + # The path to the Cloudflare DDNS configuration directory. # Default: "/etc/cloudflare-ddns" # Example: # configPath: "/etc/cloudflare-ddns" @@ -65,7 +66,7 @@ cloudflareddns: # zoneID: "71fovu74p100z856k795umzl32h3240p" zoneID: "" -# Resource requirements and limits for cloudflareddns container. +# Resource requirements and limits for Cloudflare DDNS containers. resources: # The minimum amount of resources required by cloudflareddns to run. requests: From 97a8831691a051d367dcc74e1faa4083b8f92e8c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 12:52:26 +0800 Subject: [PATCH 044/363] Update sample value --- mika/cloudflareddns/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index 2917b465..fe9f5477 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -35,7 +35,7 @@ cloudflareddns: # The path to the Cloudflare DDNS configuration directory. # Default: "/etc/cloudflare-ddns" # Example: - # configPath: "/etc/cloudflare-ddns" + # configPath: "/var/lib/cloudflare-ddns" configPath: "" # Specify whether to add an A record for each subdomain. # Default: "true" From 3c888b308378da84d7c6973da8d2e9dbb7f5b89c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 12:59:16 +0800 Subject: [PATCH 045/363] Update values --- mika/cloudflareddns/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index fe9f5477..97337de1 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -38,14 +38,14 @@ cloudflareddns: # configPath: "/var/lib/cloudflare-ddns" configPath: "" # Specify whether to add an A record for each subdomain. - # Default: "true" + # Default: true # Example: - # ipv4: "false" + # ipv4: false ipv4: "" # Specify whether to add an AAAA record for each subdomain. - # Default: "false" + # Default: false # Example - # ipv6: "true" + # ipv6: true ipv6: "" # The list of subdomains to be updated, each with their own hostname and proxied setting. # Example: From f9a16729ed4a3ff7c7dd9e9e9b2b103bed4a7189 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 21:24:21 +0800 Subject: [PATCH 046/363] Note that value must be defined as string Otherwise default value may not be supplied as expected --- mika/cloudflareddns/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index 97337de1..94b106dd 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -51,11 +51,11 @@ cloudflareddns: # Example: # subdomains: # - hostname: "" - # proxied: true + # proxied: "true" # - hostname: "foo" - # proxied: false + # proxied: "false" # - hostname: "bar" - # proxied: false + # proxied: "false" subdomains: [] # The Cloudflare API token used to authenticate with the Cloudflare API. # Example: From cc390b081f0ba17646530f02baac99830ff84d00 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 21:25:32 +0800 Subject: [PATCH 047/363] Set default proxied value as false --- mika/cloudflareddns/templates/config.json.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/cloudflareddns/templates/config.json.tpl b/mika/cloudflareddns/templates/config.json.tpl index c671325b..f37cab21 100644 --- a/mika/cloudflareddns/templates/config.json.tpl +++ b/mika/cloudflareddns/templates/config.json.tpl @@ -14,7 +14,7 @@ Cloudflare-DDNS config.json template {{- range $index, $subdomain := $subdomains }} { "name": "{{ $subdomain.hostname }}", - "proxied": {{ $subdomain.proxied }} + "proxied": {{ $subdomain.proxied | default "false" | toString }} }{{ if ne $index (sub (len $subdomains) 1) }},{{ end }} {{- end }} ] From 0a8092b6e53b64eb163399fa1d8f7738739dd816 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 21:26:27 +0800 Subject: [PATCH 048/363] Quote value using filter --- mika/cloudflareddns/templates/config.json.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/cloudflareddns/templates/config.json.tpl b/mika/cloudflareddns/templates/config.json.tpl index f37cab21..70926a09 100644 --- a/mika/cloudflareddns/templates/config.json.tpl +++ b/mika/cloudflareddns/templates/config.json.tpl @@ -13,7 +13,7 @@ Cloudflare-DDNS config.json template {{- $subdomains := .Values.cloudflareddns.subdomains }} {{- range $index, $subdomain := $subdomains }} { - "name": "{{ $subdomain.hostname }}", + "name": {{ $subdomain.hostname | quote }}, "proxied": {{ $subdomain.proxied | default "false" | toString }} }{{ if ne $index (sub (len $subdomains) 1) }},{{ end }} {{- end }} From 2d8eefa57bf22126c1765345183416688b34f914 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 21:39:36 +0800 Subject: [PATCH 049/363] Add value descriptions --- mika/cloudflareddns/values.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index 94b106dd..9c61804f 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -50,12 +50,15 @@ cloudflareddns: # The list of subdomains to be updated, each with their own hostname and proxied setting. # Example: # subdomains: + # # The subdomain of the domain to be updated. + # # Example: + # # hostname: "foo" # - hostname: "" - # proxied: "true" - # - hostname: "foo" - # proxied: "false" - # - hostname: "bar" - # proxied: "false" + # # Specifies whether the subdomain should be proxied. + # # Default: "false" + # # Example: + # # proxied: "true" + # proxied: "" subdomains: [] # The Cloudflare API token used to authenticate with the Cloudflare API. # Example: From 8e19b19dbe943aafef1cb0c74d83181c343e952d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 22:48:03 +0800 Subject: [PATCH 050/363] Update desc --- mika/cloudflareddns/README.md | 2 +- mika/cloudflareddns/values.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mika/cloudflareddns/README.md b/mika/cloudflareddns/README.md index d1c0b3b0..0243e643 100644 --- a/mika/cloudflareddns/README.md +++ b/mika/cloudflareddns/README.md @@ -72,7 +72,7 @@ helm uninstall $release_name --namespace $namespace --wait | cloudflareddns.configPath | string | `""` | The path to the cloudflareddns configuration directory. Default: `"/etc/cloudflare-ddns"`. | | cloudflareddns.ipv4 | string | `""` | Specify whether to add an A record for each subdomain. Default: `"true"`. | | cloudflareddns.ipv6 | string | `""` | Specify whether to add an AAAA record for each subdomain. Default: `"false"`. | -| cloudflareddns.subdomains | list | `[]` | The list of subdomains to be updated, each with their own hostname and proxied setting. | +| cloudflareddns.subdomains | list | `[]` | The list of subdomains to be updated for a specified domain (zone). Items: `.hostname`, `.proxied`. | | cloudflareddns.token | string | `""` | The Cloudflare API token used to authenticate with the Cloudflare API. | | cloudflareddns.zoneID | string | `""` | The ID of the zone that will get the records. | | image.cloudflareddns.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the cloudflareddns container image. Default: `"IfNotPresent"`. | diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index 9c61804f..33c602d2 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -47,7 +47,8 @@ cloudflareddns: # Example # ipv6: true ipv6: "" - # The list of subdomains to be updated, each with their own hostname and proxied setting. + # The list of subdomains to be updated for a specified domain (zone). + # Items: `.hostname`, `.proxied` # Example: # subdomains: # # The subdomain of the domain to be updated. From 790494fcf2aa6dba0f4c59d4fe5493c379856a77 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 15 Jul 2024 22:49:12 +0800 Subject: [PATCH 051/363] Update resources config --- mika/cloudflareddns/templates/deployment.yaml | 2 +- mika/cloudflareddns/values.yaml | 44 ++++++++++--------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/mika/cloudflareddns/templates/deployment.yaml b/mika/cloudflareddns/templates/deployment.yaml index d7addfaa..63a5f1af 100644 --- a/mika/cloudflareddns/templates/deployment.yaml +++ b/mika/cloudflareddns/templates/deployment.yaml @@ -33,7 +33,7 @@ spec: image: {{ printf "%s/%s:%s" $registry $repository $tag | quote }} imagePullPolicy: {{ $pullPolicy }} resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.resources.cloudflareddns | nindent 12 }} envFrom: - configMapRef: name: {{ .Release.Name }}-cloudflareddns-cm diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index 33c602d2..63907a7c 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -72,23 +72,27 @@ cloudflareddns: # Resource requirements and limits for Cloudflare DDNS containers. resources: - # The minimum amount of resources required by cloudflareddns to run. - requests: - # The minimum amount of CPU resources required by cloudflareddns. - # Example: - # cpu: "10m" - cpu: "10m" - # The minimum amount of memory required by cloudflareddns. - # Example: - # memory: "10Mi" - memory: "10Mi" - # The maximum amount of resources allowed for cloudflareddns. - limits: - # The maximum amount of CPU resources allowed for cloudflareddns. - # Example: - # cpu: "250m" - cpu: "50m" - # The maximum amount of memory allowed for cloudflareddns. - # Example: - # memory: "250Mi" - memory: "32Mi" + # Cloudflare DDNS container resources. + # Example: + # cloudflareddns: + # # The minimum amount of resources required by Cloudflare DDNS to run. + # requests: + # # The minimum amount of CPU resources required by Cloudflare DDNS. + # # Example: + # # cpu: "10m" + # cpu: "10m" + # # The minimum amount of memory required by Cloudflare DDNS. + # # Example: + # # memory: "10Mi" + # memory: "10Mi" + # # The maximum amount of resources allowed for Cloudflare DDNS. + # limits: + # # The maximum amount of CPU resources allowed for Cloudflare DDNS. + # # Example: + # # cpu: "250m" + # cpu: "50m" + # # The maximum amount of memory allowed for Cloudflare DDNS. + # # Example: + # # memory: "250Mi" + # memory: "32Mi" + cloudflareddns: {} From be77bb5f28f75fffff68c282b27ee9c38da7d74b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:19:28 +0800 Subject: [PATCH 052/363] Remove unnecessary item declaration --- mika/cloudflareddns/templates/deployment.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/mika/cloudflareddns/templates/deployment.yaml b/mika/cloudflareddns/templates/deployment.yaml index 63a5f1af..e0cae315 100644 --- a/mika/cloudflareddns/templates/deployment.yaml +++ b/mika/cloudflareddns/templates/deployment.yaml @@ -46,6 +46,3 @@ spec: - name: {{ .Release.Name }}-cloudflareddns-config secret: secretName: {{ .Release.Name }}-cloudflareddns-config - items: - - key: config.json - path: config.json From 2ad5897e150d301358f7490b9777f2acca238ce0 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:20:09 +0800 Subject: [PATCH 053/363] Update mountpath and subpath format --- mika/cloudflareddns/templates/deployment.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mika/cloudflareddns/templates/deployment.yaml b/mika/cloudflareddns/templates/deployment.yaml index e0cae315..49cb30f9 100644 --- a/mika/cloudflareddns/templates/deployment.yaml +++ b/mika/cloudflareddns/templates/deployment.yaml @@ -3,7 +3,8 @@ {{- $tag := .Values.image.cloudflareddns.tag | default .Chart.AppVersion | toString }} {{- $pullPolicy := .Values.image.cloudflareddns.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} -{{- $config_path := .Values.cloudflareddns.configPath | default "/etc/cloudflare-ddns" | toString }} +{{- $configPath := .Values.cloudflareddns.configPath | default "/etc/cloudflare-ddns" | toString }} +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -39,8 +40,8 @@ spec: name: {{ .Release.Name }}-cloudflareddns-cm volumeMounts: - name: {{ .Release.Name }}-cloudflareddns-config - mountPath: {{ $config_path }}/config.json - subPath: config.json + mountPath: {{ printf "%s/%s" $configPath "config.json" | quote }} + subPath: "config.json" readOnly: true volumes: - name: {{ .Release.Name }}-cloudflareddns-config From 7535874c6df2b602b912db66898cf1524ce343c8 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:20:29 +0800 Subject: [PATCH 054/363] Update image value vars --- mika/cloudflareddns/templates/deployment.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/cloudflareddns/templates/deployment.yaml b/mika/cloudflareddns/templates/deployment.yaml index 49cb30f9..5bcf6ac2 100644 --- a/mika/cloudflareddns/templates/deployment.yaml +++ b/mika/cloudflareddns/templates/deployment.yaml @@ -1,7 +1,7 @@ -{{- $registry := .Values.image.cloudflareddns.registry | default "docker.io" | toString }} -{{- $repository := .Values.image.cloudflareddns.repository | default "timothyjmiller/cloudflare-ddns" | toString }} -{{- $tag := .Values.image.cloudflareddns.tag | default .Chart.AppVersion | toString }} -{{- $pullPolicy := .Values.image.cloudflareddns.pullPolicy | default "IfNotPresent" | toString | quote }} +{{- $cloudflareddns_registry := .Values.image.cloudflareddns.registry | default "docker.io" | toString }} +{{- $cloudflareddns_repository := .Values.image.cloudflareddns.repository | default "timothyjmiller/cloudflare-ddns" | toString }} +{{- $cloudflareddns_tag := .Values.image.cloudflareddns.tag | default .Chart.AppVersion | toString }} +{{- $cloudflareddns_pullPolicy := .Values.image.cloudflareddns.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $configPath := .Values.cloudflareddns.configPath | default "/etc/cloudflare-ddns" | toString }} --- @@ -31,8 +31,8 @@ spec: {{- end }} containers: - name: cloudflareddns - image: {{ printf "%s/%s:%s" $registry $repository $tag | quote }} - imagePullPolicy: {{ $pullPolicy }} + image: {{ printf "%s/%s:%s" $cloudflareddns_registry $cloudflareddns_repository $cloudflareddns_tag | quote }} + imagePullPolicy: {{ $cloudflareddns_pullPolicy }} resources: {{- toYaml .Values.resources.cloudflareddns | nindent 12 }} envFrom: From 6e86c853fcf7f031e0e5b3df4b97b19519bd2f72 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:21:42 +0800 Subject: [PATCH 055/363] Update var name --- mika/cloudflareddns/templates/configmap.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mika/cloudflareddns/templates/configmap.yaml b/mika/cloudflareddns/templates/configmap.yaml index 9c3205b5..d6c8e6b1 100644 --- a/mika/cloudflareddns/templates/configmap.yaml +++ b/mika/cloudflareddns/templates/configmap.yaml @@ -1,4 +1,5 @@ -{{- $config_path := .Values.cloudflareddns.configPath | default "/etc/cloudflare-ddns" | toString | quote }} +{{- $configPath := .Values.cloudflareddns.configPath | default "/etc/cloudflare-ddns" | toString | quote }} +--- apiVersion: v1 kind: ConfigMap metadata: @@ -6,4 +7,4 @@ metadata: labels: {{- include "cloudflareddns.labels" . | nindent 4 }} data: - CONFIG_PATH: {{ $config_path }} + CONFIG_PATH: {{ $configPath }} From cdd51d0fdce30e194e7cdb3c73bd8a84c36fdb79 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:22:30 +0800 Subject: [PATCH 056/363] Add separator --- mika/cloudflareddns/templates/secret.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/cloudflareddns/templates/secret.yaml b/mika/cloudflareddns/templates/secret.yaml index 7cc5adeb..ff82d278 100644 --- a/mika/cloudflareddns/templates/secret.yaml +++ b/mika/cloudflareddns/templates/secret.yaml @@ -2,6 +2,7 @@ {{- $zone_id := .Values.cloudflareddns.zoneID | toString }} {{- $ipv4 := .Values.cloudflareddns.ipv4 | default "true" | toString }} {{- $ipv6 := .Values.cloudflareddns.ipv6 | default "false" | toString }} +--- apiVersion: v1 kind: Secret metadata: From d67bb48a051fe06183d0d0adff8f2d1b03399607 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:23:16 +0800 Subject: [PATCH 057/363] Update var name --- mika/cloudflareddns/templates/secret.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/cloudflareddns/templates/secret.yaml b/mika/cloudflareddns/templates/secret.yaml index ff82d278..5974681f 100644 --- a/mika/cloudflareddns/templates/secret.yaml +++ b/mika/cloudflareddns/templates/secret.yaml @@ -1,5 +1,5 @@ {{- $token := .Values.cloudflareddns.token | toString }} -{{- $zone_id := .Values.cloudflareddns.zoneID | toString }} +{{- $zoneID := .Values.cloudflareddns.zoneID | toString }} {{- $ipv4 := .Values.cloudflareddns.ipv4 | default "true" | toString }} {{- $ipv6 := .Values.cloudflareddns.ipv6 | default "false" | toString }} --- @@ -12,4 +12,4 @@ metadata: type: Opaque data: config.json: |- - {{- include "cloudflareddns.config-json" . | toString | replace "API_TOKEN" $token | replace "ZONE_ID" $zone_id | replace "ENABLE_IPV4" $ipv4 | replace "ENABLE_IPV6" $ipv6 | b64enc | nindent 4 }} + {{- include "cloudflareddns.config-json" . | toString | replace "API_TOKEN" $token | replace "ZONE_ID" $zoneID | replace "ENABLE_IPV4" $ipv4 | replace "ENABLE_IPV6" $ipv6 | b64enc | nindent 4 }} From edd4d18a4d6993ee0ded831451ce4cc26b34c892 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:27:11 +0800 Subject: [PATCH 058/363] Bool values with defaults should be defined as string --- mika/clog/README.md | 2 +- mika/clog/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/clog/README.md b/mika/clog/README.md index 78f6d94f..c490111a 100644 --- a/mika/clog/README.md +++ b/mika/clog/README.md @@ -168,7 +168,7 @@ A unique, secure secret key is required for each Clog installation. | Key | Type | Default | Description | |-----|------|---------|-------------| | clog.cloudflared.enabled | bool | `false` | Specifies whether Cloudflare Tunnel should be enabled for hosting Clog services. | -| clog.debug | string | `""` | Specifies whether Clog should run in debug mode. Default: `false`. | +| clog.debug | string | `""` | Specifies whether Clog should run in debug mode. Default: `"false"`. | | clog.domain | string | `""` | The ingress domain name that hosts the Clog server. Default: `"localhost"`. | | clog.name | string | `""` | The full name of the Clog web application. Default: `"Clog"`. | | clog.ngrok.enabled | bool | `false` | Specifies whether Ngrok should be enabled for hosting Clog services. | diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 54ee48ad..d8c9ae5a 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -48,9 +48,9 @@ imagePullSecrets: [] # Clog configurations. clog: # Specifies whether Clog should run in debug mode. - # Default: false + # Default: "false" # Example: - # debug: true + # debug: "true" debug: "" # The ingress domain name that hosts the Clog server. # Default: "localhost" From 78a5cce7438cc60a5bbbdeaa17a865c4d7b7fd56 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:28:49 +0800 Subject: [PATCH 059/363] Specify as string --- mika/cloudflareddns/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index 63907a7c..f4015373 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -38,14 +38,14 @@ cloudflareddns: # configPath: "/var/lib/cloudflare-ddns" configPath: "" # Specify whether to add an A record for each subdomain. - # Default: true + # Default: "true" # Example: - # ipv4: false + # ipv4: "false" ipv4: "" # Specify whether to add an AAAA record for each subdomain. - # Default: false + # Default: "false" # Example - # ipv6: true + # ipv6: "true" ipv6: "" # The list of subdomains to be updated for a specified domain (zone). # Items: `.hostname`, `.proxied` From 3f8d1fe5a27ce704f580e3a0d9202cc2b192c31a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 00:29:42 +0800 Subject: [PATCH 060/363] Update order --- mika/cloudflareddns/templates/secret.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/cloudflareddns/templates/secret.yaml b/mika/cloudflareddns/templates/secret.yaml index 5974681f..ab29833a 100644 --- a/mika/cloudflareddns/templates/secret.yaml +++ b/mika/cloudflareddns/templates/secret.yaml @@ -1,7 +1,7 @@ -{{- $token := .Values.cloudflareddns.token | toString }} -{{- $zoneID := .Values.cloudflareddns.zoneID | toString }} {{- $ipv4 := .Values.cloudflareddns.ipv4 | default "true" | toString }} {{- $ipv6 := .Values.cloudflareddns.ipv6 | default "false" | toString }} +{{- $token := .Values.cloudflareddns.token | toString }} +{{- $zoneID := .Values.cloudflareddns.zoneID | toString }} --- apiVersion: v1 kind: Secret From c04abd4bdad42799ff57e2b9e6571e870c70fe20 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 02:00:55 +0800 Subject: [PATCH 061/363] Update cloudflare logo --- logos/cloudflare.png | Bin 3252 -> 0 bytes logos/cloudflare.svg | 14 ++++++++++++++ mika/cloudflareddns/Chart.yaml | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) delete mode 100644 logos/cloudflare.png create mode 100644 logos/cloudflare.svg diff --git a/logos/cloudflare.png b/logos/cloudflare.png deleted file mode 100644 index 544f67f2f33a95193a442d0b5f2f8307f1723ac1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3252 zcmV;l3`_HgP)Px#Fi=cXMf8Cg`K&+mff@O%KlYF&^nn@nkSFwk8TE=G z_KhU;ff@O%Kl!Xb^nn@qtUpI^O!{AdC;$Ke5Oh*bQ~&>efI`G4>sb(`wAzsH0O~j9 zIsgCw32;bRa{vG#Hvj-3HvuzPpLzfQ3-L)rK~#9!?cHB!Th|!?@Q)Jr+J-U?4xzBgLdl|YsuQ`RMUGG;Is z9u1~@*;7Ivy2oG`g|UaVwya1_JWaB$t|UwM>i+q@bMN_%zUMwTzn*ix?|kRnBPho{ z=H4CqXmTNd+P!ug+`^c+ z(zA1r%Rtwdy3(_2k24fEM4^%0(z}2K0DC6T8bm5J@fU{y;$|Ysrh&u8<+IlT;!{Yc~o+@sPdU zO)5G$vlbZ6SXr|+O1sNI7)jQ4o0N1idU?^=QB=ipE9B_xKA@!o!(?k$$P(Mpr;Et! zUI+46Vro~Ur-MPJc8e11V1=dKt_(WrIwc~zWhr*>BZhW6a_FEh$InjEup=ILz}UrbupV}mfyc~lRH7YajTeDkQ6?Sb<{|>SMX7d#M;G$#=o=`l(a*^4EJ%(e zHg=_qY`b|jcH6S)z{qj2Tb6D|Rv*i@+mug7R;I|dI}w2$)mg1%yHYj^y8|rjwxgh< z$`+FC9zlcAHVr(Uf>n?PemgBWVbL7E_j{ zAplxTS(=nEd`v)rLCc%aX6hrZx}M#~-cf(IHccK{19wwp_(Qk~{S zAs%$d_qOruzWwqKtX1X5Z9n3)6B9clj&_CjTW96IA90$Ai5>2i7RRo`&%{iaaq8WX z^zbn3I{!A2@mb@)$i~I)>6qF5+)3t#xtJVPG~$_f*?q_PFa4Dnr^*<;Iu333E!P8O zGhV3zH(3BBT^;X1eC(#e-3Ln2Vc!1? zY#06AoX8U`5GRWGg&Db>s>2TRya#j}c8EJ#&~4Zu?r1@`VTV|xfNsMMu}A@(YCGg2 zC74}CVLQAcC6L{&%5-=|N+7#MrR`Rtv{N}#V0Kc1*ljCKhgaYQu^Uy}?m&cgici@{ z?G&G~Fc6{LqT+TD=8BTyQ#Q&PWm9oFyeldG?QSSeSKrUhof@x1DrHKvTUOl8x>fOe zQIEvh_-Q$I1=XjlRT{5~<{0_&X$f}9FL$+`dqM1v;cw)q?QZZ$6dtDpUlX0<6O+y^ulkg=cC!~9?8L}XGP@ns?G`$v*{M?ASSLLN;T9vuNbHt*q>3$9JCQg_VW)bUwQdDG5nbXh_;y7msp6VI z!1HOhtGeC8E+vXRYdzrkwA<#9D%?sG?<3Er-Brcu>Q6*(bf-%sj^Wy!P~6UXT_!KQ z#7G*|PW4W}fTt40E|N`5JJrj(6^|u~6+@VIs+V`xInS&|JMni!J0|Bm7rokvV`z2- z9;w1piDKmo6U$EZ?%mVgOB4@Fo&s63wP)8z6-WHpIptcd>=t~ND7E-k&(8j`LimlPo?R|LiBf9{Xm3|f z6km|-)Y3&xbGwCLCCXm>Lvy=iuoA^_;Av!Mzqz<7a0Z@6douea{0)IK z@HDck{{lln2%LeZkzIYc%LlV-A9(uoKJDdhE0~?QuW!%YUhWVp)^KJC6xf6A6m z2DTIT0^7~KHuj?WQ#Op+5v+Yc(96>1MadhOYAim9ydO?z!0US?nBstRm!scgV%=GM^dS z`F4M49i>VE)-(35Lj`s++`vma*_HUr*z-<>{}#%E2aI#FL4 z{BJA#mKJ!u9piD-RpV!&kGO&3urt2q<)X-|VS9MMFv-4?_H@an^lHdt0ql~jaVO{T zZdd7>;o1SfZP-nv%iiNB>tT`wu-a1eedtH7`cMA#YVc&yY^U72&*vuV@#$D44hQ-P zkGWIhYisL4S}73628v;uOpVp!aH<|=nIiJ3Q{%6!{moCZ0I3B^W1xI!qr6u)IbDuJ z6jG`2%0TR9_up1K)a}^B*h}_6NtacOxzzZodm9R9zO(yfnM33^T-#7Uk|~TF3p?WLRSQ1=uIOza-JUL~{b&XS)fD;Q5)zv2dx?$b0AyII#AEs(SU zE-T&W3O#@P@wDCXsb+gXsd+Z!qi$QYrfm=mK}qO6z8T6`)8aR zUklhePTaTbnA`^NepFFg)-HuP;C|k+d&K2Pd+>^Px=Z2iq#U&D*j(TN<1?>|+{YqZ z3|V$r;1hRgPsr@}PtC5#h|c})SUtWgLdS5;?hz+DrwiK6@f(2PtcFxy~QRzf( z&o0Bu4w5qHL>kKK|AJ9_rQ%BWJsdi*RJGgXX6M?s{wWfjI1cPmMVJ2J)&`c{J>Zur zsd9gcSM)H7Cy zL!kceKzlFoZeh}igTOM)LdzqS1Ua^Dx6IP+VY}UL1-f09rCs~ggd#4T7y^E~*;=%} zvTzaKZj-0opq~p8LG5;U+5zro?w#!(F|}JF9(Gl`8K!ng!m_w-x5(6Pnl#DQ>_(Z| zEs!SJnq7ve-9XEhLXg;HncB5{r|=6JJJ7(cv`%7|=W5qaTA=LN6}j3yMOvWj*==fI zN0BM2eUx1d>~0a+ZEIk6q-Ph@t|*A?xV8eC@+{4i70<&L{Oh|TJ-eWGG+DNKFW@Ry zyRVQI#(VcsPH?qbAZ(#qK_P`Px0Ctx#CoEp`9qKkR*Dwst1*awkl-b_Vrw zC(3N?>Sx<|D!O65cKyWF9cR0N?oXVA{*G~md3kq)%I;v9?S3{%ohqK=YiAOt3UQyU zok5){s_#@V?HkuilxtLUiQ{bT`l(Yz^<5sOR~HAUQ$?a&=6XImP1`fBy+g*-E=ip# zhAMVU@1vMqA3F{EMO4ME#FDQ59pg#D@~#ZnuLi~==BanH)n88G`Hg^KQkTZh*4~Cb mGsZ3&-v?Y8r-|zSoc{v{HTy99*&i(c0000 + + + + + + + + + + + + + \ No newline at end of file diff --git a/mika/cloudflareddns/Chart.yaml b/mika/cloudflareddns/Chart.yaml index 61c90521..33e296bf 100644 --- a/mika/cloudflareddns/Chart.yaml +++ b/mika/cloudflareddns/Chart.yaml @@ -10,7 +10,7 @@ keywords: - "ddns" - "cloudflare-ddns" home: "https://github.com/irfanhakim-as/charts" -icon: "https://irfanhakim-as.github.io/charts/logos/cloudflare.png" +icon: "https://irfanhakim-as.github.io/charts/logos/cloudflare.svg" sources: - "https://github.com/timothymiller/cloudflare-ddns" maintainers: From 3c6ddd246154f4a3a46c9f7dc8c32c67790fd777 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 11:47:21 +0800 Subject: [PATCH 062/363] Update docs --- mika/cloudflareddns/README.md | 154 +++++++++++++++++++++++----------- 1 file changed, 104 insertions(+), 50 deletions(-) diff --git a/mika/cloudflareddns/README.md b/mika/cloudflareddns/README.md index 0243e643..38836e23 100644 --- a/mika/cloudflareddns/README.md +++ b/mika/cloudflareddns/README.md @@ -1,87 +1,141 @@ -# [`cloudflareddns`](https://github.com/timothymiller/cloudflare-ddns) +# [Cloudflare DDNS](https://github.com/timothymiller/cloudflare-ddns) + +Access your home network remotely via a custom domain name without a static IP! ## Prerequisites +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + - Kubernetes 1.19+ - Helm 3.2.0+ -## How to add repo +--- + +## Preflight checklist + +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +**This section does not apply to this chart.** + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: + + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` + +2. Update the repo to retrieve the latest versions of the packages: + + ```sh + helm repo update + ``` + +--- + +## How to install or upgrade a chart release + +1. Get the values file of the Cloudflare DDNS chart or an existing installation (release). + + Get the latest Cloudflare DDNS chart values file for a new installation: + + ```sh + helm show values mika/cloudflareddns > values.yaml + ``` + + Alternatively, get the values file of an existing Cloudflare DDNS release: -Add the repo to your local helm client. + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Update the repo to retrieve the latest versions of the packages. +2. Edit your Cloudflare DDNS values file with the intended configurations: -```sh -helm repo update -``` + ```sh + nano values.yaml + ``` -## How to install + Pay extra attention to the descriptions and sample values provided in the chart values file. -### Prepare chart values +3. Install a new release for Cloudflare DDNS or upgrade an existing Cloudflare DDNS release: -Copy `values.yaml` from the chart you would like to install. + ```sh + helm upgrade --install ${releaseName} mika/cloudflareddns --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` -```sh -cp mika/cloudflareddns/values.yaml . -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Edit `values.yaml` with the appropriate values. Please refer to the [Configurations](#configurations) section below, or the `values.yaml` file itself for details and sample values. +4. Verify that your Cloudflare DDNS release has been installed: -```sh -nano values.yaml -``` + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -### Perform installation + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. +--- -```sh -helm install $release_name mika/cloudflareddns --namespace $namespace --create-namespace --values values.yaml --wait -``` +## How to uninstall a chart release -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. -```sh -helm ls --namespace $namespace | grep "$release_name" -``` +1. Uninstall the desired release: -## How to upgrade + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` -After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${releaseName}` and `${namespace}` accordingly. -```sh -helm upgrade $release_name mika/cloudflareddns --namespace $namespace --values values.yaml --wait -``` +2. Verify that the release has been uninstalled: -## How to uninstall + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. -```sh -helm uninstall $release_name --namespace $namespace --wait -``` +--- -## Configurations +## Chart configurations | Key | Type | Default | Description | |-----|------|---------|-------------| -| cloudflareddns.configPath | string | `""` | The path to the cloudflareddns configuration directory. Default: `"/etc/cloudflare-ddns"`. | +| cloudflareddns.configPath | string | `""` | The path to the Cloudflare DDNS configuration directory. Default: `"/etc/cloudflare-ddns"`. | | cloudflareddns.ipv4 | string | `""` | Specify whether to add an A record for each subdomain. Default: `"true"`. | | cloudflareddns.ipv6 | string | `""` | Specify whether to add an AAAA record for each subdomain. Default: `"false"`. | | cloudflareddns.subdomains | list | `[]` | The list of subdomains to be updated for a specified domain (zone). Items: `.hostname`, `.proxied`. | | cloudflareddns.token | string | `""` | The Cloudflare API token used to authenticate with the Cloudflare API. | | cloudflareddns.zoneID | string | `""` | The ID of the zone that will get the records. | -| image.cloudflareddns.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the cloudflareddns container image. Default: `"IfNotPresent"`. | -| image.cloudflareddns.registry | string | `""` | The registry where the cloudflareddns container image is hosted. Default: `"docker.io"`. | -| image.cloudflareddns.repository | string | `""` | The name of the repository that contains the cloudflareddns container image used. Default: `"timothyjmiller/cloudflare-ddns"`. | -| image.cloudflareddns.tag | string | `""` | The tag that specifies the version of the cloudflareddns container image used. Default: `Chart appVersion`. | +| image.cloudflareddns.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Cloudflare DDNS container image. Default: `"IfNotPresent"`. | +| image.cloudflareddns.registry | string | `""` | The registry where the Cloudflare DDNS container image is hosted. Default: `"docker.io"`. | +| image.cloudflareddns.repository | string | `""` | The name of the repository that contains the Cloudflare DDNS container image used. Default: `"timothyjmiller/cloudflare-ddns"`. | +| image.cloudflareddns.tag | string | `""` | The tag that specifies the version of the Cloudflare DDNS container image used. Default: `Chart appVersion`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | -| replicaCount | string | `""` | The desired number of running replicas for cloudflareddns. Default: `"1"`. | -| resources.limits.cpu | string | `"50m"` | The maximum amount of CPU resources allowed for cloudflareddns. | -| resources.limits.memory | string | `"32Mi"` | The maximum amount of memory allowed for cloudflareddns. | -| resources.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by cloudflareddns. | -| resources.requests.memory | string | `"10Mi"` | The minimum amount of memory required by cloudflareddns. | \ No newline at end of file +| replicaCount | string | `""` | The desired number of running replicas for Cloudflare DDNS. Default: `"1"`. | +| resources.cloudflareddns | object | `{}` | Resource requirements and limits for Cloudflare DDNS containers. | \ No newline at end of file From a2022a760f2480f9f9af697d833350ab055aecef Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 11:47:52 +0800 Subject: [PATCH 063/363] Upgrade version --- mika/cloudflareddns/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/cloudflareddns/Chart.yaml b/mika/cloudflareddns/Chart.yaml index 33e296bf..587d401a 100644 --- a/mika/cloudflareddns/Chart.yaml +++ b/mika/cloudflareddns/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: cloudflareddns description: Access your home network remotely via a custom domain name without a static IP! type: application -version: 0.1.0 +version: 0.1.1 appVersion: "latest" keywords: - "cloudflareddns" From 15cd5015b1840358eff5a6a727a546069aad39ac Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 12:25:16 +0800 Subject: [PATCH 064/363] Update chart notes to be more useful --- mika/cloudflareddns/templates/NOTES.txt | 69 +++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/mika/cloudflareddns/templates/NOTES.txt b/mika/cloudflareddns/templates/NOTES.txt index 186b0d10..9d760dd5 100644 --- a/mika/cloudflareddns/templates/NOTES.txt +++ b/mika/cloudflareddns/templates/NOTES.txt @@ -1,5 +1,68 @@ -cloudflareddns is now installed and configured for {{ .Release.Name | toString }}. +{{- $cloudflareIP := "" }} +{{- $ipv4 := .Values.cloudflareddns.ipv4 | default "true" | toString }} +{{- $ipv6 := .Values.cloudflareddns.ipv6 | default "false" | toString }} +{{- $subdomains := .Values.cloudflareddns.subdomains }} +Cloudflare DDNS has been installed and configured for {{ .Release.Name | toString }} 🎉 -See the values.yaml file of this chart for more configuration options. +{{- if and (kindIs "array" $subdomains) (eq (len $subdomains) 0) }} -Please refer to the official documentation for more information on how to use cloudflareddns. + ⚠️ No subdomains were supplied for Cloudflare DDNS to monitor and update + +{{- else }} + +The following are a list of subdomain(s) you have supplied to be updated: + +{{- range $index, $subdomain := $subdomains }} + {{- $fqdn := "" }} + {{- $ip := "" }} + {{- $hostname := $subdomain.hostname | toString }} + {{- $proxied := $subdomain.proxied | default "false" | toString }} +{{- if eq $hostname "" }} + {{- $fqdn = "domain" | toString }} +{{- else }} + {{- $fqdn = printf "%s.domain" $hostname | toString }} +{{- end }} +{{- if eq $proxied "true" }} + {{- $cloudflareIP = "true" | toString }} + {{- $ip = "Cloudflare IP" | toString }} +{{- else }} + {{- $ip = printf "IPv4=%s/IPv6=%s" $ipv4 $ipv6 | toString }} +{{- end }} + + {{ printf "%s. %s (%s)" ($index | add1 | toString) $fqdn $ip }} + +{{- end }} + +Expected endpoint(s): + +{{- if or (eq $ipv4 "true") (eq $ipv6 "true") (eq $cloudflareIP "true") }} +{{- if eq $ipv4 "true" }} + + - IPv4: $(dig -4 +short myip.opendns.com @resolver1.opendns.com) + +{{- end }} +{{- if eq $ipv6 "true" }} + + - IPv6: $(dig AAAA +short myip.opendns.com @resolver1.ipv6-sandbox.opendns.com) + +{{- end }} +{{- if eq $cloudflareIP "true" }} + + - Cloudflare IP: Please refer to https://www.cloudflare.com/ips for the full list of IPs + +{{- end }} + +Please run the following command to check if each subdomain is being routed to the right endpoint: + + ```sh + nslookup . + ``` + +{{- else }} + + ⚠️ Subdomains supplied were not configured to be updated according to any endpoint + +{{- end }} +{{- end }} + +For more information on how to use and configure Cloudflare DDNS, please refer to the official documentation. From 0f0ba2073743b95dad9b34d1598cdeb152acae4d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 13:47:34 +0800 Subject: [PATCH 065/363] Add missing colon --- mika/cloudflareddns/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index f4015373..a89b1b9b 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -44,7 +44,7 @@ cloudflareddns: ipv4: "" # Specify whether to add an AAAA record for each subdomain. # Default: "false" - # Example + # Example: # ipv6: "true" ipv6: "" # The list of subdomains to be updated for a specified domain (zone). From f140eb2e613fd43246afeafd366d5f22cb2a353a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 14:16:24 +0800 Subject: [PATCH 066/363] Add new purge and ttl settings --- mika/cloudflareddns/README.md | 2 ++ mika/cloudflareddns/values.yaml | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/mika/cloudflareddns/README.md b/mika/cloudflareddns/README.md index 38836e23..b751c476 100644 --- a/mika/cloudflareddns/README.md +++ b/mika/cloudflareddns/README.md @@ -129,8 +129,10 @@ Access your home network remotely via a custom domain name without a static IP! | cloudflareddns.configPath | string | `""` | The path to the Cloudflare DDNS configuration directory. Default: `"/etc/cloudflare-ddns"`. | | cloudflareddns.ipv4 | string | `""` | Specify whether to add an A record for each subdomain. Default: `"true"`. | | cloudflareddns.ipv6 | string | `""` | Specify whether to add an AAAA record for each subdomain. Default: `"false"`. | +| cloudflareddns.purge | string | `""` | Specify whether to purge stale DNS records not defined in the configuration. Default: `"false"`. | | cloudflareddns.subdomains | list | `[]` | The list of subdomains to be updated for a specified domain (zone). Items: `.hostname`, `.proxied`. | | cloudflareddns.token | string | `""` | The Cloudflare API token used to authenticate with the Cloudflare API. | +| cloudflareddns.ttl | string | `""` | The Time-To-Live (TTL) duration defining how long DNS records are cached in seconds. Default: `"300"`. | | cloudflareddns.zoneID | string | `""` | The ID of the zone that will get the records. | | image.cloudflareddns.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Cloudflare DDNS container image. Default: `"IfNotPresent"`. | | image.cloudflareddns.registry | string | `""` | The registry where the Cloudflare DDNS container image is hosted. Default: `"docker.io"`. | diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index a89b1b9b..e631756a 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -47,6 +47,11 @@ cloudflareddns: # Example: # ipv6: "true" ipv6: "" + # Specify whether to purge stale DNS records not defined in the configuration. + # Default: "false" + # Example: + # purge: "true" + purge: "" # The list of subdomains to be updated for a specified domain (zone). # Items: `.hostname`, `.proxied` # Example: @@ -65,6 +70,11 @@ cloudflareddns: # Example: # token: "Na9E7VEY58COhA03l1ytm1r70u7jBsf8bNqh5AlZ" token: "" + # The Time-To-Live (TTL) duration defining how long DNS records are cached in seconds. + # Default: "300" + # Example: + # ttl: "86400" + ttl: "" # The ID of the zone that will get the records. # Example: # zoneID: "71fovu74p100z856k795umzl32h3240p" From 0480fb4c12e93c0d188e752dd19b7aa7faba517e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 14:17:04 +0800 Subject: [PATCH 067/363] Update purge and ttl settings --- mika/cloudflareddns/templates/config.json.tpl | 4 ++-- mika/cloudflareddns/templates/secret.yaml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mika/cloudflareddns/templates/config.json.tpl b/mika/cloudflareddns/templates/config.json.tpl index 70926a09..1ff5aed7 100644 --- a/mika/cloudflareddns/templates/config.json.tpl +++ b/mika/cloudflareddns/templates/config.json.tpl @@ -22,7 +22,7 @@ Cloudflare-DDNS config.json template ], "a": ENABLE_IPV4, "aaaa": ENABLE_IPV6, - "purgeUnknownRecords": false, - "ttl": 300 + "purgeUnknownRecords": ENABLE_PURGE, + "ttl": TTL_SECONDS } {{- end }} diff --git a/mika/cloudflareddns/templates/secret.yaml b/mika/cloudflareddns/templates/secret.yaml index ab29833a..1183a564 100644 --- a/mika/cloudflareddns/templates/secret.yaml +++ b/mika/cloudflareddns/templates/secret.yaml @@ -1,6 +1,8 @@ {{- $ipv4 := .Values.cloudflareddns.ipv4 | default "true" | toString }} {{- $ipv6 := .Values.cloudflareddns.ipv6 | default "false" | toString }} +{{- $purge := .Values.cloudflareddns.purge | default "false" | toString }} {{- $token := .Values.cloudflareddns.token | toString }} +{{- $ttl := .Values.cloudflareddns.ttl | default "300" | toString }} {{- $zoneID := .Values.cloudflareddns.zoneID | toString }} --- apiVersion: v1 @@ -12,4 +14,4 @@ metadata: type: Opaque data: config.json: |- - {{- include "cloudflareddns.config-json" . | toString | replace "API_TOKEN" $token | replace "ZONE_ID" $zoneID | replace "ENABLE_IPV4" $ipv4 | replace "ENABLE_IPV6" $ipv6 | b64enc | nindent 4 }} + {{- include "cloudflareddns.config-json" . | toString | replace "API_TOKEN" $token | replace "ZONE_ID" $zoneID | replace "ENABLE_IPV4" $ipv4 | replace "ENABLE_IPV6" $ipv6 | replace "ENABLE_PURGE" $purge | replace "TTL_SECONDS" $ttl | b64enc | nindent 4 }} From 4f2e26bda39201c6c87c6745cc012b40d487f53c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 14:59:07 +0800 Subject: [PATCH 068/363] Add image sources --- mika/rizz/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 965366d2..d4060883 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -9,6 +9,7 @@ replicaCount: "" # Container images used for Rizz. image: # Rizz container image configurations. + # Source: https://github.com/irfanhakim-as/rizz/pkgs/container/rizz rizz: # The registry where the Rizz container image is hosted. # Default: "ghcr.io" @@ -23,6 +24,7 @@ image: # Default: "IfNotPresent" pullPolicy: "" # Redis container image configurations. + # Source: https://hub.docker.com/_/redis redis: # The registry where the Redis container image is hosted. # Default: "docker.io" From 5f2e97e828e120177b767968d8f8932cda74aa29 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 15:57:55 +0800 Subject: [PATCH 069/363] Update sample indentation --- mika/clog/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index d8c9ae5a..9cb3df70 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -134,15 +134,15 @@ ingress: # # The prefix of the annotation. # # Default: "nginx.ingress.kubernetes.io" # # Example: - # # - prefix: "nginx.org" + # # prefix: "nginx.org" # - prefix: "" # # The name of the annotation. # # Example: - # # name: "proxy-connect-timeout" + # # name: "proxy-connect-timeout" # name: "" # # The value of the annotation. # # Example: - # # value: "120" + # # value: "120" # value: "" customAnnotations: [] # Specifies whether the WWW subdomain should be enabled. From 2f3ec3b989174bd2bd063242dcd8a8862925dbe3 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 15:58:43 +0800 Subject: [PATCH 070/363] Add list items --- mika/clog/README.md | 2 +- mika/clog/values.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/clog/README.md b/mika/clog/README.md index c490111a..c13c47c2 100644 --- a/mika/clog/README.md +++ b/mika/clog/README.md @@ -191,7 +191,7 @@ A unique, secure secret key is required for each Clog installation. | image.ngrok.tag | string | `""` | The tag that specifies the version of the Ngrok container image used. Default: `"latest"`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | -| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. | +| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. Items: `.prefix`, `.name`, `.value`. | | ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Clog services. | | ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | | replicaCount | string | `""` | The desired number of running replicas for Clog. | diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 9cb3df70..7d4b5820 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -129,6 +129,7 @@ ingress: # clusterIssuer: "letsencrypt-http-prod" clusterIssuer: "" # Additional configuration annotations to be added to the Ingress resource. + # Items: `.prefix`, `.name`, `.value` # Example: # customAnnotations: # # The prefix of the annotation. From 94a8a8528f4bc1ed7fd45b0d4f3fcec2bedb6332 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 20:26:28 +0800 Subject: [PATCH 071/363] Wrap bool like vars in quotes --- mika/rizz/values.yaml | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index d4060883..e7e97be3 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -48,30 +48,30 @@ imagePullSecrets: [] # Rizz configurations. rizz: # Specifies whether Rizz should run in debug mode. - # Default: false + # Default: "false" # Example: - # debug: true - debug: false + # debug: "true" + debug: "" # The domain name of the Rizz service. # Default: "localhost" # Example: # domain: "localhost" domain: "" # Specifies whether to enable posting in organic numbers. - # Default: true + # Default: "true" # Example: - # organic: false - organic: true + # organic: "false" + organic: "" # The limit number of posts to be scheduled for posting per run. # Default: "3" # Example: # post_limit: "5" post_limit: "" # Specifies whether to retry posting if the post fails to be sent. - # Default: true + # Default: "true" # Example: - # retry_post: false - retry_post: true + # retry_post: "false" + retry_post: "" # A 50-character secret key used for secure session management and cryptographic operations within the Rizz service. # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" @@ -97,22 +97,22 @@ rizz: # # token: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" # token: "" # # Specifies whether the Rizz bot should be marked as a bot. - # # Default: true + # # Default: "true" # # Example: - # # bot: false + # # bot: "false" # bot: "" # # Specifies whether the Rizz bot should appear in the user directory. - # # Default: true + # # Default: "true" # # Example: - # # discoverable: false + # # discoverable: "false" # discoverable: "" # # Specifies whether the Rizz bot should be active. - # # Default: true + # # Default: "true" # # Example: - # # enabled: false + # # enabled: "false" # enabled: "" # # The display name of the Rizz bot. - # # Default: null + # # Default: "null" # # Example: # # display_name: "Rizz" # display_name: "" @@ -126,12 +126,12 @@ rizz: # # value: "https://domain2.example.org" # fields: [] # # Specifies whether the Rizz bot needs to manually approve follow requests. - # # Default: false + # # Default: "false" # # Example: - # # locked: true + # # locked: "true" # locked: "" # # The bio of the Rizz bot. - # # Default: null + # # Default: "null" # # Example: # # note: "This is the bio of the Rizz bot." # note: "" From 4457b18d2ddca5f0c831bd0b838b912970774f21 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 20:27:10 +0800 Subject: [PATCH 072/363] Remove false default --- mika/rizz/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index e7e97be3..b4a6e309 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -117,7 +117,6 @@ rizz: # # display_name: "Rizz" # display_name: "" # # A list of up to four name-value pairs information to be displayed on the Rizz bot's profile. - # # Default: [] # # Example: # # fields: # # - name: "Website 1" From 169ad4d097af6697955a333aa09f79dc8892304b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 20:27:50 +0800 Subject: [PATCH 073/363] Add array items --- mika/rizz/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index b4a6e309..418b25ef 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -81,7 +81,8 @@ rizz: # Example: # visibility: "unlisted" visibility: "" - # Rizz Mastodon configurations. + # Mastodon configurations. + # Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note` # Example: # mastodon: # # API endpoint or URL for the Mastodon instance of the Rizz bot. From e90a3484ce207e547b632a0b1b02273d5d5f601c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 21:54:06 +0800 Subject: [PATCH 074/363] Update value desc and order --- mika/rizz/values.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 418b25ef..26c03261 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -248,12 +248,21 @@ rizz: # Database configurations. db: - # The type of the database used by Rizz. + # The database engine or backend being used by Rizz. # Default: "postgresql" # Example: - # type: "postgresql" + # type: "mysql" type: "" - # The name of the database used by Rizz. + # The hostname or IP address of the Rizz database server. + # Example: + # host: "rizz.default.svc.cluster.local" + host: "" + # The port number the Rizz database server is listening for connections. + # Default: "5432" + # Example: + # port: "3306" + port: "" + # The name of the database being used by Rizz. # Example: # name: "rizz" name: "" @@ -261,19 +270,10 @@ db: # Example: # user: "root" user: "" - # The password associated with the Rizz database's user. + # The password associated with the Rizz database user. # Example: # password: "password" password: "" - # The hostname or IP address of the Rizz database server. - # Example: - # host: "rizz.default.svc.cluster.local" - host: "" - # The port number on which the Rizz database server is listening. - # Default: "5432" - # Example: - # port: "5432" - port: "" # Resource requirements and limits for Rizz containers. resources: From b9995c46077b14aabffca23c6dce87556cc14564 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 21:58:24 +0800 Subject: [PATCH 075/363] Set no default value for resources --- mika/rizz/values.yaml | 96 +++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 50 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 26c03261..a592868c 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -278,54 +278,50 @@ db: # Resource requirements and limits for Rizz containers. resources: # Rizz container resources. - rizz: - # The minimum amount of resources required by Rizz to run. - requests: - # The minimum amount of CPU resources required by Rizz. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100m" or more if using `celery` as the scheduler. - # Example: - # cpu: "20m" - cpu: "30m" - # The minimum amount of memory required by Rizz. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "250Mi" or more if using `celery` as the scheduler. - # Example: - # memory: "250Mi" - memory: "60Mi" - # The maximum amount of resources allowed for Rizz. - limits: - # The maximum amount of CPU resources allowed for Rizz. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "200m" or more if using `celery` as the scheduler. - # Example: - # cpu: "50m" - cpu: "50m" - # The maximum amount of memory allowed for Rizz. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "400Mi" or more if using `celery` as the scheduler. - # Example: - # memory: "450Mi" - memory: "120Mi" + # Example: + # rizz: + # # The minimum amount of resources required by Rizz to run. + # requests: + # # The minimum amount of CPU resources required by Rizz. + # # Example: + # # cpu: "10m" + # cpu: "30m" + # # The minimum amount of memory required by Rizz. + # # Example: + # # memory: "10Mi" + # memory: "60Mi" + # # The maximum amount of resources allowed for Rizz. + # limits: + # # The maximum amount of CPU resources allowed for Rizz. + # # Example: + # # cpu: "250m" + # cpu: "50m" + # # The maximum amount of memory allowed for Rizz. + # # Example: + # # memory: "250Mi" + # memory: "120Mi" + rizz: {} # Scheduler container resources. - scheduler: - # The minimum amount of resources required by Scheduler to run. - requests: - # The minimum amount of CPU resources required by Scheduler. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "10m" or more if using `celery` as the scheduler. - # Example: - # cpu: "5m" - cpu: "10m" - # The minimum amount of memory required by Scheduler. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "50Mi" or more if using `celery` as the scheduler. - # Example: - # memory: "30Mi" - memory: "100Mi" - # The maximum amount of resources allowed for Scheduler. - limits: - # The maximum amount of CPU resources allowed for Scheduler. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "20m" or more if using `celery` as the scheduler. - # Example: - # cpu: "15m" - cpu: "20m" - # The maximum amount of memory allowed for Scheduler. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100Mi" or more if using `celery` as the scheduler. - # Example: - # memory: "50Mi" - memory: "200Mi" + # Example: + # scheduler: + # # The minimum amount of resources required by Scheduler to run. + # requests: + # # The minimum amount of CPU resources required by Scheduler. + # # Example: + # # cpu: "10m" + # cpu: "10m" + # # The minimum amount of memory required by Scheduler. + # # Example: + # # memory: "10Mi" + # memory: "100Mi" + # # The maximum amount of resources allowed for Scheduler. + # limits: + # # The maximum amount of CPU resources allowed for Scheduler. + # # Example: + # # cpu: "250m" + # cpu: "20m" + # # The maximum amount of memory allowed for Scheduler. + # # Example: + # # memory: "250Mi" + # memory: "200Mi" + scheduler: {} From 3359cd2352ee1e86a44cd0ca93ae1b4ca6905b24 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:00:21 +0800 Subject: [PATCH 076/363] Update desc --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index a592868c..835aba42 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -176,7 +176,7 @@ rizz: # # enabled: false # enabled: "" feed: [] - # Rizz scheduler configurations. + # Scheduler configurations. scheduler: # Specifies whether APScheduler should be used by Rizz as the task scheduler. # Example: From c8e9a035c271cb05dac6528ed8d78a36387d38d2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:05:44 +0800 Subject: [PATCH 077/363] Separate lines --- mika/rizz/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 835aba42..c32a50c2 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -187,7 +187,8 @@ rizz: # celery: true celery: false # The schedule for the task scheduler used by Rizz. - # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. + # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. + # The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. schedule: # The schedule for cleaning up the database. clean_data: From 87a5b7656d078f0fed0279ecfdb7a85524120fc4 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:05:55 +0800 Subject: [PATCH 078/363] Update wording --- mika/rizz/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index c32a50c2..fbaccedd 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -203,7 +203,7 @@ rizz: # minute: "30" minute: "" # The seconds at which the task scheduler cleans up the database. - # Default: "0" for `apscheduler` + # Default: "0" (`apscheduler`) # Example: # second: "30" second: "" @@ -220,7 +220,7 @@ rizz: # minute: "*/30" minute: "" # The seconds at which the task scheduler posts scheduled posts. - # Default: "0" for `apscheduler` + # Default: "0" (`apscheduler`) # Example: # second: "30" second: "" From d6515302abbed31cf4f7b5314fed03a389cec969 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:06:08 +0800 Subject: [PATCH 079/363] Update wording --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index fbaccedd..c02704aa 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -237,7 +237,7 @@ rizz: # minute: "15" minute: "" # The seconds at which the task scheduler updates the database. - # Default: "0" for `apscheduler` + # Default: "0" (`apscheduler`) # Example: # second: "30" second: "" From deae8839d2a35aeceeed6fc01fef7b37531c3294 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:06:13 +0800 Subject: [PATCH 080/363] Update sample value --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index c02704aa..cd5d33c0 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -244,7 +244,7 @@ rizz: # The timezone for the task scheduler used by Rizz to schedule time-dependent operations. # Default: "Asia/Kuala_Lumpur" # Example: - # timezone: "Asia/Kuala_Lumpur" + # timezone: "Etc/UTC" timezone: "" # Database configurations. From 562c66a3b5d22889842cdcc0f9650171ae84d6db Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:10:39 +0800 Subject: [PATCH 081/363] Replaced persistence config with storage --- mika/rizz/values.yaml | 51 ++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index cd5d33c0..678db6f6 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -136,24 +136,6 @@ rizz: # # note: "This is the bio of the Rizz bot." # note: "" mastodon: [] - # Rizz storage persistence configurations. - persistence: - # Specifies whether Rizz should persist its storage. - # Example: - # enabled: true - enabled: false - # The storage class name used for dynamically provisioning a persistent volume for the Rizz storage. - # Default: "longhorn" - # Example: - # storageClassName: "longhorn" - storageClassName: "" - # Rizz logs persistence configurations. - logs: - # The amount of persistent storage allocated for Rizz logs. - # Default: "20Mi" - # Example: - # storage: "1Gi" - storage: "" # Rizz feed configurations. # Example: # feed: @@ -276,6 +258,39 @@ db: # password: "password" password: "" +# Storage configurations. +storage: + # Log storage configurations. + log: + # Specifies whether persistent storage should be provisioned for log storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the log storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" + # The path where the log storage should be mounted on the container. + # Default: "/var/log/apache2" + # Example: + # mountPath: "/log" + mountPath: "" + # The subpath within the log storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Log" + subPath: "" + # The default amount of persistent storage allocated for the log storage. + # Default: "50Mi" + # Example: + # storage: "10Gi" + storage: "" + # The storage class name used for dynamically provisioning a persistent volume for the log storage. + # Default: "longhorn" + # Example: + # storageClassName: "smb" + storageClassName: "" + # Resource requirements and limits for Rizz containers. resources: # Rizz container resources. From d344cc10ebe48048eee96083dfe611f84fe42f68 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:14:05 +0800 Subject: [PATCH 082/363] Refactor log volume settings --- mika/rizz/templates/pvc.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mika/rizz/templates/pvc.yaml b/mika/rizz/templates/pvc.yaml index e5b339a4..b355046c 100644 --- a/mika/rizz/templates/pvc.yaml +++ b/mika/rizz/templates/pvc.yaml @@ -1,18 +1,20 @@ -{{- $logs_storage := .Values.rizz.persistence.logs.storage | default "20Mi" | toString | quote }} -{{- $storage_class_name := .Values.rizz.persistence.storageClassName | default "longhorn" | toString | quote }} -{{- $persistence := .Values.rizz.persistence.enabled }} -{{- if $persistence }} +{{- $logPersistence := .Values.storage.log.enabled }} +{{- $logAccessMode := .Values.storage.log.accessMode | default "ReadWriteMany" | toString | quote }} +{{- $logStorage := .Values.storage.log.storage | default "50Mi" | toString | quote }} +{{- $logStorageClassName := .Values.storage.log.storageClassName | default "longhorn" | toString | quote }} +{{- if $logPersistence }} +--- apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ .Release.Name }}-rizz-logs-pvc + name: {{ .Release.Name }}-rizz-log-pvc labels: {{- include "rizz.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $logAccessMode }} resources: requests: - storage: {{ $logs_storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $logStorage }} + storageClassName: {{ $logStorageClassName }} {{- end }} From d20155bf5cb329f11b63d60d9ffb7bbfee7471fc Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:15:07 +0800 Subject: [PATCH 083/363] Updated log pvc name --- mika/rizz/templates/deployment.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index bf1086bd..904b4372 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -92,7 +92,7 @@ spec: readOnly: true {{- end }} {{- if $persistence }} - - name: {{ .Release.Name }}-rizz-logs + - name: {{ .Release.Name }}-rizz-log mountPath: /var/log/apache2 {{- end }} {{- if $apscheduler }} @@ -137,7 +137,7 @@ spec: readOnly: true {{- end }} {{- if $persistence }} - - name: {{ .Release.Name }}-rizz-logs + - name: {{ .Release.Name }}-rizz-log mountPath: /var/log/apache2 {{- end }} {{- else if $celery }} @@ -218,9 +218,9 @@ spec: {{- end }} {{- end }} {{- if $persistence }} - - name: {{ .Release.Name }}-rizz-logs + - name: {{ .Release.Name }}-rizz-log persistentVolumeClaim: - claimName: {{ .Release.Name }}-rizz-logs-pvc + claimName: {{ .Release.Name }}-rizz-log-pvc {{- end }} securityContext: fsGroup: 33 From 5b2f5c14a7add449d7b33d662b368b6af367b5df Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:16:14 +0800 Subject: [PATCH 084/363] Wrap in quotes --- mika/rizz/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 678db6f6..80812290 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -153,9 +153,9 @@ rizz: # # id: "MyFeed" # id: "" # # Specifies whether the RSS feed entry should be actively processed. - # # Default: true + # # Default: "true" # # Example: - # # enabled: false + # # enabled: "false" # enabled: "" feed: [] # Scheduler configurations. From 96658bc3ebe131d013a82be1a308024ca9e4a712 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:16:53 +0800 Subject: [PATCH 085/363] Update desc --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 80812290..ff44b50d 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -136,7 +136,7 @@ rizz: # # note: "This is the bio of the Rizz bot." # note: "" mastodon: [] - # Rizz feed configurations. + # RSS feed configurations. # Example: # feed: # # The URL of the RSS feed to be tracked by Rizz. From 2b49529026df67a63493e2c1fea62e6d83f84ef8 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 22:27:31 +0800 Subject: [PATCH 086/363] Include list items --- mika/rizz/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index ff44b50d..5c36e068 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -137,6 +137,7 @@ rizz: # note: "" mastodon: [] # RSS feed configurations. + # Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled` # Example: # feed: # # The URL of the RSS feed to be tracked by Rizz. From c265cb230f01d4d60147bc99495f8ef92ce6629f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:20:32 +0800 Subject: [PATCH 087/363] Check if mastodon list was supplied --- mika/rizz/templates/deployment.yaml | 9 +++++---- mika/rizz/templates/secret.yaml | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index 904b4372..14311e76 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -11,6 +11,7 @@ {{- $apscheduler := .Values.rizz.scheduler.apscheduler }} {{- $celery := .Values.rizz.scheduler.celery }} {{- $persistence := .Values.rizz.persistence.enabled }} +{{- $mastodon := .Values.rizz.mastodon }} apiVersion: apps/v1 kind: Deployment metadata: @@ -83,7 +84,7 @@ spec: mountPath: /base/base/__init__.py subPath: init.py {{- end }} - {{- range .Values.rizz.mastodon }} + {{- range $mastodon }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - name: {{ $release_name }}-rizz-token-secret @@ -128,7 +129,7 @@ spec: - name: {{ .Release.Name }}-rizz-scheduler-config mountPath: /base/base/tasks.py subPath: tasks.py - {{- range .Values.rizz.mastodon }} + {{- range $mastodon }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - name: {{ $release_name }}-rizz-token-secret @@ -205,12 +206,12 @@ spec: - key: tasks.py path: tasks.py {{- end }} - {{- if .Values.rizz.mastodon }} + {{- if and (kindIs "array" $mastodon) (gt (len $mastodon) 0) }} - name: {{ .Release.Name }}-rizz-token-secret secret: secretName: {{ .Release.Name }}-rizz-token-secret items: - {{- range .Values.rizz.mastodon }} + {{- range $mastodon }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - key: {{ $token_secret }} diff --git a/mika/rizz/templates/secret.yaml b/mika/rizz/templates/secret.yaml index e20c847b..d7e29728 100644 --- a/mika/rizz/templates/secret.yaml +++ b/mika/rizz/templates/secret.yaml @@ -5,6 +5,8 @@ {{- $db_password := .Values.db.password | toString | b64enc }} {{- $db_host := .Values.db.host | toString | b64enc }} {{- $db_port := .Values.db.port | default "5432" | toString | b64enc }} +{{- $mastodon := .Values.rizz.mastodon }} +--- apiVersion: v1 kind: Secret metadata: @@ -31,7 +33,7 @@ type: Opaque data: accounts.json: |- {{- include "rizz.accounts-json" . | toString | b64enc | nindent 4 }} -{{- if .Values.rizz.mastodon }} +{{- if and (kindIs "array" $mastodon) (gt (len $mastodon) 0) }} --- apiVersion: v1 kind: Secret @@ -41,7 +43,7 @@ metadata: {{- include "rizz.labels" . | nindent 4 }} type: Opaque data: - {{- range .Values.rizz.mastodon }} + {{- range $mastodon }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} {{ $token_secret }}: |- From bf396dc3e49a2b00902a7fcfa6a736d862e588b6 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:22:22 +0800 Subject: [PATCH 088/363] Rename as accounts --- mika/rizz/templates/deployment.yaml | 10 +++++----- mika/rizz/templates/secret.yaml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index 14311e76..a6646608 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -11,7 +11,7 @@ {{- $apscheduler := .Values.rizz.scheduler.apscheduler }} {{- $celery := .Values.rizz.scheduler.celery }} {{- $persistence := .Values.rizz.persistence.enabled }} -{{- $mastodon := .Values.rizz.mastodon }} +{{- $accounts := .Values.rizz.mastodon }} apiVersion: apps/v1 kind: Deployment metadata: @@ -84,7 +84,7 @@ spec: mountPath: /base/base/__init__.py subPath: init.py {{- end }} - {{- range $mastodon }} + {{- range $accounts }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - name: {{ $release_name }}-rizz-token-secret @@ -129,7 +129,7 @@ spec: - name: {{ .Release.Name }}-rizz-scheduler-config mountPath: /base/base/tasks.py subPath: tasks.py - {{- range $mastodon }} + {{- range $accounts }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - name: {{ $release_name }}-rizz-token-secret @@ -206,12 +206,12 @@ spec: - key: tasks.py path: tasks.py {{- end }} - {{- if and (kindIs "array" $mastodon) (gt (len $mastodon) 0) }} + {{- if and (kindIs "array" $accounts) (gt (len $accounts) 0) }} - name: {{ .Release.Name }}-rizz-token-secret secret: secretName: {{ .Release.Name }}-rizz-token-secret items: - {{- range $mastodon }} + {{- range $accounts }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - key: {{ $token_secret }} diff --git a/mika/rizz/templates/secret.yaml b/mika/rizz/templates/secret.yaml index d7e29728..e0385a63 100644 --- a/mika/rizz/templates/secret.yaml +++ b/mika/rizz/templates/secret.yaml @@ -5,7 +5,7 @@ {{- $db_password := .Values.db.password | toString | b64enc }} {{- $db_host := .Values.db.host | toString | b64enc }} {{- $db_port := .Values.db.port | default "5432" | toString | b64enc }} -{{- $mastodon := .Values.rizz.mastodon }} +{{- $accounts := .Values.rizz.mastodon }} --- apiVersion: v1 kind: Secret @@ -33,7 +33,7 @@ type: Opaque data: accounts.json: |- {{- include "rizz.accounts-json" . | toString | b64enc | nindent 4 }} -{{- if and (kindIs "array" $mastodon) (gt (len $mastodon) 0) }} +{{- if and (kindIs "array" $accounts) (gt (len $accounts) 0) }} --- apiVersion: v1 kind: Secret @@ -43,7 +43,7 @@ metadata: {{- include "rizz.labels" . | nindent 4 }} type: Opaque data: - {{- range $mastodon }} + {{- range $accounts }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} {{ $token_secret }}: |- From 1c88a492c694563402c1a1b15785a3108a99783f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:25:44 +0800 Subject: [PATCH 089/363] Move scheduler config --- mika/rizz/values.yaml | 141 +++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 5c36e068..dc432a65 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -159,76 +159,77 @@ rizz: # # enabled: "false" # enabled: "" feed: [] - # Scheduler configurations. - scheduler: - # Specifies whether APScheduler should be used by Rizz as the task scheduler. - # Example: - # apscheduler: false - apscheduler: true - # Specifies whether Celery should be used by Rizz as the task scheduler. - # Example: - # celery: true - celery: false - # The schedule for the task scheduler used by Rizz. - # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. - # The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. - schedule: - # The schedule for cleaning up the database. - clean_data: - # The hours at which the task scheduler cleans up the database. - # Default: "0" - # Example: - # hour: "1" - hour: "" - # The minutes at which the task scheduler cleans up the database. - # Default: "0" - # Example: - # minute: "30" - minute: "" - # The seconds at which the task scheduler cleans up the database. - # Default: "0" (`apscheduler`) - # Example: - # second: "30" - second: "" - # The schedule for posting scheduled posts. - post_scheduler: - # The hours at which the task scheduler posts scheduled posts. - # Default: "8-23/3" - # Example: - # hour: "*" - hour: "" - # The minutes at which the task scheduler posts scheduled posts. - # Default: "0" - # Example: - # minute: "*/30" - minute: "" - # The seconds at which the task scheduler posts scheduled posts. - # Default: "0" (`apscheduler`) - # Example: - # second: "30" - second: "" - # The schedule for updating up the database. - update_data: - # The hours at which the task scheduler updates the database. - # Default: "7-22/3" - # Example: - # hour: "*/2" - hour: "" - # The minutes at which the task scheduler updates the database. - # Default: "0" - # Example: - # minute: "15" - minute: "" - # The seconds at which the task scheduler updates the database. - # Default: "0" (`apscheduler`) - # Example: - # second: "30" - second: "" - # The timezone for the task scheduler used by Rizz to schedule time-dependent operations. - # Default: "Asia/Kuala_Lumpur" - # Example: - # timezone: "Etc/UTC" - timezone: "" + +# Scheduler configurations. +scheduler: + # Specifies whether APScheduler should be used by Rizz as the task scheduler. + # Example: + # apscheduler: false + apscheduler: true + # Specifies whether Celery should be used by Rizz as the task scheduler. + # Example: + # celery: true + celery: false + # The timezone for the task scheduler used by Rizz to schedule time-dependent operations. + # Default: "Asia/Kuala_Lumpur" + # Example: + # timezone: "Etc/UTC" + timezone: "" + # The schedule for the task scheduler used by Rizz. + # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. + # The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. + schedule: + # The schedule for cleaning up the database. + clean_data: + # The hours at which the task scheduler cleans up the database. + # Default: "0" + # Example: + # hour: "1" + hour: "" + # The minutes at which the task scheduler cleans up the database. + # Default: "0" + # Example: + # minute: "30" + minute: "" + # The seconds at which the task scheduler cleans up the database. + # Default: "0" (`apscheduler`) + # Example: + # second: "30" + second: "" + # The schedule for posting scheduled posts. + post_scheduler: + # The hours at which the task scheduler posts scheduled posts. + # Default: "8-23/3" + # Example: + # hour: "*" + hour: "" + # The minutes at which the task scheduler posts scheduled posts. + # Default: "0" + # Example: + # minute: "*/30" + minute: "" + # The seconds at which the task scheduler posts scheduled posts. + # Default: "0" (`apscheduler`) + # Example: + # second: "30" + second: "" + # The schedule for updating up the database. + update_data: + # The hours at which the task scheduler updates the database. + # Default: "7-22/3" + # Example: + # hour: "*/2" + hour: "" + # The minutes at which the task scheduler updates the database. + # Default: "0" + # Example: + # minute: "15" + minute: "" + # The seconds at which the task scheduler updates the database. + # Default: "0" (`apscheduler`) + # Example: + # second: "30" + second: "" # Database configurations. db: From 7bd01b6b6e7e399f945a970872a6766ab43b1365 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:26:50 +0800 Subject: [PATCH 090/363] Refactor scheduler value path --- mika/rizz/templates/celery.py.tpl | 18 +++++++++--------- mika/rizz/templates/configmap.yaml | 6 +++--- mika/rizz/templates/deployment.yaml | 4 ++-- mika/rizz/templates/service.yaml | 2 +- mika/rizz/templates/tasks.py.tpl | 18 +++++++++--------- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/mika/rizz/templates/celery.py.tpl b/mika/rizz/templates/celery.py.tpl index 91150a25..7d688175 100644 --- a/mika/rizz/templates/celery.py.tpl +++ b/mika/rizz/templates/celery.py.tpl @@ -3,15 +3,15 @@ Celery /base/base/celery.py template */}} {{- define "rizz.celery-py" -}} -{{- $clean_data_hour := .Values.rizz.scheduler.schedule.clean_data.hour | default "0" | toString -}} -{{- $clean_data_minute := .Values.rizz.scheduler.schedule.clean_data.minute | default "0" | toString -}} -{{- $clean_data_second := .Values.rizz.scheduler.schedule.clean_data.second | toString -}} -{{- $post_scheduler_hour := .Values.rizz.scheduler.schedule.post_scheduler.hour | default "8-23/3" | toString -}} -{{- $post_scheduler_minute := .Values.rizz.scheduler.schedule.post_scheduler.minute | default "0" | toString -}} -{{- $post_scheduler_second := .Values.rizz.scheduler.schedule.post_scheduler.second | toString -}} -{{- $update_data_hour := .Values.rizz.scheduler.schedule.update_data.hour | default "7-22/3" | toString -}} -{{- $update_data_minute := .Values.rizz.scheduler.schedule.update_data.minute | default "0" | toString -}} -{{- $update_data_second := .Values.rizz.scheduler.schedule.update_data.second | toString -}} +{{- $clean_data_hour := .Values.scheduler.schedule.clean_data.hour | default "0" | toString -}} +{{- $clean_data_minute := .Values.scheduler.schedule.clean_data.minute | default "0" | toString -}} +{{- $clean_data_second := .Values.scheduler.schedule.clean_data.second | toString -}} +{{- $post_scheduler_hour := .Values.scheduler.schedule.post_scheduler.hour | default "8-23/3" | toString -}} +{{- $post_scheduler_minute := .Values.scheduler.schedule.post_scheduler.minute | default "0" | toString -}} +{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | toString -}} +{{- $update_data_hour := .Values.scheduler.schedule.update_data.hour | default "7-22/3" | toString -}} +{{- $update_data_minute := .Values.scheduler.schedule.update_data.minute | default "0" | toString -}} +{{- $update_data_second := .Values.scheduler.schedule.update_data.second | toString -}} from __future__ import absolute_import, unicode_literals import os diff --git a/mika/rizz/templates/configmap.yaml b/mika/rizz/templates/configmap.yaml index 5a5a41b4..08b7ed04 100644 --- a/mika/rizz/templates/configmap.yaml +++ b/mika/rizz/templates/configmap.yaml @@ -1,13 +1,13 @@ {{- $debug := .Values.rizz.debug | default "false" | toString | quote }} -{{- $scheduler_timezone := .Values.rizz.scheduler.timezone | default "Asia/Kuala_Lumpur" | toString | quote }} +{{- $scheduler_timezone := .Values.scheduler.timezone | default "Asia/Kuala_Lumpur" | toString | quote }} {{- $visibility := .Values.rizz.visibility | default "public" | toString | quote }} {{- $organic := .Values.rizz.organic | default "true" | toString | quote }} {{- $post_limit := .Values.rizz.post_limit | default "3" | toString | quote }} {{- $retry_post := .Values.rizz.retry_post | default "true" | toString | quote }} {{- $redis_service := printf "redis://%s-rizz-svc" .Release.Name | quote }} {{- $domain := .Values.rizz.domain | default "localhost" | toString }} -{{- $apscheduler := .Values.rizz.scheduler.apscheduler }} -{{- $celery := .Values.rizz.scheduler.celery }} +{{- $apscheduler := .Values.scheduler.apscheduler }} +{{- $celery := .Values.scheduler.celery }} apiVersion: v1 kind: ConfigMap metadata: diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index a6646608..6a769d51 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -8,8 +8,8 @@ {{- $redis_repository := .Values.image.redis.repository | default "redis" | toString }} {{- $redis_tag := .Values.image.redis.tag | default "alpine" | toString }} {{- $redis_pullPolicy := .Values.image.redis.pullPolicy | default "IfNotPresent" | toString | quote }} -{{- $apscheduler := .Values.rizz.scheduler.apscheduler }} -{{- $celery := .Values.rizz.scheduler.celery }} +{{- $apscheduler := .Values.scheduler.apscheduler }} +{{- $celery := .Values.scheduler.celery }} {{- $persistence := .Values.rizz.persistence.enabled }} {{- $accounts := .Values.rizz.mastodon }} apiVersion: apps/v1 diff --git a/mika/rizz/templates/service.yaml b/mika/rizz/templates/service.yaml index d288ee0c..5d965b55 100644 --- a/mika/rizz/templates/service.yaml +++ b/mika/rizz/templates/service.yaml @@ -1,4 +1,4 @@ -{{- $celery := .Values.rizz.scheduler.celery }} +{{- $celery := .Values.scheduler.celery }} apiVersion: v1 kind: Service metadata: diff --git a/mika/rizz/templates/tasks.py.tpl b/mika/rizz/templates/tasks.py.tpl index c27f99a6..f95ef760 100644 --- a/mika/rizz/templates/tasks.py.tpl +++ b/mika/rizz/templates/tasks.py.tpl @@ -3,15 +3,15 @@ APScheduler /base/base/tasks.py template */}} {{- define "rizz.apscheduler-tasks-py" -}} -{{- $clean_data_hour := .Values.rizz.scheduler.schedule.clean_data.hour | default "0" | toString -}} -{{- $clean_data_minute := .Values.rizz.scheduler.schedule.clean_data.minute | default "0" | toString -}} -{{- $clean_data_second := .Values.rizz.scheduler.schedule.clean_data.second | default "0" | toString -}} -{{- $post_scheduler_hour := .Values.rizz.scheduler.schedule.post_scheduler.hour | default "8-23/3" | toString -}} -{{- $post_scheduler_minute := .Values.rizz.scheduler.schedule.post_scheduler.minute | default "0" | toString -}} -{{- $post_scheduler_second := .Values.rizz.scheduler.schedule.post_scheduler.second | default "0" | toString -}} -{{- $update_data_hour := .Values.rizz.scheduler.schedule.update_data.hour | default "7-22/3" | toString -}} -{{- $update_data_minute := .Values.rizz.scheduler.schedule.update_data.minute | default "0" | toString -}} -{{- $update_data_second := .Values.rizz.scheduler.schedule.update_data.second | default "0" | toString -}} +{{- $clean_data_hour := .Values.scheduler.schedule.clean_data.hour | default "0" | toString -}} +{{- $clean_data_minute := .Values.scheduler.schedule.clean_data.minute | default "0" | toString -}} +{{- $clean_data_second := .Values.scheduler.schedule.clean_data.second | default "0" | toString -}} +{{- $post_scheduler_hour := .Values.scheduler.schedule.post_scheduler.hour | default "8-23/3" | toString -}} +{{- $post_scheduler_minute := .Values.scheduler.schedule.post_scheduler.minute | default "0" | toString -}} +{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | default "0" | toString -}} +{{- $update_data_hour := .Values.scheduler.schedule.update_data.hour | default "7-22/3" | toString -}} +{{- $update_data_minute := .Values.scheduler.schedule.update_data.minute | default "0" | toString -}} +{{- $update_data_second := .Values.scheduler.schedule.update_data.second | default "0" | toString -}} from apscheduler.schedulers.blocking import BlockingScheduler from django.conf import settings From 56581a317b073f89d9617e379885483c0fec63e9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:34:19 +0800 Subject: [PATCH 091/363] Add separator --- mika/rizz/templates/configmap.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/rizz/templates/configmap.yaml b/mika/rizz/templates/configmap.yaml index 08b7ed04..e36b821b 100644 --- a/mika/rizz/templates/configmap.yaml +++ b/mika/rizz/templates/configmap.yaml @@ -8,6 +8,7 @@ {{- $domain := .Values.rizz.domain | default "localhost" | toString }} {{- $apscheduler := .Values.scheduler.apscheduler }} {{- $celery := .Values.scheduler.celery }} +--- apiVersion: v1 kind: ConfigMap metadata: From ae0448fbabe67be8658cf806c186fc0c9352bb78 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:34:28 +0800 Subject: [PATCH 092/363] Parse tpl to string --- mika/rizz/templates/configmap.yaml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mika/rizz/templates/configmap.yaml b/mika/rizz/templates/configmap.yaml index e36b821b..af88fe95 100644 --- a/mika/rizz/templates/configmap.yaml +++ b/mika/rizz/templates/configmap.yaml @@ -37,7 +37,7 @@ metadata: {{- include "rizz.labels" . | nindent 4 }} data: site-config.conf: |- - {{- include "rizz.site-config-conf" . | replace "DOMAIN" $domain | nindent 4 }} + {{- include "rizz.site-config-conf" . | toString | replace "DOMAIN" $domain | nindent 4 }} --- apiVersion: v1 kind: ConfigMap @@ -58,7 +58,7 @@ metadata: {{- include "rizz.labels" . | nindent 4 }} data: entrypoint.sh: |- - {{- include "rizz.apscheduler-entrypoint-sh" . | nindent 4 }} + {{- include "rizz.apscheduler-entrypoint-sh" . | toString | nindent 4 }} {{- else if $celery }} --- apiVersion: v1 @@ -69,7 +69,7 @@ metadata: {{- include "rizz.labels" . | nindent 4 }} data: celeryd: |- - {{- include "rizz.default-celeryd" . | nindent 4 }} + {{- include "rizz.default-celeryd" . | toString | nindent 4 }} --- apiVersion: v1 kind: ConfigMap @@ -79,9 +79,9 @@ metadata: {{- include "rizz.labels" . | nindent 4 }} data: celerybeat: |- - {{- include "rizz.initd-celerybeat" . | nindent 4 }} + {{- include "rizz.initd-celerybeat" . | toString | nindent 4 }} celeryd: |- - {{- include "rizz.initd-celeryd" . | nindent 4 }} + {{- include "rizz.initd-celeryd" . | toString | nindent 4 }} {{- end }} {{- if or $apscheduler $celery }} --- @@ -94,17 +94,17 @@ metadata: data: {{- if $apscheduler }} apps.py: |- - {{- include "rizz.apscheduler-apps-py" . | nindent 4 }} + {{- include "rizz.apscheduler-apps-py" . | toString | nindent 4 }} {{- else if $celery }} celery.py: |- - {{- include "rizz.celery-py" . | nindent 4 }} + {{- include "rizz.celery-py" . | toString | nindent 4 }} init.py: |- - {{- include "rizz.celery-init-py" . | nindent 4 }} + {{- include "rizz.celery-init-py" . | toString | nindent 4 }} {{- end }} tasks.py: |- {{- if $apscheduler }} - {{- include "rizz.apscheduler-tasks-py" . | nindent 4 }} + {{- include "rizz.apscheduler-tasks-py" . | toString | nindent 4 }} {{- else if $celery }} - {{- include "rizz.celery-tasks-py" . | nindent 4 }} + {{- include "rizz.celery-tasks-py" . | toString | nindent 4 }} {{- end }} {{- end }} From ad04d275472e3147de446bab664ec83243e809c5 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:36:41 +0800 Subject: [PATCH 093/363] Reorder vals --- mika/rizz/templates/configmap.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/rizz/templates/configmap.yaml b/mika/rizz/templates/configmap.yaml index af88fe95..e38e3781 100644 --- a/mika/rizz/templates/configmap.yaml +++ b/mika/rizz/templates/configmap.yaml @@ -1,3 +1,5 @@ +{{- $apscheduler := .Values.scheduler.apscheduler }} +{{- $celery := .Values.scheduler.celery }} {{- $debug := .Values.rizz.debug | default "false" | toString | quote }} {{- $scheduler_timezone := .Values.scheduler.timezone | default "Asia/Kuala_Lumpur" | toString | quote }} {{- $visibility := .Values.rizz.visibility | default "public" | toString | quote }} @@ -6,8 +8,6 @@ {{- $retry_post := .Values.rizz.retry_post | default "true" | toString | quote }} {{- $redis_service := printf "redis://%s-rizz-svc" .Release.Name | quote }} {{- $domain := .Values.rizz.domain | default "localhost" | toString }} -{{- $apscheduler := .Values.scheduler.apscheduler }} -{{- $celery := .Values.scheduler.celery }} --- apiVersion: v1 kind: ConfigMap From 64682b3aa717325273ddf09a9658457da2214b35 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:57:32 +0800 Subject: [PATCH 094/363] Add service config --- mika/rizz/values.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index dc432a65..4ec359d4 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -260,6 +260,36 @@ db: # password: "password" password: "" +# Service configurations. +service: + # Rizz service port configurations. + rizz: + # The optional node port to expose for http when the service type is NodePort. + # Example: + # nodePort: "30000" + nodePort: "" + # The port on which the Rizz server should listen for connections. + # Default: "80" + # Example: + # port: "8080" + port: "" + # Redis service port configurations. + redis: + # The optional node port to expose for https when the service type is NodePort. + # Example: + # nodePort: "32000" + nodePort: "" + # The port on which the Redis server should listen for connections. + # Default: "6379" + # Example: + # port: "8443" + port: "" + # The type of service used to expose Rizz services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" + # Storage configurations. storage: # Log storage configurations. From 4ae082d1db34bf9d110250323a85923b95a4f9f6 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 16 Jul 2024 23:57:40 +0800 Subject: [PATCH 095/363] Update svc --- mika/rizz/templates/service.yaml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/mika/rizz/templates/service.yaml b/mika/rizz/templates/service.yaml index 5d965b55..a0bedd7a 100644 --- a/mika/rizz/templates/service.yaml +++ b/mika/rizz/templates/service.yaml @@ -1,4 +1,10 @@ {{- $celery := .Values.scheduler.celery }} +{{- $rizzPort := .Values.service.rizz.port | default "80" | toString }} +{{- $rizzNodePort := .Values.service.rizz.nodePort | toString }} +{{- $redisPort := .Values.service.redis.port | default "6379" | toString }} +{{- $redisNodePort := .Values.service.redis.nodePort | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +--- apiVersion: v1 kind: Service metadata: @@ -6,17 +12,23 @@ metadata: labels: {{- include "rizz.labels" . | nindent 4 }} spec: - type: ClusterIP + type: {{ $type }} ports: - - port: 80 + - port: {{ int $rizzPort }} targetPort: rizz + {{- if and (eq $type "NodePort") $rizzNodePort }} + nodePort: {{ int $rizzNodePort }} + {{- end }} protocol: TCP - name: {{ .Release.Name }}-rizz + name: rizz {{- if $celery }} - - port: 6379 + - port: {{ int $redisPort }} targetPort: redis + {{- if and (eq $type "NodePort") $redisNodePort }} + nodePort: {{ int $redisNodePort }} + {{- end }} protocol: TCP - name: {{ .Release.Name }}-redis + name: redis {{- end }} selector: {{- include "rizz.selectorLabels" . | nindent 4 }} From a2fe44f0def7ad663afff6d6d05929d594a5ddbf Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 00:00:52 +0800 Subject: [PATCH 096/363] Reorder values --- mika/rizz/templates/deployment.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index 6a769d51..a59c5ebd 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -1,5 +1,6 @@ -{{- $release_name := .Release.Name | toString }} -{{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $apscheduler := .Values.scheduler.apscheduler }} +{{- $celery := .Values.scheduler.celery }} +{{- $persistence := .Values.rizz.persistence.enabled }} {{- $rizz_registry := .Values.image.rizz.registry | default "ghcr.io" | toString }} {{- $rizz_repository := .Values.image.rizz.repository | default "irfanhakim-as/rizz" | toString }} {{- $rizz_tag := .Values.image.rizz.tag | default .Chart.AppVersion | toString }} @@ -8,9 +9,8 @@ {{- $redis_repository := .Values.image.redis.repository | default "redis" | toString }} {{- $redis_tag := .Values.image.redis.tag | default "alpine" | toString }} {{- $redis_pullPolicy := .Values.image.redis.pullPolicy | default "IfNotPresent" | toString | quote }} -{{- $apscheduler := .Values.scheduler.apscheduler }} -{{- $celery := .Values.scheduler.celery }} -{{- $persistence := .Values.rizz.persistence.enabled }} +{{- $release_name := .Release.Name | toString }} +{{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $accounts := .Values.rizz.mastodon }} apiVersion: apps/v1 kind: Deployment From cf2708bccd46389f7993a74fca11c418bbbae0b6 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 00:07:20 +0800 Subject: [PATCH 097/363] Update log persistence vol --- mika/rizz/templates/deployment.yaml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index a59c5ebd..020ff89b 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -1,6 +1,6 @@ {{- $apscheduler := .Values.scheduler.apscheduler }} {{- $celery := .Values.scheduler.celery }} -{{- $persistence := .Values.rizz.persistence.enabled }} +{{- $logPersistence := .Values.storage.log.enabled }} {{- $rizz_registry := .Values.image.rizz.registry | default "ghcr.io" | toString }} {{- $rizz_repository := .Values.image.rizz.repository | default "irfanhakim-as/rizz" | toString }} {{- $rizz_tag := .Values.image.rizz.tag | default .Chart.AppVersion | toString }} @@ -11,6 +11,8 @@ {{- $redis_pullPolicy := .Values.image.redis.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $release_name := .Release.Name | toString }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString | quote }} +{{- $logSubPath := .Values.storage.log.subPath | toString }} {{- $accounts := .Values.rizz.mastodon }} apiVersion: apps/v1 kind: Deployment @@ -92,9 +94,12 @@ spec: subPath: {{ $token_secret }} readOnly: true {{- end }} - {{- if $persistence }} + {{- if $logPersistence }} - name: {{ .Release.Name }}-rizz-log - mountPath: /var/log/apache2 + mountPath: {{ $logMountPath }} + {{- if $logSubPath }} + subPath: {{ $logSubPath | quote }} + {{- end }} {{- end }} {{- if $apscheduler }} - name: apscheduler @@ -137,9 +142,12 @@ spec: subPath: {{ $token_secret }} readOnly: true {{- end }} - {{- if $persistence }} + {{- if $logPersistence }} - name: {{ .Release.Name }}-rizz-log - mountPath: /var/log/apache2 + mountPath: {{ $logMountPath }} + {{- if $logSubPath }} + subPath: {{ $logSubPath | quote }} + {{- end }} {{- end }} {{- else if $celery }} - name: redis @@ -218,7 +226,7 @@ spec: path: {{ $token_secret }} {{- end }} {{- end }} - {{- if $persistence }} + {{- if $logPersistence }} - name: {{ .Release.Name }}-rizz-log persistentVolumeClaim: claimName: {{ .Release.Name }}-rizz-log-pvc From b1f6376de817ce6d0d70db234f62b994b6cff86b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 00:17:22 +0800 Subject: [PATCH 098/363] Update log mount path in siteconfig --- mika/rizz/templates/configmap.yaml | 3 ++- mika/rizz/templates/site-config.conf.tpl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mika/rizz/templates/configmap.yaml b/mika/rizz/templates/configmap.yaml index e38e3781..edec9b0e 100644 --- a/mika/rizz/templates/configmap.yaml +++ b/mika/rizz/templates/configmap.yaml @@ -8,6 +8,7 @@ {{- $retry_post := .Values.rizz.retry_post | default "true" | toString | quote }} {{- $redis_service := printf "redis://%s-rizz-svc" .Release.Name | quote }} {{- $domain := .Values.rizz.domain | default "localhost" | toString }} +{{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString }} --- apiVersion: v1 kind: ConfigMap @@ -37,7 +38,7 @@ metadata: {{- include "rizz.labels" . | nindent 4 }} data: site-config.conf: |- - {{- include "rizz.site-config-conf" . | toString | replace "DOMAIN" $domain | nindent 4 }} + {{- include "rizz.site-config-conf" . | toString | replace "DOMAIN" $domain | replace "LOG_MOUNT_PATH" $logMountPath | nindent 4 }} --- apiVersion: v1 kind: ConfigMap diff --git a/mika/rizz/templates/site-config.conf.tpl b/mika/rizz/templates/site-config.conf.tpl index ec32f96e..1a924aed 100644 --- a/mika/rizz/templates/site-config.conf.tpl +++ b/mika/rizz/templates/site-config.conf.tpl @@ -22,7 +22,7 @@ Apache site-config.conf template Require all granted - ErrorLog /var/log/apache2/apache.error.log - CustomLog /var/log/apache2/apache.access.log combined + ErrorLog LOG_MOUNT_PATH/apache.error.log + CustomLog LOG_MOUNT_PATH/apache.access.log combined {{- end }} From 488dbe9e263489fe70bfa53d126002d45f2ffb87 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 00:21:19 +0800 Subject: [PATCH 099/363] Add new serverAdmin val --- mika/rizz/values.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 4ec359d4..7a9d61a2 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -76,6 +76,11 @@ rizz: # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" secret: "" + # The email address displayed by Apache for server administration contact. + # Default: "admin@example.com" + # Example: + # serverAdmin: "foo@example.com" + serverAdmin: "" # The default visibility of posts made by the Rizz service. # Default: "public" # Example: From 42314b1e6216284d2a663c2f8151fe78d05547d8 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 00:21:40 +0800 Subject: [PATCH 100/363] Update server admin --- mika/rizz/templates/configmap.yaml | 3 ++- mika/rizz/templates/site-config.conf.tpl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mika/rizz/templates/configmap.yaml b/mika/rizz/templates/configmap.yaml index edec9b0e..94defef6 100644 --- a/mika/rizz/templates/configmap.yaml +++ b/mika/rizz/templates/configmap.yaml @@ -8,6 +8,7 @@ {{- $retry_post := .Values.rizz.retry_post | default "true" | toString | quote }} {{- $redis_service := printf "redis://%s-rizz-svc" .Release.Name | quote }} {{- $domain := .Values.rizz.domain | default "localhost" | toString }} +{{- $serverAdmin := .Values.rizz.serverAdmin | default "admin@example.com" | toString }} {{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString }} --- apiVersion: v1 @@ -38,7 +39,7 @@ metadata: {{- include "rizz.labels" . | nindent 4 }} data: site-config.conf: |- - {{- include "rizz.site-config-conf" . | toString | replace "DOMAIN" $domain | replace "LOG_MOUNT_PATH" $logMountPath | nindent 4 }} + {{- include "rizz.site-config-conf" . | toString | replace "DOMAIN" $domain | replace "SERVER_ADMIN" $serverAdmin | replace "LOG_MOUNT_PATH" $logMountPath | nindent 4 }} --- apiVersion: v1 kind: ConfigMap diff --git a/mika/rizz/templates/site-config.conf.tpl b/mika/rizz/templates/site-config.conf.tpl index 1a924aed..e812754f 100644 --- a/mika/rizz/templates/site-config.conf.tpl +++ b/mika/rizz/templates/site-config.conf.tpl @@ -5,7 +5,7 @@ Apache site-config.conf template ServerName DOMAIN:443 UseCanonicalName On - ServerAdmin support@mikahomelab.com + ServerAdmin SERVER_ADMIN DocumentRoot /base WSGIScriptAlias / /base/base/wsgi.py WSGIDaemonProcess DOMAIN python-path=/base From d40caef70a6c5b1e8cba49d59b1a974aae96cedf Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 00:24:37 +0800 Subject: [PATCH 101/363] Update log path in siteconfig --- mika/clog/templates/configmap.yaml | 3 ++- mika/clog/templates/site-config.conf.tpl | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mika/clog/templates/configmap.yaml b/mika/clog/templates/configmap.yaml index fa3b333f..0e4bb450 100644 --- a/mika/clog/templates/configmap.yaml +++ b/mika/clog/templates/configmap.yaml @@ -5,6 +5,7 @@ {{- $domain := .Values.clog.domain | default "localhost" | toString }} {{- $name := .Values.clog.name | default "Clog" | toString | quote }} {{- $serverAdmin := .Values.clog.serverAdmin | default "admin@example.com" | toString }} +{{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString }} --- apiVersion: v1 kind: ConfigMap @@ -28,4 +29,4 @@ metadata: {{- include "clog.labels" . | nindent 4 }} data: site-config.conf: |- - {{- include "clog.site-config-conf" . | toString | replace "DOMAIN" $domain | replace "SERVER_ADMIN" $serverAdmin | nindent 4 }} + {{- include "clog.site-config-conf" . | toString | replace "DOMAIN" $domain | replace "SERVER_ADMIN" $serverAdmin | replace "LOG_MOUNT_PATH" $logMountPath | nindent 4 }} diff --git a/mika/clog/templates/site-config.conf.tpl b/mika/clog/templates/site-config.conf.tpl index 775d3deb..103cea2c 100644 --- a/mika/clog/templates/site-config.conf.tpl +++ b/mika/clog/templates/site-config.conf.tpl @@ -27,7 +27,7 @@ Apache site-config.conf template Require all granted - ErrorLog /var/log/apache2/apache.error.log - CustomLog /var/log/apache2/apache.access.log combined + ErrorLog LOG_MOUNT_PATH/apache.error.log + CustomLog LOG_MOUNT_PATH/apache.access.log combined {{- end }} From c53889a0c0832a49c8e4c80b9d3ad71cb5b4e546 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 01:16:44 +0800 Subject: [PATCH 102/363] Update desc --- mika/rizz/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 7a9d61a2..1f4b7623 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -52,10 +52,10 @@ rizz: # Example: # debug: "true" debug: "" - # The domain name of the Rizz service. + # The ingress domain name that hosts the Rizz server. # Default: "localhost" # Example: - # domain: "localhost" + # domain: "rizz.example.com" domain: "" # Specifies whether to enable posting in organic numbers. # Default: "true" From bd22e0d136e61a02d6474dc38839e30179576373 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 01:17:59 +0800 Subject: [PATCH 103/363] Add ingress vals --- mika/rizz/values.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 1f4b7623..5cfa8aaf 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -265,6 +265,40 @@ db: # password: "password" password: "" +# Ingress configurations. +ingress: + # Specifies whether Ingress should be enabled for hosting Rizz services. + # Example: + # enabled: true + enabled: false + # The name of the cluster issuer for Ingress. + # Default: "letsencrypt-dns-prod" + # Example: + # clusterIssuer: "letsencrypt-http-prod" + clusterIssuer: "" + # Additional configuration annotations to be added to the Ingress resource. + # Items: `.prefix`, `.name`, `.value` + # Example: + # customAnnotations: + # # The prefix of the annotation. + # # Default: "nginx.ingress.kubernetes.io" + # # Example: + # # prefix: "nginx.org" + # - prefix: "" + # # The name of the annotation. + # # Example: + # # name: "proxy-connect-timeout" + # name: "" + # # The value of the annotation. + # # Example: + # # value: "120" + # value: "" + customAnnotations: [] + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false + # Service configurations. service: # Rizz service port configurations. From 61559282c0aff501725c2135d1451b7cedf942db Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 01:18:24 +0800 Subject: [PATCH 104/363] Add ingress manifest --- mika/rizz/templates/ingress.yaml | 60 ++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 mika/rizz/templates/ingress.yaml diff --git a/mika/rizz/templates/ingress.yaml b/mika/rizz/templates/ingress.yaml new file mode 100644 index 00000000..247b7e1e --- /dev/null +++ b/mika/rizz/templates/ingress.yaml @@ -0,0 +1,60 @@ +{{- $ingress := .Values.ingress.enabled }} +{{- $www := .Values.ingress.www }} +{{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $customAnnotations := .Values.ingress.customAnnotations }} +{{- $domain := .Values.rizz.domain | toString }} +{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} +{{- if and $ingress $domain }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-rizz-ingress + labels: + {{- include "rizz.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: {{ $clusterIssuer }} + cert-manager.io/private-key-algorithm: "ECDSA" + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/affinity-mode: "persistent" + nginx.ingress.kubernetes.io/proxy-body-size: "100m" + nginx.ingress.kubernetes.io/session-cookie-expires: "172800" + nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" + nginx.ingress.kubernetes.io/session-cookie-name: "route" + nginx.org/client-max-body-size: "100m" + {{- range $customAnnotations }} + {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} + {{- end }} +spec: + ingressClassName: "nginx" + rules: + - host: {{ $domain | quote }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-rizz-svc + port: + name: rizz + path: / + pathType: Prefix + {{- if $www }} + - host: {{ $wwwDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-rizz-svc + port: + name: rizz + path: / + pathType: Prefix + {{- end }} + tls: + - hosts: + - {{ $domain | quote }} + {{- if $www }} + - {{ $wwwDomain }} + {{- end }} + secretName: {{ .Release.Name }}-rizz-tls-cert +{{- end }} From b26c47042f28cee700641336ddae723cd33de308 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 01:26:57 +0800 Subject: [PATCH 105/363] Reorder val --- mika/rizz/values.yaml | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 5cfa8aaf..3a49c27d 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -86,6 +86,29 @@ rizz: # Example: # visibility: "unlisted" visibility: "" + # RSS feed configurations. + # Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled` + # Example: + # feed: + # # The URL of the RSS feed to be tracked by Rizz. + # # Example: + # # endpoint: "https://www.reddit.com/r/programming/.rss" + # - endpoint: "" + # # The publishing date format of the RSS feed entry. + # # Default: "%a, %d %b %Y %H:%M:%S %z" + # # Example: + # # pubdate_format: "%a, %d %b %Y %H:%M:%S %Z" + # pubdate_format: "" + # # The unique identifier of the RSS feed entry. + # # Example: + # # id: "MyFeed" + # id: "" + # # Specifies whether the RSS feed entry should be actively processed. + # # Default: "true" + # # Example: + # # enabled: "false" + # enabled: "" + feed: [] # Mastodon configurations. # Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note` # Example: @@ -141,29 +164,6 @@ rizz: # # note: "This is the bio of the Rizz bot." # note: "" mastodon: [] - # RSS feed configurations. - # Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled` - # Example: - # feed: - # # The URL of the RSS feed to be tracked by Rizz. - # # Example: - # # endpoint: "https://www.reddit.com/r/programming/.rss" - # - endpoint: "" - # # The publishing date format of the RSS feed entry. - # # Default: "%a, %d %b %Y %H:%M:%S %z" - # # Example: - # # pubdate_format: "%a, %d %b %Y %H:%M:%S %Z" - # pubdate_format: "" - # # The unique identifier of the RSS feed entry. - # # Example: - # # id: "MyFeed" - # id: "" - # # Specifies whether the RSS feed entry should be actively processed. - # # Default: "true" - # # Example: - # # enabled: "false" - # enabled: "" - feed: [] # Scheduler configurations. scheduler: From 907aae679c7b6dcf4265f0187ba0ab9b0d13210a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 01:39:25 +0800 Subject: [PATCH 106/363] Update val desc --- mika/rizz/values.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 3a49c27d..3af651f7 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -303,22 +303,22 @@ ingress: service: # Rizz service port configurations. rizz: - # The optional node port to expose for http when the service type is NodePort. + # The optional node port to expose for Rizz when the service type is NodePort. # Example: # nodePort: "30000" nodePort: "" - # The port on which the Rizz server should listen for connections. + # The Rizz port on which the Rizz server should listen for connections. # Default: "80" # Example: # port: "8080" port: "" # Redis service port configurations. redis: - # The optional node port to expose for https when the service type is NodePort. + # The optional node port to expose for Redis when the service type is NodePort. # Example: # nodePort: "32000" nodePort: "" - # The port on which the Redis server should listen for connections. + # The Redis port on which the Rizz server should listen for connections. # Default: "6379" # Example: # port: "8443" From 17df81a8e7e9e1f5dbe9055b49b9e481a5136a04 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 01:39:49 +0800 Subject: [PATCH 107/363] Reorder val --- mika/rizz/values.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 3af651f7..d72f96f9 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -301,6 +301,11 @@ ingress: # Service configurations. service: + # The type of service used to expose Rizz services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" # Rizz service port configurations. rizz: # The optional node port to expose for Rizz when the service type is NodePort. @@ -323,11 +328,6 @@ service: # Example: # port: "8443" port: "" - # The type of service used to expose Rizz services. - # Default: "ClusterIP" - # Example: - # type: "NodePort" - type: "" # Storage configurations. storage: From efc78a876f8e59497d1bd01f9719df29d9d8647c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 01:49:14 +0800 Subject: [PATCH 108/363] Update docs --- mika/rizz/README.md | 253 ++++++++++++++++++++++++++++++-------------- 1 file changed, 171 insertions(+), 82 deletions(-) diff --git a/mika/rizz/README.md b/mika/rizz/README.md index 79650889..b8968068 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -1,95 +1,177 @@ -# [`rizz`](https://github.com/irfanhakim-as/rizz) 🔒 +# [Rizz](https://github.com/irfanhakim-as/rizz) + +> [!WARNING] +> This chart requires access to a private image registry, please request access from the owner of the repository. + +Rizz is a simple web application that tracks and posts content from RSS Feeds to Mastodon. ## Prerequisites +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + - Kubernetes 1.19+ - Helm 3.2.0+ +- Longhorn 1.4.1+ + +--- ## Preflight checklist -### Create image pull secret +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +### Image pull secret + +An image pull secret is required to access the private image registry that hosts the required image. + +1. If you have the necessary credentials, create a named image pull secret (i.e. `ghcr-token-secret`) in the `default` namespace: + + ```sh + kubectl create secret docker-registry ghcr-token-secret --docker-server= --docker-username= --docker-password= --docker-email= -n default + ``` + +2. Copy the image pull secret from the `default` namespace to the destination namespace: + + ```sh + kubectl get secret ghcr-token-secret -n default -o yaml | sed "s/namespace: .*/namespace: /" | kubectl apply -f - + ``` + +3. Add the name of the image pull secret to the `imagePullSecrets` array in your installation's values file: + + ```yaml + imagePullSecrets: + - name: "ghcr-token-secret" + ``` + +### Generate secret key + +A unique, secure secret key is required for each Rizz installation. + +1. Generate a secret key using the following command: + + ```sh + python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' + ``` + +2. Set the generated secret key as the value of the `rizz.secret` setting in your installation's values file: + + ```yaml + secret: "" + ``` + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: + + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` + +2. Update the repo to retrieve the latest versions of the packages: + + ```sh + helm repo update + ``` + +--- -Replace `$github-username`, `$github-pass`, `$github-email` and `$namespace` accordingly. +## How to install or upgrade a chart release -```sh -kubectl create secret docker-registry ghcr-token-secret --docker-server=https://ghcr.io --docker-username="$github-username" --docker-password="$github-pass" --docker-email="$github-email" -n $namespace -``` +1. Get the values file of the Rizz chart or an existing installation (release). -### Generate secret key for `rizz.secret` + Get the latest Rizz chart values file for a new installation: -```sh -python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' -``` + ```sh + helm show values mika/rizz > values.yaml + ``` -## How to add repo + Alternatively, get the values file of an existing Rizz release: -Add the repo to your local helm client. + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Update the repo to retrieve the latest versions of the packages. +2. Edit your Rizz values file with the intended configurations: -```sh -helm repo update -``` + ```sh + nano values.yaml + ``` -## How to install + Pay extra attention to the descriptions and sample values provided in the chart values file. -### Prepare chart values +3. Install a new release for Rizz or upgrade an existing Rizz release: -Copy `values.yaml` from the chart you would like to install. + ```sh + helm upgrade --install ${releaseName} mika/rizz --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` -```sh -cp mika/rizz/values.yaml . -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Edit `values.yaml` with the appropriate values. Refer to the [Configurations](#Configurations) section for available options. +4. Verify that your Rizz release has been installed: -```sh -nano values.yaml -``` + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -### Perform installation + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. +--- -```sh -helm install $release_name mika/rizz --namespace $namespace --create-namespace --values values.yaml --wait -``` +## How to uninstall a chart release -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. -```sh -helm ls --namespace $namespace | grep "$release_name" -``` +1. Uninstall the desired release: -## How to upgrade + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` -After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${releaseName}` and `${namespace}` accordingly. -```sh -helm upgrade $release_name mika/rizz --namespace $namespace --values values.yaml --wait -``` +2. Verify that the release has been uninstalled: -## How to uninstall + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. -```sh -helm uninstall $release_name --namespace $namespace --wait -``` +--- -## Configurations +## Chart configurations | Key | Type | Default | Description | |-----|------|---------|-------------| | db.host | string | `""` | The hostname or IP address of the Rizz database server. | -| db.name | string | `""` | The name of the database used by Rizz. | -| db.password | string | `""` | The password associated with the Rizz database's user. | -| db.port | string | `""` | The port number on which the Rizz database server is listening. Default: `"5432"`. | -| db.type | string | `""` | The type of the database used by Rizz. Default: `"postgresql"`. | +| db.name | string | `""` | The name of the database being used by Rizz. | +| db.password | string | `""` | The password associated with the Rizz database user. | +| db.port | string | `""` | The port number the Rizz database server is listening for connections. Default: `"5432"`. | +| db.type | string | `""` | The database engine or backend being used by Rizz. Default: `"postgresql"`. | | db.user | string | `""` | The username or user account for accessing the Rizz database. | | image.redis.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Redis container image. Default: `"IfNotPresent"`. | | image.redis.registry | string | `""` | The registry where the Redis container image is hosted. Default: `"docker.io"`. | @@ -100,36 +182,43 @@ helm uninstall $release_name --namespace $namespace --wait | image.rizz.repository | string | `""` | The name of the repository that contains the Rizz container image used. Default: `"irfanhakim-as/rizz"`. | | image.rizz.tag | string | `""` | The tag that specifies the version of the Rizz container image used. Default: `Chart appVersion`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | +| ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | +| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. Items: `.prefix`, `.name`, `.value`. | +| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Rizz services. | +| ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | | replicaCount | string | `""` | The desired number of running replicas for Rizz. Default: `"1"`. | -| resources.rizz.limits.cpu | string | `"50m"` | The maximum amount of CPU resources allowed for Rizz. | -| resources.rizz.limits.memory | string | `"120Mi"` | The maximum amount of memory allowed for Rizz. | -| resources.rizz.requests.cpu | string | `"30m"` | The minimum amount of CPU resources required by Rizz. | -| resources.rizz.requests.memory | string | `"60Mi"` | The minimum amount of memory required by Rizz. | -| resources.scheduler.limits.cpu | string | `"20m"` | The maximum amount of CPU resources allowed for Scheduler. | -| resources.scheduler.limits.memory | string | `"200Mi"` | The maximum amount of memory allowed for Scheduler. | -| resources.scheduler.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by Scheduler. | -| resources.scheduler.requests.memory | string | `"100Mi"` | The minimum amount of memory required by Scheduler. | -| rizz.debug | bool | `false` | Specifies whether Rizz should run in debug mode. Default: `false`. | -| rizz.domain | string | `""` | The domain name of the Rizz service. Default: `"localhost"`. | -| rizz.feed | list | `[]` | Rizz feed configurations. | -| rizz.mastodon | list | `[]` | Rizz Mastodon configurations. | -| rizz.organic | bool | `true` | Specifies whether to enable posting in organic numbers. Default: `true`. | -| rizz.persistence.enabled | bool | `false` | Specifies whether Rizz should persist its storage. | -| rizz.persistence.logs.storage | string | `""` | The amount of persistent storage allocated for Rizz logs. Default: `"20Mi"`. | -| rizz.persistence.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the Rizz storage. Default: `"longhorn"`. | +| resources.rizz | object | `{}` | Rizz container resources. | +| resources.scheduler | object | `{}` | Scheduler container resources. | +| rizz.debug | string | `""` | Specifies whether Rizz should run in debug mode. Default: `"false"`. | +| rizz.domain | string | `""` | The ingress domain name that hosts the Rizz server. Default: `"localhost"`. | +| rizz.feed | list | `[]` | RSS feed configurations. Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled`. | +| rizz.mastodon | list | `[]` | Mastodon configurations. Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | +| rizz.organic | string | `""` | Specifies whether to enable posting in organic numbers. Default: `"true"`. | | rizz.post_limit | string | `""` | The limit number of posts to be scheduled for posting per run. Default: `"3"`. | -| rizz.retry_post | bool | `true` | Specifies whether to retry posting if the post fails to be sent. Default: `true`. | -| rizz.scheduler.apscheduler | bool | `true` | Specifies whether APScheduler should be used by Rizz as the task scheduler. | -| rizz.scheduler.celery | bool | `false` | Specifies whether Celery should be used by Rizz as the task scheduler. | -| rizz.scheduler.schedule.clean_data.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | -| rizz.scheduler.schedule.clean_data.minute | string | `""` | The minutes at which the task scheduler cleans up the database. Default: `"0"`. | -| rizz.scheduler.schedule.clean_data.second | string | `""` | The seconds at which the task scheduler cleans up the database. Default: `"0"` for `apscheduler`. | -| rizz.scheduler.schedule.post_scheduler.hour | string | `""` | The hours at which the task scheduler posts scheduled posts. Default: `"8-23/3"`. | -| rizz.scheduler.schedule.post_scheduler.minute | string | `""` | The minutes at which the task scheduler posts scheduled posts. Default: `"0"`. | -| rizz.scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"0"` for `apscheduler`. | -| rizz.scheduler.schedule.update_data.hour | string | `""` | The hours at which the task scheduler updates the database. Default: `"7-22/3"`. | -| rizz.scheduler.schedule.update_data.minute | string | `""` | The minutes at which the task scheduler updates the database. Default: `"0"`. | -| rizz.scheduler.schedule.update_data.second | string | `""` | The seconds at which the task scheduler updates the database. Default: `"0"` for `apscheduler`. | -| rizz.scheduler.timezone | string | `""` | The timezone for the task scheduler used by Rizz to schedule time-dependent operations. Default: `"Asia/Kuala_Lumpur"`. | +| rizz.retry_post | string | `""` | Specifies whether to retry posting if the post fails to be sent. Default: `"true"`. | | rizz.secret | string | `""` | A 50-character secret key used for secure session management and cryptographic operations within the Rizz service. | +| rizz.serverAdmin | string | `""` | The email address displayed by Apache for server administration contact. Default: `"admin@example.com"`. | | rizz.visibility | string | `""` | The default visibility of posts made by the Rizz service. Default: `"public"`. | +| scheduler.apscheduler | bool | `true` | Specifies whether APScheduler should be used by Rizz as the task scheduler. | +| scheduler.celery | bool | `false` | Specifies whether Celery should be used by Rizz as the task scheduler. | +| scheduler.schedule.clean_data.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | +| scheduler.schedule.clean_data.minute | string | `""` | The minutes at which the task scheduler cleans up the database. Default: `"0"`. | +| scheduler.schedule.clean_data.second | string | `""` | The seconds at which the task scheduler cleans up the database. Default: `"0"` (`apscheduler`). | +| scheduler.schedule.post_scheduler.hour | string | `""` | The hours at which the task scheduler posts scheduled posts. Default: `"8-23/3"`. | +| scheduler.schedule.post_scheduler.minute | string | `""` | The minutes at which the task scheduler posts scheduled posts. Default: `"0"`. | +| scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"0"` (`apscheduler`). | +| scheduler.schedule.update_data.hour | string | `""` | The hours at which the task scheduler updates the database. Default: `"7-22/3"`. | +| scheduler.schedule.update_data.minute | string | `""` | The minutes at which the task scheduler updates the database. Default: `"0"`. | +| scheduler.schedule.update_data.second | string | `""` | The seconds at which the task scheduler updates the database. Default: `"0"` (`apscheduler`). | +| scheduler.timezone | string | `""` | The timezone for the task scheduler used by Rizz to schedule time-dependent operations. Default: `"Asia/Kuala_Lumpur"`. | +| service.redis.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | +| service.redis.port | string | `""` | The Redis port on which the Rizz server should listen for connections. Default: `"6379"`. | +| service.rizz.nodePort | string | `""` | The optional node port to expose for Rizz when the service type is NodePort. | +| service.rizz.port | string | `""` | The Rizz port on which the Rizz server should listen for connections. Default: `"80"`. | +| service.type | string | `""` | The type of service used to expose Rizz services. Default: `"ClusterIP"`. | +| storage.log.accessMode | string | `""` | The access mode defining how the log storage can be mounted. Default: `"ReadWriteMany"`. | +| storage.log.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for log storage. | +| storage.log.mountPath | string | `""` | The path where the log storage should be mounted on the container. Default: `"/var/log/apache2"`. | +| storage.log.storage | string | `""` | The default amount of persistent storage allocated for the log storage. Default: `"50Mi"`. | +| storage.log.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the log storage. Default: `"longhorn"`. | +| storage.log.subPath | string | `""` | The subpath within the log storage to mount to the container. Leave empty if not required. | \ No newline at end of file From 83a9b099db5ca421ebde1dcaf690d35ab828ca55 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 02:23:49 +0800 Subject: [PATCH 109/363] Update desc --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index d72f96f9..b92966b0 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -121,7 +121,7 @@ rizz: # # Example: # # id: "rizz" # id: "" - # # A secure token required to authenticate the Rizz service with the Mastodon instance's API. + # # A secure access token required to authenticate the Rizz service with the Mastodon instance's API. # # Example: # # token: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" # token: "" From bf0cef30c3db06ba1692e01bf048f4b7cfc38657 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 02:23:59 +0800 Subject: [PATCH 110/363] Update sample value --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index b92966b0..f8137bd0 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -123,7 +123,7 @@ rizz: # id: "" # # A secure access token required to authenticate the Rizz service with the Mastodon instance's API. # # Example: - # # token: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" + # # token: "rinoSZiIvRHLw6PL1QCSia+8liGDau0MZ336JAnL0IQ" # token: "" # # Specifies whether the Rizz bot should be marked as a bot. # # Default: "true" From fbaec2aa0f866397a2a6dafa212f2fa31e91f17f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 02:25:22 +0800 Subject: [PATCH 111/363] Update desc --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index f8137bd0..8bd4dcc9 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -121,7 +121,7 @@ rizz: # # Example: # # id: "rizz" # id: "" - # # A secure access token required to authenticate the Rizz service with the Mastodon instance's API. + # # The application access token required to authenticate the Rizz service with the Mastodon instance's API. # # Example: # # token: "rinoSZiIvRHLw6PL1QCSia+8liGDau0MZ336JAnL0IQ" # token: "" From 5b440d6c88b83ac1491721f674159fe6c5fcb6f2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 02:33:08 +0800 Subject: [PATCH 112/363] Add Application access token guide --- mika/rizz/README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/mika/rizz/README.md b/mika/rizz/README.md index b8968068..eead369f 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -60,6 +60,38 @@ A unique, secure secret key is required for each Rizz installation. secret: "" ``` +### Application access token + +A secure application access token is required for each configured Mastodon account. + +1. Login to your Mastodon (bot) account. If you do not currently have one, you will need to register one first on any available Mastodon instance. + +2. Click the **Preferences** menu item. + +3. In the **Preferences** page, navigate to the **Development** section. + +4. From the **Your applications** list, click the **New application** button. +5. In the **New application** form, fill in the following required details: + + - Application name: Add in a unique, descriptive name for your application i.e. `Rizz` + + - Scopes: + + - `read` + - `write` + +6. Click the **Save changes** button. + +7. After being redirected back to the **Your applications** page, click the link on the name of the application you just created. + +8. In the specific **Application** page, copy the value of the confidential **Your access token** field. + +9. Set the access token as the value of the `rizz.mastodon` account's `token` setting in your installation's values file: + + ```yaml + token: "" + ``` + --- ## Recommended configurations From 828176129975e7bda07a4f48a3af00198f157470 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 11:53:14 +0800 Subject: [PATCH 113/363] Fix array check --- mika/rizz/templates/deployment.yaml | 2 +- mika/rizz/templates/secret.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index 020ff89b..622f248c 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -214,7 +214,7 @@ spec: - key: tasks.py path: tasks.py {{- end }} - {{- if and (kindIs "array" $accounts) (gt (len $accounts) 0) }} + {{- if $accounts }} - name: {{ .Release.Name }}-rizz-token-secret secret: secretName: {{ .Release.Name }}-rizz-token-secret diff --git a/mika/rizz/templates/secret.yaml b/mika/rizz/templates/secret.yaml index e0385a63..e856aca4 100644 --- a/mika/rizz/templates/secret.yaml +++ b/mika/rizz/templates/secret.yaml @@ -33,7 +33,7 @@ type: Opaque data: accounts.json: |- {{- include "rizz.accounts-json" . | toString | b64enc | nindent 4 }} -{{- if and (kindIs "array" $accounts) (gt (len $accounts) 0) }} +{{- if $accounts }} --- apiVersion: v1 kind: Secret From 0555afd04da96f5cdf366bbdfc9085da82a76a20 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 11:54:44 +0800 Subject: [PATCH 114/363] Remove leading line --- mika/rizz/templates/secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/templates/secret.yaml b/mika/rizz/templates/secret.yaml index e856aca4..c66417ff 100644 --- a/mika/rizz/templates/secret.yaml +++ b/mika/rizz/templates/secret.yaml @@ -47,6 +47,6 @@ data: {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} {{ $token_secret }}: |- - {{ .token | toString | b64enc | nindent 4 }} + {{- .token | toString | b64enc | nindent 4 }} {{- end }} {{- end }} From 16b5ab457162fa85659256f2f503c2dd4d79496a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 11:56:15 +0800 Subject: [PATCH 115/363] Update chart notes --- mika/rizz/templates/NOTES.txt | 106 +++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 3 deletions(-) diff --git a/mika/rizz/templates/NOTES.txt b/mika/rizz/templates/NOTES.txt index 55be8054..001f85be 100644 --- a/mika/rizz/templates/NOTES.txt +++ b/mika/rizz/templates/NOTES.txt @@ -1,5 +1,105 @@ -rizz is now installed and configured for {{ .Release.Name | toString }}. +{{- $ingress := .Values.ingress.enabled }} +{{- $domain := .Values.rizz.domain | toString }} +{{- $rizzPort := .Values.service.rizz.port | default "80" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +{{- $serviceName := printf "%s-rizz-svc" .Release.Name | toString }} +{{- $accounts := .Values.rizz.mastodon }} +{{- $feeds := .Values.rizz.feed }} +{{- $serviceAddress := "" }} +Rizz has been installed and configured for {{ .Release.Name | toString }} 🎉 -See the values.yaml file of this chart for more configuration options. +{{- if $ingress }} + {{- $serviceAddress = printf "https://%s" $domain | toString }} +{{- else if or (eq $type "ClusterIP") (eq $type "LoadBalancer") (eq $type "NodePort") }} -Please refer to the official documentation for more information on how to use rizz. +Please run the following command(s) to obtain the right address to the service: + + ```sh + {{- if eq $type "ClusterIP" }} + {{- $forwardPort := "8080" | toString }} + {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} + export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "rizz.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} + {{- else if eq $type "LoadBalancer" }} + {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $rizzPort | toString }} + export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} --template "{{"{{- range (index .status.loadBalancer.ingress 0) }}{{ . }}{{- end }}"}}") + {{- else if eq $type "NodePort" }} + {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") + {{- end }} + ``` + +{{- end }} + +Visit the following service(s) at the provided address: + +{{- if $serviceAddress }} + + - Rizz: {{ $serviceAddress }} + +{{- else }} + + ⚠️ This chart may have no accessible services available + +{{- end }} + +The following are a list of account(s) you have supplied to be managed: + +{{- if not $accounts }} + + ⚠️ No Mastodon accounts were supplied for Rizz to manage + +{{- else }} + + {{- range $index, $account := $accounts }} + {{- $enabled := $account.enabled | default "true" | toString }} + {{- $api := $account.api | toString }} + {{- $id := $account.id | toString }} + {{- $url := printf "%s/%s" ($api | trimSuffix "/") $id | toString }} + {{- $entry := printf "%s. %s (%s)" ($index | add1 | toString) $id $url | toString }} + + {{- if $enabled }} + + {{ $entry }} + + {{- else }} + + {{ printf "%s [%s]" $entry "disabled" }} + + {{- end }} + + {{- end }} + +The following are a list of RSS feed(s) you have supplied to be monitored: + + {{- if not $feeds }} + + ⚠️ No RSS feeds were supplied for Rizz to monitor + + {{- else }} + + {{- range $index, $feed := $feeds }} + {{- $enabled := $feed.enabled | default "true" | toString }} + {{- $uid := $feed.id | toString }} + {{- $endpoint := $feed.endpoint | toString | trimSuffix "/" }} + {{- $entry := printf "%s. %s (%s)" ($index | add1 | toString) $uid $endpoint | toString }} + + {{- if $enabled }} + + {{ $entry }} + + {{- else }} + + {{ printf "%s [%s]" $entry "disabled" }} + + {{- end }} + + {{- end }} + + {{- end }} + +{{- end }} + +For more information on how to use and configure Rizz, please refer to the official documentation. \ No newline at end of file From 7afe55b787d2da1cf1a4d5224ab5232a4f814d22 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 12:00:19 +0800 Subject: [PATCH 116/363] Fix array check --- mika/cloudflareddns/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/cloudflareddns/templates/NOTES.txt b/mika/cloudflareddns/templates/NOTES.txt index 9d760dd5..4cd415f8 100644 --- a/mika/cloudflareddns/templates/NOTES.txt +++ b/mika/cloudflareddns/templates/NOTES.txt @@ -4,7 +4,7 @@ {{- $subdomains := .Values.cloudflareddns.subdomains }} Cloudflare DDNS has been installed and configured for {{ .Release.Name | toString }} 🎉 -{{- if and (kindIs "array" $subdomains) (eq (len $subdomains) 0) }} +{{- if not $subdomains }} ⚠️ No subdomains were supplied for Cloudflare DDNS to monitor and update From 322fc0664e21e43eb1e55a299efb87b45c1743f1 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 12:07:05 +0800 Subject: [PATCH 117/363] Upgrade chart version --- mika/rizz/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/Chart.yaml b/mika/rizz/Chart.yaml index 2e4bd2fb..6ca06c2a 100644 --- a/mika/rizz/Chart.yaml +++ b/mika/rizz/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: rizz description: Rizz is a simple web application that tracks and posts content from RSS Feeds to Mastodon. type: application -version: 0.1.2 +version: 0.1.3 appVersion: "0.1.1-stable-r1" keywords: - "rss" From b1596e55d20824a557aa511167d0315da4e51fb3 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 12:19:42 +0800 Subject: [PATCH 118/363] Update default scheduler.timezone to utc --- mika/rizz/README.md | 2 +- mika/rizz/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/rizz/README.md b/mika/rizz/README.md index eead369f..359a6902 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -242,7 +242,7 @@ A secure application access token is required for each configured Mastodon accou | scheduler.schedule.update_data.hour | string | `""` | The hours at which the task scheduler updates the database. Default: `"7-22/3"`. | | scheduler.schedule.update_data.minute | string | `""` | The minutes at which the task scheduler updates the database. Default: `"0"`. | | scheduler.schedule.update_data.second | string | `""` | The seconds at which the task scheduler updates the database. Default: `"0"` (`apscheduler`). | -| scheduler.timezone | string | `""` | The timezone for the task scheduler used by Rizz to schedule time-dependent operations. Default: `"Asia/Kuala_Lumpur"`. | +| scheduler.timezone | string | `""` | The timezone for the task scheduler used by Rizz to schedule time-dependent operations. Default: `"Etc/UTC"`. | | service.redis.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | | service.redis.port | string | `""` | The Redis port on which the Rizz server should listen for connections. Default: `"6379"`. | | service.rizz.nodePort | string | `""` | The optional node port to expose for Rizz when the service type is NodePort. | diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 8bd4dcc9..c0bb8c10 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -176,9 +176,9 @@ scheduler: # celery: true celery: false # The timezone for the task scheduler used by Rizz to schedule time-dependent operations. - # Default: "Asia/Kuala_Lumpur" + # Default: "Etc/UTC" # Example: - # timezone: "Etc/UTC" + # timezone: "Asia/Kuala_Lumpur" timezone: "" # The schedule for the task scheduler used by Rizz. # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. From 96ad20dc20b487ffa263975faefc966d47dadcac Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 12:20:28 +0800 Subject: [PATCH 119/363] Update default scheduler.timezone val --- mika/rizz/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/templates/configmap.yaml b/mika/rizz/templates/configmap.yaml index 94defef6..7691ab96 100644 --- a/mika/rizz/templates/configmap.yaml +++ b/mika/rizz/templates/configmap.yaml @@ -1,7 +1,7 @@ {{- $apscheduler := .Values.scheduler.apscheduler }} {{- $celery := .Values.scheduler.celery }} {{- $debug := .Values.rizz.debug | default "false" | toString | quote }} -{{- $scheduler_timezone := .Values.scheduler.timezone | default "Asia/Kuala_Lumpur" | toString | quote }} +{{- $scheduler_timezone := .Values.scheduler.timezone | default "Etc/UTC" | toString | quote }} {{- $visibility := .Values.rizz.visibility | default "public" | toString | quote }} {{- $organic := .Values.rizz.organic | default "true" | toString | quote }} {{- $post_limit := .Values.rizz.post_limit | default "3" | toString | quote }} From f8090e1e09db682947e3e91ddd47c82225ceb5f6 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 13:53:29 +0800 Subject: [PATCH 120/363] Fix value check --- mika/rizz/templates/NOTES.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/rizz/templates/NOTES.txt b/mika/rizz/templates/NOTES.txt index 001f85be..b4acba9c 100644 --- a/mika/rizz/templates/NOTES.txt +++ b/mika/rizz/templates/NOTES.txt @@ -60,7 +60,7 @@ The following are a list of account(s) you have supplied to be managed: {{- $url := printf "%s/%s" ($api | trimSuffix "/") $id | toString }} {{- $entry := printf "%s. %s (%s)" ($index | add1 | toString) $id $url | toString }} - {{- if $enabled }} + {{- if eq $enabled "true" }} {{ $entry }} @@ -86,7 +86,7 @@ The following are a list of RSS feed(s) you have supplied to be monitored: {{- $endpoint := $feed.endpoint | toString | trimSuffix "/" }} {{- $entry := printf "%s. %s (%s)" ($index | add1 | toString) $uid $endpoint | toString }} - {{- if $enabled }} + {{- if eq $enabled "true" }} {{ $entry }} From d800abe35729b85626281311acaa0283b27f6d56 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 14:26:56 +0800 Subject: [PATCH 121/363] Update notes --- mika/clog/templates/NOTES.txt | 14 +++---- mika/cloudflareddns/templates/NOTES.txt | 56 ++++++++++++------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/mika/clog/templates/NOTES.txt b/mika/clog/templates/NOTES.txt index 59e31a78..e45dcdb1 100644 --- a/mika/clog/templates/NOTES.txt +++ b/mika/clog/templates/NOTES.txt @@ -7,23 +7,23 @@ Clog has been installed and configured for {{ .Release.Name | toString }} 🎉 {{- if $ingress }} -{{- $serviceAddress = printf "https://%s" $domain | toString }} + {{- $serviceAddress = printf "https://%s" $domain | toString }} {{- else if or (eq $type "ClusterIP") (eq $type "LoadBalancer") (eq $type "NodePort") }} Please run the following command(s) to obtain the right address to the service: ```sh {{- if eq $type "ClusterIP" }} - {{- $forwardPort := "8080" | toString }} - {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} + {{- $forwardPort := "8080" | toString }} + {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "clog.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} {{- else if eq $type "LoadBalancer" }} - {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $port | toString }} + {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $port | toString }} export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} --template "{{"{{- range (index .status.loadBalancer.ingress 0) }}{{ . }}{{- end }}"}}") {{- else if eq $type "NodePort" }} - {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} + {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") {{- end }} @@ -31,9 +31,9 @@ Please run the following command(s) to obtain the right address to the service: {{- end }} -{{- if $serviceAddress }} +Visit the following service(s) at the provided address: -Visit the following service at the provided address: +{{- if $serviceAddress }} - Clog: {{ $serviceAddress }} diff --git a/mika/cloudflareddns/templates/NOTES.txt b/mika/cloudflareddns/templates/NOTES.txt index 4cd415f8..905d025a 100644 --- a/mika/cloudflareddns/templates/NOTES.txt +++ b/mika/cloudflareddns/templates/NOTES.txt @@ -4,53 +4,53 @@ {{- $subdomains := .Values.cloudflareddns.subdomains }} Cloudflare DDNS has been installed and configured for {{ .Release.Name | toString }} 🎉 +The following are a list of subdomain(s) you have supplied to be updated: + {{- if not $subdomains }} ⚠️ No subdomains were supplied for Cloudflare DDNS to monitor and update {{- else }} -The following are a list of subdomain(s) you have supplied to be updated: - -{{- range $index, $subdomain := $subdomains }} - {{- $fqdn := "" }} - {{- $ip := "" }} - {{- $hostname := $subdomain.hostname | toString }} - {{- $proxied := $subdomain.proxied | default "false" | toString }} -{{- if eq $hostname "" }} - {{- $fqdn = "domain" | toString }} -{{- else }} - {{- $fqdn = printf "%s.domain" $hostname | toString }} -{{- end }} -{{- if eq $proxied "true" }} - {{- $cloudflareIP = "true" | toString }} - {{- $ip = "Cloudflare IP" | toString }} -{{- else }} - {{- $ip = printf "IPv4=%s/IPv6=%s" $ipv4 $ipv6 | toString }} -{{- end }} + {{- range $index, $subdomain := $subdomains }} + {{- $fqdn := "" }} + {{- $ip := "" }} + {{- $hostname := $subdomain.hostname | toString }} + {{- $proxied := $subdomain.proxied | default "false" | toString }} + {{- if eq $hostname "" }} + {{- $fqdn = "domain" | toString }} + {{- else }} + {{- $fqdn = printf "%s.domain" $hostname | toString }} + {{- end }} + {{- if eq $proxied "true" }} + {{- $cloudflareIP = "true" | toString }} + {{- $ip = "Cloudflare IP" | toString }} + {{- else }} + {{- $ip = printf "IPv4=%s/IPv6=%s" $ipv4 $ipv6 | toString }} + {{- end }} {{ printf "%s. %s (%s)" ($index | add1 | toString) $fqdn $ip }} -{{- end }} + {{- end }} Expected endpoint(s): -{{- if or (eq $ipv4 "true") (eq $ipv6 "true") (eq $cloudflareIP "true") }} -{{- if eq $ipv4 "true" }} + {{- if or (eq $ipv4 "true") (eq $ipv6 "true") (eq $cloudflareIP "true") }} + {{- if eq $ipv4 "true" }} - IPv4: $(dig -4 +short myip.opendns.com @resolver1.opendns.com) -{{- end }} -{{- if eq $ipv6 "true" }} + {{- end }} + {{- if eq $ipv6 "true" }} - IPv6: $(dig AAAA +short myip.opendns.com @resolver1.ipv6-sandbox.opendns.com) -{{- end }} -{{- if eq $cloudflareIP "true" }} + {{- end }} + {{- if eq $cloudflareIP "true" }} - Cloudflare IP: Please refer to https://www.cloudflare.com/ips for the full list of IPs -{{- end }} + {{- end }} Please run the following command to check if each subdomain is being routed to the right endpoint: @@ -58,11 +58,11 @@ Please run the following command to check if each subdomain is being routed to t nslookup . ``` -{{- else }} + {{- else }} ⚠️ Subdomains supplied were not configured to be updated according to any endpoint -{{- end }} + {{- end }} {{- end }} For more information on how to use and configure Cloudflare DDNS, please refer to the official documentation. From 7529f92ebcf3dd7669b4cc430fb4c66fbe808a45 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 17 Jul 2024 15:53:00 +0800 Subject: [PATCH 122/363] Update indentation --- mika/cloudflareddns/templates/NOTES.txt | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/mika/cloudflareddns/templates/NOTES.txt b/mika/cloudflareddns/templates/NOTES.txt index 905d025a..ad5e052b 100644 --- a/mika/cloudflareddns/templates/NOTES.txt +++ b/mika/cloudflareddns/templates/NOTES.txt @@ -17,17 +17,18 @@ The following are a list of subdomain(s) you have supplied to be updated: {{- $ip := "" }} {{- $hostname := $subdomain.hostname | toString }} {{- $proxied := $subdomain.proxied | default "false" | toString }} - {{- if eq $hostname "" }} - {{- $fqdn = "domain" | toString }} - {{- else }} - {{- $fqdn = printf "%s.domain" $hostname | toString }} - {{- end }} - {{- if eq $proxied "true" }} - {{- $cloudflareIP = "true" | toString }} - {{- $ip = "Cloudflare IP" | toString }} - {{- else }} - {{- $ip = printf "IPv4=%s/IPv6=%s" $ipv4 $ipv6 | toString }} - {{- end }} + + {{- if eq $hostname "" }} + {{- $fqdn = "domain" | toString }} + {{- else }} + {{- $fqdn = printf "%s.domain" $hostname | toString }} + {{- end }} + {{- if eq $proxied "true" }} + {{- $cloudflareIP = "true" | toString }} + {{- $ip = "Cloudflare IP" | toString }} + {{- else }} + {{- $ip = printf "IPv4=%s/IPv6=%s" $ipv4 $ipv6 | toString }} + {{- end }} {{ printf "%s. %s (%s)" ($index | add1 | toString) $fqdn $ip }} From 407bf9a6d595871e50f535ae5607deafd7f4877a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 29 Jul 2024 21:15:32 +0800 Subject: [PATCH 123/363] Update value desc --- mika/postgres-agent/README.md | 2 +- mika/postgres-agent/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/postgres-agent/README.md b/mika/postgres-agent/README.md index 65aa4eb5..e05e3bd0 100644 --- a/mika/postgres-agent/README.md +++ b/mika/postgres-agent/README.md @@ -132,7 +132,7 @@ Easily create or delete a database and user pair in a remote PostgreSQL instance | image.postgres.repository | string | `""` | The name of the repository that contains the PostgreSQL container image used. Default: `"bitnami/postgresql"`. | | image.postgres.tag | string | `""` | The tag that specifies the version of the PostgreSQL container image used. Default: `Chart appVersion`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | -| postgres.databases | list | `[]` | Database configurations array. Elements: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | +| postgres.databases | list | `[]` | Database configurations array. Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | | postgres.host | string | `""` | The hostname or IP address of the PostgreSQL database server. | | postgres.root.database | string | `""` | The name of the database of the PostgreSQL database server root user. Default: `$user`. | | postgres.root.password | string | `""` | The password associated with the PostgreSQL database server root user. | diff --git a/mika/postgres-agent/values.yaml b/mika/postgres-agent/values.yaml index aac9fd37..31e351f8 100644 --- a/mika/postgres-agent/values.yaml +++ b/mika/postgres-agent/values.yaml @@ -29,7 +29,7 @@ imagePullSecrets: [] # Postgres-Agent configurations. postgres: # Database configurations array. - # Elements: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. + # Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command` # .name: The name of the intended PostgreSQL database. # .user: The username or user account for accessing the intended PostgreSQL database. # .password: The password associated with the intended PostgreSQL database user. From c16c3bdb582d17f3a33baa4e18272fd621680b61 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 29 Jul 2024 21:16:55 +0800 Subject: [PATCH 124/363] Update sample values and desc --- mika/postgres-agent/values.yaml | 56 ++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/mika/postgres-agent/values.yaml b/mika/postgres-agent/values.yaml index 31e351f8..15dd6324 100644 --- a/mika/postgres-agent/values.yaml +++ b/mika/postgres-agent/values.yaml @@ -30,30 +30,44 @@ imagePullSecrets: [] postgres: # Database configurations array. # Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command` - # .name: The name of the intended PostgreSQL database. - # .user: The username or user account for accessing the intended PostgreSQL database. - # .password: The password associated with the intended PostgreSQL database user. - # .create: Specifies whether to create the database and user in the remote PostgreSQL instance. - # .drop: Specifies whether to delete the database and user in the remote PostgreSQL instance. - # .custom: Specifies whether to run a custom command against the remote PostgreSQL instance. - # .custom_command: Specify a custom command to run against the remote PostgreSQL instance. # Example: # databases: - # - name: "postgres" - # user: "postgresuser" - # password: "postgresuserpassword" - # create: true + # # The name of the intended PostgreSQL database. + # # Example: + # # name: "postgres" + # - name: "" + # # The username or user account for accessing the intended PostgreSQL database. + # # Example: + # # user: "postgresuser" + # user: "" + # # The password associated with the intended PostgreSQL database user. + # # Example: + # # password: "postgresuserpassword" + # password: "" + # # Specifies whether to create the database and user in the remote PostgreSQL instance. + # # Example: + # # create: true + # create: false + # # Specifies whether to delete the database and user in the remote PostgreSQL instance. + # # Example: + # # drop: true # drop: false - # custom: true - # custom_command: >- - # CREATE TABLE IF NOT EXISTS public.StorageRecords ( - # context VARCHAR(255) NOT NULL, - # expires BIGINT DEFAULT NULL, - # id SERIAL NOT NULL, - # value TEXT NOT NULL, - # version BIGINT NOT NULL, - # PRIMARY KEY (context, id) - # ); + # # Specifies whether to run a custom command against the remote PostgreSQL instance. + # # Example: + # # custom: true + # custom: false + # # Specify a custom command to run against the remote PostgreSQL instance. + # # Example: + # # custom_command: >- + # # CREATE TABLE IF NOT EXISTS public.StorageRecords ( + # # context VARCHAR(255) NOT NULL, + # # expires BIGINT DEFAULT NULL, + # # id SERIAL NOT NULL, + # # value TEXT NOT NULL, + # # version BIGINT NOT NULL, + # # PRIMARY KEY (context, id) + # # ); + # custom_command: "" databases: [] # The hostname or IP address of the PostgreSQL database server. # Example: From ed8cb28733e245ea781f7f6c85f5156f9393a0b9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 29 Jul 2024 21:24:27 +0800 Subject: [PATCH 125/363] Update value desc --- mika/postgres-agent/README.md | 2 +- mika/postgres-agent/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/postgres-agent/README.md b/mika/postgres-agent/README.md index e05e3bd0..b19f9067 100644 --- a/mika/postgres-agent/README.md +++ b/mika/postgres-agent/README.md @@ -134,7 +134,7 @@ Easily create or delete a database and user pair in a remote PostgreSQL instance | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | postgres.databases | list | `[]` | Database configurations array. Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | | postgres.host | string | `""` | The hostname or IP address of the PostgreSQL database server. | -| postgres.root.database | string | `""` | The name of the database of the PostgreSQL database server root user. Default: `$user`. | +| postgres.root.database | string | `""` | The name of the database being used by the PostgreSQL database server root user. Default: `$user`. | | postgres.root.password | string | `""` | The password associated with the PostgreSQL database server root user. | | postgres.root.user | string | `""` | The username or user account for accessing the PostgreSQL database server as root. Default: `"postgres"`. | | resources.postgres | object | `{}` | PostgreSQL container resources. | \ No newline at end of file diff --git a/mika/postgres-agent/values.yaml b/mika/postgres-agent/values.yaml index 15dd6324..0aa7ce00 100644 --- a/mika/postgres-agent/values.yaml +++ b/mika/postgres-agent/values.yaml @@ -84,7 +84,7 @@ postgres: # Example: # password: "password" password: "" - # The name of the database of the PostgreSQL database server root user. + # The name of the database being used by the PostgreSQL database server root user. # Default: $user # Example: # database: "postgres" From 9c5af14727d7f0b6c38d8f1cafff21cdbbb758f9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 29 Jul 2024 21:24:49 +0800 Subject: [PATCH 126/363] Reorder value --- mika/postgres-agent/values.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mika/postgres-agent/values.yaml b/mika/postgres-agent/values.yaml index 0aa7ce00..0c0ed27b 100644 --- a/mika/postgres-agent/values.yaml +++ b/mika/postgres-agent/values.yaml @@ -75,6 +75,11 @@ postgres: host: "" # PostgreSQL database server root user configurations. root: + # The name of the database being used by the PostgreSQL database server root user. + # Default: $user + # Example: + # database: "postgres" + database: "" # The username or user account for accessing the PostgreSQL database server as root. # Default: "postgres" # Example: @@ -84,11 +89,6 @@ postgres: # Example: # password: "password" password: "" - # The name of the database being used by the PostgreSQL database server root user. - # Default: $user - # Example: - # database: "postgres" - database: "" # Resource requirements and limits for Postgres-Agent containers. resources: From b5ee9add2c38edd4d94985b973116f45a88f7f0c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 29 Jul 2024 21:25:38 +0800 Subject: [PATCH 127/363] Add separators --- mika/postgres-agent/templates/job.yaml | 1 + mika/postgres-agent/templates/secret.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/mika/postgres-agent/templates/job.yaml b/mika/postgres-agent/templates/job.yaml index 1bd38c57..0be0435a 100644 --- a/mika/postgres-agent/templates/job.yaml +++ b/mika/postgres-agent/templates/job.yaml @@ -5,6 +5,7 @@ {{- $pullPolicy := .Values.image.postgres.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $rootDB := .Values.postgres.root.database | default "$(ROOT_USER)" | toString }} {{- $databases := .Values.postgres.databases }} +--- apiVersion: batch/v1 kind: Job metadata: diff --git a/mika/postgres-agent/templates/secret.yaml b/mika/postgres-agent/templates/secret.yaml index c826e762..eb197f20 100644 --- a/mika/postgres-agent/templates/secret.yaml +++ b/mika/postgres-agent/templates/secret.yaml @@ -1,6 +1,7 @@ {{- $db_host := .Values.postgres.host | toString | b64enc }} {{- $root_user := .Values.postgres.root.user | default "postgres" | toString | b64enc }} {{- $root_password := .Values.postgres.root.password | toString | b64enc }} +--- apiVersion: v1 kind: Secret metadata: From a907f81367e2f94513ee77558acae8ffa4d299f2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 29 Jul 2024 21:40:20 +0800 Subject: [PATCH 128/363] Update var names --- mika/postgres-agent/templates/job.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mika/postgres-agent/templates/job.yaml b/mika/postgres-agent/templates/job.yaml index 0be0435a..f802cadd 100644 --- a/mika/postgres-agent/templates/job.yaml +++ b/mika/postgres-agent/templates/job.yaml @@ -1,15 +1,15 @@ -{{- $host := .Values.postgres.host | default "postgres" | toString }} -{{- $registry := .Values.image.postgres.registry | default "docker.io" | toString }} -{{- $repository := .Values.image.postgres.repository | default "bitnami/postgresql" | toString }} -{{- $tag := .Values.image.postgres.tag | default .Chart.AppVersion | toString }} -{{- $pullPolicy := .Values.image.postgres.pullPolicy | default "IfNotPresent" | toString | quote }} -{{- $rootDB := .Values.postgres.root.database | default "$(ROOT_USER)" | toString }} +{{- $postgres_registry := .Values.image.postgres.registry | default "docker.io" | toString }} +{{- $postgres_repository := .Values.image.postgres.repository | default "bitnami/postgresql" | toString }} +{{- $postgres_tag := .Values.image.postgres.tag | default .Chart.AppVersion | toString }} +{{- $postgres_pullPolicy := .Values.image.postgres.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $databases := .Values.postgres.databases }} +{{- $postgresHost := .Values.postgres.host | default "postgres" | toString }} +{{- $rootDB := .Values.postgres.root.database | default "$(ROOT_USER)" | toString }} --- apiVersion: batch/v1 kind: Job metadata: - name: {{ printf "%s-%s-%s" (index (splitList "." $host) 0) .Release.Name "postgres-agent" }} + name: {{ printf "%s-%s-%s" (index (splitList "." $postgresHost) 0) .Release.Name "postgres-agent" }} labels: {{- include "postgres-agent.labels" . | nindent 4 }} spec: @@ -30,8 +30,8 @@ spec: {{- end }} containers: - name: postgres-agent - image: {{ printf "%s/%s:%s" $registry $repository $tag | quote }} - imagePullPolicy: {{ $pullPolicy }} + image: {{ printf "%s/%s:%s" $postgres_registry $postgres_repository $postgres_tag | quote }} + imagePullPolicy: {{ $postgres_pullPolicy }} resources: {{- toYaml .Values.resources.postgres | nindent 12 }} command: ["/bin/bash"] From 5420c712c404143d0506d0a271d639aca23b4c86 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 00:48:38 +0800 Subject: [PATCH 129/363] Allow creating and dropping --- mika/postgres-agent/templates/job.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/postgres-agent/templates/job.yaml b/mika/postgres-agent/templates/job.yaml index f802cadd..8afb3ad5 100644 --- a/mika/postgres-agent/templates/job.yaml +++ b/mika/postgres-agent/templates/job.yaml @@ -46,7 +46,8 @@ spec: GRANT ALL ON DATABASE {{ .name | quote }} TO {{ .user | quote }}; ALTER DATABASE {{ .name | quote }} OWNER TO {{ .user | quote }}; GRANT USAGE, CREATE ON SCHEMA PUBLIC TO {{ .user | quote }}; - {{- else if .drop }} + {{- end }} + {{- if .drop }} DROP DATABASE IF EXISTS {{ .name | quote }}; REVOKE ALL ON SCHEMA PUBLIC FROM {{ .user | quote }}; DROP USER IF EXISTS {{ .user | quote }}; From 900a06be3eef3444c1e3bce534eca731dc9bd4b7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 03:14:41 +0800 Subject: [PATCH 130/363] Update var name --- mika/postgres-agent/templates/secret.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/postgres-agent/templates/secret.yaml b/mika/postgres-agent/templates/secret.yaml index eb197f20..0d6fd9f4 100644 --- a/mika/postgres-agent/templates/secret.yaml +++ b/mika/postgres-agent/templates/secret.yaml @@ -1,6 +1,6 @@ -{{- $db_host := .Values.postgres.host | toString | b64enc }} -{{- $root_user := .Values.postgres.root.user | default "postgres" | toString | b64enc }} -{{- $root_password := .Values.postgres.root.password | toString | b64enc }} +{{- $postgresHost := .Values.postgres.host | toString | b64enc }} +{{- $rootUser := .Values.postgres.root.user | default "postgres" | toString | b64enc }} +{{- $rootPassword := .Values.postgres.root.password | toString | b64enc }} --- apiVersion: v1 kind: Secret @@ -10,6 +10,6 @@ metadata: {{- include "postgres-agent.labels" . | nindent 4 }} type: Opaque data: - DB_HOST: {{ $db_host }} - ROOT_USER: {{ $root_user }} - PGPASSWORD: {{ $root_password }} + DB_HOST: {{ $postgresHost }} + ROOT_USER: {{ $rootUser }} + PGPASSWORD: {{ $rootPassword }} From c3a54cda0bddde451151326bcd0aecae685b81d8 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 03:47:19 +0800 Subject: [PATCH 131/363] Update chart notes --- mika/postgres-agent/templates/NOTES.txt | 45 +++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/mika/postgres-agent/templates/NOTES.txt b/mika/postgres-agent/templates/NOTES.txt index 8f118730..c69127e8 100644 --- a/mika/postgres-agent/templates/NOTES.txt +++ b/mika/postgres-agent/templates/NOTES.txt @@ -1,5 +1,44 @@ -Postgres-Agent job has been deployed for {{ .Release.Name | toString }}. +{{- $index := 0 | int }} +{{- $databases := .Values.postgres.databases }} +{{- $postgresHost := .Values.postgres.host | toString }} +Postgres-Agent has been installed and configured for {{ .Release.Name | toString }} 🎉 -See the values.yaml file of this chart for more configuration options. +The following are a list of database(s) you have supplied to be updated: -Please refer to the official documentation for more information on how to use Postgres-Agent. +{{- range $database := $databases }} + {{- $custom_command := "false" }} + {{- $create := $database.create }} + {{- $drop := $database.drop }} + {{- $custom := $database.custom }} + {{- $command := $database.custom_command }} + {{- $db := $database.name | toString }} + {{- $user := $database.user | toString }} + {{- $password := $database.password | toString }} + + {{- if and $custom $command }} + {{- $custom_command = "true" | toString }} + {{- end }} + + {{- if or $create $drop (eq $custom_command "true") }} + {{- $index = add $index 1 }} + + {{ printf "%s. db=%s | user=%s | password=%s | create=%s | drop=%s | custom=%s" ($index | toString) $db $user $password ($create | toString) ($drop | toString) $custom_command }} + + {{- end }} +{{- end }} + +{{- if eq ($index | toString) "0" }} + + ⚠️ No databases were supplied for Postgres-Agent to update + +{{- else }} + +Please run the following command for each database and check if they have been updated accordingly: + + ```sh + psql -h {{ $postgresHost }} -U -d + ``` + +{{- end }} + +For more information on how to use and configure Postgres-Agent, please refer to the official documentation. From 78ffa461469823311a7a1020c056c0cd9c3deb96 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 03:59:38 +0800 Subject: [PATCH 132/363] Quote value --- mika/postgres-agent/templates/job.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres-agent/templates/job.yaml b/mika/postgres-agent/templates/job.yaml index 8afb3ad5..a513286a 100644 --- a/mika/postgres-agent/templates/job.yaml +++ b/mika/postgres-agent/templates/job.yaml @@ -4,7 +4,7 @@ {{- $postgres_pullPolicy := .Values.image.postgres.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $databases := .Values.postgres.databases }} {{- $postgresHost := .Values.postgres.host | default "postgres" | toString }} -{{- $rootDB := .Values.postgres.root.database | default "$(ROOT_USER)" | toString }} +{{- $rootDB := .Values.postgres.root.database | default "$(ROOT_USER)" | toString | quote }} --- apiVersion: batch/v1 kind: Job From e203d675404d819f53995d34900401967e53cee7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 04:01:55 +0800 Subject: [PATCH 133/363] Use vars --- mika/postgres-agent/templates/job.yaml | 43 +++++++++++++++----------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/mika/postgres-agent/templates/job.yaml b/mika/postgres-agent/templates/job.yaml index a513286a..5599cd26 100644 --- a/mika/postgres-agent/templates/job.yaml +++ b/mika/postgres-agent/templates/job.yaml @@ -38,25 +38,32 @@ spec: args: - -c - >- - psql -h $(DB_HOST) -U $(ROOT_USER) -d {{ $rootDB | quote }} < Date: Tue, 30 Jul 2024 04:07:26 +0800 Subject: [PATCH 134/363] Add svg logo for postgres --- logos/postgres.svg | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 logos/postgres.svg diff --git a/logos/postgres.svg b/logos/postgres.svg new file mode 100644 index 00000000..8666f75c --- /dev/null +++ b/logos/postgres.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 3cbb32c37719fd85e0b1f5d7ab2207fff0e63d9f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 04:07:37 +0800 Subject: [PATCH 135/363] Use svg logo --- mika/postgres-agent/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres-agent/Chart.yaml b/mika/postgres-agent/Chart.yaml index f4aa7883..bb55f3d6 100644 --- a/mika/postgres-agent/Chart.yaml +++ b/mika/postgres-agent/Chart.yaml @@ -9,7 +9,7 @@ keywords: - "agent" - "job" home: "https://github.com/irfanhakim-as/charts" -icon: "https://irfanhakim-as.github.io/charts/logos/postgres.png" +icon: "https://irfanhakim-as.github.io/charts/logos/postgres.svg" sources: - "https://github.com/irfanhakim-as/charts" maintainers: From 9f2298d5a59d50a82f2e378fbb82b5d2ca8ea0e9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 04:07:44 +0800 Subject: [PATCH 136/363] Upgrade chart version --- mika/postgres-agent/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres-agent/Chart.yaml b/mika/postgres-agent/Chart.yaml index bb55f3d6..9fd3a304 100644 --- a/mika/postgres-agent/Chart.yaml +++ b/mika/postgres-agent/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: postgres-agent description: Easily create or delete a database and user pair in a remote PostgreSQL instance. type: application -version: 0.3.1 +version: 0.3.2 appVersion: "16.3.0-debian-12-r12" keywords: - "postgresql" From 3c3d3fe5234e46b160b45496816d54f926d6d2d2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 04:09:58 +0800 Subject: [PATCH 137/363] Update header --- mika/postgres-agent/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres-agent/README.md b/mika/postgres-agent/README.md index b19f9067..ca019ba2 100644 --- a/mika/postgres-agent/README.md +++ b/mika/postgres-agent/README.md @@ -13,7 +13,7 @@ Easily create or delete a database and user pair in a remote PostgreSQL instance --- -## External dependencies +## Preflight checklist > [!IMPORTANT] > The following items are required to be set up prior to installing this chart. From f92a0e0d3b4c708500fd45b852daa75c7e688d74 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 04:14:56 +0800 Subject: [PATCH 138/363] Reorder vals --- mika/postgres-agent/values.yaml | 40 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/mika/postgres-agent/values.yaml b/mika/postgres-agent/values.yaml index 0c0ed27b..c2190cf0 100644 --- a/mika/postgres-agent/values.yaml +++ b/mika/postgres-agent/values.yaml @@ -28,6 +28,26 @@ imagePullSecrets: [] # Postgres-Agent configurations. postgres: + # The hostname or IP address of the PostgreSQL database server. + # Example: + # host: "postgres.default.svc.cluster.local" + host: "" + # PostgreSQL database server root user configurations. + root: + # The name of the database being used by the PostgreSQL database server root user. + # Default: $user + # Example: + # database: "postgres" + database: "" + # The username or user account for accessing the PostgreSQL database server as root. + # Default: "postgres" + # Example: + # user: "root" + user: "" + # The password associated with the PostgreSQL database server root user. + # Example: + # password: "password" + password: "" # Database configurations array. # Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command` # Example: @@ -69,26 +89,6 @@ postgres: # # ); # custom_command: "" databases: [] - # The hostname or IP address of the PostgreSQL database server. - # Example: - # host: "postgres.default.svc.cluster.local" - host: "" - # PostgreSQL database server root user configurations. - root: - # The name of the database being used by the PostgreSQL database server root user. - # Default: $user - # Example: - # database: "postgres" - database: "" - # The username or user account for accessing the PostgreSQL database server as root. - # Default: "postgres" - # Example: - # user: "root" - user: "" - # The password associated with the PostgreSQL database server root user. - # Example: - # password: "password" - password: "" # Resource requirements and limits for Postgres-Agent containers. resources: From c6f5d65b9f7033ea5c2be4e5ffbf853ec9ef1a80 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 04:20:10 +0800 Subject: [PATCH 139/363] Add port config --- mika/postgres-agent/README.md | 1 + mika/postgres-agent/values.yaml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mika/postgres-agent/README.md b/mika/postgres-agent/README.md index ca019ba2..5896bec7 100644 --- a/mika/postgres-agent/README.md +++ b/mika/postgres-agent/README.md @@ -134,6 +134,7 @@ Easily create or delete a database and user pair in a remote PostgreSQL instance | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | postgres.databases | list | `[]` | Database configurations array. Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | | postgres.host | string | `""` | The hostname or IP address of the PostgreSQL database server. | +| postgres.port | string | `""` | The port number the PostgreSQL database server is listening for connections. Default: `"5432"`. | | postgres.root.database | string | `""` | The name of the database being used by the PostgreSQL database server root user. Default: `$user`. | | postgres.root.password | string | `""` | The password associated with the PostgreSQL database server root user. | | postgres.root.user | string | `""` | The username or user account for accessing the PostgreSQL database server as root. Default: `"postgres"`. | diff --git a/mika/postgres-agent/values.yaml b/mika/postgres-agent/values.yaml index c2190cf0..449724cb 100644 --- a/mika/postgres-agent/values.yaml +++ b/mika/postgres-agent/values.yaml @@ -32,6 +32,11 @@ postgres: # Example: # host: "postgres.default.svc.cluster.local" host: "" + # The port number the PostgreSQL database server is listening for connections. + # Default: "5432" + # Example: + # port: "3306" + port: "" # PostgreSQL database server root user configurations. root: # The name of the database being used by the PostgreSQL database server root user. From fdb5830662eb039419df14a9e97ceca456099dd6 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 04:20:29 +0800 Subject: [PATCH 140/363] Add specified port no to secret --- mika/postgres-agent/templates/secret.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/postgres-agent/templates/secret.yaml b/mika/postgres-agent/templates/secret.yaml index 0d6fd9f4..ed0c23d9 100644 --- a/mika/postgres-agent/templates/secret.yaml +++ b/mika/postgres-agent/templates/secret.yaml @@ -1,4 +1,5 @@ {{- $postgresHost := .Values.postgres.host | toString | b64enc }} +{{- $postgresPort := .Values.postgres.port | default "5432" | toString | b64enc }} {{- $rootUser := .Values.postgres.root.user | default "postgres" | toString | b64enc }} {{- $rootPassword := .Values.postgres.root.password | toString | b64enc }} --- @@ -11,5 +12,6 @@ metadata: type: Opaque data: DB_HOST: {{ $postgresHost }} + DB_PORT: {{ $postgresPort }} ROOT_USER: {{ $rootUser }} PGPASSWORD: {{ $rootPassword }} From 274ec972ccc983544a74e712c8afdf8ddd5aae50 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 04:20:44 +0800 Subject: [PATCH 141/363] Specify port when making connection --- mika/postgres-agent/templates/job.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres-agent/templates/job.yaml b/mika/postgres-agent/templates/job.yaml index 5599cd26..28055893 100644 --- a/mika/postgres-agent/templates/job.yaml +++ b/mika/postgres-agent/templates/job.yaml @@ -38,7 +38,7 @@ spec: args: - -c - >- - psql -h $(DB_HOST) -U $(ROOT_USER) -d {{ $rootDB }} < Date: Tue, 30 Jul 2024 04:32:48 +0800 Subject: [PATCH 142/363] Include port no in notes --- mika/postgres-agent/templates/NOTES.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/postgres-agent/templates/NOTES.txt b/mika/postgres-agent/templates/NOTES.txt index c69127e8..e5c7de76 100644 --- a/mika/postgres-agent/templates/NOTES.txt +++ b/mika/postgres-agent/templates/NOTES.txt @@ -1,6 +1,7 @@ {{- $index := 0 | int }} {{- $databases := .Values.postgres.databases }} {{- $postgresHost := .Values.postgres.host | toString }} +{{- $postgresPort := .Values.postgres.port | default "5432" | toString }} Postgres-Agent has been installed and configured for {{ .Release.Name | toString }} 🎉 The following are a list of database(s) you have supplied to be updated: @@ -36,7 +37,7 @@ The following are a list of database(s) you have supplied to be updated: Please run the following command for each database and check if they have been updated accordingly: ```sh - psql -h {{ $postgresHost }} -U -d + psql -h {{ $postgresHost }} -p {{ $postgresPort }} -U -d ``` {{- end }} From 9c525aa7ab512c9a24bb8a86845cd9be2cd89cff Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:39:24 +0800 Subject: [PATCH 143/363] Update value descriptions --- mika/mariadb-agent/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index 99d4aa26..afbfdb7c 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -2,7 +2,7 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. -# Container image used for MariaDB. +# Container images used for MariaDB-Agent. image: # MariaDB container image configurations. mariadb: @@ -19,7 +19,7 @@ image: # Default: "IfNotPresent" pullPolicy: "" -# MariaDB configurations. +# MariaDB-Agent configurations. mariadb: # Database configurations array. # Elements: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. From 5fa771d5543358fe7a2227cbcb4f083c41869fc9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:39:58 +0800 Subject: [PATCH 144/363] Add image source --- mika/mariadb-agent/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index afbfdb7c..53d4cd8c 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -5,6 +5,7 @@ # Container images used for MariaDB-Agent. image: # MariaDB container image configurations. + # Source: https://hub.docker.com/r/bitnami/mariadb mariadb: # The registry where the MariaDB container image is hosted. # Default: "docker.io" From 1d661fa8e78be6a7fa2770865229880b9d02f66d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:40:56 +0800 Subject: [PATCH 145/363] Add imagePullSecrets --- mika/mariadb-agent/templates/deployment.yaml | 4 ++++ mika/mariadb-agent/values.yaml | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 4f86ba81..f8ac7318 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -22,6 +22,10 @@ spec: labels: {{- include "mariadb-agent.selectorLabels" . | nindent 8 }} spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: mariadb-agent image: {{ printf "%s/%s:%s" $registry $repository $tag | quote }} diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index 53d4cd8c..beda05bf 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -20,6 +20,12 @@ image: # Default: "IfNotPresent" pullPolicy: "" +# Credentials used to securely authenticate and authorise the pulling of container images from private registries. +# Example: +# imagePullSecrets: +# - name: "ghcr-token-secret" +imagePullSecrets: [] + # MariaDB-Agent configurations. mariadb: # Database configurations array. From b3ca4ac4fe2421bc811dda5357a34eb7327cabc2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:41:36 +0800 Subject: [PATCH 146/363] Reorder vals --- mika/mariadb-agent/values.yaml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index beda05bf..943cb7c0 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -28,6 +28,21 @@ imagePullSecrets: [] # MariaDB-Agent configurations. mariadb: + # The hostname or IP address of the MariaDB database server. + # Example: + # host: "mariadb.default.svc.cluster.local" + host: "" + # MariaDB database server root user configurations. + root: + # The username or user account for accessing the MariaDB database server as root. + # Default: "root" + # Example: + # user: "root" + user: "" + # The password associated with the MariaDB database server root user. + # Example: + # password: "password" + password: "" # Database configurations array. # Elements: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. # .name: The name of the intended MariaDB database. @@ -56,18 +71,3 @@ mariadb: # UNIQUE KEY `key` (`key`) # ); databases: [] - # The hostname or IP address of the MariaDB database server. - # Example: - # host: "mariadb.default.svc.cluster.local" - host: "" - # MariaDB database server root user configurations. - root: - # The username or user account for accessing the MariaDB database server as root. - # Default: "root" - # Example: - # user: "root" - user: "" - # The password associated with the MariaDB database server root user. - # Example: - # password: "password" - password: "" From 78b68a0282cde69cd8c01235641ab34d09e49e57 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:45:00 +0800 Subject: [PATCH 147/363] Add new param --- mika/mariadb-agent/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/mariadb-agent/README.md b/mika/mariadb-agent/README.md index 253620c9..52faabc8 100644 --- a/mika/mariadb-agent/README.md +++ b/mika/mariadb-agent/README.md @@ -79,6 +79,7 @@ helm uninstall $release_name --namespace $namespace --wait | image.mariadb.registry | string | `""` | The registry where the MariaDB container image is hosted. Default: `"docker.io"`. | | image.mariadb.repository | string | `""` | The name of the repository that contains the MariaDB container image used. Default: `"bitnami/mariadb"`. | | image.mariadb.tag | string | `""` | The tag that specifies the version of the MariaDB container image used. Default: `Chart appVersion`. | +| imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | mariadb.databases | list | `[]` | Database configurations array. Elements: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | | mariadb.host | string | `""` | The hostname or IP address of the MariaDB database server. | | mariadb.root.password | string | `""` | The password associated with the MariaDB database server root user. | From 9d67a2c4c6ef657ec3d129507c71ebaa45ae53bb Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:45:25 +0800 Subject: [PATCH 148/363] Add new mariadb resources val --- mika/mariadb-agent/README.md | 1 + mika/mariadb-agent/values.yaml | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/mika/mariadb-agent/README.md b/mika/mariadb-agent/README.md index 52faabc8..86f8ca52 100644 --- a/mika/mariadb-agent/README.md +++ b/mika/mariadb-agent/README.md @@ -84,3 +84,4 @@ helm uninstall $release_name --namespace $namespace --wait | mariadb.host | string | `""` | The hostname or IP address of the MariaDB database server. | | mariadb.root.password | string | `""` | The password associated with the MariaDB database server root user. | | mariadb.root.user | string | `""` | The username or user account for accessing the MariaDB database server as root. Default: `"root"`. | +| resources.mariadb | object | `{}` | MariaDB container resources. | diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index 943cb7c0..276c55ec 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -71,3 +71,30 @@ mariadb: # UNIQUE KEY `key` (`key`) # ); databases: [] + +# Resource requirements and limits for MariaDB-Agent containers. +resources: + # MariaDB container resources. + # Example: + # mariadb: + # # The minimum amount of resources required by MariaDB to run. + # requests: + # # The minimum amount of CPU resources required by MariaDB. + # # Example: + # # cpu: "10m" + # cpu: "10m" + # # The minimum amount of memory required by MariaDB. + # # Example: + # # memory: "10Mi" + # memory: "10Mi" + # # The maximum amount of resources allowed for MariaDB. + # limits: + # # The maximum amount of CPU resources allowed for MariaDB. + # # Example: + # # cpu: "250m" + # cpu: "250m" + # # The maximum amount of memory allowed for MariaDB. + # # Example: + # # memory: "250Mi" + # memory: "250Mi" + mariadb: {} From c1fb753bb633187a3b9e3d81a3a8c13cda8c1f1a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:45:42 +0800 Subject: [PATCH 149/363] Include specified resources --- mika/mariadb-agent/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index f8ac7318..645c09af 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -31,7 +31,7 @@ spec: image: {{ printf "%s/%s:%s" $registry $repository $tag | quote }} imagePullPolicy: {{ $pullPolicy }} resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.resources.mariadb | nindent 12 }} command: ["/bin/bash"] args: - -c From f68af44e8b5af8b8cc265284228eef88caea99e0 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:52:54 +0800 Subject: [PATCH 150/363] Update sample value --- mika/mariadb-agent/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index 276c55ec..77ba4b4d 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -37,7 +37,7 @@ mariadb: # The username or user account for accessing the MariaDB database server as root. # Default: "root" # Example: - # user: "root" + # user: "mariadb" user: "" # The password associated with the MariaDB database server root user. # Example: From 9a7f50d5746480ed03c411305c8ff03c08a4aa04 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:57:54 +0800 Subject: [PATCH 151/363] Update desc --- mika/mariadb-agent/README.md | 2 +- mika/mariadb-agent/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/mariadb-agent/README.md b/mika/mariadb-agent/README.md index 86f8ca52..b7a0a212 100644 --- a/mika/mariadb-agent/README.md +++ b/mika/mariadb-agent/README.md @@ -80,7 +80,7 @@ helm uninstall $release_name --namespace $namespace --wait | image.mariadb.repository | string | `""` | The name of the repository that contains the MariaDB container image used. Default: `"bitnami/mariadb"`. | | image.mariadb.tag | string | `""` | The tag that specifies the version of the MariaDB container image used. Default: `Chart appVersion`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | -| mariadb.databases | list | `[]` | Database configurations array. Elements: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | +| mariadb.databases | list | `[]` | Database configurations array. Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | | mariadb.host | string | `""` | The hostname or IP address of the MariaDB database server. | | mariadb.root.password | string | `""` | The password associated with the MariaDB database server root user. | | mariadb.root.user | string | `""` | The username or user account for accessing the MariaDB database server as root. Default: `"root"`. | diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index 77ba4b4d..48fca2ed 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -44,7 +44,7 @@ mariadb: # password: "password" password: "" # Database configurations array. - # Elements: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. + # Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command` # .name: The name of the intended MariaDB database. # .user: The username or user account for accessing the intended MariaDB database. # .password: The password associated with the intended MariaDB database user. From e164f0b020eccc7918da72b12f228270c2bf1dc9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 09:59:06 +0800 Subject: [PATCH 152/363] Update sample value --- mika/mariadb-agent/values.yaml | 56 +++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index 48fca2ed..6c3443f0 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -45,31 +45,45 @@ mariadb: password: "" # Database configurations array. # Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command` - # .name: The name of the intended MariaDB database. - # .user: The username or user account for accessing the intended MariaDB database. - # .password: The password associated with the intended MariaDB database user. - # .create: Specifies whether to create the database and user in the remote MariaDB instance. - # .drop: Specifies whether to delete the database and user in the remote MariaDB instance. - # .custom: Specifies whether to run a custom command against the remote MariaDB instance. - # .custom_command: Specify a custom command to run against the remote MariaDB instance. # Example: # databases: - # - name: "mariadb" - # user: "mariadbuser" - # password: "mariadbuserpassword" - # create: true + # # The name of the intended MariaDB database. + # # Example: + # # name: "mariadb" + # - name: "" + # # The username or user account for accessing the intended MariaDB database. + # # Example: + # # user: "mariadbuser" + # user: "" + # # The password associated with the intended MariaDB database user. + # # Example: + # # password: "mariadbuserpassword" + # password: "" + # # Specifies whether to create the database and user in the remote MariaDB instance. + # # Example: + # # create: true + # create: false + # # Specifies whether to delete the database and user in the remote MariaDB instance. + # # Example: + # # drop: true # drop: false + # # Specifies whether to run a custom command against the remote MariaDB instance. + # # Example: + # # custom: true # custom: false - # custom_command: >- - # CREATE TABLE IF NOT EXISTS `$.name`.`StorageRecords` ( - # `id` int(11) NOT NULL AUTO_INCREMENT, - # `key` varchar(255) NOT NULL, - # `value` text NOT NULL, - # `created_at` datetime NOT NULL, - # `updated_at` datetime NOT NULL, - # PRIMARY KEY (`id`), - # UNIQUE KEY `key` (`key`) - # ); + # # Specify a custom command to run against the remote MariaDB instance. + # # Example: + # # custom_command: >- + # # CREATE TABLE IF NOT EXISTS `$.name`.`StorageRecords` ( + # # `id` int(11) NOT NULL AUTO_INCREMENT, + # # `key` varchar(255) NOT NULL, + # # `value` text NOT NULL, + # # `created_at` datetime NOT NULL, + # # `updated_at` datetime NOT NULL, + # # PRIMARY KEY (`id`), + # # UNIQUE KEY `key` (`key`) + # # ); + # custom_command: "" databases: [] # Resource requirements and limits for MariaDB-Agent containers. From b5f2f8ed3dd8f1ddf2a244d3e35f85bee9bef2a0 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:01:58 +0800 Subject: [PATCH 153/363] Update indentation --- mika/mariadb-agent/templates/deployment.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 645c09af..5c626356 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -37,20 +37,20 @@ spec: - -c - >- mysql -h $(DB_HOST) -u $(ROOT_USER) -e ' - {{- range $databases }} - {{- if .create }} + {{- range $databases }} + {{- if .create }} CREATE DATABASE IF NOT EXISTS {{ .name }}; CREATE USER IF NOT EXISTS "{{ .user }}"@"%"; SET PASSWORD FOR "{{ .user }}"@"%" = PASSWORD("{{ .password }}"); GRANT ALL PRIVILEGES ON {{ .name }}.* TO "{{ .user }}"@"%"; - {{- else if .drop }} + {{- else if .drop }} DROP DATABASE IF EXISTS {{ .name }}; DROP USER IF EXISTS "{{ .user }}"@"%"; - {{- end }} - {{- if and .custom .custom_command }} + {{- end }} + {{- if and .custom .custom_command }} {{- .custom_command | replace "$.name" .name | replace "$.user" .user | replace "$.password" .password | nindent 16 }} - {{- end }} - {{- end }} + {{- end }} + {{- end }} FLUSH PRIVILEGES; ' envFrom: From 740bc6f6556df231279af041a5a580debbc4281c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:20:47 +0800 Subject: [PATCH 154/363] Add separator --- mika/mariadb-agent/templates/deployment.yaml | 1 + mika/mariadb-agent/templates/secret.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 5c626356..96ea4cd4 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -4,6 +4,7 @@ {{- $tag := .Values.image.mariadb.tag | default .Chart.AppVersion | toString }} {{- $pullPolicy := .Values.image.mariadb.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $databases := .Values.mariadb.databases }} +--- apiVersion: batch/v1 kind: Job metadata: diff --git a/mika/mariadb-agent/templates/secret.yaml b/mika/mariadb-agent/templates/secret.yaml index a49a755a..1c5ec4cf 100644 --- a/mika/mariadb-agent/templates/secret.yaml +++ b/mika/mariadb-agent/templates/secret.yaml @@ -1,6 +1,7 @@ {{- $db_host := .Values.mariadb.host | toString | b64enc }} {{- $root_user := .Values.mariadb.root.user | default "root" | toString | b64enc }} {{- $root_password := .Values.mariadb.root.password | toString | b64enc }} +--- apiVersion: v1 kind: Secret metadata: From 6a59b667de6ea8451725c00d2d50f5fabf5ba081 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:23:02 +0800 Subject: [PATCH 155/363] Update var names --- mika/mariadb-agent/templates/secret.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/mariadb-agent/templates/secret.yaml b/mika/mariadb-agent/templates/secret.yaml index 1c5ec4cf..34ba6d98 100644 --- a/mika/mariadb-agent/templates/secret.yaml +++ b/mika/mariadb-agent/templates/secret.yaml @@ -1,6 +1,6 @@ -{{- $db_host := .Values.mariadb.host | toString | b64enc }} -{{- $root_user := .Values.mariadb.root.user | default "root" | toString | b64enc }} -{{- $root_password := .Values.mariadb.root.password | toString | b64enc }} +{{- $mariadbHost := .Values.mariadb.host | toString | b64enc }} +{{- $rootUser := .Values.mariadb.root.user | default "root" | toString | b64enc }} +{{- $rootPassword := .Values.mariadb.root.password | toString | b64enc }} --- apiVersion: v1 kind: Secret @@ -10,6 +10,6 @@ metadata: {{- include "mariadb-agent.labels" . | nindent 4 }} type: Opaque data: - DB_HOST: {{ $db_host }} - ROOT_USER: {{ $root_user }} - MYSQL_PWD: {{ $root_password }} + DB_HOST: {{ $mariadbHost }} + ROOT_USER: {{ $rootUser }} + MYSQL_PWD: {{ $rootPassword }} From f4aaba0644842ec454097d1fe9fa1c00416fb13a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:26:17 +0800 Subject: [PATCH 156/363] Add mariadb port val --- mika/mariadb-agent/README.md | 1 + mika/mariadb-agent/values.yaml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mika/mariadb-agent/README.md b/mika/mariadb-agent/README.md index b7a0a212..8989dee9 100644 --- a/mika/mariadb-agent/README.md +++ b/mika/mariadb-agent/README.md @@ -82,6 +82,7 @@ helm uninstall $release_name --namespace $namespace --wait | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | mariadb.databases | list | `[]` | Database configurations array. Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | | mariadb.host | string | `""` | The hostname or IP address of the MariaDB database server. | +| mariadb.port | string | `""` | The port number the MariaDB database server is listening for connections. Default: `"3306"`. | | mariadb.root.password | string | `""` | The password associated with the MariaDB database server root user. | | mariadb.root.user | string | `""` | The username or user account for accessing the MariaDB database server as root. Default: `"root"`. | | resources.mariadb | object | `{}` | MariaDB container resources. | diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index 6c3443f0..a476db0e 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -32,6 +32,11 @@ mariadb: # Example: # host: "mariadb.default.svc.cluster.local" host: "" + # The port number the MariaDB database server is listening for connections. + # Default: "3306" + # Example: + # port: "5432" + port: "" # MariaDB database server root user configurations. root: # The username or user account for accessing the MariaDB database server as root. From e95737c09cdfaf3edef6988352f694af686ea627 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:27:53 +0800 Subject: [PATCH 157/363] Include port in secret --- mika/mariadb-agent/templates/secret.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/mariadb-agent/templates/secret.yaml b/mika/mariadb-agent/templates/secret.yaml index 34ba6d98..3ca8a606 100644 --- a/mika/mariadb-agent/templates/secret.yaml +++ b/mika/mariadb-agent/templates/secret.yaml @@ -1,4 +1,5 @@ {{- $mariadbHost := .Values.mariadb.host | toString | b64enc }} +{{- $mariadbPort := .Values.mariadb.port | default "3306" | toString | b64enc }} {{- $rootUser := .Values.mariadb.root.user | default "root" | toString | b64enc }} {{- $rootPassword := .Values.mariadb.root.password | toString | b64enc }} --- @@ -11,5 +12,6 @@ metadata: type: Opaque data: DB_HOST: {{ $mariadbHost }} + DB_PORT: {{ $mariadbPort }} ROOT_USER: {{ $rootUser }} MYSQL_PWD: {{ $rootPassword }} From 168721830cd6748b792bb9bcbd55574010dc687d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:32:00 +0800 Subject: [PATCH 158/363] Specify port --- mika/mariadb-agent/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 96ea4cd4..3fa76d0d 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -37,7 +37,7 @@ spec: args: - -c - >- - mysql -h $(DB_HOST) -u $(ROOT_USER) -e ' + mysql -h $(DB_HOST) -P $(DB_PORT) -u $(ROOT_USER) -e ' {{- range $databases }} {{- if .create }} CREATE DATABASE IF NOT EXISTS {{ .name }}; From 53556ce76d68121a1dfe53d2950a760fece099c9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:36:16 +0800 Subject: [PATCH 159/363] Update var names --- mika/mariadb-agent/templates/deployment.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 3fa76d0d..b9f78404 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -1,14 +1,14 @@ -{{- $host := .Values.mariadb.host | default "mariadb" | toString }} -{{- $registry := .Values.image.mariadb.registry | default "docker.io" | toString }} -{{- $repository := .Values.image.mariadb.repository | default "bitnami/mariadb" | toString }} -{{- $tag := .Values.image.mariadb.tag | default .Chart.AppVersion | toString }} -{{- $pullPolicy := .Values.image.mariadb.pullPolicy | default "IfNotPresent" | toString | quote }} +{{- $mariadb_registry := .Values.image.mariadb.registry | default "docker.io" | toString }} +{{- $mariadb_repository := .Values.image.mariadb.repository | default "bitnami/mariadb" | toString }} +{{- $mariadb_tag := .Values.image.mariadb.tag | default .Chart.AppVersion | toString }} +{{- $mariadb_pullPolicy := .Values.image.mariadb.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $databases := .Values.mariadb.databases }} +{{- $mariadbHost := .Values.mariadb.host | default "mariadb" | toString }} --- apiVersion: batch/v1 kind: Job metadata: - name: {{ printf "%s-%s-%s" (index (splitList "." $host) 0) .Release.Name "mariadb-agent" }} + name: {{ printf "%s-%s-%s" (index (splitList "." $mariadbHost) 0) .Release.Name "mariadb-agent" }} labels: {{- include "mariadb-agent.labels" . | nindent 4 }} spec: @@ -29,8 +29,8 @@ spec: {{- end }} containers: - name: mariadb-agent - image: {{ printf "%s/%s:%s" $registry $repository $tag | quote }} - imagePullPolicy: {{ $pullPolicy }} + image: {{ printf "%s/%s:%s" $mariadb_registry $mariadb_repository $mariadb_tag | quote }} + imagePullPolicy: {{ $mariadb_pullPolicy }} resources: {{- toYaml .Values.resources.mariadb | nindent 12 }} command: ["/bin/bash"] From fcaf6a7b57ec3701a7dec04f66a2b855af135ea4 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:51:21 +0800 Subject: [PATCH 160/363] Allow both create and drop --- mika/mariadb-agent/templates/deployment.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index b9f78404..4b3012a3 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -44,7 +44,8 @@ spec: CREATE USER IF NOT EXISTS "{{ .user }}"@"%"; SET PASSWORD FOR "{{ .user }}"@"%" = PASSWORD("{{ .password }}"); GRANT ALL PRIVILEGES ON {{ .name }}.* TO "{{ .user }}"@"%"; - {{- else if .drop }} + {{- end }} + {{- if .drop }} DROP DATABASE IF EXISTS {{ .name }}; DROP USER IF EXISTS "{{ .user }}"@"%"; {{- end }} From f9019d7f5f324948dca8bdc106810d86440b0cac Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:56:15 +0800 Subject: [PATCH 161/363] Use vars --- mika/mariadb-agent/templates/deployment.yaml | 27 ++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 4b3012a3..5d738912 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -39,18 +39,25 @@ spec: - >- mysql -h $(DB_HOST) -P $(DB_PORT) -u $(ROOT_USER) -e ' {{- range $databases }} - {{- if .create }} - CREATE DATABASE IF NOT EXISTS {{ .name }}; - CREATE USER IF NOT EXISTS "{{ .user }}"@"%"; - SET PASSWORD FOR "{{ .user }}"@"%" = PASSWORD("{{ .password }}"); - GRANT ALL PRIVILEGES ON {{ .name }}.* TO "{{ .user }}"@"%"; + {{- $create := .create }} + {{- $drop := .drop }} + {{- $custom := .custom }} + {{- $command := .custom_command }} + {{- $db := .name | toString }} + {{- $user := .user | toString }} + {{- $password := .password | toString }} + {{- if $create }} + CREATE DATABASE IF NOT EXISTS {{ $db }}; + CREATE USER IF NOT EXISTS "{{ $user }}"@"%"; + SET PASSWORD FOR "{{ $user }}"@"%" = PASSWORD("{{ $password }}"); + GRANT ALL PRIVILEGES ON {{ $db }}.* TO "{{ $user }}"@"%"; {{- end }} - {{- if .drop }} - DROP DATABASE IF EXISTS {{ .name }}; - DROP USER IF EXISTS "{{ .user }}"@"%"; + {{- if $drop }} + DROP DATABASE IF EXISTS {{ $db }}; + DROP USER IF EXISTS "{{ $user }}"@"%"; {{- end }} - {{- if and .custom .custom_command }} - {{- .custom_command | replace "$.name" .name | replace "$.user" .user | replace "$.password" .password | nindent 16 }} + {{- if and $custom $command }} + {{- .custom_command | replace "$.name" $db | replace "$.user" $user | replace "$.password" $password | nindent 16 }} {{- end }} {{- end }} FLUSH PRIVILEGES; From d7d158fa3903445b0e63d19f813202551f4a04e5 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:56:36 +0800 Subject: [PATCH 162/363] Use var --- mika/mariadb-agent/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 5d738912..4785b45c 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -57,7 +57,7 @@ spec: DROP USER IF EXISTS "{{ $user }}"@"%"; {{- end }} {{- if and $custom $command }} - {{- .custom_command | replace "$.name" $db | replace "$.user" $user | replace "$.password" $password | nindent 16 }} + {{- $command | replace "$.name" $db | replace "$.user" $user | replace "$.password" $password | nindent 16 }} {{- end }} {{- end }} FLUSH PRIVILEGES; From 7892f29097cb7f28d179ccbc4b7cd37e9201add0 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 10:56:59 +0800 Subject: [PATCH 163/363] Parse to string --- mika/mariadb-agent/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 4785b45c..73814220 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -57,7 +57,7 @@ spec: DROP USER IF EXISTS "{{ $user }}"@"%"; {{- end }} {{- if and $custom $command }} - {{- $command | replace "$.name" $db | replace "$.user" $user | replace "$.password" $password | nindent 16 }} + {{- $command | toString | replace "$.name" $db | replace "$.user" $user | replace "$.password" $password | nindent 16 }} {{- end }} {{- end }} FLUSH PRIVILEGES; From 18c4ba443e8d8bf04453a99db4ccef86d0a29a76 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 11:00:01 +0800 Subject: [PATCH 164/363] Quote using filter --- mika/mariadb-agent/templates/deployment.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 73814220..37dfe951 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -48,13 +48,13 @@ spec: {{- $password := .password | toString }} {{- if $create }} CREATE DATABASE IF NOT EXISTS {{ $db }}; - CREATE USER IF NOT EXISTS "{{ $user }}"@"%"; - SET PASSWORD FOR "{{ $user }}"@"%" = PASSWORD("{{ $password }}"); - GRANT ALL PRIVILEGES ON {{ $db }}.* TO "{{ $user }}"@"%"; + CREATE USER IF NOT EXISTS {{ $user | quote }}@"%"; + SET PASSWORD FOR {{ $user | quote }}@"%" = PASSWORD({{ $password | quote }}); + GRANT ALL PRIVILEGES ON {{ $db }}.* TO {{ $user | quote }}@"%"; {{- end }} {{- if $drop }} DROP DATABASE IF EXISTS {{ $db }}; - DROP USER IF EXISTS "{{ $user }}"@"%"; + DROP USER IF EXISTS {{ $user | quote }}@"%"; {{- end }} {{- if and $custom $command }} {{- $command | toString | replace "$.name" $db | replace "$.user" $user | replace "$.password" $password | nindent 16 }} From 77c6c389ed7cdd0729f95313f0120b82c902de60 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 11:00:44 +0800 Subject: [PATCH 165/363] Create user first --- mika/mariadb-agent/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/deployment.yaml index 37dfe951..94377f2b 100644 --- a/mika/mariadb-agent/templates/deployment.yaml +++ b/mika/mariadb-agent/templates/deployment.yaml @@ -47,9 +47,9 @@ spec: {{- $user := .user | toString }} {{- $password := .password | toString }} {{- if $create }} - CREATE DATABASE IF NOT EXISTS {{ $db }}; CREATE USER IF NOT EXISTS {{ $user | quote }}@"%"; SET PASSWORD FOR {{ $user | quote }}@"%" = PASSWORD({{ $password | quote }}); + CREATE DATABASE IF NOT EXISTS {{ $db }}; GRANT ALL PRIVILEGES ON {{ $db }}.* TO {{ $user | quote }}@"%"; {{- end }} {{- if $drop }} From 74c94b1d028f6ba9ea439298cb59f5c00f2c9f72 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 11:02:30 +0800 Subject: [PATCH 166/363] Rename manifest as job --- mika/mariadb-agent/templates/{deployment.yaml => job.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mika/mariadb-agent/templates/{deployment.yaml => job.yaml} (100%) diff --git a/mika/mariadb-agent/templates/deployment.yaml b/mika/mariadb-agent/templates/job.yaml similarity index 100% rename from mika/mariadb-agent/templates/deployment.yaml rename to mika/mariadb-agent/templates/job.yaml From d8a2ddf52fc100aa3a6d68db6c51fbad16d19501 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 11:15:48 +0800 Subject: [PATCH 167/363] Update docs --- mika/mariadb-agent/README.md | 136 +++++++++++++++++-------- mika/mariadb-agent/templates/NOTES.txt | 46 ++++++++- 2 files changed, 137 insertions(+), 45 deletions(-) diff --git a/mika/mariadb-agent/README.md b/mika/mariadb-agent/README.md index 8989dee9..7d5c9a29 100644 --- a/mika/mariadb-agent/README.md +++ b/mika/mariadb-agent/README.md @@ -1,77 +1,129 @@ -# [`mariadb-agent`](https://github.com/mariadb/mariadb) +# [MariaDB-Agent](https://github.com/MariaDB/server) + +Easily create or delete multiple pairs of databases and users in a remote MariaDB instance. ## Prerequisites +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + - Kubernetes 1.19+ - Helm 3.2.0+ +- Longhorn 1.4.1+ + +--- ## Preflight checklist -## How to add repo +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +**This section does not apply to this chart.** + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: + + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` + +2. Update the repo to retrieve the latest versions of the packages: + + ```sh + helm repo update + ``` + +--- + +## How to install or upgrade a chart release + +1. Get the values file of the MariaDB-Agent chart or an existing installation (release). + + Get the latest MariaDB-Agent chart values file for a new installation: -Add the repo to your local helm client. + ```sh + helm show values mika/mariadb-agent > values.yaml + ``` -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` + Alternatively, get the values file of an existing MariaDB-Agent release: -Update the repo to retrieve the latest versions of the packages. + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` -```sh -helm repo update -``` + Replace `${releaseName}` and `${namespace}` accordingly. -## How to install +2. Edit your MariaDB-Agent values file with the intended configurations: -### Prepare MariaDB host + ```sh + nano values.yaml + ``` -Install [`bitnami/mariadb`](https://github.com/bitnami/charts/tree/main/bitnami/mariadb). This step can be skipped if you have an existing MariaDB server. + Pay extra attention to the descriptions and sample values provided in the chart values file. -### Prepare chart values +3. Install a new release for MariaDB-Agent or upgrade an existing MariaDB-Agent release: -Copy `values.yaml` from the chart you would like to install. Refer to the [Configurations](#configurations) section for more information. + ```sh + helm upgrade --install ${releaseName} mika/mariadb-agent --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` -```sh -cp mika/mariadb-agent/values.yaml . -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Edit `values.yaml` with the appropriate values. Refer to the [Configurations](#Configurations) section for available options. +4. Verify that your MariaDB-Agent release has been installed: -```sh -nano values.yaml -``` + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -### Perform installation + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. +--- -```sh -helm install $release_name mika/mariadb-agent --namespace $namespace --create-namespace --values values.yaml --wait -``` +## How to uninstall a chart release -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. -```sh -helm ls --namespace $namespace | grep "$release_name" -``` +1. Uninstall the desired release: -## How to upgrade + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` -After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${releaseName}` and `${namespace}` accordingly. -```sh -helm upgrade $release_name mika/mariadb-agent --namespace $namespace --values values.yaml --wait -``` +2. Verify that the release has been uninstalled: -## How to uninstall + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. -```sh -helm uninstall $release_name --namespace $namespace --wait -``` +--- -## Configurations +## Chart configurations | Key | Type | Default | Description | |-----|------|---------|-------------| diff --git a/mika/mariadb-agent/templates/NOTES.txt b/mika/mariadb-agent/templates/NOTES.txt index e3f9ee05..aff74556 100644 --- a/mika/mariadb-agent/templates/NOTES.txt +++ b/mika/mariadb-agent/templates/NOTES.txt @@ -1,5 +1,45 @@ -mariadb-agent job has been deployed for {{ .Release.Name | toString }}. +{{- $index := 0 | int }} +{{- $databases := .Values.mariadb.databases }} +{{- $mariadbHost := .Values.mariadb.host | toString }} +{{- $mariadbPort := .Values.mariadb.port | default "3306" | toString }} +MariaDB-Agent has been installed and configured for {{ .Release.Name | toString }} 🎉 -See the values.yaml file of this chart for more configuration options. +The following are a list of database(s) you have supplied to be updated: -Please refer to the official documentation for more information on how to use mariadb-agent. +{{- range $database := $databases }} + {{- $custom_command := "false" }} + {{- $create := $database.create }} + {{- $drop := $database.drop }} + {{- $custom := $database.custom }} + {{- $command := $database.custom_command }} + {{- $db := $database.name | toString }} + {{- $user := $database.user | toString }} + {{- $password := $database.password | toString }} + + {{- if and $custom $command }} + {{- $custom_command = "true" | toString }} + {{- end }} + + {{- if or $create $drop (eq $custom_command "true") }} + {{- $index = add $index 1 }} + + {{ printf "%s. db=%s | user=%s | password=%s | create=%s | drop=%s | custom=%s" ($index | toString) $db $user $password ($create | toString) ($drop | toString) $custom_command }} + + {{- end }} +{{- end }} + +{{- if eq ($index | toString) "0" }} + + ⚠️ No databases were supplied for MariaDB-Agent to update + +{{- else }} + +Please run the following command for each database and check if they have been updated accordingly: + + ```sh + mysql -h {{ $mariadbHost }} -P {{ $mariadbPort }} -u -D + ``` + +{{- end }} + +For more information on how to use and configure MariaDB-Agent, please refer to the official documentation. From c68fac680388e8a6f0f5835d01580570abfca992 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 11:19:15 +0800 Subject: [PATCH 168/363] Replace with svg logo --- logos/mariadb.png | Bin 12464 -> 0 bytes logos/mariadb.svg | 15 +++++++++++++++ mika/mariadb-agent/Chart.yaml | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) delete mode 100644 logos/mariadb.png create mode 100644 logos/mariadb.svg diff --git a/logos/mariadb.png b/logos/mariadb.png deleted file mode 100644 index 31050fab276508e920b5e994f2494160b277b4f9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12464 zcma)jbx@m8({FHhcPJLzL!nSSNRdFX;!+@m;_d`@N^$oVmm-B?!CDGMi)(NxPALvI zyze)6=6-+Oi9DG-yL-;={&vqkXP(4BG?fW(X>kDn0D-ECq7DFn!i)TUfsKj$-hVO3 zfxIwVtLSI|0Dj2dA>jbP4U!bH3jlZuA~`Go0Le@MfXXHJo3<2k0MqJ~vLfK|=~dYI zIR#0tQTn;lDka*m)2A_bhz*Q_5T$oNAEi~gC+6nr06~ghRYvFtF7&u#D@Sr~khj<1@zl^9M#iylh{GX~@@-wbk^tG5uj#GTy%3xc<1; zSc2r#81ZP|pCv&(j@q>0f)?0<*t?4I(s;pWCF-lx|Yy-Q;O&F6KO(rM4=&p(z6Sk zO;a&RhmbZ7!^nwUa(}&BG;?r6rES{}Dl4QYfhMF{5=Mktfc3o{#Alh0xgyvj91ms( z>XX6hiYzVCUz1gC1zD8fq+5zUlWSPOYQ?RYZ~#-HJce)6tkQy4S%CUK05Y-_xFbU{ zFuOt_cOm?eV^Z>}*RX=$OIFR8R|NGq>PTZ;v16xiVGghwlbkeR?_$!QAp|%CB|=DQ z7SL9#xA_fMBYG?Cv}cs^u`toFps*ICTC>zSngX5_61*d0DYi_&I*dNBFNm0hqPRD@ zW4VCp$wQQnQIWb?+tCN?y%FAR!8v)KC+fW^$9eQE17TC2oW*Kp3${z?GS z*MrZxyv2xZ>Y4TyN+s(7d^25NFSDeMai6sKqeq1@p^SPu>M;0_)P!}^TxOv*pgsu+ z{|*tD%ymFJ_oa_HW9S?UkETF^2i$VfS>+hQGp;E%@~fttbpP*)-LrmNUe_tXFJS`u z_pn#mBNw(dVnb7pp!({|dFuZv!|Z9D-h)fjYN#dez=lKUU?ZJl>BKxwZm(|OIjhC| z24chb7Lo(2D>mWLj)eF=;nX4E*dBoUMa#`m2bUMng?EQffTe_Cg@Fv}TKc-1(C1bV zm!)4w`vmbx5uAr2_CM>>pF_DqJ^PX!VFMRy`!Ts{glqGpMh9#>N#4JRAMkGOh>g=tS%bb5};*Yob}13>^FbMaO^)(RuxIF=T?f$%rzgN*?c zOmlS6w3x>#o&IZgs7OekDV;W29V!)Cqklm~m>~>_(kZOf_65Q;6sIYdUy`ZTp25c= zo}~Zr?%&gaN{lqAmFZ?xu@kx`|D^Jg|4O9XLl15a#?V&LK&YNn|Kat(ISM*|XHo5t zVvmqSU}RuE#XImhp-++nt35&t@oD8z;-vP;VUvBAwcnYKE0e3DSE3@rNBjSSC5F&x z>QS^$-#`_Z-$J@Sng=hFAVZbR-(G}1OgS4l1rI>T)FwP3QY9bZ*AoYGL>kAMR7{=z zdyV;Nu55aO-0g*EbRPf#UY<45IjZaa1|_gDGzAkRm zlb=f50vha~ zhaPldl+3ArKdY1aj}By(;~i`+d`LAUl-gK`7JMSoBNIl@1!KX!>rGY?=+%fWoZ*Qq z+7lXJ4p=!}C{6XnG+g^HGixG(qnrw*0At~)Hfeoq2-ki}ljvvEZ)KRajK$7I#kcAi z`F{RnLz+SYcEyN12K1Ta=wVT=Ii_bfTv5ojJD}mSzDAG0ZBm-`4k4-4s3JRur2BIS zAuE|wsMR!K0C_7e_0~d@26{&LMAtshI}8oq7tO8$n2SllC|}w=u^&U|4Q0qMW^z19+}W!+H&DEhXt_a^ zE3!u+RFwDRHDZDSFZU&8!KuCI!%(x>sNfd>D%2fRYm=M|q5L1Os7H43S&-;_+Jq7m zh8kC>y3ZbA=u#kFJi2ZAgXl>;ZFM#azgT)C+L& zT^()18pH7osQLQQhX*Owo{3>&jA?<}d5@!~-Co7+jPpxmC7C0OMlwZgL?yu-V(`mPM<;qZ3?(2tsJS8Cd!7|Jlo1oQ>mxLMLNT;Sjis0o|Ckq5282L zQ#&Gt`U@i;gO=kd3&CaKak@P9?DYbq6$%iFG27Ld&SYO~!~KP5HDuDLk@4#s0=F!< zNh{D`hxPNFU<)#r0tePgFwzEEfU(&Ty21I?<0Ga{UH%ZkUJl{F&;$&xj71)DQ)0+Kr3=Y*B3n#OLXa}m}M7O z741h^=_nUB`}>z{YL;B@p&S+Vd|5mf>ahp)N>@;(hPqH!hPp80=F$bm&BAVx#UGEu za6~rX`*jf96&TVbogO-#;Y;j80v&t`fEZ{^UJUn;+FdlLA|0hxLoBzE=88v+*3nSC zo;Cp)fEX)nWt6CrX8%0opzy#ecsDZUJRF7zvaKovO8HYl(DX6Iq38`K+Hx;{at^~c z905dKs!*?E^wjZp?cb@(4Dps?ZE@&m$*OsEcy;e5o^3RaGX{{EY+Mwsy9EL~8J_?Gk zLOiRM4^5_j{L}+dOTs&JG9Fe_TYz{g z=o#OyKDDqyyJ?&Nl2-JpS2m@us7|c2r`l1;syC6fT@c}hV4Z6QP1;Giq&Ton_B$1` zA<5X}bvJ;Pz4GLj4lsuh8`;->$Q>z-Uao-_=MIn-CKT^?LWS^}1(zmZET`B#KdV-+ zj`usoJPEXr9&bXL8>RO`Zp@zega8pRYfBRt`=~@$3XT?!1!_w{2OoO6?;W;r5 zux*11?$hLlHqA^%~}GXXM1w5 zip}J^4MYTq23}=+1C_31TIj_hyD~t5B3%~k{MH+UR$F%?0^Xo>cZuQ@v_U=5`!Zoo zH^GbLGMR)9iUv(J5X9VIa#&aX=hbX`Ax6xEC&s{FS-x+})k$3E?!n;ZDYL`CPelI6uu~)*n-a+T zV=?Y8u$AzFO5Awp&hy=~c)Y1j)Q^rqqEdV|k6Ouw*ZF!(R6O<6`l4Ni&B&d7)Yb8$ zHb|g|Mj}ZL&ZgW_jS`eJL=`s4vyT3UFZG)X#Wji-84nztC)Z+WKLBw)*KE)BfbwhX z_K|wY@!^ztL3qWQd7?3G3}BAp^!=47fUHVt-<=E-gPCzwMss{71rk^#=aeAKZ9$=i zGC0PzntZkaR-KG!i8If;Tq2IOfw0hkA*KBRQF;BjR?nIU}VM40+SrAdc9#7NbcJ*?3RsH(j0bA;NvFx&} z=MqW>- z+1C(>Bh+K8E}VGJKpo$|%+3yIw6@!;ziOcWoU!LADw>v0WfvXGh&wL-2 zs%hnjzo>|lmIW7w|M)T9yS$6)ta`c7Gy0k5(l9LY_ZU@2JH@I39Sq&^6`R$Dds4%o z0$rj2^j<}O>YFy`mR$vL@32uYHZkShbDpzlSDxdY_FNTvMsxEs1NGJy+7bI@?4<-N zrvV%HKNGvJ0+k`--zEg7=xSdYpB(9L7I_wH{;E<)dz^cAxj@VY%)4r6k?*j)Hxe!S zf{N28GMMvb>2|cxFhMRML^WUCleL#rcoo{G&9LX{2u59C(1x0hHu+<9A0Ei5u5&C0TXC{1JfXf;@>7|Wg34ET3c zE~S6ShMCRURtk#L4-g;f>O@cM4P?Vfyhc3k2obaJEKkX*W;m9%liunz9|OdnQQsAf zK7tZ2IR0R?YdS@2u;d%1udWBc4W*%Ws`y!<$@da@1E9vu$y92-5z}M{8u_ZlB2mDQnI|a2`O`6rR@}2=l z=H}Imox`;5fzKmuqVGdf;7)w>RxU^bmpvft>L`jk>c8L;i6|VGt;(S1-BJ_K1CY zcS?RUk}>PYTp~QVYTNnzVhxyj<5Ku1r7l?mit{}U_+t4-cxBMlp@YMwX&Hk+AVW>g z#aH6S)pn;+87coj#`sm1$1E!CKBGw7&9;@79kgbEF8qLmJF)jkD`n?m`wI0UcjRaF zlW*BiXm|&Y;{Qrl2gJI!w4l92H;JApv&r*>Gr^oUoEO=u*JhZyr4KRh(mXEXO_Ew- zyJ?4Qy}^MP!>mA)`(*4~#En&|1qW{Bs(KJi)}hJiWD)WrJGoPEzhX-bBv((rP^rcsMdl98p=ln0t&7LQ2P$UhuIuj~lBmUSAZjW(8#f|KMU@7= zzE|VbV==y3nWlvAsMIx0fJN`RQOBxUR#&(#sCc^@5)}O(Y#M@Yc%X-?0;gWmC=S(c z3Vl)*n>x;$Rm!`fV)Sgw>nt!f2$6T9hc~F?^|;gPU9?*ZSBBOjwEo3vCGR##`IRKX zWCo0@ow|cL$_p$o{J)EYBz=2%Ed?sdHZwq;Lw;W|s4lX_>L&0k?jI4g#n>sf+~(^X zGo%~D=WnT8rMu#upL+-tsmyz@o|0X~?XV{hdx5?v<9Y&{Q_Il|4d!XkK3<% z%)T?EFwB7x@2^=N5(N}$?ubx1l03YKy&P@?&jZn=t5{U332WA(&mlRjgnA1n4WJ1~ zDWBmXTv^4tuGh(e&_y~{wS(Gcn)aM-cb3b&45{S0 zG7Nif5^!8ePzDc3JX_f1-qg59qlgN?t--*zax7U>HLh>bKu|9OWpAD@(4U)at}Moz zi;(1&wh?a`6GZ!Xi&q-n@(z7&r^-|^Oz?D|(ok9mz3`(bm=B>{c~uTw34>PjOPzf# zl&+Qo(S0sV@M)jG4R0=~}vYHOY03jSvxhtJW0Ae;{ zinR`u3w6cQZoX=JtizW^nq^x?G4eM*A>3Z$Xmz?Rcy=v~lfQpKv4GjJ$BzO-Lm4&f z6r&1HPsOmn|9z=Tv_Z7kV3(}8+6f<#16g3ApJS=f%NcBfK0*Bd&v%K|x>b^F$(v|n zgj3vH0y$8tp1Yz0k`!t5jvc$*_hZ@BjW^(4JF74OW{`cjU|<|kN;&y0l7F=9`*~$4 zqdr}w!!+fY5m6;}TQb-0{dtur)Uan}=dozCdqVWj$)3|v!}k9?qB-J!`PJ;oHJSZl zH4!~&KFq$~aZnm`(WL|A{kdY!x9d$0*>GJSt-|wsOXv3ZPuJh93}aYk_XtWh)I$O` zP5c-1ifT1q4&Dr1?d#=Eb%dKwX!hg`ziiQ_eY_#Us6}1Taxuu+2nh>GLK)s)f=$O+ z!UaO|Vk$$7B&5qTx9lyr7T()1RvJH=96fTAUYJRsA6;ag{bGKt_;3_smrw;wb!LtlPzkz9p5wf;vACe?H%|N z?W0S=SfGOvsVCI)h6rASG@K7=SSxwe>~DPiPbvfyQSp{+v3{dzYt#X_fD-hI{BgJ& zTmvU(>o>vXw4=5PHP}P1YNLwiwv6xpWWN#Sgl0d8>7hp zI8Yun+(b5{F&=09ay{FAd|YZXOo zRQ7y!VAu9hN>wwUjB4f$P5_gyp#kw{WLN*~I9G1MZ4*>TroS22(NCKqbFyv2Nzh3~B(iFE42$ zuO;luC)2X3)byad=+ao#imK_2{x-J6iiZRdA#qc4rx zwy}KItnR3{zQ_P$&=TR4i}KFH;jj5cjE;!f)10<$f2+jT4;Md$dsdG#fF|b?q27nl z`m_PD-wpQ~&_|>$$NXy-}VL z%R15738s_!j*3+x^v`UUgXv>q14Z!Rl%xmi2*v~29a+LOo?Wu$D1*Rz{br02at#5? zvRSzUGS^(jDb_LI^MZ%A;~;_Tmjxl{MPlCc$MpHA{Al^3w+AdhGYU}LROH#JQ^lF& zSG0Ci<;{adn&tu6)o;YIilRZ$(&slo@71E zfiaOI<4gi$AjR{-ck=8NNRS7K?q)I0kCt=Ry2G%`dm>k57UzByltXDCA=j zqeUdE5OoUla5X#fTMj+*>0p__-i%OWIHnLqo23q=cx!fK(rtWlXUJwG!u`^!^Cb9| z4>(iI-w~4|r8Yu(r0gMvKAv=!kvY2x^E(<^_ISL{za&n3(@Cq5^peEA$yB?9e>D+t zn<$?@dilXXZ-o2a65c+6dipp(HLG)NzqQ@d-}bPKvFa}6LbeYXiqRS^ea`tQb-C>P zBy`pXPjuJ^&xOBifID8_0t?YtZfX|N(RoBV`}veKE{yT_2)Tb6^90k@!j$k_gjJ6b zE-!z8b*_acF;llu45?yp+|rpKCTmjZN2QsFgZOk7MInZox>&MmS71z&)E!*~g|AFE z8e#Ps{n;M+=$Pr(pHnj5T~LQovUPjx7@14IR>c$=YW$k_pjlh-6FUg`(%c>1@yCda zxiLz>NT6tbUY=uZq|(l@MR3=Yf$S`CKAfCC8mS$+OEwT7dj3z4_M_4%e}`xEv}x08 z?Jz=XG8cv+!F)LnTTiSqD(BZ0)_Anp0XZIi6=CB9dhdo*nmtNZ*KT#UJFAsK(}=;xC*N+LvbyDZXu!{u^RNwZ37{ z_+hbyCI;+s(K-gz-8^hq*~q{J+52ZRYB>&1K zUbaCn#UmBv7nuO1ZWW{bc%9AA7B<4$_4P zMCcAx(fsel34DYwo7p`iYyop1Bt7+BBh8f~wj`|>uN6zfPmBLSm zINgtFa*Yu(zyE=cw1I|;g@omkEP<2kb_>aUf+!INqlzLU5ww4uQ-40{A74|@v&BF3 z6BX%`u1mefIsVzAAin=qEkC_(w@qbkRxF-=F;~ppSOPiu>3?ZR4?P zLpvW*p@+=_5esD^lZpF^;z=z~>~;DMLDoO3?!cj6LISp|_99Qi)91-1S&dtWoHXN~ z28jNaBJqV=17~8yVRR7e?X*_38}!)&jYOfhFG=GAoD>>Dfl0ggqE)T+zdAm!LIh|A zG|27hWFq}G1X=!3x<>6pT<>%-kPhiAMOvBQp^Zi6WdtA8F70fy*1fM2?&8ETIvJ?M ztC79pHWQ$<^Y`n>m>jOwFIoBb*=Byvd`AhMk-TfB8Q5Vs`(EDW4K9u1R`GHyeSFI6 z7GH^>({?P+2a%tbxe7r$z>B}>jfz5e&I~ER;|ALIxj--F-!~KJ)^t0>zXC>f2+pcd zu0T>6cPBRHY8gMXB5gC*GsE;pZmsk>%2P6D^A#o3`G>?GG5J1R3~-PB^PmoOiqvr} zV`8xs7#l_W$rpSq&F9?yFrtFMdsp`D#^l0+m9%Cnm1a1BwE8}p67K^i8HgbmjXRwQ zOc%SRBDfyrdy5t|&=K^)jQRPXLqC!AoqYJjuzv!6D9^?=Q{$w)vaNgx|aF+fXhae0asJXRRq8Tahv3kp8gRB#*;MbD$;`S`HsRjtl} z+#cz$I0@NsdB`F_OjxEYvsoUmkT)F!Z4v<;OB)vx z4_iY27Ki^8=1xph{(YkTOS#e2QrtnDG(`m4`NM?g>V1xn@agZR%c7+^AY+-&)>mb` zSnGT4^~MdZyw)p#QM-Pp_j=q+98|xQF;tAmF>rekk!Y&c(G`35k#%~G_JI0GasGHK zb=pZ+61#h6=CyCdK4b63lfZ!Ar~0TD-YRhPi{z z%t=Me3tS`xm!W&wo~v5Q_H^Gd?-VC26#jLu4im-M=lYj;MARp|{6XAJj)U7dyf7C( zsW7T`lBq2fD{kV=qhI4QTw3hQP*<%Y+%h`MP?v?_K)iNYlVNPYwSSWGo~P^kds)_^ ztU;94Sc}n}bf~Qlp`gra1J1d;8bybH_*Jt39mGO>{~3X@IMm@-^@{Tg--JBYx4k1S z*Eic_UA05jSRI9ar_{d0rzk@Nia&NMZ5S`Oe8h9!r_#RT3=mlfpiJ(UfBR@_oUouI zB9iXXVgSxyXv{2}Ulo`uJ+y4@jVpM8)=#{&W317Ba`1bl zq~(C#g%+jOv%ekt&^)j_(Cf*%wpFn5N^mr7XDb?~{|6N%Vx%`>x&FbOC%IMeV%O4h zRk`S37P$R^DJ*73XdNv9i}=Vi{l?Nbra-zTQh(AMG#SPjd-Ug-K11r)UzH8WbC`4} zy8_GkX=P^Xak<*sj@J!-DKo4SQcuVnM0-x6Mqqx2*GR0_7T;TSOBlts?z*3| zj56p_YW;KnSEYSZpp-Kt^PZtJ;fiL;elF|nr$o9Kot%27h>TW~S3ihNw)Ku?ToUA5 zJ6rM;Ry<|Yc1QUiq}x+Z5_usZEavqcHOnQ2aR#nM0T1dPfF+(^;`lgQJwiX)5_WZC z1v^q7fsv$)RmLiNhy$39NX+z#`oj+92a~)SuodW(VHNmsIp2{gTcbVzTu90nk+)(r z^^>zRT7vHzHq$b?{->txWht^4LZ2|(ANd$+agmQVCQWnVv7OqkU5(NC5=OCZ?cAzC ze?B#}YL@wcT`;m^;;nH{W17?IIk#r^>@n}Wgz$VDwVR6fNogtde+!|@xRa(G-=&&{ z?sze-<*fwv&sGf6GKBw#LJQ3~wmeh~nB4rG%G5oyb178tCyKJ-yB>LG-2T3fjGPC% zE~LeC?)o9@>iG;rH=^lV4p(c#_lWQxli7I&(FIDFHPI(z(L8OVJ(oub>t!QyCrgBK zI1LdD$Hwr-&m^G6i!nRVwabmzyT?tunV|k1W@)hJ?_&|1pN1pWoW*Fx4%)@#XQ@MN zCvwO9PIp~mE3Gn_4>Ea^sJ^J&atg;gua+SL#}aX+-h-o*uEtJ|@_lKoiA7|dwn1Dw zYAsY`tmC99Ix&?A$ceqMYB@SodIW%Zb-Ve9>jPyUqwmAlkEiH7+@CfY64f>gdi2g+ zJy$n;KI{*lcd5D=w4g10V<{#Dr9YyT9lFWW2chG}q>d(c&=4`bAFedtF zw_*J;hhKBp4@USS1ZZSA+je!W4flqOnp?jPaJntdbL&0BIaU%YOO^a+b3A1CoI4)! z9OsJCj91c|(X7ykuH#Lki`kDjbG;uPqWSz^$@$4~O}D6!&@NezM0-6k*Ea5c_xi|P zc_6?GeSghMPCU)FYrQk%6do0#rQ>(%Jj2!Oxp)LT_rp0`3KV!VyUW+ah737-@Jfu1 z5x;VrtJtrYuF*r_CwHy|u}`jCFMq(G?1MJp8M4_ixK#XX!{}pG1Qc#kqMLal!1AUw zoEgS`=O)4S%V)Yq+X~-nl-9}gE~VqMfEiVkwwqlqhEh(QDh==sOi=;|wnF*|I3ocW zg=Tm9Q|%*4;?`6*LXm}%`%%S+Is@zWi8rv0@p8dla?u0hNXbNJ$U)jN%-$@ptKYkm zfg-qrNslZLALDSgxX3P;9BrQA5XBdt|Gf5NUD!&Dv!eI+ zf*Qvp-oB5br6d7r_Xj@si>$h$-;PQ~?eNd?1B~Ckt*v+f_O3o{K_PWf@j~)=`+o@ckt%3{nJ!JC*PU*f z>#pRD=eK)?;O+=?X(s}%!S?60zMVYdo@Nn>^<rJ0AakL{t)N$I{dY%_MvXh3=vUl&v-PJ!>T&3Y zbFSI)QgY0Pj3xxv=--x_&On(XKe*m^nvLPRVL5E%C!DnNb z2%FSK{mLL}Xs9($Z;D$+k=YE-uyHJo20Vv98Jty)I=sLo_|9P|f)9~izuy@9ygY=a^Y2Gu zwykV!nWt@onrwV3{8WN^-#MGj#9tCUPbDUn1Yw9 z3H8s@oZX4kf~0Y#vCK6cc@@Q`Wg`3rz$=JzDj(0P^*veFN#>rMKN_OdFR8Ym(>l1H z=|*Jp6IwzYB25csi^3O=i=HoIY{u!GZPgl+2KAqEWbaB6c=GmilAb}8f7lp^7}wh2;UekYDNNkZ}9o{M#MML7Y4L=(@rGel|n-Czv? zUI^tEoPmIc#LB#Fq6X=l-r8WEtshG3iN7^Iiq{02=7Wvj1r|)M?6ef^kac{|fh_gr zXuqV;SW7CFvNVt2aHv%lmklcVS-a#-Wj3bImN=bCa>O!EYrQP-LcDl>oW0z1RPl06 zy%)r<%59eBM3a5ze%`|7&sd|?#Uugl(bmL1+{L`(nUFE8Fv(K$B^>dJkGmR;QY|LA z67O{w%%P!hPZUUXr60#ANIdInQCitUfl@j=!<8la)#*%eqrJUZyLR7p%++BT6xRV4 zTr`Rnz&e}=>*)4>miSv?ZJb5oNS2}Z8i--ZL(X%?L2fo^TGvg?-ZfzJC4M6o+?SO_4)U*W z61!o2Zp9oOANR)FLzoH$)wA<=zlXXT=iatonI%coJ)-f|4)(5nlpaSuna}Q_Wa#nM z(!)m5+RX-e0SF5Ui|`2v^9hRT3W`VyiAjnI@(2n_3JM;v{1X0u1RR~;zO(iH-vXjY zng0sd+rC8p5dZ-EzcYBebF^{yuyl0!-!dRcVUhpJOwHe`AY}lmN}7tb@)n{02O7?I AiU0rr diff --git a/logos/mariadb.svg b/logos/mariadb.svg new file mode 100644 index 00000000..ddbe283f --- /dev/null +++ b/logos/mariadb.svg @@ -0,0 +1,15 @@ + + + + + + MDB-VLogo_RGB + + + + + + + + + \ No newline at end of file diff --git a/mika/mariadb-agent/Chart.yaml b/mika/mariadb-agent/Chart.yaml index c611645a..00771368 100644 --- a/mika/mariadb-agent/Chart.yaml +++ b/mika/mariadb-agent/Chart.yaml @@ -10,7 +10,7 @@ keywords: - "agent" - "job" home: "https://github.com/irfanhakim-as/charts" -icon: "https://irfanhakim-as.github.io/charts/logos/mariadb.png" +icon: "https://irfanhakim-as.github.io/charts/logos/mariadb.svg" sources: - "https://github.com/irfanhakim-as/charts" maintainers: From 4e5cd3f4ecb18867858316c2ac521a79ff4f10cc Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 11:19:25 +0800 Subject: [PATCH 169/363] Upgrade chart version --- mika/mariadb-agent/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/Chart.yaml b/mika/mariadb-agent/Chart.yaml index 00771368..8dbafcc9 100644 --- a/mika/mariadb-agent/Chart.yaml +++ b/mika/mariadb-agent/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: mariadb-agent description: Easily create or delete multiple pairs of databases and users in a remote MariaDB instance. type: application -version: 0.1.1 +version: 0.1.2 appVersion: "11.1.3-debian-11-r0" keywords: - "mariadb" From a889f100983ddc24ba31bbc346d79c43f1389202 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:07:17 +0800 Subject: [PATCH 170/363] Add flag to prompt for password --- mika/mariadb-agent/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/templates/NOTES.txt b/mika/mariadb-agent/templates/NOTES.txt index aff74556..f636005b 100644 --- a/mika/mariadb-agent/templates/NOTES.txt +++ b/mika/mariadb-agent/templates/NOTES.txt @@ -37,7 +37,7 @@ The following are a list of database(s) you have supplied to be updated: Please run the following command for each database and check if they have been updated accordingly: ```sh - mysql -h {{ $mariadbHost }} -P {{ $mariadbPort }} -u -D + mysql -h {{ $mariadbHost }} -P {{ $mariadbPort }} -u -p -D ``` {{- end }} From 24853b0614d15bbdd792c790c9b0137887c1bffc Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:07:48 +0800 Subject: [PATCH 171/363] Replace mysql command with mariadb mysql command will be deprecated in future releases --- mika/mariadb-agent/templates/job.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/mariadb-agent/templates/job.yaml b/mika/mariadb-agent/templates/job.yaml index 94377f2b..b3b230c8 100644 --- a/mika/mariadb-agent/templates/job.yaml +++ b/mika/mariadb-agent/templates/job.yaml @@ -37,7 +37,7 @@ spec: args: - -c - >- - mysql -h $(DB_HOST) -P $(DB_PORT) -u $(ROOT_USER) -e ' + mariadb -h $(DB_HOST) -P $(DB_PORT) -u $(ROOT_USER) -e ' {{- range $databases }} {{- $create := .create }} {{- $drop := .drop }} From 35322f52afdfb540b6daad74db1acbb0988ed60d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:11:30 +0800 Subject: [PATCH 172/363] Add link to source proj --- mika/postgres-agent/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres-agent/README.md b/mika/postgres-agent/README.md index 5896bec7..70578392 100644 --- a/mika/postgres-agent/README.md +++ b/mika/postgres-agent/README.md @@ -1,4 +1,4 @@ -# Postgres-Agent +# [Postgres-Agent](https://github.com/postgres/postgres) Easily create or delete a database and user pair in a remote PostgreSQL instance. From def23d6493270039ee33c53a35b397f3982a451a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:17:17 +0800 Subject: [PATCH 173/363] Update desc --- mika/postgres/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index 145d2e9f..b231e853 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -6,7 +6,7 @@ # Default: "1" replicaCount: "" -# Container image used for PostgreSQL. +# Container images used for PostgreSQL. image: # The registry where the PostgreSQL container image is hosted. # Default: "docker.io" From 43800e2e1407e30d4e799b392bdd23c48fc7611c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:17:22 +0800 Subject: [PATCH 174/363] Move container image config --- mika/postgres/values.yaml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index b231e853..d0eb1024 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -8,18 +8,21 @@ replicaCount: "" # Container images used for PostgreSQL. image: - # The registry where the PostgreSQL container image is hosted. - # Default: "docker.io" - registry: "" - # The name of the repository that contains the PostgreSQL container image used. - # Default: "postgres" - repository: "" - # The tag that specifies the version of the PostgreSQL container image used. - # Default: Chart appVersion - tag: "" - # The policy that determines when Kubernetes should pull the PostgreSQL container image. - # Default: "IfNotPresent" - pullPolicy: "" + # PostgreSQL container image configurations. + # Source: https://hub.docker.com/_/postgres + postgres: + # The registry where the PostgreSQL container image is hosted. + # Default: "docker.io" + registry: "" + # The name of the repository that contains the PostgreSQL container image used. + # Default: "postgres" + repository: "" + # The tag that specifies the version of the PostgreSQL container image used. + # Default: Chart appVersion + tag: "" + # The policy that determines when Kubernetes should pull the PostgreSQL container image. + # Default: "IfNotPresent" + pullPolicy: "" # PostgreSQL configurations. postgres: From 0e0907f61b638f77480b205497aef791efc02d3b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:17:51 +0800 Subject: [PATCH 175/363] Add imagePullSecrets --- mika/postgres/values.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index d0eb1024..9e44cfe5 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -24,6 +24,12 @@ image: # Default: "IfNotPresent" pullPolicy: "" +# Credentials used to securely authenticate and authorise the pulling of container images from private registries. +# Example: +# imagePullSecrets: +# - name: "ghcr-token-secret" +imagePullSecrets: [] + # PostgreSQL configurations. postgres: # The name of the default PostgreSQL database. From fbf5390492971e046bf8024d3cc54fcb05310c4d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:24:27 +0800 Subject: [PATCH 176/363] Update sample value --- mika/postgres/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index 9e44cfe5..99982d74 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -35,12 +35,12 @@ postgres: # The name of the default PostgreSQL database. # Default: "default" # Example: - # name: "default" + # name: "postgres" name: "" # The username for accessing the PostgreSQL instance. # Default: "root" # Example: - # user: "root" + # user: "postgres" user: "" # The password for accessing the PostgreSQL instance. # Example: From 80cf7fb5385200969059797640aa6224e8943a6a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:35:26 +0800 Subject: [PATCH 177/363] Update value desc --- mika/postgres/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index 99982d74..34c184e2 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -32,17 +32,17 @@ imagePullSecrets: [] # PostgreSQL configurations. postgres: - # The name of the default PostgreSQL database. + # The name of the default database of the root PostgreSQL database user. # Default: "default" # Example: # name: "postgres" name: "" - # The username for accessing the PostgreSQL instance. + # The root username or user account of the PostgreSQL database server. # Default: "root" # Example: # user: "postgres" user: "" - # The password for accessing the PostgreSQL instance. + # The password associated with the root PostgreSQL database user. # Example: # pass: "password" pass: "" From acd7bd4458d718ca94caca6e5d6409d2e9883712 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:36:08 +0800 Subject: [PATCH 178/363] Rename value --- mika/postgres/templates/secret.yaml | 2 +- mika/postgres/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/postgres/templates/secret.yaml b/mika/postgres/templates/secret.yaml index 700c9c15..b43f5080 100644 --- a/mika/postgres/templates/secret.yaml +++ b/mika/postgres/templates/secret.yaml @@ -1,6 +1,6 @@ {{- $postgres_name := .Values.postgres.name | default "default" | toString | b64enc }} {{- $postgres_user := .Values.postgres.user | default "root" | toString | b64enc }} -{{- $postgres_pass := .Values.postgres.pass | toString | b64enc }} +{{- $postgres_pass := .Values.postgres.password | toString | b64enc }} apiVersion: v1 kind: Secret metadata: diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index 34c184e2..c738261a 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -44,8 +44,8 @@ postgres: user: "" # The password associated with the root PostgreSQL database user. # Example: - # pass: "password" - pass: "" + # password: "password" + password: "" # PostgreSQL data configurations. data: # The amount of persistent storage allocated for the PostgreSQL instance. From 61d2aee7328a02aee9566e65eede1685c8908640 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:38:48 +0800 Subject: [PATCH 179/363] Update data pvc values --- mika/postgres/values.yaml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index c738261a..94abe772 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -46,17 +46,38 @@ postgres: # Example: # password: "password" password: "" - # PostgreSQL data configurations. + +# Storage configurations. +storage: + # Data storage configurations. data: - # The amount of persistent storage allocated for the PostgreSQL instance. + # Specifies whether persistent storage should be provisioned for data storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the data storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" + # The path where the data storage should be mounted on the container. + # Default: "/var/lib/postgresql/data" + # Example: + # mountPath: "/data" + mountPath: "" + # The subpath within the data storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Data" + subPath: "" + # The default amount of persistent storage allocated for the data storage. # Default: "1Gi" # Example: - # storage: "1Gi" + # storage: "10Gi" storage: "" - # The storage class name used for dynamically provisioning a persistent volume for the PostgreSQL storage. + # The storage class name used for dynamically provisioning a persistent volume for the data storage. # Default: "longhorn" # Example: - # storageClassName: "longhorn" + # storageClassName: "smb" storageClassName: "" # Resource requirements and limits for PostgreSQL. From de944ec03f87b024280d0e2f932b0d4bddc7b1d6 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:40:02 +0800 Subject: [PATCH 180/363] Refactor pvc --- mika/postgres/templates/pvc.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mika/postgres/templates/pvc.yaml b/mika/postgres/templates/pvc.yaml index 93e8a4db..a9da2beb 100644 --- a/mika/postgres/templates/pvc.yaml +++ b/mika/postgres/templates/pvc.yaml @@ -1,5 +1,9 @@ -{{- $storage := .Values.postgres.data.storage | default "1Gi" | toString | quote }} -{{- $storage_class_name := .Values.postgres.data.storageClassName | default "longhorn" | toString | quote }} +{{- $dataPersistence := .Values.storage.data.enabled }} +{{- $dataAccessMode := .Values.storage.data.accessMode | default "ReadWriteMany" | toString | quote }} +{{- $dataStorage := .Values.storage.data.storage | default "1Gi" | toString | quote }} +{{- $dataStorageClassName := .Values.storage.data.storageClassName | default "longhorn" | toString | quote }} +{{- if $dataPersistence }} +--- apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -8,8 +12,9 @@ metadata: {{- include "postgres.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $dataAccessMode }} resources: requests: - storage: {{ $storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $dataStorage }} + storageClassName: {{ $dataStorageClassName }} +{{- end }} From 74b635ebf34eeb7f6e4d8ccf082e9d7ead73ab72 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:44:13 +0800 Subject: [PATCH 181/363] Add new service config --- mika/postgres/values.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index 94abe772..5652a10a 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -47,6 +47,23 @@ postgres: # password: "password" password: "" +# Service configurations. +service: + # The optional node port to expose when the service type is NodePort. + # Example: + # nodePort: "32000" + nodePort: "" + # The port on which the PostgreSQL server should listen for connections. + # Default: "5432" + # Example: + # port: "8080" + port: "" + # The type of service used to expose PostgreSQL services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" + # Storage configurations. storage: # Data storage configurations. From 048dbdf6131b7b65ebaa0119632ac9d2268165b0 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:44:25 +0800 Subject: [PATCH 182/363] Update svc to be more configurable --- mika/postgres/templates/service.yaml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/mika/postgres/templates/service.yaml b/mika/postgres/templates/service.yaml index a097dbbe..56666814 100644 --- a/mika/postgres/templates/service.yaml +++ b/mika/postgres/templates/service.yaml @@ -1,3 +1,7 @@ +{{- $nodePort := .Values.service.nodePort | toString }} +{{- $port := .Values.service.port | default "5432" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +--- apiVersion: v1 kind: Service metadata: @@ -5,11 +9,14 @@ metadata: labels: {{- include "postgres.labels" . | nindent 4 }} spec: - type: ClusterIP + type: {{ $type }} ports: - - port: 5432 + - port: {{ int $port }} targetPort: postgres + {{- if and (eq $type "NodePort") $nodePort }} + nodePort: {{ int $nodePort }} + {{- end }} protocol: TCP - name: {{ .Release.Name }}-postgres + name: postgres selector: {{- include "postgres.selectorLabels" . | nindent 4 }} From 78870983f7bd39c95b255442ba54137fbed29724 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:49:22 +0800 Subject: [PATCH 183/363] Move values --- mika/clog/values.yaml | 8 ++++---- mika/rizz/values.yaml | 8 ++++---- template/chartName/values.yaml | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/mika/clog/values.yaml b/mika/clog/values.yaml index 7d4b5820..0c570734 100644 --- a/mika/clog/values.yaml +++ b/mika/clog/values.yaml @@ -128,6 +128,10 @@ ingress: # Example: # clusterIssuer: "letsencrypt-http-prod" clusterIssuer: "" + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false # Additional configuration annotations to be added to the Ingress resource. # Items: `.prefix`, `.name`, `.value` # Example: @@ -146,10 +150,6 @@ ingress: # # value: "120" # value: "" customAnnotations: [] - # Specifies whether the WWW subdomain should be enabled. - # Example: - # www: true - www: false # Service configurations. service: diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index c0bb8c10..3c3a0ed4 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -276,6 +276,10 @@ ingress: # Example: # clusterIssuer: "letsencrypt-http-prod" clusterIssuer: "" + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false # Additional configuration annotations to be added to the Ingress resource. # Items: `.prefix`, `.name`, `.value` # Example: @@ -294,10 +298,6 @@ ingress: # # value: "120" # value: "" customAnnotations: [] - # Specifies whether the WWW subdomain should be enabled. - # Example: - # www: true - www: false # Service configurations. service: diff --git a/template/chartName/values.yaml b/template/chartName/values.yaml index ea2f12f5..976b3060 100644 --- a/template/chartName/values.yaml +++ b/template/chartName/values.yaml @@ -79,6 +79,10 @@ ingress: # Example: # clusterIssuer: "letsencrypt-http-prod" clusterIssuer: "" + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false # Additional configuration annotations to be added to the Ingress resource. # Items: `.prefix`, `.name`, `.value` # Example: @@ -97,10 +101,6 @@ ingress: # # value: "120" # value: "" customAnnotations: [] - # Specifies whether the WWW subdomain should be enabled. - # Example: - # www: true - www: false # Service configurations. service: From e1d48b82abf65ab8dcd0ea8bdc11e53d6d947a48 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:54:53 +0800 Subject: [PATCH 184/363] Update val desc --- mika/postgres-agent/README.md | 6 +++--- mika/postgres-agent/values.yaml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/postgres-agent/README.md b/mika/postgres-agent/README.md index 70578392..0f157bc6 100644 --- a/mika/postgres-agent/README.md +++ b/mika/postgres-agent/README.md @@ -135,7 +135,7 @@ Easily create or delete a database and user pair in a remote PostgreSQL instance | postgres.databases | list | `[]` | Database configurations array. Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | | postgres.host | string | `""` | The hostname or IP address of the PostgreSQL database server. | | postgres.port | string | `""` | The port number the PostgreSQL database server is listening for connections. Default: `"5432"`. | -| postgres.root.database | string | `""` | The name of the database being used by the PostgreSQL database server root user. Default: `$user`. | -| postgres.root.password | string | `""` | The password associated with the PostgreSQL database server root user. | -| postgres.root.user | string | `""` | The username or user account for accessing the PostgreSQL database server as root. Default: `"postgres"`. | +| postgres.root.database | string | `""` | The name of the default database of the root PostgreSQL database user. Default: `$user`. | +| postgres.root.password | string | `""` | The password associated with the root PostgreSQL database user. | +| postgres.root.user | string | `""` | The root username or user account of the PostgreSQL database server. Default: `"postgres"`. | | resources.postgres | object | `{}` | PostgreSQL container resources. | \ No newline at end of file diff --git a/mika/postgres-agent/values.yaml b/mika/postgres-agent/values.yaml index 449724cb..b55317b0 100644 --- a/mika/postgres-agent/values.yaml +++ b/mika/postgres-agent/values.yaml @@ -39,17 +39,17 @@ postgres: port: "" # PostgreSQL database server root user configurations. root: - # The name of the database being used by the PostgreSQL database server root user. + # The name of the default database of the root PostgreSQL database user. # Default: $user # Example: # database: "postgres" database: "" - # The username or user account for accessing the PostgreSQL database server as root. + # The root username or user account of the PostgreSQL database server. # Default: "postgres" # Example: # user: "root" user: "" - # The password associated with the PostgreSQL database server root user. + # The password associated with the root PostgreSQL database user. # Example: # password: "password" password: "" From e5ee241083f8a1c0b551017204814e5971f60c1b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:55:10 +0800 Subject: [PATCH 185/363] Update val desc --- mika/mariadb-agent/README.md | 4 ++-- mika/mariadb-agent/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/mariadb-agent/README.md b/mika/mariadb-agent/README.md index 7d5c9a29..19822a72 100644 --- a/mika/mariadb-agent/README.md +++ b/mika/mariadb-agent/README.md @@ -135,6 +135,6 @@ Easily create or delete multiple pairs of databases and users in a remote MariaD | mariadb.databases | list | `[]` | Database configurations array. Items: `.name`, `.user`, `.password`, `.create`, `.drop`, `.custom`, `.custom_command`. | | mariadb.host | string | `""` | The hostname or IP address of the MariaDB database server. | | mariadb.port | string | `""` | The port number the MariaDB database server is listening for connections. Default: `"3306"`. | -| mariadb.root.password | string | `""` | The password associated with the MariaDB database server root user. | -| mariadb.root.user | string | `""` | The username or user account for accessing the MariaDB database server as root. Default: `"root"`. | +| mariadb.root.password | string | `""` | The password associated with the root MariaDB database user. | +| mariadb.root.user | string | `""` | The root username or user account of the MariaDB database server. Default: `"root"`. | | resources.mariadb | object | `{}` | MariaDB container resources. | diff --git a/mika/mariadb-agent/values.yaml b/mika/mariadb-agent/values.yaml index a476db0e..5b7a9285 100644 --- a/mika/mariadb-agent/values.yaml +++ b/mika/mariadb-agent/values.yaml @@ -39,12 +39,12 @@ mariadb: port: "" # MariaDB database server root user configurations. root: - # The username or user account for accessing the MariaDB database server as root. + # The root username or user account of the MariaDB database server. # Default: "root" # Example: # user: "mariadb" user: "" - # The password associated with the MariaDB database server root user. + # The password associated with the root MariaDB database user. # Example: # password: "password" password: "" From 0390f0b76cb6d979c93bbc858b293e9fa7f147a7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:59:47 +0800 Subject: [PATCH 186/363] Added ingress config --- mika/postgres/values.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index 5652a10a..9d393fd2 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -47,6 +47,40 @@ postgres: # password: "password" password: "" +# Ingress configurations. +ingress: + # Specifies whether Ingress should be enabled for hosting PostgreSQL services. + # Example: + # enabled: true + enabled: false + # The name of the cluster issuer for Ingress. + # Default: "letsencrypt-dns-prod" + # Example: + # clusterIssuer: "letsencrypt-http-prod" + clusterIssuer: "" + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false + # Additional configuration annotations to be added to the Ingress resource. + # Items: `.prefix`, `.name`, `.value` + # Example: + # customAnnotations: + # # The prefix of the annotation. + # # Default: "nginx.ingress.kubernetes.io" + # # Example: + # # prefix: "nginx.org" + # - prefix: "" + # # The name of the annotation. + # # Example: + # # name: "proxy-connect-timeout" + # name: "" + # # The value of the annotation. + # # Example: + # # value: "120" + # value: "" + customAnnotations: [] + # Service configurations. service: # The optional node port to expose when the service type is NodePort. From 083e4974cd5ccceb0f9c30a8477e2fe7fd339e5f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 12:59:54 +0800 Subject: [PATCH 187/363] Added domain val for when enabling ingress --- mika/postgres/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index 9d393fd2..a2f66ac6 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -32,6 +32,10 @@ imagePullSecrets: [] # PostgreSQL configurations. postgres: + # The ingress domain name that hosts the PostgreSQL server. + # Example: + # domain: "postgres.example.com" + domain: "" # The name of the default database of the root PostgreSQL database user. # Default: "default" # Example: From 622226f6e050fe1e65b0fed13afc046a02422303 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 13:00:12 +0800 Subject: [PATCH 188/363] Add ingress resource --- mika/postgres-agent/templates/ingress.yaml | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 mika/postgres-agent/templates/ingress.yaml diff --git a/mika/postgres-agent/templates/ingress.yaml b/mika/postgres-agent/templates/ingress.yaml new file mode 100644 index 00000000..8ad324bd --- /dev/null +++ b/mika/postgres-agent/templates/ingress.yaml @@ -0,0 +1,60 @@ +{{- $ingress := .Values.ingress.enabled }} +{{- $www := .Values.ingress.www }} +{{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $customAnnotations := .Values.ingress.customAnnotations }} +{{- $domain := .Values.postgres.domain | toString }} +{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} +{{- if and $ingress $domain }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-postgres-ingress + labels: + {{- include "postgres.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: {{ $clusterIssuer }} + cert-manager.io/private-key-algorithm: "ECDSA" + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/affinity-mode: "persistent" + nginx.ingress.kubernetes.io/proxy-body-size: "100m" + nginx.ingress.kubernetes.io/session-cookie-expires: "172800" + nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" + nginx.ingress.kubernetes.io/session-cookie-name: "route" + nginx.org/client-max-body-size: "100m" + {{- range $customAnnotations }} + {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} + {{- end }} +spec: + ingressClassName: "nginx" + rules: + - host: {{ $domain | quote }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-postgres-svc + port: + name: postgres + path: / + pathType: Prefix + {{- if $www }} + - host: {{ $wwwDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-postgres-svc + port: + name: postgres + path: / + pathType: Prefix + {{- end }} + tls: + - hosts: + - {{ $domain | quote }} + {{- if $www }} + - {{ $wwwDomain }} + {{- end }} + secretName: {{ .Release.Name }}-postgres-tls-cert +{{- end }} From 316f119deacb412cf477c9e81d9c6b0391286ae1 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 13:06:36 +0800 Subject: [PATCH 189/363] Move postgres resources val --- mika/postgres/templates/deployment.yaml | 2 +- mika/postgres/values.yaml | 46 ++++++++++++++----------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/mika/postgres/templates/deployment.yaml b/mika/postgres/templates/deployment.yaml index 9de7da90..d9ed994a 100644 --- a/mika/postgres/templates/deployment.yaml +++ b/mika/postgres/templates/deployment.yaml @@ -32,7 +32,7 @@ spec: containerPort: 5432 protocol: TCP resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.resources.postgres | nindent 12 }} env: - name: POSTGRES_DB valueFrom: diff --git a/mika/postgres/values.yaml b/mika/postgres/values.yaml index a2f66ac6..0ed12de9 100644 --- a/mika/postgres/values.yaml +++ b/mika/postgres/values.yaml @@ -135,25 +135,29 @@ storage: # storageClassName: "smb" storageClassName: "" -# Resource requirements and limits for PostgreSQL. +# Resource requirements and limits for PostgreSQL containers. resources: - # The minimum amount of resources required by PostgreSQL to run. - requests: - # The minimum amount of CPU resources required by PostgreSQL. - # Example: - # cpu: "10m" - cpu: "10m" - # The minimum amount of memory required by PostgreSQL. - # Example: - # memory: "10Mi" - memory: "100Mi" - # The maximum amount of resources allowed for PostgreSQL. - limits: - # The maximum amount of CPU resources allowed for PostgreSQL. - # Example: - # cpu: "250m" - cpu: "250m" - # The maximum amount of memory allowed for PostgreSQL. - # Example: - # memory: "250Mi" - memory: "250Mi" + # PostgreSQL container resources. + # Example: + # postgres: + # # The minimum amount of resources required by PostgreSQL to run. + # requests: + # # The minimum amount of CPU resources required by PostgreSQL. + # # Example: + # # cpu: "10m" + # cpu: "10m" + # # The minimum amount of memory required by PostgreSQL. + # # Example: + # # memory: "10Mi" + # memory: "100Mi" + # # The maximum amount of resources allowed for PostgreSQL. + # limits: + # # The maximum amount of CPU resources allowed for PostgreSQL. + # # Example: + # # cpu: "250m" + # cpu: "250m" + # # The maximum amount of memory allowed for PostgreSQL. + # # Example: + # # memory: "250Mi" + # memory: "250Mi" + postgres: {} From 3ba413cfc75654c4f61d70ac2033685114f190d2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 16:48:16 +0800 Subject: [PATCH 190/363] Add separator --- mika/postgres/templates/deployment.yaml | 1 + mika/postgres/templates/secret.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/mika/postgres/templates/deployment.yaml b/mika/postgres/templates/deployment.yaml index d9ed994a..1be72bff 100644 --- a/mika/postgres/templates/deployment.yaml +++ b/mika/postgres/templates/deployment.yaml @@ -3,6 +3,7 @@ {{- $repository := .Values.image.repository | default "postgres" | toString }} {{- $tag := .Values.image.tag | default .Chart.AppVersion | toString }} {{- $pullPolicy := .Values.image.pullPolicy | default "IfNotPresent" | toString | quote }} +--- apiVersion: apps/v1 kind: Deployment metadata: diff --git a/mika/postgres/templates/secret.yaml b/mika/postgres/templates/secret.yaml index b43f5080..0299254d 100644 --- a/mika/postgres/templates/secret.yaml +++ b/mika/postgres/templates/secret.yaml @@ -1,6 +1,7 @@ {{- $postgres_name := .Values.postgres.name | default "default" | toString | b64enc }} {{- $postgres_user := .Values.postgres.user | default "root" | toString | b64enc }} {{- $postgres_pass := .Values.postgres.password | toString | b64enc }} +--- apiVersion: v1 kind: Secret metadata: From cf4614997d89d1448b4b4896504966bf3031f890 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 16:51:22 +0800 Subject: [PATCH 191/363] Update var names --- mika/postgres/templates/secret.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/postgres/templates/secret.yaml b/mika/postgres/templates/secret.yaml index 0299254d..4426f368 100644 --- a/mika/postgres/templates/secret.yaml +++ b/mika/postgres/templates/secret.yaml @@ -1,6 +1,6 @@ -{{- $postgres_name := .Values.postgres.name | default "default" | toString | b64enc }} -{{- $postgres_user := .Values.postgres.user | default "root" | toString | b64enc }} -{{- $postgres_pass := .Values.postgres.password | toString | b64enc }} +{{- $postgresDB := .Values.postgres.name | default "default" | toString | b64enc }} +{{- $postgresUser := .Values.postgres.user | default "root" | toString | b64enc }} +{{- $postgresPassword := .Values.postgres.password | toString | b64enc }} --- apiVersion: v1 kind: Secret @@ -10,6 +10,6 @@ metadata: {{- include "postgres.labels" . | nindent 4 }} type: Opaque data: - DB_NAME: {{ $postgres_name }} - DB_USER: {{ $postgres_user }} - DB_PASS: {{ $postgres_pass }} + DB_NAME: {{ $postgresDB }} + DB_USER: {{ $postgresUser }} + DB_PASS: {{ $postgresPassword }} From 6a81854b777b30798e67d2fd6c2f42c731a4014e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 16:59:10 +0800 Subject: [PATCH 192/363] Update secret keys --- mika/postgres/templates/secret.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/postgres/templates/secret.yaml b/mika/postgres/templates/secret.yaml index 4426f368..fe65f6d1 100644 --- a/mika/postgres/templates/secret.yaml +++ b/mika/postgres/templates/secret.yaml @@ -10,6 +10,6 @@ metadata: {{- include "postgres.labels" . | nindent 4 }} type: Opaque data: - DB_NAME: {{ $postgresDB }} - DB_USER: {{ $postgresUser }} - DB_PASS: {{ $postgresPassword }} + POSTGRES_DB: {{ $postgresDB }} + POSTGRES_USER: {{ $postgresUser }} + POSTGRES_PASSWORD: {{ $postgresPassword }} From 651f11ad1c0ace27338685b709b39efd277a2c68 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:00:31 +0800 Subject: [PATCH 193/363] Add PGDATA to secret --- mika/postgres/templates/secret.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/postgres/templates/secret.yaml b/mika/postgres/templates/secret.yaml index fe65f6d1..ceedade0 100644 --- a/mika/postgres/templates/secret.yaml +++ b/mika/postgres/templates/secret.yaml @@ -1,6 +1,7 @@ {{- $postgresDB := .Values.postgres.name | default "default" | toString | b64enc }} {{- $postgresUser := .Values.postgres.user | default "root" | toString | b64enc }} {{- $postgresPassword := .Values.postgres.password | toString | b64enc }} +{{- $dataMountPath := .Values.storage.data.mountPath | default "/var/lib/postgresql/data" | toString | b64enc }} --- apiVersion: v1 kind: Secret @@ -13,3 +14,4 @@ data: POSTGRES_DB: {{ $postgresDB }} POSTGRES_USER: {{ $postgresUser }} POSTGRES_PASSWORD: {{ $postgresPassword }} + PGDATA: {{ $dataMountPath }} From c649ba27689b8c59573431e6dccd3bd6f586bdaa Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:05:03 +0800 Subject: [PATCH 194/363] Update var name --- mika/postgres/templates/deployment.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mika/postgres/templates/deployment.yaml b/mika/postgres/templates/deployment.yaml index 1be72bff..e61226bb 100644 --- a/mika/postgres/templates/deployment.yaml +++ b/mika/postgres/templates/deployment.yaml @@ -1,3 +1,7 @@ +{{- $postgres_registry := .Values.image.postgres.registry | default "docker.io" | toString }} +{{- $postgres_repository := .Values.image.postgres.repository | default "postgres" | toString }} +{{- $postgres_tag := .Values.image.postgres.tag | default .Chart.AppVersion | toString }} +{{- $postgres_pullPolicy := .Values.image.postgres.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $registry := .Values.image.registry | default "docker.io" | toString }} {{- $repository := .Values.image.repository | default "postgres" | toString }} @@ -26,8 +30,8 @@ spec: spec: containers: - name: postgres - image: {{ printf "%s/%s:%s" $registry $repository $tag | quote }} - imagePullPolicy: {{ $pullPolicy }} + image: {{ printf "%s/%s:%s" $postgres_registry $postgres_repository $postgres_tag | quote }} + imagePullPolicy: {{ $postgres_pullPolicy }} ports: - name: postgres containerPort: 5432 From 41f4ede15348b001653b8e3ba1e0536ddd8d67f9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:05:20 +0800 Subject: [PATCH 195/363] Add imagepullsecrets --- mika/postgres/templates/deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mika/postgres/templates/deployment.yaml b/mika/postgres/templates/deployment.yaml index e61226bb..406887b4 100644 --- a/mika/postgres/templates/deployment.yaml +++ b/mika/postgres/templates/deployment.yaml @@ -28,6 +28,10 @@ spec: labels: {{- include "postgres.selectorLabels" . | nindent 8 }} spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: postgres image: {{ printf "%s/%s:%s" $postgres_registry $postgres_repository $postgres_tag | quote }} From 245f518c778b449acb9beeafa820966866813224 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:06:24 +0800 Subject: [PATCH 196/363] Get env vars from secret --- mika/postgres/templates/deployment.yaml | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/mika/postgres/templates/deployment.yaml b/mika/postgres/templates/deployment.yaml index 406887b4..872adf32 100644 --- a/mika/postgres/templates/deployment.yaml +++ b/mika/postgres/templates/deployment.yaml @@ -42,24 +42,10 @@ spec: protocol: TCP resources: {{- toYaml .Values.resources.postgres | nindent 12 }} - env: - - name: POSTGRES_DB - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-postgres-secret - key: DB_NAME - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-postgres-secret - key: DB_USER - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-postgres-secret - key: DB_PASS - - name: PGDATA - value: /var/lib/postgresql/data/pgdata + envFrom: + - secretRef: + name: {{ .Release.Name }}-postgres-secret + {{- if or $dataPersistence }} volumeMounts: - name: {{ .Release.Name }}-postgres-data mountPath: /var/lib/postgresql/data From ff83031d8eb36e8d2d0ded672e0a0fbfbc2d6549 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:06:44 +0800 Subject: [PATCH 197/363] Update data storage mounts --- mika/postgres/templates/deployment.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/mika/postgres/templates/deployment.yaml b/mika/postgres/templates/deployment.yaml index 872adf32..469a3305 100644 --- a/mika/postgres/templates/deployment.yaml +++ b/mika/postgres/templates/deployment.yaml @@ -1,12 +1,11 @@ +{{- $dataPersistence := .Values.storage.data.enabled }} {{- $postgres_registry := .Values.image.postgres.registry | default "docker.io" | toString }} {{- $postgres_repository := .Values.image.postgres.repository | default "postgres" | toString }} {{- $postgres_tag := .Values.image.postgres.tag | default .Chart.AppVersion | toString }} {{- $postgres_pullPolicy := .Values.image.postgres.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} -{{- $registry := .Values.image.registry | default "docker.io" | toString }} -{{- $repository := .Values.image.repository | default "postgres" | toString }} -{{- $tag := .Values.image.tag | default .Chart.AppVersion | toString }} -{{- $pullPolicy := .Values.image.pullPolicy | default "IfNotPresent" | toString | quote }} +{{- $dataMountPath := .Values.storage.data.mountPath | default "/var/lib/postgresql/data" | toString | quote }} +{{- $dataSubPath := .Values.storage.data.subPath | toString }} --- apiVersion: apps/v1 kind: Deployment @@ -47,9 +46,19 @@ spec: name: {{ .Release.Name }}-postgres-secret {{- if or $dataPersistence }} volumeMounts: + {{- if $dataPersistence }} - name: {{ .Release.Name }}-postgres-data - mountPath: /var/lib/postgresql/data + mountPath: {{ $dataMountPath }} + {{- if $dataSubPath }} + subPath: {{ $dataSubPath | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- if or $dataPersistence }} volumes: + {{- if $dataPersistence }} - name: {{ .Release.Name }}-postgres-data persistentVolumeClaim: claimName: {{ .Release.Name }}-postgres-data-pvc + {{- end }} + {{- end }} From b55fcdba893364444802b25c71b84756653ecac8 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:13:18 +0800 Subject: [PATCH 198/363] Update chart notes --- mika/postgres/templates/NOTES.txt | 47 +++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/mika/postgres/templates/NOTES.txt b/mika/postgres/templates/NOTES.txt index 1d671717..5bab21b8 100644 --- a/mika/postgres/templates/NOTES.txt +++ b/mika/postgres/templates/NOTES.txt @@ -1,5 +1,46 @@ -PostgreSQL is now installed and configured for {{ .Release.Name | toString }}. +{{- $serviceAddress := "" }} +{{- $ingress := .Values.ingress.enabled }} +{{- $domain := .Values.postgres.domain | toString }} +{{- $port := .Values.service.port | default "5432" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +{{- $serviceName := printf "%s-postgres-svc" .Release.Name | toString }} +PostgreSQL has been installed and configured for {{ .Release.Name | toString }} 🎉 -See the values.yaml file of this chart for more configuration options. +{{- if $ingress }} + {{- $serviceAddress = printf "https://%s" $domain | toString }} +{{- else if or (eq $type "ClusterIP") (eq $type "LoadBalancer") (eq $type "NodePort") }} -Please refer to the official documentation for more information on how to use PostgreSQL. +Please run the following command(s) to obtain the right address to the service: + + ```sh + {{- if eq $type "ClusterIP" }} + {{- $forwardPort := "8080" | toString }} + {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} + export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "postgres.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} + {{- else if eq $type "LoadBalancer" }} + {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $port | toString }} + export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} --template "{{"{{- range (index .status.loadBalancer.ingress 0) }}{{ . }}{{- end }}"}}") + {{- else if eq $type "NodePort" }} + {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") + {{- end }} + ``` + +{{- end }} + +Visit the following service(s) at the provided address: + +{{- if $serviceAddress }} + + - PostgreSQL: {{ $serviceAddress }} + +{{- else }} + + ⚠️ This chart may have no accessible services available + +{{- end }} + +For more information on how to use and configure PostgreSQL, please refer to the official documentation. \ No newline at end of file From ba3a1676abf04933b36d7cdf6b067024e71f493c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:14:28 +0800 Subject: [PATCH 199/363] Use svg logo --- mika/postgres/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres/Chart.yaml b/mika/postgres/Chart.yaml index e5f6de49..e36b7a2e 100644 --- a/mika/postgres/Chart.yaml +++ b/mika/postgres/Chart.yaml @@ -11,7 +11,7 @@ keywords: - "Relational" - "Database" home: "https://github.com/irfanhakim-as/charts" -icon: "https://irfanhakim-as.github.io/charts/logos/postgres.png" +icon: "https://irfanhakim-as.github.io/charts/logos/postgres.svg" sources: - "https://github.com/irfanhakim-as/charts" maintainers: From 7fb393538ea647f74f74cb1abfb25a2cf6f6ccb4 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:14:41 +0800 Subject: [PATCH 200/363] Remove unused logo --- logos/postgres.png | Bin 10825 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 logos/postgres.png diff --git a/logos/postgres.png b/logos/postgres.png deleted file mode 100644 index 71d6980ccb4fe0bf22092b304abf035cc90f1b0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10825 zcmZ{KWl$VU%rNfmu7%?6Zil-beh0<-;O-Rn;_gX6&9IN)BpjV^ zVuL7ln-mJ;*sGhnqqED0r)T{y6=E*g0R_<90x%`LHU0iTy6jCJKfXMQ&dzG5D@TA+u7O0$H%`DJUl$_ zcx7d!p`pRh&=5|@Ob(d5{|Dwbskfc~@ZMf~ z^`UPw?|PAMZ#i$*|JMKx4u}cNf`g-jQ&EuB_g&dBbMV>fB+zH@v+VuJVT+1ryWUUW ze)jfeZWJ|`Dh!i}=zjVK-pf~4Oi`VmpXWrrm~D6f^h_isS1<8gy}%ShXv{pC9#o&A$7j zNcLK6>~MG$aogGxw-4@416eI6YIT%Wd(4g7g(We-h3cpMvOgcNuqZ&!h4y=X?#j{i zvXqB%(&O4}Z>N(UP_JG!Vv#ne`@22Xx_{mRf3M?>(p|ly*jbexv}rSX&NV;`N^<-V z+*4FA94u{FPYRiB^*ilJ3|a#{Y%2*1o-j4FN^gD9^#}lt+jYrZN?K=kEeE4-2BJD8vG+cy%P#E{x{PJZ|XQ^Hn&D-?IC2Y4!u0;}h*QI`ycjnwT$;eQvlo4B2ydwym%=UjxnCA(HJlpMs(KXK_-67-LVlqLqI^bMbSrbjpoq*Az`rU*Ah=b6{fGn@$X)kWrwURy8 zi2JE6hO>GK$51+Vf>a#miMNNOYNYuijdn-NO8Fexwifn6mkaAwq*}oJK?qmn|eCBbZQLEPCpHr0G4) zf6|iO8#gk)d0ZpczU$s$$e#80OO966-v?u(Me={_Mn{Q`0U+a~ZQw$&d5zFf#uafr zXyHHECj53GItA@4fpOj{6BXk=?eB_(iWUKwS}xjkFEX55C!780nSpzvM;PGHfS-old4Ts~ zGdwSS7}m#6iM8tJ=_10~7Iz_BO63-@kDQv2(V6?jXqn)8aO+MY^_xk?5|+n`XJYp% zNXPGj|L6TmFP=f9>!Hv#y|w_A)M#<;1W#LStjU?m)a+3Wi})`Y|00&sq$|yEPgzf^ zlNFs3k$nHQ-qPoJ`p%v>CNzTaE)qu_ZS)binOX0Wa&!W#f*X#xpT(&$L#^MIAMB=W z`r>rw$}x*YOx$2%M20$s;BTI`<=?Cau`uU;svk6dIm_22_*6yn@kD`u9ES*AmJ^WG zJd!j>2DIR&hFF>6!F|~X3oBF7O&&%&A8WP$Bh8KiAihz=;+hpx#kybwq%)_WF9?_{ z_Ag~LmS@b4>WK!*O3kzOMt1=iBwCafM}cnE+GKI0^QG6l8Pm5K)9iN>Zb-ieaM zCN@p6?5RK!6xqt0+4%d&E)?+P>k&%27rxsv5do^_CrIOj%}TubSj9Kbj3rORw6#i) z8`8+kB8*JhS8;>wOzh>oMn+Ru^@}=CH;^l5p)9jHOb?Y%61h5avNqX}0tjY)E{COx zf+GbIF-|*K=zBeo8kUm2I`y+Ow^IC)N*}$`?KO#dQ$;&e&4+!71Nt!-I_%Uqu+8Gi zMkzZT<)ht;z-Qj2VD&Q)h#+H@5;tEVK_~yrk`kmdPP;puZU+=mg{!n7`p=LcqD zJQ`WviEwBmp^ih2J%y$OmrpZfXidd`0mK0Kz}q8gIz$;e-iz8r;q%M9ht07pEVv~t zi8lzcUx0(1i=Ql}5m*ITR=!{t3Vk-NcwvI<$;l{fah)s$`U(KcSw1X^hXG8nJBCjwoZrM^ ze=O`_87{e^d4T0NDu9hQY*qyj$5gX5Ck9OT55E%g?x)E)q&Jm0bBq=k8rC!V>XT#s zI>un->FyN8xJHA;keWZeggU6^kIH>Jd^SJ({=LK}4~*>ZJ6ghd>KE#7O{8iVNs9gz zZ?ub@eFJ%}l#<3KCk(M%{^c5iJU~)xV$8mlM08}ra&B;mJQ!!r#*4)8VOYHzk?!vI zz(qz;#Z|1Ff_q%7z&!>mRAVf&KzvwxZBr(Eci7xeHpQ1!aogrc7{`~ZN)g6A&28|1 z)piz0FkFi-!o5HgT{7N;&ChX~_{y{O8x9=j#moKJNZjZz5f*0_A_}B>K)io| z&8}z%R#D6I15cz?c84!zbX`q2X}Ap;bBSTne7UGE)&leEpJYA$_*7^VoQ32;(tm}Y zi*zWRw|u4zq(F!LJ6dGX=M!o>w~Y)(qP;agyKvxv+Yujkn*?=_iNfIDh+0ml5)n#h zLMn)x?G-OkH1gD@;2kHE(Yys;c7b5W6bp?c|1Sb>f1v<>1AuF z^o@3$yKAXDRjV#nF)Tm^v14CC;5Z&905`Uz+UTp9UBWe}MR4(2EoIS4dY%Foq$u;r z+)izQZA7_)BIrF|_fHe(r{g>1$w01t}ONpXM84)}#&2 z_AFfYGDvey&TTASCW21iuDlD5|2tOwir;JT36iz65WAZ>xVt0frYZIP&BI)`wH*ul zS7MFe%5G9Og8NHvj`lgC_!~cq4$wc;jQyv52u@b&LY=xXL?y25X*LY7?rje>c;$Zh zRM%``T-UL_`stYEa!R=1Oc)|$7!PR7Jgr7htHEvy3I+I$7LIRm+@$>qtnoQB9+q7g zHs3M+Dwz#T2jom2ACh8aLV(dUEEK*1+XsK4R^11%h|Ux1Pie!6hn9c$ORzb(Q<0R4 z>eygsTC%V3K87^<>qStk?qC+iIu2%rD0(KAxaiW{{ zF>sv$s653&y*xzxnrLD)7$~Bf`tXY~W(62XZTD-aTm+?Q4HVsWKVtDq<&10eUd>$w zRoORcTKi(J#B0z>HC;rRsmGwg~%XK~^O2>u zHAH_J#mZ7wF5^3?q20i;(8{o!@|#Jc%5R`FhLp)#U7gRPdb6BXjbq#m%f$d9)4-Uk zu43A#3*UqyZ$h^;Fj!no>7QZHn376o6q?YwHDhJS3N64HRT{~fMTP$O&X&`PNAgVfZT?WaR4(w1Uc-tjaY8qBa_Zke2b88)(qbY_|O(%zrs*<8W~gH1aDT|pe*Jr@dcGv-eMoc%Op?vKom z5MR*YMHTbU{@}h9(+9q=QxhRpI5AR8>DI1DI|1X-Ci|7*`u1pkM?j^)NuPNTQ6hmP z*~E#~NA&McSIM-3i4JNUQ{|1Y!m9>757`BCou3kYW4yK{_T`Fq1qF)CeDs-KBt<&Ihm1N?#Z=*G+RG}tZ*THhRhA3EtN z@%v0tyIUNi8Pt{hb`ZN?i};s((v1IM^p7Q0Ch{s+(hCw_wRH$+zZq! zg)0UY)}(H!p#csNgr>33asng#3(hSslYdM6e%m7=4wxr4^476Md{9xK-});Z}mlK4Q& z+^w^w@fNZ271x?G(MzPjI+BbRvhNG4;@m4P&^)6I2(ZEb*B70*tQM%TCaJyLy>2O)5M3j^px~@{~SIP~(y^=Qs8V2}DNZWzDr=HQZnd zC~+tBU4BYC@Am}<+SLB>!|gyDIRYdRM5<|6_n>%y!j%eKmCRN#%iLgoX!*rapWnxj zLBDA3VAvuzHl_3fV}D&SR*P3nJdF9@ey3Bx3VXRX)-4EsK*Rh(1R@h_=&Zr3mJKY3 z81fQq8<)FlE2&93oTLgJq$m7?iKNEni?MiFFm6e0i8FVF1|eYZKS+gd_-49{NIjqw zHdfQuna0?COjMxaSN|r-`C~0KDC|w)30b@4^{d(B9cUg|D+GV-L)o;nFXk5fnpLM| zA)sKGdW|pS)2j0{!I6(kI*EjWH7sVLg^ZTqz-!HIDqg3KacDu8@TABIABy092xfgN&7SCY=iRiY{i(+|BWf^FCJi|~+C#=tYQg?sw~bl`u>bEf(N2aOqI zjze(YE$M%rY#XnnhQc(xY3xxVZYB5sxt>R zx@Yr;=JnvreOxSi(Axz>`o}nL);14pL3aLb8&dPVUHQV=0mXW{`$u0<9TgHq;;WrY zx-YhW{F=e?sA`@g;1Ed~{%A6%#Fg&A+MF){s&?M2!bInYt#H#H$n)aAsff}b+DIQ@ zC;X=gBU^4@bt&1YeV$2vox3wpDz8w@qw9_u%|@0?HrhS2tZ%T}Fp^FcLc7>= zkw5qd{Y*oQ&ByBGfOe6KezzgJM(SO%bl|y~-rRwYYgiqg6%dK2GGG-l?T;I~0A$fa zE$#Zo)opN!kv5|%yqQ7`B;tqC5O>qr)})a~_j<^^ku}niSEQMY+UvYQw2%s+s4%6>Ez#fDvgVTM-~ZFwzIv!*#x| zL=wVc(*!_E|CT<%osB%uyhJB8a4A=3gwxc)M!8XW%eCGZ#Li9Wsw45~#>E`=d>%IR zB33IoRvtaK0vj3GdJ1UjU<>o&MCC+vVsUK5X}UNM+YRH4NkDDxFSnpw+gP8elXAfP z8&rfdR&e@67&fHCzWn_Dt>kq@zzzSl?PM*VjRE~AYQH=y@BwRiC+DthEh@mV^Y6KYE)MVNsYMqq>mxU(9we?YoRLFV!)ji-sBmZi6z3vQDOb88Dy@;NfU7G zoPeX$t*7E8&~igP_zQlyzRvJ0|57nIOyJ+Tph{-D?Y|$Qm-@b~$yuu@oJlR4ue`D( zJ@&WPJnY148K4f-&6iGO4#4k5PF!rULe+(^4j9f%WU84^N*wVvZzAifPTgu|Z)$j^ zU=1ZE(j`u`NMx*m}Gxp}*l?)DR zIB!k&X97xbJc@2M&5@2(`y7@hsB{=D>Xq~}`sjYU)6uAOFaBw-7|$SAe|es>J=cKM zRd7aUQn-9$w^dS>Xnd6D){$u7D3fSF*nBL(j4>JzRD?S37 zh>*UA>C|K0ND>$I3Tv;q_8cP|$14o3#;(wPrAZ0u?HbjgiPBM1-nO<%I*OnqoUs&h zSA<`PY^HtaWBa}0rKW>+&MZMhs*P}5Qo2m$g&FH|-+7D#S%{u1ZDnXG^*OC6I4I#( zVW+9({EE9V;r82=7Zw-dJVyBe_L}hl*RZFR7)Vz%Tp4Gs(z@jp?Fu6xz0@mz= zbwyxpC&b=#y`md100Iwo)v6Jz!U3)PMO@>(HSC3ND7S1*kQLbZjaGIRt$z%b@@tUp z=*+#kt+E#?1l{oOP`zE@35sC#vZyMymR#qF3hT=yqGUFQ6!Zv_a_ejxClhI*hu|8t zy_ZyWVT)flElU>ly*=>S{=@0YuOTUnDqds};GMW0?CirH*amrFHzk%t#IfFgWdghU zL1{W1k$ay16UhIrCGzM@HEmy%`+q z=91@ZtgJu5gYLG{l3OxRZ0ia81asUA^X@W*8ibaFMarJR&&PIYAkfr~!SBT*ty!SS zuAxOv_oepLCpcQw0 z*aC2s`wc6-otft)6KZk0^nQwy>zY?jEzRIp;vy z$?f*5f&>s=!Dm$It)mq&UTk(ff6hkYauSbI>ylq4vjIo5Nf@g-`$ZQU0e2>>wbxCP9_9ixm%?zSG8pzA*ukN)egw=kcQFh9s z`(={y_a`^a#E%Nf8WK|GVc^|n(G>weTu5aq^kPAP&eP7gm$;LU@?vi8{k6m6SX z#2qiqjUFfxfD7Jrw`iL%ApU&N`xIX;C!gFs6Ot9|CLsJ(#*@Wxu=B2~Y|Y=-AcqGJ z9}Nb0Fr-r4A^6m>qw zCNu3tmJF$>ur%*82v0_E@8*DYUrGXxm4m7a_|FlD90-H~Q*}lkIm_|GEA6+q3l%^c zO>~)Ztt~$g***P=W2dsF30t`1HWO^*Td@pu1uxX1@zc}m39e8zBcV>|SeOefwV*nY zXn#D7n%MB$^4G`5wVDk*{ren_VzuHZtR(lD&F1h($!g_fzblQf-b^|bEK3;TJ4zit+}&8!u`$8wIxjf+z+(`b6HEG8z)mcW z`|fG`vfYwvAM$rDnG!&yns7=D1h)#FR1>e$oN+-&uY|8MyYx+PHdHVV47X!#s98a> zggxqkUir*0?T_30q*p6r4x?3V#Kad(Mn~*~kPGv_@3-;IeaNnrr5*QX%dBV{7v+KD<^)Xb#LPxK7OLo^?@H*$S zuK-N$hE8M|)f55qmoPo|18fZSud&yOslG@KC*h6z=)ACzP;O6SQ?Y-jc&N7%Ja%H> zlLZB&rrLyfr{|lRSq)PPbZ1tN{bD^al}T^BrIk_#(VdngVQApO-GD7t-|8PG{+Xt@ zw{^kSbNXW@jSP10;GERVj6jM&@(o>MHq}S9>!fLyIS8WX{Y@ASi9Rmm^S(S$1N4D8 za~>Q%Pt2GCNiD09%Lxdr8z_^1biy`@eA__UghK{YX+@#W!yj#+8VYT>*!7-EO z{wnTKP=*K>Yp$v6`X_H6?yZm5U1-DiAiz@7II!1Z=`GH|oi% zqs%PL2sKURJV6O93eHBrjLO9qdY@uPI>Q=PCTEe^3dj+FK^$t_2?M0 z==HSf#U`x13-2wGq9v^wj@-5&vG+owp=d`u=ICM_8#E~FR&d0q%7l4XjCVN1Vo+eHIy54&7sagFHqz zEI&D&mY}4b>j%fJ7~MF_%!r@-{!O4G??7>mMK~}5Se@q+35)v>PJ;icC_lCBA;$5^ zNu!7bVcZHm@fI*>A0T?|#;x55dn4^Wwl;OzkD6DGLJoDPPUWMkaNG_ZQgHzF1s
7_`WczgEH*7doCD48KxK?DuX$9CIrx z&GZd6-rB=W{w4+UJrkT49D-zV@f$8RL>G?XYiyN1s0RE{LmLud*u-h)cksty@|bd~b9HRYpDo%xX8>>OR2GANW9j@hw zIAxoP!TaUyIf;Oof{Qx1k?pI(`I~22=CcCBXEQ>k@R7>Ss08yh2~Zzt)Ld6w0&`Gz zQ@`XYV6FB&>tyH!a< z?~Sxn-fzQ|IPbQLey=SxZ{qYc9LXGwiG{sfUewP)4slVUX~re8w;#I<(8n_z?f0}o z`R@NBYNsA8P^83RTfjhhyLzqtEmJyCN{FnsYW7dDP*CpLfMma7i=kUf{I$Q^Bm!b3 zn{x%gnN9qCGyx9NJ7(2JR*=fZADm*_8gVNSHZLI+a^2))0hus7P1US!$(<*oT@XbR zk_Pg$HI*s}p4kQ_rPj0}fbo2YD2L0(>Hg-nmWWwLM+#&Y%@+1pe7s&QXvVskcLiY7 zj+Ue5W-MT2G`^?M&nN&xdlk&>VTn4*e(BC`)#qtP?19bAFVZ+WaMQSjhUqvX&-U$x zPd{X1~)UCyd`JXkN(yKd#EPfhs2>EF;agfuM=$V(efTa{W$Mc7^ zI78t)@gji8%!XLxegq?wfGXqgC3M+;-RbF4l&YTeyH1tX%U}M1{#uE@E70dB!E*i` ziw!hP+c-@yS^fHh#Y^y>OCjQdU$e&W?9+$WK5(JF($V?t!H*sLrmua|dXLe+1HlF2 z1IEn4L``I3Xr$Ug*7@)pW&e%cKJtPx5ILE^Lv#WDgI?lUguGkpZreZT5d+09Q{hjOWfvZ8WjAk`FAcr>9x z96H5sLr*T%nvzjN;-spjn-MZB}R*pt=ilxTTuo;E{cQ{I@{mfV1d;9Hif4kdLoK`Z`HT5HI$*gtyt#A(|0U| z2VFf$V9Y}4AL)7$y7?LxLbkxKMw(zxlVEI1jImHV^9rXl#M`Sos2pnhtPP90XMD>X z1g#I$obd_oYI6XsC72|^2YAWl-tDZ>R(&ShtcPrbPfRU( z2=f<#8cBxy)6zTswC?l2C5j5)=0IQHWEd8`o+#1%%;-lI3~(PmJs(D~bk274h!yTWh{{|_wkcWTiu zHZmwqo$7TGKn@k2ro9?k+SeKRW}EPfXBt8JV@F^0cu6SCc@fOgTzK7Lq?k)N(JmS_ z6yDO?B0qUMTKP{i7dnL4PqDeU2`Sl)OO29`8hCGIqDFYBQ5R%vmxESsMqziS}))nTlRqa1mcs9G1 z?FY`z!i%MPIU#W3>`+3SU$+Xx1Ti(r)N|WtY458YP=1Ego@UoI4KtZS}Se zY7m3!#tC^+;s7=vJ>5GCP24#`$+BT7(nd$&WyJO`9>Cb?8%u7uV?Zg|%H9`s&{2b| ztMm@-LVb-itJ@-JZ7YTVK$ca`dZwaHt}N{0-V|{F#^JcIVU~HCsJK`v>cj^>Ak4wx za`e}jaGiKK&H$M7@=>yh6a%@@ikM^pFp4pwtz8fyXUvOoXBE`#bYN+fQ zYIrDBH%A+QB9>eaV6A+OtM9ouECP1%NL@MdJy5giVMfj-44`vknaqx4m@> Date: Tue, 30 Jul 2024 17:26:41 +0800 Subject: [PATCH 201/363] Update docs --- mika/postgres/README.md | 176 ++++++++++++++++++++++++++++------------ 1 file changed, 122 insertions(+), 54 deletions(-) diff --git a/mika/postgres/README.md b/mika/postgres/README.md index d70404a4..d170532d 100644 --- a/mika/postgres/README.md +++ b/mika/postgres/README.md @@ -1,85 +1,153 @@ -# [`postgres`](https://github.com/postgres/postgres) +# [PostgreSQL](https://github.com/postgres/postgres) + +Easy tool to deploy a PostgreSQL instance on Kubernetes. ## Prerequisites +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + - Kubernetes 1.19+ - Helm 3.2.0+ +- Longhorn 1.4.1+ + +--- + +## Preflight checklist + +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +**This section does not apply to this chart.** + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: + + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` + +2. Update the repo to retrieve the latest versions of the packages: + + ```sh + helm repo update + ``` + +--- + +## How to install or upgrade a chart release + +1. Get the values file of the PostgreSQL chart or an existing installation (release). + + Get the latest PostgreSQL chart values file for a new installation: + + ```sh + helm show values mika/postgres > values.yaml + ``` -## How to add repo + Alternatively, get the values file of an existing PostgreSQL release: -Add the repo to your local helm client. + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Update the repo to retrieve the latest versions of the packages. +2. Edit your PostgreSQL values file with the intended configurations: -```sh -helm repo update -``` + ```sh + nano values.yaml + ``` -## How to install + Pay extra attention to the descriptions and sample values provided in the chart values file. -### Prepare chart values +3. Install a new release for PostgreSQL or upgrade an existing PostgreSQL release: -Copy `values.yaml` from the chart you would like to install. + ```sh + helm upgrade --install ${releaseName} mika/postgres --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` -```sh -cp mika/postgres/values.yaml . -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Edit `values.yaml` with the appropriate values. Refer to the [Configurations](#Configurations) section for available options. +4. Verify that your PostgreSQL release has been installed: -```sh -nano values.yaml -``` + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -### Perform installation + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. +--- -```sh -helm install $release_name mika/postgres --namespace $namespace --create-namespace --values values.yaml --wait -``` +## How to uninstall a chart release -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. -```sh -helm ls --namespace $namespace | grep "$release_name" -``` +1. Uninstall the desired release: -## How to upgrade + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` -After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${releaseName}` and `${namespace}` accordingly. -```sh -helm upgrade $release_name mika/postgres --namespace $namespace --values values.yaml --wait -``` +2. Verify that the release has been uninstalled: -## How to uninstall + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. -```sh -helm uninstall $release_name --namespace $namespace --wait -``` +--- -## Configurations +## Chart configurations | Key | Type | Default | Description | |-----|------|---------|-------------| -| image.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the PostgreSQL container image. Default: `"IfNotPresent"`. | -| image.registry | string | `""` | The registry where the PostgreSQL container image is hosted. Default: `"docker.io"`. | -| image.repository | string | `""` | The name of the repository that contains the PostgreSQL container image used. Default: `"postgres"`. | -| image.tag | string | `""` | The tag that specifies the version of the PostgreSQL container image used. Default: `Chart appVersion`. | -| postgres.data.storage | string | `"1Gi"` | The amount of persistent storage allocated for the PostgreSQL instance. Default: `"1Gi"`. | -| postgres.data.storageClassName | string | `"longhorn"` | The storage class name used for dynamically provisioning a persistent volume for the PostgreSQL storage. Default: `"longhorn"`. | -| postgres.name | string | `""` | The name of the default PostgreSQL database. Default: `"default"`. | -| postgres.pass | string | `""` | The password for accessing the PostgreSQL instance. | -| postgres.user | string | `""` | The username for accessing the PostgreSQL instance. Default: `"root"`. | -| replicaCount | int | `""` | The desired number of running replicas for PostgreSQL. Default: `"1"`. | -| resources.limits.cpu | string | `"250m"` | The maximum amount of CPU resources allowed for PostgreSQL. | -| resources.limits.memory | string | `"250Mi"` | The maximum amount of memory allowed for PostgreSQL. | -| resources.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by PostgreSQL. | -| resources.requests.memory | string | `"100Mi"` | The minimum amount of memory required by PostgreSQL. | +| image.postgres.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the PostgreSQL container image. Default: `"IfNotPresent"`. | +| image.postgres.registry | string | `""` | The registry where the PostgreSQL container image is hosted. Default: `"docker.io"`. | +| image.postgres.repository | string | `""` | The name of the repository that contains the PostgreSQL container image used. Default: `"postgres"`. | +| image.postgres.tag | string | `""` | The tag that specifies the version of the PostgreSQL container image used. Default: `Chart appVersion`. | +| imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | +| ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | +| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. Items: `.prefix`, `.name`, `.value`. | +| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting PostgreSQL services. | +| ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | +| postgres.domain | string | `""` | The ingress domain name that hosts the PostgreSQL server. | +| postgres.name | string | `""` | The name of the default database of the root PostgreSQL database user. Default: `"default"`. | +| postgres.password | string | `""` | The password associated with the root PostgreSQL database user. | +| postgres.user | string | `""` | The root username or user account of the PostgreSQL database server. Default: `"root"`. | +| replicaCount | string | `""` | The desired number of running replicas for PostgreSQL. Default: `"1"`. | +| resources.postgres | object | `{}` | PostgreSQL container resources. | +| service.nodePort | string | `""` | The optional node port to expose when the service type is NodePort. | +| service.port | string | `""` | The port on which the PostgreSQL server should listen for connections. Default: `"5432"`. | +| service.type | string | `""` | The type of service used to expose PostgreSQL services. Default: `"ClusterIP"`. | +| storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteMany"`. | +| storage.data.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for data storage. | +| storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/var/lib/postgresql/data"`. | +| storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"1Gi"`. | +| storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. | +| storage.data.subPath | string | `""` | The subpath within the data storage to mount to the container. Leave empty if not required. | \ No newline at end of file From d6baadbfcbd273e1a308bc3a39fab7f529879319 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:26:54 +0800 Subject: [PATCH 202/363] Upgrade chart version --- mika/postgres/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/postgres/Chart.yaml b/mika/postgres/Chart.yaml index e36b7a2e..60a04518 100644 --- a/mika/postgres/Chart.yaml +++ b/mika/postgres/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: postgres description: Easy tool to deploy a PostgreSQL instance on Kubernetes. type: application -version: 0.2.1 +version: 0.2.2 appVersion: "13.3" keywords: - "PostgreSQL" From 7dc13a7f1b418f607c1810fcb2c9a400368fae34 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:30:35 +0800 Subject: [PATCH 203/363] Move variable --- mika/clog/templates/NOTES.txt | 2 +- mika/linkstack/templates/NOTES.txt | 2 +- mika/rizz/templates/NOTES.txt | 2 +- template/chartName/templates/NOTES.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/clog/templates/NOTES.txt b/mika/clog/templates/NOTES.txt index e45dcdb1..bfa74965 100644 --- a/mika/clog/templates/NOTES.txt +++ b/mika/clog/templates/NOTES.txt @@ -1,9 +1,9 @@ +{{- $serviceAddress := "" }} {{- $ingress := .Values.ingress.enabled }} {{- $domain := .Values.clog.domain | toString }} {{- $port := .Values.service.port | default "80" | toString }} {{- $type := .Values.service.type | default "ClusterIP" | toString }} {{- $serviceName := printf "%s-clog-svc" .Release.Name | toString }} -{{- $serviceAddress := "" }} Clog has been installed and configured for {{ .Release.Name | toString }} 🎉 {{- if $ingress }} diff --git a/mika/linkstack/templates/NOTES.txt b/mika/linkstack/templates/NOTES.txt index e4f1ca0b..32095002 100644 --- a/mika/linkstack/templates/NOTES.txt +++ b/mika/linkstack/templates/NOTES.txt @@ -1,9 +1,9 @@ +{{- $serviceAddress := "" }} {{- $ingress := .Values.ingress.enabled }} {{- $domain := .Values.linkstack.domain | toString }} {{- $http := .Values.service.http.port | default "80" | toString }} {{- $type := .Values.service.type | default "ClusterIP" | toString }} {{- $serviceName := printf "%s-linkstack-svc" .Release.Name | toString }} -{{- $serviceAddress := "" }} LinkStack has been installed and configured for {{ .Release.Name | toString }} 🎉 {{- if $ingress }} diff --git a/mika/rizz/templates/NOTES.txt b/mika/rizz/templates/NOTES.txt index b4acba9c..7c311b10 100644 --- a/mika/rizz/templates/NOTES.txt +++ b/mika/rizz/templates/NOTES.txt @@ -1,3 +1,4 @@ +{{- $serviceAddress := "" }} {{- $ingress := .Values.ingress.enabled }} {{- $domain := .Values.rizz.domain | toString }} {{- $rizzPort := .Values.service.rizz.port | default "80" | toString }} @@ -5,7 +6,6 @@ {{- $serviceName := printf "%s-rizz-svc" .Release.Name | toString }} {{- $accounts := .Values.rizz.mastodon }} {{- $feeds := .Values.rizz.feed }} -{{- $serviceAddress := "" }} Rizz has been installed and configured for {{ .Release.Name | toString }} 🎉 {{- if $ingress }} diff --git a/template/chartName/templates/NOTES.txt b/template/chartName/templates/NOTES.txt index def1029d..0d9d3ba4 100644 --- a/template/chartName/templates/NOTES.txt +++ b/template/chartName/templates/NOTES.txt @@ -1,9 +1,9 @@ +{{- $serviceAddress := "" }} {{- $ingress := .Values.ingress.enabled }} {{- $domain := .Values.chartName.domain | toString }} {{- $port := .Values.service.port | default "80" | toString }} {{- $type := .Values.service.type | default "ClusterIP" | toString }} {{- $serviceName := printf "%s-chartName-svc" .Release.Name | toString }} -{{- $serviceAddress := "" }} ChartName has been installed and configured for {{ .Release.Name | toString }} 🎉 {{- if $ingress }} From 2b207df0a172e3ae3f5de6ded5feedd5aaa2bff7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:51:31 +0800 Subject: [PATCH 204/363] Mount as group postgres (999) --- mika/postgres/templates/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/postgres/templates/deployment.yaml b/mika/postgres/templates/deployment.yaml index 469a3305..4bf0d9cf 100644 --- a/mika/postgres/templates/deployment.yaml +++ b/mika/postgres/templates/deployment.yaml @@ -62,3 +62,5 @@ spec: claimName: {{ .Release.Name }}-postgres-data-pvc {{- end }} {{- end }} + securityContext: + fsGroup: 999 From 89fd311bf5a012196ea7110a5a752df4ea184f64 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 17:52:10 +0800 Subject: [PATCH 205/363] Set pgdata in subdir --- mika/postgres/templates/secret.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/postgres/templates/secret.yaml b/mika/postgres/templates/secret.yaml index ceedade0..2de74cfe 100644 --- a/mika/postgres/templates/secret.yaml +++ b/mika/postgres/templates/secret.yaml @@ -1,7 +1,7 @@ {{- $postgresDB := .Values.postgres.name | default "default" | toString | b64enc }} {{- $postgresUser := .Values.postgres.user | default "root" | toString | b64enc }} {{- $postgresPassword := .Values.postgres.password | toString | b64enc }} -{{- $dataMountPath := .Values.storage.data.mountPath | default "/var/lib/postgresql/data" | toString | b64enc }} +{{- $dataMountPath := .Values.storage.data.mountPath | default "/var/lib/postgresql/data" | toString }} --- apiVersion: v1 kind: Secret @@ -14,4 +14,4 @@ data: POSTGRES_DB: {{ $postgresDB }} POSTGRES_USER: {{ $postgresUser }} POSTGRES_PASSWORD: {{ $postgresPassword }} - PGDATA: {{ $dataMountPath }} + PGDATA: {{ printf "%s/pgdata" $dataMountPath | toString | b64enc }} From 6ecf0bd382851f758c8210a72e75c5c7c5645c7f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:01:23 +0800 Subject: [PATCH 206/363] Update image desc --- mika/grocy/values.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 4d98546b..bbd0086b 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -9,31 +9,33 @@ replicaCount: "" # Container images used for Grocy. image: # Backend container image configurations. + # Source: https://hub.docker.com/r/grocy/backend backend: - # The registry where the backend container image is hosted. + # The registry where the Backend container image is hosted. # Default: "docker.io" registry: "" - # The name of the repository that contains the backend container image used. + # The name of the repository that contains the Backend container image used. # Default: "grocy/backend" repository: "" - # The tag that specifies the version of the backend container image used. + # The tag that specifies the version of the Backend container image used. # Default: Chart appVersion tag: "" - # The policy that determines when Kubernetes should pull the backend container image. + # The policy that determines when Kubernetes should pull the Backend container image. # Default: "IfNotPresent" pullPolicy: "" # Frontend container image configurations. + # Source: https://hub.docker.com/r/grocy/frontend frontend: - # The registry where the frontend container image is hosted. + # The registry where the Frontend container image is hosted. # Default: "docker.io" registry: "" - # The name of the repository that contains the frontend container image used. + # The name of the repository that contains the Frontend container image used. # Default: "grocy/frontend" repository: "" - # The tag that specifies the version of the frontend container image used. + # The tag that specifies the version of the Frontend container image used. # Default: Chart appVersion tag: "" - # The policy that determines when Kubernetes should pull the frontend container image. + # The policy that determines when Kubernetes should pull the Frontend container image. # Default: "IfNotPresent" pullPolicy: "" From fc85969e4d0c08b811a6334b10b200f43d0f3702 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:01:34 +0800 Subject: [PATCH 207/363] Add imagePullSecrets --- mika/grocy/values.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index bbd0086b..17561815 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -39,6 +39,12 @@ image: # Default: "IfNotPresent" pullPolicy: "" +# Credentials used to securely authenticate and authorise the pulling of container images from private registries. +# Example: +# imagePullSecrets: +# - name: "ghcr-token-secret" +imagePullSecrets: [] + # Grocy configurations. grocy: # The mode to deploy grocy in which determines whether to enable user authentication. From bf60f03c123c7059991b1ca8e264bd8896000d8a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:23:16 +0800 Subject: [PATCH 208/363] Move storage vals --- mika/grocy/values.yaml | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 17561815..37f65dab 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -89,17 +89,38 @@ grocy: # Example: # memory_limit: "256M" memory_limit: "" - # Grocy data configurations. + +# Storage configurations. +storage: + # Data storage configurations. data: - # The amount of persistent storage allocated for the Grocy instance. + # Specifies whether persistent storage should be provisioned for data storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the data storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" + # The path where the data storage should be mounted on the container. + # Default: "/var/www/data" + # Example: + # mountPath: "/data" + mountPath: "" + # The subpath within the data storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Data" + subPath: "" + # The default amount of persistent storage allocated for the data storage. # Default: "500Mi" # Example: - # storage: "1Gi" + # storage: "10Gi" storage: "" - # The storage class name used for dynamically provisioning a persistent volume for the Grocy storage. + # The storage class name used for dynamically provisioning a persistent volume for the data storage. # Default: "longhorn" # Example: - # storageClassName: "longhorn" + # storageClassName: "smb" storageClassName: "" # Resource requirements and limits for Grocy containers. From f70f26c452a8ee8a86daa77c2aecf16beefa956a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:23:35 +0800 Subject: [PATCH 209/363] Refactor pvc --- mika/grocy/templates/pvc.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mika/grocy/templates/pvc.yaml b/mika/grocy/templates/pvc.yaml index 7d5c58bd..4d87ba86 100644 --- a/mika/grocy/templates/pvc.yaml +++ b/mika/grocy/templates/pvc.yaml @@ -1,5 +1,9 @@ -{{- $storage := .Values.grocy.data.storage | default "500Mi" | toString | quote }} -{{- $storage_class_name := .Values.grocy.data.storageClassName | default "longhorn" | toString | quote }} +{{- $dataPersistence := .Values.storage.data.enabled }} +{{- $dataAccessMode := .Values.storage.data.accessMode | default "ReadWriteMany" | toString | quote }} +{{- $dataStorage := .Values.storage.data.storage | default "500Mi" | toString | quote }} +{{- $dataStorageClassName := .Values.storage.data.storageClassName | default "longhorn" | toString | quote }} +{{- if $dataPersistence }} +--- apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -8,8 +12,9 @@ metadata: {{- include "grocy.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $dataAccessMode }} resources: requests: - storage: {{ $storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $dataStorage }} + storageClassName: {{ $dataStorageClassName }} +{{- end }} From aed221db5282bcd3bd5870b471799b876e8081d9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:33:28 +0800 Subject: [PATCH 210/363] Add service config --- mika/grocy/values.yaml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 37f65dab..ac488ace 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -90,6 +90,36 @@ grocy: # memory_limit: "256M" memory_limit: "" +# Service configurations. +service: + # Backend service port configurations. + backend: + # The optional node port to expose for backend when the service type is NodePort. + # Example: + # nodePort: "30000" + nodePort: "" + # The backend port on which the Grocy server should listen. + # Default: "9000" + # Example: + # port: "9090" + port: "" + # Frontend service port configurations. + frontend: + # The optional node port to expose for frontend when the service type is NodePort. + # Example: + # nodePort: "32000" + nodePort: "" + # The frontend port on which the Grocy server should listen. + # Default: "8080" + # Example: + # port: "80" + port: "" + # The type of service used for Grocy services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" + # Storage configurations. storage: # Data storage configurations. From 448a13d28b612b50bac89280808730b89dc4530c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:33:56 +0800 Subject: [PATCH 211/363] Update service --- mika/grocy/templates/service.yaml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/mika/grocy/templates/service.yaml b/mika/grocy/templates/service.yaml index 9b7bf687..e24844e0 100644 --- a/mika/grocy/templates/service.yaml +++ b/mika/grocy/templates/service.yaml @@ -1,3 +1,9 @@ +{{- $backend := .Values.service.backend.port | default "9000" | toString }} +{{- $backendNodePort := .Values.service.backend.nodePort | toString }} +{{- $frontend := .Values.service.frontend.port | default "8080" | toString }} +{{- $frontendNodePort := .Values.service.frontend.nodePort | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +--- apiVersion: v1 kind: Service metadata: @@ -5,15 +11,21 @@ metadata: labels: {{- include "grocy.labels" . | nindent 4 }} spec: - type: ClusterIP + type: {{ $type }} ports: - - port: 9000 + - port: {{ int $backend }} targetPort: backend + {{- if and (eq $type "NodePort") $backendNodePort }} + nodePort: {{ int $backendNodePort }} + {{- end }} protocol: TCP - name: {{ .Release.Name }}-grocy-backend - - port: 8080 + name: backend + - port: {{ int $frontend }} targetPort: frontend + {{- if and (eq $type "NodePort") $frontendNodePort }} + nodePort: {{ int $frontendNodePort }} + {{- end }} protocol: TCP - name: {{ .Release.Name }}-grocy-frontend + name: frontend selector: {{- include "grocy.selectorLabels" . | nindent 4 }} From c4c7fa8bd174a0a13da69604cd099615a087e7d7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:37:04 +0800 Subject: [PATCH 212/363] Move val --- mika/grocy/values.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index ac488ace..4f5de794 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -92,6 +92,11 @@ grocy: # Service configurations. service: + # The type of service used for Grocy services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" # Backend service port configurations. backend: # The optional node port to expose for backend when the service type is NodePort. @@ -114,11 +119,6 @@ service: # Example: # port: "80" port: "" - # The type of service used for Grocy services. - # Default: "ClusterIP" - # Example: - # type: "NodePort" - type: "" # Storage configurations. storage: From 28268f9ca43e959ad76e67e8b34781e4addcf4dc Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:41:15 +0800 Subject: [PATCH 213/363] Add ingress config --- mika/grocy/values.yaml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 4f5de794..9afdfdd5 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -90,6 +90,40 @@ grocy: # memory_limit: "256M" memory_limit: "" +# Ingress configurations. +ingress: + # Specifies whether Ingress should be enabled for hosting Grocy services. + # Example: + # enabled: true + enabled: false + # The name of the cluster issuer for Ingress. + # Default: "letsencrypt-dns-prod" + # Example: + # clusterIssuer: "letsencrypt-http-prod" + clusterIssuer: "" + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false + # Additional configuration annotations to be added to the Ingress resource. + # Items: `.prefix`, `.name`, `.value` + # Example: + # customAnnotations: + # # The prefix of the annotation. + # # Default: "nginx.ingress.kubernetes.io" + # # Example: + # # prefix: "nginx.org" + # - prefix: "" + # # The name of the annotation. + # # Example: + # # name: "proxy-connect-timeout" + # name: "" + # # The value of the annotation. + # # Example: + # # value: "120" + # value: "" + customAnnotations: [] + # Service configurations. service: # The type of service used for Grocy services. From a12091978bee08f0c3c13a5b94d9890d8704bf6f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:41:24 +0800 Subject: [PATCH 214/363] Add domain val --- mika/grocy/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 9afdfdd5..80c4e033 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -47,6 +47,10 @@ imagePullSecrets: [] # Grocy configurations. grocy: + # The ingress domain name that hosts the Grocy server. + # Example: + # domain: "grocy.example.com" + domain: "" # The mode to deploy grocy in which determines whether to enable user authentication. # Default: "production" # Example: From 248089eafe4cf0bb4f095eda9071a44f9ef1119a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:41:34 +0800 Subject: [PATCH 215/363] Add ingress resource --- mika/grocy/templates/ingress.yaml | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 mika/grocy/templates/ingress.yaml diff --git a/mika/grocy/templates/ingress.yaml b/mika/grocy/templates/ingress.yaml new file mode 100644 index 00000000..e94db6ca --- /dev/null +++ b/mika/grocy/templates/ingress.yaml @@ -0,0 +1,60 @@ +{{- $ingress := .Values.ingress.enabled }} +{{- $www := .Values.ingress.www }} +{{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $customAnnotations := .Values.ingress.customAnnotations }} +{{- $domain := .Values.grocy.domain | toString }} +{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} +{{- if and $ingress $domain }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-grocy-ingress + labels: + {{- include "grocy.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: {{ $clusterIssuer }} + cert-manager.io/private-key-algorithm: "ECDSA" + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/affinity-mode: "persistent" + nginx.ingress.kubernetes.io/proxy-body-size: "100m" + nginx.ingress.kubernetes.io/session-cookie-expires: "172800" + nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" + nginx.ingress.kubernetes.io/session-cookie-name: "route" + nginx.org/client-max-body-size: "100m" + {{- range $customAnnotations }} + {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} + {{- end }} +spec: + ingressClassName: "nginx" + rules: + - host: {{ $domain | quote }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-grocy-svc + port: + name: frontend + path: / + pathType: Prefix + {{- if $www }} + - host: {{ $wwwDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-grocy-svc + port: + name: frontend + path: / + pathType: Prefix + {{- end }} + tls: + - hosts: + - {{ $domain | quote }} + {{- if $www }} + - {{ $wwwDomain }} + {{- end }} + secretName: {{ .Release.Name }}-grocy-tls-cert +{{- end }} From 8ff7812962493063180cd8f26ed168981152f281 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:44:45 +0800 Subject: [PATCH 216/363] Update resources vals --- mika/grocy/values.yaml | 88 ++++++++++++++++++++++-------------------- 1 file changed, 46 insertions(+), 42 deletions(-) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 80c4e033..8939ccb0 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -194,46 +194,50 @@ storage: # Resource requirements and limits for Grocy containers. resources: # Backend container resources. - backend: - # The minimum amount of resources required by the backend to run. - requests: - # The minimum amount of CPU resources required by the backend. - # Example: - # cpu: "10m" - cpu: "50m" - # The minimum amount of memory required by the backend. - # Example: - # memory: "10Mi" - memory: "50Mi" - # The maximum amount of resources allowed for the backend. - limits: - # The maximum amount of CPU resources allowed for the backend. - # Example: - # cpu: "250m" - cpu: "100m" - # The maximum amount of memory allowed for the backend. - # Example: - # memory: "250Mi" - memory: "100Mi" + # Example: + # backend: + # # The minimum amount of resources required by Backend to run. + # requests: + # # The minimum amount of CPU resources required by Backend. + # # Example: + # # cpu: "10m" + # cpu: "50m" + # # The minimum amount of memory required by Backend. + # # Example: + # # memory: "10Mi" + # memory: "50Mi" + # # The maximum amount of resources allowed for Backend. + # limits: + # # The maximum amount of CPU resources allowed for Backend. + # # Example: + # # cpu: "250m" + # cpu: "100m" + # # The maximum amount of memory allowed for Backend. + # # Example: + # # memory: "250Mi" + # memory: "100Mi" + backend: {} # Frontend container resources. - frontend: - # The minimum amount of resources required by the frontend to run. - requests: - # The minimum amount of CPU resources required by the frontend. - # Example: - # cpu: "10m" - cpu: "10m" - # The minimum amount of memory required by the frontend. - # Example: - # memory: "10Mi" - memory: "10Mi" - # The maximum amount of resources allowed for the frontend. - limits: - # The maximum amount of CPU resources allowed for the frontend. - # Example: - # cpu: "250m" - cpu: "100m" - # The maximum amount of memory allowed for the frontend. - # Example: - # memory: "250Mi" - memory: "50Mi" + # Example: + # frontend: + # # The minimum amount of resources required by Frontend to run. + # requests: + # # The minimum amount of CPU resources required by Frontend. + # # Example: + # # cpu: "10m" + # cpu: "10m" + # # The minimum amount of memory required by Frontend. + # # Example: + # # memory: "10Mi" + # memory: "10Mi" + # # The maximum amount of resources allowed for Frontend. + # limits: + # # The maximum amount of CPU resources allowed for Frontend. + # # Example: + # # cpu: "250m" + # cpu: "100m" + # # The maximum amount of memory allowed for Frontend. + # # Example: + # # memory: "250Mi" + # memory: "50Mi" + frontend: {} From de387d1c183d7aff8cbffa2f4f9c991b89a8ea18 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:48:05 +0800 Subject: [PATCH 217/363] Reorder values --- mika/grocy/values.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 8939ccb0..872a613d 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -47,15 +47,6 @@ imagePullSecrets: [] # Grocy configurations. grocy: - # The ingress domain name that hosts the Grocy server. - # Example: - # domain: "grocy.example.com" - domain: "" - # The mode to deploy grocy in which determines whether to enable user authentication. - # Default: "production" - # Example: - # mode: "demo" - mode: "" # The localisation of the Grocy application. # Default: "en_GB" # Example: @@ -66,33 +57,42 @@ grocy: # Example: # currency: "USD" currency: "" + # The ingress domain name that hosts the Grocy server. + # Example: + # domain: "grocy.example.com" + domain: "" # The preferred unit for displaying energy values in Grocy. # Default: "kcal" # Example: # energy: "kJ" energy: "" + # The mode to deploy grocy in which determines whether to enable user authentication. + # Default: "production" + # Example: + # mode: "demo" + mode: "" # Grocy PHP configurations. php: - # Specifies the maximum size of an individual file that can be uploaded through PHP. - # Default: "50M" - # Example: - # upload_limit: "100M" - upload_limit: "" # Sets the maximum number of files that can be uploaded simultaneously through PHP. # Default: "200" # Example: # file_limit: "100" file_limit: "" + # Determines the maximum amount of memory that PHP can allocate for executing scripts. + # Default: "512M" + # Example: + # memory_limit: "256M" + memory_limit: "" # Defines the maximum size of the entire HTTP POST request that PHP can handle. # Default: "100M" # Example: # post_limit: "200M" post_limit: "" - # Determines the maximum amount of memory that PHP can allocate for executing scripts. - # Default: "512M" + # Specifies the maximum size of an individual file that can be uploaded through PHP. + # Default: "50M" # Example: - # memory_limit: "256M" - memory_limit: "" + # upload_limit: "100M" + upload_limit: "" # Ingress configurations. ingress: From e3976ecea54fdc3956c0be06b7b294534faaf664 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 18:49:31 +0800 Subject: [PATCH 218/363] Add separator --- mika/grocy/templates/configmap.yaml | 1 + mika/grocy/templates/deployment.yaml | 1 + 2 files changed, 2 insertions(+) diff --git a/mika/grocy/templates/configmap.yaml b/mika/grocy/templates/configmap.yaml index ddd8c6bc..4a5cd063 100644 --- a/mika/grocy/templates/configmap.yaml +++ b/mika/grocy/templates/configmap.yaml @@ -7,6 +7,7 @@ {{- $file_limit := .Values.grocy.php.file_limit | default "200" | toString | quote }} {{- $post_limit := .Values.grocy.php.post_limit | default "100M" | toString | quote }} {{- $memory_limit := .Values.grocy.php.memory_limit | default "512M" | toString | quote }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index d67bf2b3..58ea8319 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -7,6 +7,7 @@ {{- $frontend_tag := .Values.image.frontend.tag | default .Chart.AppVersion | toString }} {{- $frontend_pullPolicy := .Values.image.frontend.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} +--- apiVersion: apps/v1 kind: Deployment metadata: From fff0c4882737c58415e419682ab4deac509bda68 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:07:02 +0800 Subject: [PATCH 219/363] Move into own template --- mika/grocy/templates/_helpers.tpl | 26 -------------------------- mika/grocy/templates/common.conf.tpl | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 26 deletions(-) create mode 100644 mika/grocy/templates/common.conf.tpl diff --git a/mika/grocy/templates/_helpers.tpl b/mika/grocy/templates/_helpers.tpl index 421135fb..3d76492d 100644 --- a/mika/grocy/templates/_helpers.tpl +++ b/mika/grocy/templates/_helpers.tpl @@ -60,29 +60,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - -{{/* -Nginx common.conf template -*/}} -{{- define "grocy.common-conf" -}} -charset utf-8; - -location / { - try_files $uri /index.php$is_args$query_string; -} - -location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { - expires 365d; -} - -location ~ \.php$ { - fastcgi_pass {{ .Release.Name }}-grocy-svc:9000; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; -} - -location ~ /\.ht { - deny all; -} -{{- end }} diff --git a/mika/grocy/templates/common.conf.tpl b/mika/grocy/templates/common.conf.tpl new file mode 100644 index 00000000..62faeaa2 --- /dev/null +++ b/mika/grocy/templates/common.conf.tpl @@ -0,0 +1,25 @@ +{{/* +Nginx common.conf template +*/}} +{{- define "grocy.common-conf" -}} +charset utf-8; + +location / { + try_files $uri /index.php$is_args$query_string; +} + +location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { + expires 365d; +} + +location ~ \.php$ { + fastcgi_pass {{ .Release.Name }}-grocy-svc:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; +} + +location ~ /\.ht { + deny all; +} +{{- end }} From a6015a1dc8738b6fc3167a828143cf460e08b80c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:07:29 +0800 Subject: [PATCH 220/363] Parse to string --- mika/grocy/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/grocy/templates/configmap.yaml b/mika/grocy/templates/configmap.yaml index 4a5cd063..5464292f 100644 --- a/mika/grocy/templates/configmap.yaml +++ b/mika/grocy/templates/configmap.yaml @@ -34,4 +34,4 @@ metadata: {{- include "grocy.labels" . | nindent 4 }} data: common.conf: | - {{- include "grocy.common-conf" . | nindent 4 }} + {{- include "grocy.common-conf" . | toString | nindent 4 }} From a15d06f87ee39c0d494ab94d10ecf94cefa1ce79 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:09:03 +0800 Subject: [PATCH 221/363] Mount data volume if enabled --- mika/grocy/templates/deployment.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index 58ea8319..a35d4889 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -56,8 +56,13 @@ spec: volumeMounts: - name: {{ .Release.Name }}-tmp-volume mountPath: /tmp + {{- if $dataPersistence }} - name: {{ .Release.Name }}-grocy-data - mountPath: /var/www/data + mountPath: {{ $dataMountPath }} + {{- if $dataSubPath }} + subPath: {{ $dataSubPath | quote }} + {{- end }} + {{- end }} - name: frontend image: {{ printf "%s/%s:%s" $frontend_registry $frontend_repository $frontend_tag | quote }} imagePullPolicy: {{ $frontend_pullPolicy }} @@ -82,8 +87,10 @@ spec: - name: {{ .Release.Name }}-grocy-nginx-config configMap: name: {{ .Release.Name }}-grocy-nginx-config + {{- if $dataPersistence }} - name: {{ .Release.Name }}-grocy-data persistentVolumeClaim: claimName: {{ .Release.Name }}-grocy-data-pvc + {{- end }} securityContext: fsGroup: 82 From 3466645fd77631e76ef2e072a67d90208600deef Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:12:28 +0800 Subject: [PATCH 222/363] Update var name --- mika/grocy/templates/configmap.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mika/grocy/templates/configmap.yaml b/mika/grocy/templates/configmap.yaml index 5464292f..b6ffea06 100644 --- a/mika/grocy/templates/configmap.yaml +++ b/mika/grocy/templates/configmap.yaml @@ -3,10 +3,10 @@ {{- $culture := .Values.grocy.culture | default "en_GB" | toString | quote }} {{- $currency := .Values.grocy.currency | default "MYR" | toString | quote }} {{- $energy := .Values.grocy.energy | default "kcal" | toString | quote }} -{{- $upload_limit := .Values.grocy.php.upload_limit | default "50M" | toString | quote }} -{{- $file_limit := .Values.grocy.php.file_limit | default "200" | toString | quote }} -{{- $post_limit := .Values.grocy.php.post_limit | default "100M" | toString | quote }} -{{- $memory_limit := .Values.grocy.php.memory_limit | default "512M" | toString | quote }} +{{- $uploadLimit := .Values.grocy.php.upload_limit | default "50M" | toString | quote }} +{{- $fileLimit := .Values.grocy.php.file_limit | default "200" | toString | quote }} +{{- $postLimit := .Values.grocy.php.post_limit | default "100M" | toString | quote }} +{{- $memoryLimit := .Values.grocy.php.memory_limit | default "512M" | toString | quote }} --- apiVersion: v1 kind: ConfigMap @@ -21,10 +21,10 @@ data: GROCY_CULTURE: {{ $culture }} GROCY_CURRENCY: {{ $currency }} GROCY_ENERGY_UNIT: {{ $energy }} - MAX_UPLOAD: {{ $upload_limit }} - PHP_MAX_FILE_UPLOAD: {{ $file_limit }} - PHP_MAX_POST: {{ $post_limit }} - PHP_MEMORY_LIMIT: {{ $memory_limit }} + MAX_UPLOAD: {{ $uploadLimit }} + PHP_MAX_FILE_UPLOAD: {{ $fileLimit }} + PHP_MAX_POST: {{ $postLimit }} + PHP_MEMORY_LIMIT: {{ $memoryLimit }} --- apiVersion: v1 kind: ConfigMap From 4d8b890c833c690e1b8159e89556e2168c103f48 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:21:54 +0800 Subject: [PATCH 223/363] Add init container image --- mika/grocy/values.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 872a613d..440eadf4 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -38,6 +38,21 @@ image: # The policy that determines when Kubernetes should pull the Frontend container image. # Default: "IfNotPresent" pullPolicy: "" + # Init container image configurations. + # Source: https://hub.docker.com/_/busybox + init: + # The registry where the Init container image is hosted. + # Default: "docker.io" + registry: "" + # The name of the repository that contains the Init container image used. + # Default: "busybox" + repository: "" + # The tag that specifies the version of the Init container image used. + # Default: "1.36.1" + tag: "" + # The policy that determines when Kubernetes should pull the Init container image. + # Default: "IfNotPresent" + pullPolicy: "" # Credentials used to securely authenticate and authorise the pulling of container images from private registries. # Example: From 8b0161a7f34729804473593d682a179793bb418b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:22:26 +0800 Subject: [PATCH 224/363] Update init container for initialising persistent vol --- mika/grocy/templates/deployment.yaml | 36 ++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index a35d4889..3221ad6a 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -32,14 +32,40 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- if or $dataPersistence $initScript }} + {{- $initDataMountPath := printf "/mnt/%s" ($dataMountPath | trimPrefix "/") | toString }} initContainers: - - name: copy-data - image: {{ printf "%s/%s:%s" $backend_registry $backend_repository $backend_tag | quote }} - imagePullPolicy: {{ $backend_pullPolicy }} - command: ["sh", "-c", "cp -rf /var/www/data/. /scratch/data"] + - name: init + image: {{ printf "%s/%s:%s" $init_registry $init_repository $init_tag | quote }} + imagePullPolicy: {{ $init_pullPolicy }} + command: ["/bin/sh"] + args: + - -c + - >- + {{- if $initScript }} + {{- $initScript | nindent 14 }} + {{- else }} + if [ -z "$(ls -A {{ $initDataMountPath }} | grep -v 'lost+found')" ]; then + echo "Initialising {{ $initDataMountPath }}" + cp -Ra /var/www/data/. {{ $initDataMountPath }} + chown -R www-data: {{ $initDataMountPath }} + find {{ $initDataMountPath }} -type d -exec chmod 755 {} \; + find {{ $initDataMountPath }} -type f -exec chmod 644 {} \; + else + echo "Skipping initialisation as {{ $initDataMountPath }} is not empty" + fi + {{- end }} + {{- if or $dataPersistence }} volumeMounts: + {{- if $dataPersistence }} - name: {{ .Release.Name }}-grocy-data - mountPath: /scratch/data + mountPath: {{ $initDataMountPath | quote }} + {{- if $dataSubPath }} + subPath: {{ $dataSubPath | quote }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} containers: - name: backend image: {{ printf "%s/%s:%s" $backend_registry $backend_repository $backend_tag | quote }} From b2572125463321db176bcc6511116357364eef97 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:23:05 +0800 Subject: [PATCH 225/363] Update val vars --- mika/grocy/templates/deployment.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index 3221ad6a..41b6fa36 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -1,3 +1,4 @@ +{{- $dataPersistence := .Values.storage.data.enabled }} {{- $backend_registry := .Values.image.backend.registry | default "docker.io" | toString }} {{- $backend_repository := .Values.image.backend.repository | default "grocy/backend" | toString }} {{- $backend_tag := .Values.image.backend.tag | default .Chart.AppVersion | toString }} @@ -6,7 +7,14 @@ {{- $frontend_repository := .Values.image.frontend.repository | default "grocy/frontend" | toString }} {{- $frontend_tag := .Values.image.frontend.tag | default .Chart.AppVersion | toString }} {{- $frontend_pullPolicy := .Values.image.frontend.pullPolicy | default "IfNotPresent" | toString | quote }} +{{- $init_registry := .Values.image.init.registry | default "docker.io" | toString }} +{{- $init_repository := .Values.image.init.repository | default "busybox" | toString }} +{{- $init_tag := .Values.image.init.tag | default "1.36.1" | toString }} +{{- $init_pullPolicy := .Values.image.init.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $dataMountPath := .Values.storage.data.mountPath | default "/var/www/data" | toString | quote }} +{{- $dataSubPath := .Values.storage.data.subPath | toString }} +{{- $initScript := .Values.chartName.initScript | toString }} --- apiVersion: apps/v1 kind: Deployment From 4af6c65424ef2bea72f5dcc61a03b5123be51d57 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:24:42 +0800 Subject: [PATCH 226/363] Update keywords --- mika/grocy/Chart.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mika/grocy/Chart.yaml b/mika/grocy/Chart.yaml index a59d5612..53947cf2 100644 --- a/mika/grocy/Chart.yaml +++ b/mika/grocy/Chart.yaml @@ -6,6 +6,9 @@ version: 0.1.0 appVersion: "v3.3.2" keywords: - "grocy" + - "erp" + - "groceries" + - "household" home: "https://github.com/grocy/grocy" icon: "https://raw.githubusercontent.com/grocy/grocy/master/public/img/logo.svg" sources: From 1b59985d5ef77295c4dafb70ea6f46310a257932 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:24:53 +0800 Subject: [PATCH 227/363] Upgrade chart version --- mika/grocy/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/grocy/Chart.yaml b/mika/grocy/Chart.yaml index 53947cf2..32f83cee 100644 --- a/mika/grocy/Chart.yaml +++ b/mika/grocy/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: grocy description: Grocy is a web-based self-hosted groceries & household management solution for your home. type: application -version: 0.1.0 +version: 0.1.1 appVersion: "v3.3.2" keywords: - "grocy" From d15e9f08aa1337163f59899af53e7b5961da0e58 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:26:27 +0800 Subject: [PATCH 228/363] Source logo from own repo --- logos/grocy.svg | 10 ++++++++++ mika/grocy/Chart.yaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 logos/grocy.svg diff --git a/logos/grocy.svg b/logos/grocy.svg new file mode 100644 index 00000000..18ba1786 --- /dev/null +++ b/logos/grocy.svg @@ -0,0 +1,10 @@ + + + + +Created by potrace 1.16, written by Peter Selinger 2001-2019 + + + + + \ No newline at end of file diff --git a/mika/grocy/Chart.yaml b/mika/grocy/Chart.yaml index 32f83cee..001bb326 100644 --- a/mika/grocy/Chart.yaml +++ b/mika/grocy/Chart.yaml @@ -10,7 +10,7 @@ keywords: - "groceries" - "household" home: "https://github.com/grocy/grocy" -icon: "https://raw.githubusercontent.com/grocy/grocy/master/public/img/logo.svg" +icon: "https://irfanhakim-as.github.io/charts/logos/grocy.svg" sources: - "https://github.com/grocy/grocy" - "https://github.com/irfanhakim-as/charts" From 890b1c5d30604c5aeda89246a11735e5cc2d56df Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 19:58:08 +0800 Subject: [PATCH 229/363] Upgrade chart notes --- mika/grocy/templates/NOTES.txt | 47 +++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/mika/grocy/templates/NOTES.txt b/mika/grocy/templates/NOTES.txt index 15b08f79..b3492ca0 100644 --- a/mika/grocy/templates/NOTES.txt +++ b/mika/grocy/templates/NOTES.txt @@ -1,5 +1,46 @@ -Grocy is now installed and configured for {{ .Release.Name | toString }}. +{{- $serviceAddress := "" }} +{{- $ingress := .Values.ingress.enabled }} +{{- $domain := .Values.grocy.domain | toString }} +{{- $frontend := .Values.service.frontend.port | default "8080" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +{{- $serviceName := printf "%s-grocy-svc" .Release.Name | toString }} +Grocy has been installed and configured for {{ .Release.Name | toString }} 🎉 -See the values.yaml file of this chart for more configuration options. +{{- if $ingress }} + {{- $serviceAddress = printf "https://%s" $domain | toString }} +{{- else if or (eq $type "ClusterIP") (eq $type "LoadBalancer") (eq $type "NodePort") }} -Please refer to the official documentation for more information on how to use Grocy. +Please run the following command(s) to obtain the right address to the service: + + ```sh + {{- if eq $type "ClusterIP" }} + {{- $forwardPort := "8080" | toString }} + {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} + export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "grocy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} + {{- else if eq $type "LoadBalancer" }} + {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $frontend | toString }} + export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} --template "{{"{{- range (index .status.loadBalancer.ingress 0) }}{{ . }}{{- end }}"}}") + {{- else if eq $type "NodePort" }} + {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") + {{- end }} + ``` + +{{- end }} + +Visit the following service(s) at the provided address: + +{{- if $serviceAddress }} + + - Grocy: {{ $serviceAddress }} + +{{- else }} + + ⚠️ This chart may have no accessible services available + +{{- end }} + +For more information on how to use and configure Grocy, please refer to the official documentation. \ No newline at end of file From 44b7297673d51661415cdcd7813fdd1f00f4f250 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 21:32:06 +0800 Subject: [PATCH 230/363] Update docs --- mika/grocy/README.md | 189 +++++++++++++++++++++++++++++-------------- 1 file changed, 130 insertions(+), 59 deletions(-) diff --git a/mika/grocy/README.md b/mika/grocy/README.md index bcbaad98..efeb0816 100644 --- a/mika/grocy/README.md +++ b/mika/grocy/README.md @@ -1,98 +1,169 @@ -# [`grocy`](https://github.com/grocy/grocy) +# [Grocy](https://github.com/grocy/grocy) + +Grocy is a web-based self-hosted groceries & household management solution for your home. ## Prerequisites +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + - Kubernetes 1.19+ - Helm 3.2.0+ +- Longhorn 1.4.1+ + +--- + +## Preflight checklist + +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +**This section does not apply to this chart.** + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: + + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` + +2. Update the repo to retrieve the latest versions of the packages: + + ```sh + helm repo update + ``` + +--- + +## How to install or upgrade a chart release + +1. Get the values file of the Grocy chart or an existing installation (release). + + Get the latest Grocy chart values file for a new installation: + + ```sh + helm show values mika/grocy > values.yaml + ``` -## How to add repo + Alternatively, get the values file of an existing Grocy release: -Add the repo to your local helm client. + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Update the repo to retrieve the latest versions of the packages. +2. Edit your Grocy values file with the intended configurations: -```sh -helm repo update -``` + ```sh + nano values.yaml + ``` -## How to install + Pay extra attention to the descriptions and sample values provided in the chart values file. -### Prepare chart values +3. Install a new release for Grocy or upgrade an existing Grocy release: -Copy `values.yaml` from the chart you would like to install. + ```sh + helm upgrade --install ${releaseName} mika/grocy --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` -```sh -cp mika/grocy/values.yaml . -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Edit `values.yaml` with the appropriate values. Please refer to the [Configurations](#configurations) section below, or the `values.yaml` file itself for details and sample values. +4. Verify that your Grocy release has been installed: -```sh -nano values.yaml -``` + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -### Perform installation + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. +--- -```sh -helm install $release_name mika/grocy --namespace $namespace --create-namespace --values values.yaml --wait -``` +## How to uninstall a chart release -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. -```sh -helm ls --namespace $namespace | grep "$release_name" -``` +1. Uninstall the desired release: -## How to upgrade + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` -After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${releaseName}` and `${namespace}` accordingly. -```sh -helm upgrade $release_name mika/grocy --namespace $namespace --values values.yaml --wait -``` +2. Verify that the release has been uninstalled: -## How to uninstall + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. -```sh -helm uninstall $release_name --namespace $namespace --wait -``` +--- -## Configurations +## Chart configurations | Key | Type | Default | Description | |-----|------|---------|-------------| | grocy.culture | string | `""` | The localisation of the Grocy application. Default: `"en_GB"`. | | grocy.currency | string | `""` | The currency used to format all monetary values in Grocy. Default: `"MYR"`. | -| grocy.data.storage | string | `""` | The amount of persistent storage allocated for the Grocy instance. Default: `"500Mi"`. | -| grocy.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the Grocy storage. Default: `"longhorn"`. | +| grocy.domain | string | `""` | The ingress domain name that hosts the Grocy server. | | grocy.energy | string | `""` | The preferred unit for displaying energy values in Grocy. Default: `"kcal"`. | | grocy.mode | string | `""` | The mode to deploy grocy in which determines whether to enable user authentication. Default: `"production"`. | | grocy.php.file_limit | string | `""` | Sets the maximum number of files that can be uploaded simultaneously through PHP. Default: `"200"`. | | grocy.php.memory_limit | string | `""` | Determines the maximum amount of memory that PHP can allocate for executing scripts. Default: `"512M"`. | | grocy.php.post_limit | string | `""` | Defines the maximum size of the entire HTTP POST request that PHP can handle. Default: `"100M"`. | | grocy.php.upload_limit | string | `""` | Specifies the maximum size of an individual file that can be uploaded through PHP. Default: `"50M"`. | -| image.backend.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the backend container image. Default: `"IfNotPresent"`. | -| image.backend.registry | string | `""` | The registry where the backend container image is hosted. Default: `"docker.io"`. | -| image.backend.repository | string | `""` | The name of the repository that contains the backend container image used. Default: `"grocy/backend"`. | -| image.backend.tag | string | `""` | The tag that specifies the version of the backend container image used. Default: `Chart appVersion`. | -| image.frontend.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the frontend container image. Default: `"IfNotPresent"`. | -| image.frontend.registry | string | `""` | The registry where the frontend container image is hosted. Default: `"docker.io"`. | -| image.frontend.repository | string | `""` | The name of the repository that contains the frontend container image used. Default: `"grocy/frontend"`. | -| image.frontend.tag | string | `""` | The tag that specifies the version of the frontend container image used. Default: `Chart appVersion`. | -| replicaCount | string | `""` | The desired number of running replicas for Grocy. | -| resources.backend.limits.cpu | string | `"100m"` | The maximum amount of CPU resources allowed for the backend. | -| resources.backend.limits.memory | string | `"100Mi"` | The maximum amount of memory allowed for the backend. | -| resources.backend.requests.cpu | string | `"50m"` | The minimum amount of CPU resources required by the backend. | -| resources.backend.requests.memory | string | `"50Mi"` | The minimum amount of memory required by the backend. | -| resources.frontend.limits.cpu | string | `"100m"` | The maximum amount of CPU resources allowed for the frontend. | -| resources.frontend.limits.memory | string | `"50Mi"` | The maximum amount of memory allowed for the frontend. | -| resources.frontend.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by the frontend. | -| resources.frontend.requests.memory | string | `"10Mi"` | The minimum amount of memory required by the frontend. | +| image.backend.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Backend container image. Default: `"IfNotPresent"`. | +| image.backend.registry | string | `""` | The registry where the Backend container image is hosted. Default: `"docker.io"`. | +| image.backend.repository | string | `""` | The name of the repository that contains the Backend container image used. Default: `"grocy/backend"`. | +| image.backend.tag | string | `""` | The tag that specifies the version of the Backend container image used. Default: `Chart appVersion`. | +| image.frontend.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Frontend container image. Default: `"IfNotPresent"`. | +| image.frontend.registry | string | `""` | The registry where the Frontend container image is hosted. Default: `"docker.io"`. | +| image.frontend.repository | string | `""` | The name of the repository that contains the Frontend container image used. Default: `"grocy/frontend"`. | +| image.frontend.tag | string | `""` | The tag that specifies the version of the Frontend container image used. Default: `Chart appVersion`. | +| image.init.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Init container image. Default: `"IfNotPresent"`. | +| image.init.registry | string | `""` | The registry where the Init container image is hosted. Default: `"docker.io"`. | +| image.init.repository | string | `""` | The name of the repository that contains the Init container image used. Default: `"busybox"`. | +| image.init.tag | string | `""` | The tag that specifies the version of the Init container image used. Default: `"1.36.1"`. | +| imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | +| ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | +| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. Items: `.prefix`, `.name`, `.value`. | +| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Grocy services. | +| ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | +| replicaCount | string | `""` | The desired number of running replicas for Grocy. Default: `"1"`. | +| resources.backend | object | `{}` | Backend container resources. | +| resources.frontend | object | `{}` | Frontend container resources. | +| service.backend.nodePort | string | `""` | The optional node port to expose for backend when the service type is NodePort. | +| service.backend.port | string | `""` | The backend port on which the Grocy server should listen. Default: `"9000"`. | +| service.frontend.nodePort | string | `""` | The optional node port to expose for frontend when the service type is NodePort. | +| service.frontend.port | string | `""` | The frontend port on which the Grocy server should listen. Default: `"8080"`. | +| service.type | string | `""` | The type of service used for Grocy services. Default: `"ClusterIP"`. | +| storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteMany"`. | +| storage.data.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for data storage. | +| storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/var/www/data"`. | +| storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"500Mi"`. | +| storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. | +| storage.data.subPath | string | `""` | The subpath within the data storage to mount to the container. Leave empty if not required. | \ No newline at end of file From a678f57a21d5658edb6a662231c0666c33fd7199 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 21:39:27 +0800 Subject: [PATCH 231/363] Add initScript val --- mika/grocy/README.md | 1 + mika/grocy/values.yaml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/mika/grocy/README.md b/mika/grocy/README.md index efeb0816..0ad5dbc0 100644 --- a/mika/grocy/README.md +++ b/mika/grocy/README.md @@ -131,6 +131,7 @@ Grocy is a web-based self-hosted groceries & household management solution for y | grocy.currency | string | `""` | The currency used to format all monetary values in Grocy. Default: `"MYR"`. | | grocy.domain | string | `""` | The ingress domain name that hosts the Grocy server. | | grocy.energy | string | `""` | The preferred unit for displaying energy values in Grocy. Default: `"kcal"`. | +| grocy.initScript | string | `""` | Custom init script to run before the Grocy container starts. | | grocy.mode | string | `""` | The mode to deploy grocy in which determines whether to enable user authentication. Default: `"production"`. | | grocy.php.file_limit | string | `""` | Sets the maximum number of files that can be uploaded simultaneously through PHP. Default: `"200"`. | | grocy.php.memory_limit | string | `""` | Determines the maximum amount of memory that PHP can allocate for executing scripts. Default: `"512M"`. | diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index 440eadf4..d80ccec8 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -81,6 +81,12 @@ grocy: # Example: # energy: "kJ" energy: "" + # Custom init script to run before the Grocy container starts. + # Example: + # initScript: >- + # echo "Hello, World!" + # echo "This is a custom init script." + initScript: "" # The mode to deploy grocy in which determines whether to enable user authentication. # Default: "production" # Example: From a0734f564a5fe1239adbca36fae844f3d3ff86bc Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 21:39:35 +0800 Subject: [PATCH 232/363] Refactor value loc --- mika/grocy/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index 41b6fa36..4149e652 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -14,7 +14,7 @@ {{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $dataMountPath := .Values.storage.data.mountPath | default "/var/www/data" | toString | quote }} {{- $dataSubPath := .Values.storage.data.subPath | toString }} -{{- $initScript := .Values.chartName.initScript | toString }} +{{- $initScript := .Values.grocy.initScript | toString }} --- apiVersion: apps/v1 kind: Deployment From 435d6297d250b79f06a4cb4e8d75a1e735e560e9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 22:19:47 +0800 Subject: [PATCH 233/363] Fix quotation --- mika/grocy/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index 4149e652..ad905d10 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -12,7 +12,7 @@ {{- $init_tag := .Values.image.init.tag | default "1.36.1" | toString }} {{- $init_pullPolicy := .Values.image.init.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} -{{- $dataMountPath := .Values.storage.data.mountPath | default "/var/www/data" | toString | quote }} +{{- $dataMountPath := .Values.storage.data.mountPath | default "/var/www/data" | toString }} {{- $dataSubPath := .Values.storage.data.subPath | toString }} {{- $initScript := .Values.grocy.initScript | toString }} --- @@ -92,7 +92,7 @@ spec: mountPath: /tmp {{- if $dataPersistence }} - name: {{ .Release.Name }}-grocy-data - mountPath: {{ $dataMountPath }} + mountPath: {{ $dataMountPath | quote }} {{- if $dataSubPath }} subPath: {{ $dataSubPath | quote }} {{- end }} From fd62e9a9e0f3977b6dd2949fdcb65585ddeb54ab Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 30 Jul 2024 22:20:20 +0800 Subject: [PATCH 234/363] Fix returned nodeport --- mika/grocy/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/grocy/templates/NOTES.txt b/mika/grocy/templates/NOTES.txt index b3492ca0..4ae04bc1 100644 --- a/mika/grocy/templates/NOTES.txt +++ b/mika/grocy/templates/NOTES.txt @@ -25,7 +25,7 @@ Please run the following command(s) to obtain the right address to the service: {{- else if eq $type "NodePort" }} {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") - export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") + export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[1].nodePort}") {{- end }} ``` From 5b20b076187bf8ea06bbf08486aab48d8da3147c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 31 Jul 2024 08:25:35 +0800 Subject: [PATCH 235/363] Fix container port returned --- mika/grocy/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/grocy/templates/NOTES.txt b/mika/grocy/templates/NOTES.txt index 4ae04bc1..2c59968f 100644 --- a/mika/grocy/templates/NOTES.txt +++ b/mika/grocy/templates/NOTES.txt @@ -17,7 +17,7 @@ Please run the following command(s) to obtain the right address to the service: {{- $forwardPort := "8080" | toString }} {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "grocy.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[1].ports[0].containerPort}") kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} {{- else if eq $type "LoadBalancer" }} {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $frontend | toString }} From c2f4283e393badb6fa37cd388ce0458280641632 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 31 Jul 2024 12:50:36 +0800 Subject: [PATCH 236/363] Remove unused tmp volume --- mika/grocy/templates/deployment.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index ad905d10..c57d2d9b 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -88,8 +88,6 @@ spec: - configMapRef: name: {{ .Release.Name }}-grocy-cm volumeMounts: - - name: {{ .Release.Name }}-tmp-volume - mountPath: /tmp {{- if $dataPersistence }} - name: {{ .Release.Name }}-grocy-data mountPath: {{ $dataMountPath | quote }} @@ -110,14 +108,10 @@ spec: - configMapRef: name: {{ .Release.Name }}-grocy-cm volumeMounts: - - name: {{ .Release.Name }}-tmp-volume - mountPath: /tmp - name: {{ .Release.Name }}-grocy-nginx-config mountPath: /etc/nginx/common.conf subPath: common.conf volumes: - - name: {{ .Release.Name }}-tmp-volume - emptyDir: {} - name: {{ .Release.Name }}-grocy-nginx-config configMap: name: {{ .Release.Name }}-grocy-nginx-config From 6dd0bf85d1fe0566143eb1d31b2adaa60700ad64 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 31 Jul 2024 12:51:26 +0800 Subject: [PATCH 237/363] Run initcontainer as root --- mika/grocy/templates/deployment.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index c57d2d9b..34b6f695 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -73,6 +73,8 @@ spec: {{- end }} {{- end }} {{- end }} + securityContext: + runAsUser: 0 {{- end }} containers: - name: backend From 7fa367100942ea210eec325a52eb4c6c7ab55530 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 31 Jul 2024 12:51:37 +0800 Subject: [PATCH 238/363] Remove fsgroup spec --- mika/grocy/templates/deployment.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index 34b6f695..c44d2dfe 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -122,5 +122,3 @@ spec: persistentVolumeClaim: claimName: {{ .Release.Name }}-grocy-data-pvc {{- end }} - securityContext: - fsGroup: 82 From 32bdb01b451970fcf0972f7ca376b59fe023805f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 31 Jul 2024 12:51:53 +0800 Subject: [PATCH 239/363] Use user and group id --- mika/grocy/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index c44d2dfe..0bfb439e 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -56,7 +56,7 @@ spec: if [ -z "$(ls -A {{ $initDataMountPath }} | grep -v 'lost+found')" ]; then echo "Initialising {{ $initDataMountPath }}" cp -Ra /var/www/data/. {{ $initDataMountPath }} - chown -R www-data: {{ $initDataMountPath }} + chown -R 82:82 {{ $initDataMountPath }} find {{ $initDataMountPath }} -type d -exec chmod 755 {} \; find {{ $initDataMountPath }} -type f -exec chmod 644 {} \; else From 557ea48e7e411bdf22af68b1209981eccab663b7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 31 Jul 2024 12:55:30 +0800 Subject: [PATCH 240/363] Update default init image --- mika/grocy/README.md | 4 ++-- mika/grocy/templates/deployment.yaml | 4 ++-- mika/grocy/values.yaml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mika/grocy/README.md b/mika/grocy/README.md index 0ad5dbc0..a1113147 100644 --- a/mika/grocy/README.md +++ b/mika/grocy/README.md @@ -147,8 +147,8 @@ Grocy is a web-based self-hosted groceries & household management solution for y | image.frontend.tag | string | `""` | The tag that specifies the version of the Frontend container image used. Default: `Chart appVersion`. | | image.init.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Init container image. Default: `"IfNotPresent"`. | | image.init.registry | string | `""` | The registry where the Init container image is hosted. Default: `"docker.io"`. | -| image.init.repository | string | `""` | The name of the repository that contains the Init container image used. Default: `"busybox"`. | -| image.init.tag | string | `""` | The tag that specifies the version of the Init container image used. Default: `"1.36.1"`. | +| image.init.repository | string | `""` | The name of the repository that contains the Init container image used. Default: `"grocy/backend"`. | +| image.init.tag | string | `""` | The tag that specifies the version of the Init container image used. Default: `Chart appVersion`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | | ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. Items: `.prefix`, `.name`, `.value`. | diff --git a/mika/grocy/templates/deployment.yaml b/mika/grocy/templates/deployment.yaml index 0bfb439e..28b84287 100644 --- a/mika/grocy/templates/deployment.yaml +++ b/mika/grocy/templates/deployment.yaml @@ -8,8 +8,8 @@ {{- $frontend_tag := .Values.image.frontend.tag | default .Chart.AppVersion | toString }} {{- $frontend_pullPolicy := .Values.image.frontend.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $init_registry := .Values.image.init.registry | default "docker.io" | toString }} -{{- $init_repository := .Values.image.init.repository | default "busybox" | toString }} -{{- $init_tag := .Values.image.init.tag | default "1.36.1" | toString }} +{{- $init_repository := .Values.image.init.repository | default "grocy/backend" | toString }} +{{- $init_tag := .Values.image.init.tag | default .Chart.AppVersion | toString }} {{- $init_pullPolicy := .Values.image.init.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $dataMountPath := .Values.storage.data.mountPath | default "/var/www/data" | toString }} diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index d80ccec8..dbfe0fff 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -39,16 +39,16 @@ image: # Default: "IfNotPresent" pullPolicy: "" # Init container image configurations. - # Source: https://hub.docker.com/_/busybox + # Source: https://hub.docker.com/r/grocy/backend init: # The registry where the Init container image is hosted. # Default: "docker.io" registry: "" # The name of the repository that contains the Init container image used. - # Default: "busybox" + # Default: "grocy/backend" repository: "" # The tag that specifies the version of the Init container image used. - # Default: "1.36.1" + # Default: Chart appVersion tag: "" # The policy that determines when Kubernetes should pull the Init container image. # Default: "IfNotPresent" From 1672d1cc0c4a9dfaecb385947df9bb200129f340 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 31 Jul 2024 13:24:49 +0800 Subject: [PATCH 241/363] Add new platform val --- mika/grocy/README.md | 1 + mika/grocy/values.yaml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mika/grocy/README.md b/mika/grocy/README.md index a1113147..8eeb0dca 100644 --- a/mika/grocy/README.md +++ b/mika/grocy/README.md @@ -137,6 +137,7 @@ Grocy is a web-based self-hosted groceries & household management solution for y | grocy.php.memory_limit | string | `""` | Determines the maximum amount of memory that PHP can allocate for executing scripts. Default: `"512M"`. | | grocy.php.post_limit | string | `""` | Defines the maximum size of the entire HTTP POST request that PHP can handle. Default: `"100M"`. | | grocy.php.upload_limit | string | `""` | Specifies the maximum size of an individual file that can be uploaded through PHP. Default: `"50M"`. | +| grocy.platform | string | `""` | The target operating system and architecture for the Grocy container. Default: `"linux/amd64"`. | | image.backend.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Backend container image. Default: `"IfNotPresent"`. | | image.backend.registry | string | `""` | The registry where the Backend container image is hosted. Default: `"docker.io"`. | | image.backend.repository | string | `""` | The name of the repository that contains the Backend container image used. Default: `"grocy/backend"`. | diff --git a/mika/grocy/values.yaml b/mika/grocy/values.yaml index dbfe0fff..e0df0ebd 100644 --- a/mika/grocy/values.yaml +++ b/mika/grocy/values.yaml @@ -92,6 +92,11 @@ grocy: # Example: # mode: "demo" mode: "" + # The target operating system and architecture for the Grocy container. + # Default: "linux/amd64" + # Example: + # platform: "linux/arm64" + platform: "" # Grocy PHP configurations. php: # Sets the maximum number of files that can be uploaded simultaneously through PHP. From 13f10658e64e9d3a929ed9fe1f0d47576ebfdae0 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 31 Jul 2024 13:25:03 +0800 Subject: [PATCH 242/363] Make PLATFORM configurable --- mika/grocy/templates/configmap.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/grocy/templates/configmap.yaml b/mika/grocy/templates/configmap.yaml index b6ffea06..5d410557 100644 --- a/mika/grocy/templates/configmap.yaml +++ b/mika/grocy/templates/configmap.yaml @@ -1,4 +1,5 @@ {{- $frontend_tag := .Values.image.frontend.tag | default .Chart.AppVersion | toString }} +{{- $platform := .Values.grocy.platform | default "linux/amd64" | toString | quote }} {{- $mode := .Values.grocy.mode | default "production" | toString | quote }} {{- $culture := .Values.grocy.culture | default "en_GB" | toString | quote }} {{- $currency := .Values.grocy.currency | default "MYR" | toString | quote }} @@ -16,7 +17,7 @@ metadata: {{- include "grocy.labels" . | nindent 4 }} data: GROCY_VERSION: {{ $frontend_tag }} - PLATFORM: "linux/amd64" + PLATFORM: {{ $platform }} GROCY_MODE: {{ $mode }} GROCY_CULTURE: {{ $culture }} GROCY_CURRENCY: {{ $currency }} From c6996a35e52a0ef1c0d7f27a4cd8c0ed8447849f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 10:08:59 +0800 Subject: [PATCH 243/363] Moved and updated data storage config --- mika/kutt/README.md | 9 +++++--- mika/kutt/values.yaml | 49 ++++++++++++++++++++++++++++--------------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index c6bd6721..8fa30078 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -81,9 +81,6 @@ helm uninstall $release_name --namespace $namespace --wait | Key | Type | Default | Description | |-----|------|---------|-------------| -| data.accessMode | string | `""` | The access mode that defines how the volume can be accessed by one or many nodes. Default: `"ReadWriteOnce"`. | -| data.storage | string | `""` | The amount of persistent storage allocated for the Kutt instance. Default: `"100Mi"`. | -| data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the Kutt storage. Default: "longhorn". | | db.host | string | `""` | The hostname or IP address of the Kutt database server. | | db.name | string | `""` | The name of the database used by Kutt. | | db.password | string | `""` | The password associated with the Kutt database's user. | @@ -138,3 +135,9 @@ helm uninstall $release_name --namespace $namespace --wait | service.kutt.port | string | `""` | The port number on which the Kutt service is listening. Default: `"3000"`. | | service.kutt.protocol | string | `""` | The protocol used by the Kutt service. Default: `"TCP"`. | | service.type | string | `""` | The type of service used for Kutt. Default: `"ClusterIP"`. | +| storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteOnce"`. | +| storage.data.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for data storage. | +| storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/data"`. | +| storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"100Mi"`. | +| storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. | +| storage.data.subPath | string | `""` | The subpath within the data storage to mount to the container. Leave empty if not required. | \ No newline at end of file diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index f3b33182..4b0f2959 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -167,23 +167,38 @@ redis: # password: "password" password: "" -# Data persistence configurations. -data: - # The access mode that defines how the volume can be accessed by one or many nodes. - # Default: "ReadWriteOnce" - # Example: - # accessMode: "ReadWriteMany" - accessMode: "" - # The amount of persistent storage allocated for the Kutt instance. - # Default: "100Mi" - # Example: - # storage: "1Gi" - storage: "" - # The storage class name used for dynamically provisioning a persistent volume for the Kutt storage. - # Default: "longhorn" - # Example: - # storageClassName: "longhorn" - storageClassName: "" +# Storage configurations. +storage: + # Data storage configurations. + data: + # Specifies whether persistent storage should be provisioned for data storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the data storage can be mounted. + # Default: "ReadWriteOnce" + # Example: + # accessMode: "ReadWriteMany" + accessMode: "" + # The path where the data storage should be mounted on the container. + # Default: "/data" + # Example: + # mountPath: "/config" + mountPath: "" + # The subpath within the data storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Data" + subPath: "" + # The default amount of persistent storage allocated for the data storage. + # Default: "100Mi" + # Example: + # storage: "10Gi" + storage: "" + # The storage class name used for dynamically provisioning a persistent volume for the data storage. + # Default: "longhorn" + # Example: + # storageClassName: "smb" + storageClassName: "" # Ingress configurations. ingress: From b2f79f9b721ee43fc6d3310d09640d950b665fbe Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 10:09:49 +0800 Subject: [PATCH 244/363] Refactored pvc --- mika/kutt/templates/pvc.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mika/kutt/templates/pvc.yaml b/mika/kutt/templates/pvc.yaml index 34c3384c..6748703a 100644 --- a/mika/kutt/templates/pvc.yaml +++ b/mika/kutt/templates/pvc.yaml @@ -1,8 +1,10 @@ -{{- $external_redis := .Values.redis.external }} -{{- if not $external_redis }} -{{- $access_mode := .Values.data.accessMode | default "ReadWriteOnce" | toString | quote }} -{{- $storage := .Values.data.storage | default "100Mi" | toString | quote }} -{{- $storage_class_name := .Values.data.storageClassName | default "longhorn" | toString | quote }} +{{- $externalRedis := .Values.redis.external }} +{{- $dataPersistence := .Values.storage.data.enabled }} +{{- $dataAccessMode := .Values.storage.data.accessMode | default "ReadWriteOnce" | toString | quote }} +{{- $dataStorage := .Values.storage.data.storage | default "100Mi" | toString | quote }} +{{- $dataStorageClassName := .Values.storage.data.storageClassName | default "longhorn" | toString | quote }} +{{- if and (not $externalRedis) $dataPersistence }} +--- apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -11,9 +13,9 @@ metadata: {{- include "kutt.labels" . | nindent 4 }} spec: accessModes: - - {{ $access_mode }} + - {{ $dataAccessMode }} resources: requests: - storage: {{ $storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $dataStorage }} + storageClassName: {{ $dataStorageClassName }} {{- end }} From 961964a5c531e16046c7c4fe533614cedf4122ea Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 10:11:27 +0800 Subject: [PATCH 245/363] Add imagePullSecrets --- mika/kutt/README.md | 1 + mika/kutt/values.yaml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 8fa30078..7772285f 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -95,6 +95,7 @@ helm uninstall $release_name --namespace $namespace --wait | image.redis.registry | string | `""` | The registry where the redis container image is hosted. Default: `"docker.io"`. | | image.redis.repository | string | `""` | The name of the repository that contains the redis container image used. Default: `"redis"`. | | image.redis.tag | string | `""` | The tag that specifies the version of the redis container image used. Default: `"6.0-alpine"`. | +| imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | | ingress.enabled | bool | `false` | Specifies whether Kutt should be hosted using an Ingress.. | | kutt.administration.dailyUserLimit | string | `""` | The maximum number of links that can be created by a user in a day. Default: `"50"`. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 4b0f2959..91a0abe3 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -37,6 +37,12 @@ image: # Default: "IfNotPresent" pullPolicy: "" +# Credentials used to securely authenticate and authorise the pulling of container images from private registries. +# Example: +# imagePullSecrets: +# - name: "ghcr-token-secret" +imagePullSecrets: [] + # Kutt configurations. kutt: # Email addresses of the administrators of the Kutt application so they can access admin actions. From 386659516027b27b396100436874e3877843dacc Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 10:11:56 +0800 Subject: [PATCH 246/363] Add image source --- mika/kutt/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 91a0abe3..2b09d9da 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -9,6 +9,7 @@ replicaCount: "" # Container images used for Kutt. image: # Kutt container image configurations. + # Source: https://hub.docker.com/r/kutt/kutt kutt: # The registry where the kutt container image is hosted. # Default: "docker.io" @@ -23,6 +24,7 @@ image: # Default: "IfNotPresent" pullPolicy: "" # Redis container image configurations. + # Source: https://hub.docker.com/_/redis redis: # The registry where the redis container image is hosted. # Default: "docker.io" From 0ebb3b044bd6b338ada5cf332eef2db34f1c65c2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 10:13:51 +0800 Subject: [PATCH 247/363] Update image desc --- mika/kutt/README.md | 16 ++++++++-------- mika/kutt/values.yaml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 7772285f..ee814ef9 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -87,14 +87,14 @@ helm uninstall $release_name --namespace $namespace --wait | db.port | string | `""` | The port number on which the Kutt database server is listening. Default: `"5432"`. | | db.ssl | bool | `false` | Specifies whether the Kutt database server should use SSL. | | db.user | string | `""` | The username or user account for accessing the Kutt database. | -| image.kutt.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the kutt container image. Default: `"IfNotPresent"`. | -| image.kutt.registry | string | `""` | The registry where the kutt container image is hosted. Default: `"docker.io"`. | -| image.kutt.repository | string | `""` | The name of the repository that contains the kutt container image used. Default: `"kutt/kutt"`. | -| image.kutt.tag | string | `""` | The tag that specifies the version of the kutt container image used. Default: `Chart appVersion`. | -| image.redis.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the redis container image. Default: `"IfNotPresent"`. | -| image.redis.registry | string | `""` | The registry where the redis container image is hosted. Default: `"docker.io"`. | -| image.redis.repository | string | `""` | The name of the repository that contains the redis container image used. Default: `"redis"`. | -| image.redis.tag | string | `""` | The tag that specifies the version of the redis container image used. Default: `"6.0-alpine"`. | +| image.kutt.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Kutt container image. Default: `"IfNotPresent"`. | +| image.kutt.registry | string | `""` | The registry where the Kutt container image is hosted. Default: `"docker.io"`. | +| image.kutt.repository | string | `""` | The name of the repository that contains the Kutt container image used. Default: `"kutt/kutt"`. | +| image.kutt.tag | string | `""` | The tag that specifies the version of the Kutt container image used. Default: `Chart appVersion`. | +| image.redis.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Redis container image. Default: `"IfNotPresent"`. | +| image.redis.registry | string | `""` | The registry where the Redis container image is hosted. Default: `"docker.io"`. | +| image.redis.repository | string | `""` | The name of the repository that contains the Redis container image used. Default: `"redis"`. | +| image.redis.tag | string | `""` | The tag that specifies the version of the Redis container image used. Default: `"6.0-alpine"`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | | ingress.enabled | bool | `false` | Specifies whether Kutt should be hosted using an Ingress.. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 2b09d9da..0ceafc9c 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -11,31 +11,31 @@ image: # Kutt container image configurations. # Source: https://hub.docker.com/r/kutt/kutt kutt: - # The registry where the kutt container image is hosted. + # The registry where the Kutt container image is hosted. # Default: "docker.io" registry: "" - # The name of the repository that contains the kutt container image used. + # The name of the repository that contains the Kutt container image used. # Default: "kutt/kutt" repository: "" - # The tag that specifies the version of the kutt container image used. + # The tag that specifies the version of the Kutt container image used. # Default: Chart appVersion tag: "" - # The policy that determines when Kubernetes should pull the kutt container image. + # The policy that determines when Kubernetes should pull the Kutt container image. # Default: "IfNotPresent" pullPolicy: "" # Redis container image configurations. # Source: https://hub.docker.com/_/redis redis: - # The registry where the redis container image is hosted. + # The registry where the Redis container image is hosted. # Default: "docker.io" registry: "" - # The name of the repository that contains the redis container image used. + # The name of the repository that contains the Redis container image used. # Default: "redis" repository: "" - # The tag that specifies the version of the redis container image used. + # The tag that specifies the version of the Redis container image used. # Default: "6.0-alpine" tag: "" - # The policy that determines when Kubernetes should pull the redis container image. + # The policy that determines when Kubernetes should pull the Redis container image. # Default: "IfNotPresent" pullPolicy: "" From 6909db0935c1815d6284a6ed3b703b80b2e7dc7d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:10:09 +0800 Subject: [PATCH 248/363] Update desc --- mika/kutt/README.md | 2 +- mika/kutt/values.yaml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index ee814ef9..a14ed038 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -104,7 +104,7 @@ helm uninstall $release_name --namespace $namespace --wait | kutt.administration.maxStatsPerLink | string | `""` | The maximum number of visits for a link to have detailed statistics. Default: `"5000"`. | | kutt.administration.nonUserCooldown | string | `""` | The number of minutes an anonymous user must wait before creating another link. Default: `"0"`. | | kutt.admins | list | `[]` | Email addresses of the administrators of the Kutt application so they can access admin actions. | -| kutt.domain | string | `""` | The domain name that is hosting the Kutt application. Default: `"localhost:$service.kutt.port"` if `ingress` is disabled. | +| kutt.domain | string | `""` | The ingress domain name that hosts the Kutt server. | | kutt.google.recaptchaSecretKey | string | `""` | The Google reCAPTCHA secret key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. | | kutt.google.recaptchaSiteKey | string | `""` | The Google reCAPTCHA site key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. | | kutt.google.safeBrowsingKey | string | `""` | The Google API key used for Google Safe Browsing to prevent malicious links. Refer to https://developers.google.com/safe-browsing/v4/get-started. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 0ceafc9c..f98ab581 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -53,8 +53,7 @@ kutt: # - "admin@example.com" # - "su@example.com" admins: [] - # The domain name that is hosting the Kutt application. - # Default: "localhost:$service.kutt.port" if `ingress` is disabled + # The ingress domain name that hosts the Kutt server. # Example: # domain: "kutt.example.com" domain: "" From d6d497e5c23e34b880be6976eea6ae89fb4f7231 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:12:23 +0800 Subject: [PATCH 249/363] Move and updated ingress config --- mika/kutt/values.yaml | 44 +++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index f98ab581..f6b2b540 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -174,6 +174,40 @@ redis: # password: "password" password: "" +# Ingress configurations. +ingress: + # Specifies whether Ingress should be enabled for hosting Kutt services. + # Example: + # enabled: true + enabled: false + # The name of the cluster issuer for Ingress. + # Default: "letsencrypt-dns-prod" + # Example: + # clusterIssuer: "letsencrypt-http-prod" + clusterIssuer: "" + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false + # Additional configuration annotations to be added to the Ingress resource. + # Items: `.prefix`, `.name`, `.value` + # Example: + # customAnnotations: + # # The prefix of the annotation. + # # Default: "nginx.ingress.kubernetes.io" + # # Example: + # # prefix: "nginx.org" + # - prefix: "" + # # The name of the annotation. + # # Example: + # # name: "proxy-connect-timeout" + # name: "" + # # The value of the annotation. + # # Example: + # # value: "120" + # value: "" + customAnnotations: [] + # Storage configurations. storage: # Data storage configurations. @@ -207,16 +241,6 @@ storage: # storageClassName: "smb" storageClassName: "" -# Ingress configurations. -ingress: - # Specifies whether Kutt should be hosted using an Ingress. - # Example: - # enabled: true - enabled: false - # The name of the cluster issuer for Ingress. - # Default: "letsencrypt-dns-prod" - clusterIssuer: "" - # Service configurations. service: # The type of service used for Kutt. From 66486bfbce5b50f2ead538b070c26011b34fb19c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:14:36 +0800 Subject: [PATCH 250/363] Update ingress config settings --- mika/kutt/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index a14ed038..7c597374 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -97,7 +97,9 @@ helm uninstall $release_name --namespace $namespace --wait | image.redis.tag | string | `""` | The tag that specifies the version of the Redis container image used. Default: `"6.0-alpine"`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | | ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | -| ingress.enabled | bool | `false` | Specifies whether Kutt should be hosted using an Ingress.. | +| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. Items: `.prefix`, `.name`, `.value`. | +| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Kutt services. | +| ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | | kutt.administration.dailyUserLimit | string | `""` | The maximum number of links that can be created by a user in a day. Default: `"50"`. | | kutt.administration.disableAnonLinks | bool | `false` | Specifies whether Kutt should disallow creating links without an account. | | kutt.administration.disableRegistration | bool | `false` | Specifies whether Kutt should disallow user registrations. | From df6aa09e16a45a9090bb7a93e0e4fe358c6036b8 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:15:11 +0800 Subject: [PATCH 251/363] Update ingress res --- mika/kutt/templates/ingress.yaml | 56 ++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/mika/kutt/templates/ingress.yaml b/mika/kutt/templates/ingress.yaml index e784599f..5de59d74 100644 --- a/mika/kutt/templates/ingress.yaml +++ b/mika/kutt/templates/ingress.yaml @@ -1,7 +1,11 @@ {{- $ingress := .Values.ingress.enabled }} -{{- if $ingress }} -{{- $cluster_issuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} -{{- $domain := .Values.kutt.domain | toString | quote }} +{{- $www := .Values.ingress.www }} +{{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $customAnnotations := .Values.ingress.customAnnotations }} +{{- $domain := .Values.kutt.domain | toString }} +{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} +{{- if and $ingress $domain }} +--- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -9,7 +13,7 @@ metadata: labels: {{- include "kutt.labels" . | nindent 4 }} annotations: - cert-manager.io/cluster-issuer: {{ $cluster_issuer }} + cert-manager.io/cluster-issuer: {{ $clusterIssuer }} cert-manager.io/private-key-algorithm: "ECDSA" nginx.ingress.kubernetes.io/affinity: "cookie" nginx.ingress.kubernetes.io/affinity-mode: "persistent" @@ -18,21 +22,39 @@ metadata: nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" nginx.ingress.kubernetes.io/session-cookie-name: "route" nginx.org/client-max-body-size: "100m" + {{- range $customAnnotations }} + {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} + {{- end }} spec: ingressClassName: "nginx" rules: - - host: {{ $domain }} - http: - paths: - - backend: - service: - name: {{ .Release.Name }}-kutt-svc - port: - name: kutt - path: / - pathType: Prefix + - host: {{ $domain | quote }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-kutt-svc + port: + name: kutt + path: / + pathType: Prefix + {{- if $www }} + - host: {{ $wwwDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-kutt-svc + port: + name: kutt + path: / + pathType: Prefix + {{- end }} tls: - - hosts: - - {{ $domain }} - secretName: {{ .Release.Name }}-kutt-tls-cert + - hosts: + - {{ $domain | quote }} + {{- if $www }} + - {{ $wwwDomain }} + {{- end }} + secretName: {{ .Release.Name }}-kutt-tls-cert {{- end }} From cae6c92da7d4a2018f0736713352458d362b3e6f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:30:07 +0800 Subject: [PATCH 252/363] Moved and updated service config Removed protocol config --- mika/kutt/README.md | 8 ++++--- mika/kutt/values.yaml | 50 ++++++++++++++++++++++++++----------------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 7c597374..292d09d8 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -135,9 +135,11 @@ helm uninstall $release_name --namespace $namespace --wait | resources.redis.limits.memory | string | `"50Mi"` | The maximum amount of memory allowed for the redis. | | resources.redis.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by the redis. | | resources.redis.requests.memory | string | `"20Mi"` | The minimum amount of memory required by the redis. | -| service.kutt.port | string | `""` | The port number on which the Kutt service is listening. Default: `"3000"`. | -| service.kutt.protocol | string | `""` | The protocol used by the Kutt service. Default: `"TCP"`. | -| service.type | string | `""` | The type of service used for Kutt. Default: `"ClusterIP"`. | +| service.kutt.nodePort | string | `""` | The optional node port to expose for Kutt when the service type is NodePort. | +| service.kutt.port | string | `""` | The Kutt port on which the Kutt server should listen for connections. Default: `"3000"`. | +| service.redis.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | +| service.redis.port | string | `""` | The Redis port on which the Kutt server should listen for connections. Default: `"6379"`. | +| service.type | string | `""` | The type of service used to expose Kutt services. Default: `"ClusterIP"`. | | storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteOnce"`. | | storage.data.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for data storage. | | storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/data"`. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index f6b2b540..3e35bcf7 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -208,6 +208,36 @@ ingress: # value: "" customAnnotations: [] +# Service configurations. +service: + # The type of service used to expose Kutt services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" + # Kutt service port configurations. + kutt: + # The optional node port to expose for Kutt when the service type is NodePort. + # Example: + # nodePort: "30000" + nodePort: "" + # The Kutt port on which the Kutt server should listen for connections. + # Default: "3000" + # Example: + # port: "8080" + port: "" + # Redis service port configurations. + redis: + # The optional node port to expose for Redis when the service type is NodePort. + # Example: + # nodePort: "32000" + nodePort: "" + # The Redis port on which the Kutt server should listen for connections. + # Default: "6379" + # Example: + # port: "8443" + port: "" + # Storage configurations. storage: # Data storage configurations. @@ -241,26 +271,6 @@ storage: # storageClassName: "smb" storageClassName: "" -# Service configurations. -service: - # The type of service used for Kutt. - # Default: "ClusterIP" - # Example: - # type: "ClusterIP" - type: "" - # Kutt service configurations. - kutt: - # The port number on which the Kutt service is listening. - # Default: "3000" - # Example: - # port: "3500" - port: "" - # The protocol used by the Kutt service. - # Default: "TCP" - # Example: - # protocol: "TCP" - protocol: "" - # Database configurations. db: # The hostname or IP address of the Kutt database server. From 56f618c5e30604b421153ede9b6428649e8fd3f9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:31:11 +0800 Subject: [PATCH 253/363] Updated svc res --- mika/kutt/templates/service.yaml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/mika/kutt/templates/service.yaml b/mika/kutt/templates/service.yaml index cdd926e6..52bf506b 100644 --- a/mika/kutt/templates/service.yaml +++ b/mika/kutt/templates/service.yaml @@ -1,7 +1,10 @@ +{{- $externalRedis := .Values.redis.external }} +{{- $kuttPort := .Values.service.kutt.port | default "80" | toString }} +{{- $kuttNodePort := .Values.service.kutt.nodePort | toString }} +{{- $redisPort := .Values.service.redis.port | default "6379" | toString }} +{{- $redisNodePort := .Values.service.redis.nodePort | toString }} {{- $type := .Values.service.type | default "ClusterIP" | toString }} -{{- $kutt_port := .Values.service.kutt.port | default "3000" | toString | int }} -{{- $kutt_protocol := .Values.service.kutt.protocol | default "TCP" | toString }} -{{- $external_redis := .Values.redis.external }} +--- apiVersion: v1 kind: Service metadata: @@ -11,13 +14,19 @@ metadata: spec: type: {{ $type }} ports: - - port: {{ $kutt_port }} + - port: {{ int $kuttPort }} targetPort: kutt - protocol: {{ $kutt_protocol }} + {{- if and (eq $type "NodePort") $kuttNodePort }} + nodePort: {{ int $kuttNodePort }} + {{- end }} + protocol: TCP name: kutt - {{- if not $external_redis }} - - port: 6379 + {{- if not $externalRedis }} + - port: {{ int $redisPort }} targetPort: redis + {{- if and (eq $type "NodePort") $redisNodePort }} + nodePort: {{ int $redisNodePort }} + {{- end }} protocol: TCP name: redis {{- end }} From 1356def0c72beb30e399f282fbcf903a4d415a8d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:31:28 +0800 Subject: [PATCH 254/363] Hardcode container port and protocol --- mika/kutt/templates/deployment.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index a413e54a..b2fb02d2 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -7,8 +7,6 @@ {{- $redis_tag := .Values.image.redis.tag | default "6.0-alpine" | toString }} {{- $redis_pullPolicy := .Values.image.redis.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} -{{- $kutt_port := .Values.service.kutt.port | default "3000" | toString | int }} -{{- $kutt_protocol := .Values.service.kutt.protocol | default "TCP" | toString }} {{- $external_redis := .Values.redis.external }} {{- $redis_password := .Values.redis.password | toString }} apiVersion: apps/v1 @@ -46,8 +44,8 @@ spec: ./wait-for-it.sh $(DB_HOST):$(DB_PORT) -- npm start ports: - name: kutt - containerPort: {{ $kutt_port }} - protocol: {{ $kutt_protocol }} + containerPort: 3000 + protocol: TCP resources: {{- toYaml .Values.resources.kutt | nindent 12 }} envFrom: From b43febcc4cc4e4aab5e96e741776761ef956aa82 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:54:19 +0800 Subject: [PATCH 255/363] Replace db with postgres config --- mika/kutt/README.md | 12 ++++----- mika/kutt/values.yaml | 57 ++++++++++++++++++++++--------------------- 2 files changed, 35 insertions(+), 34 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 292d09d8..b08dd4c5 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -81,12 +81,6 @@ helm uninstall $release_name --namespace $namespace --wait | Key | Type | Default | Description | |-----|------|---------|-------------| -| db.host | string | `""` | The hostname or IP address of the Kutt database server. | -| db.name | string | `""` | The name of the database used by Kutt. | -| db.password | string | `""` | The password associated with the Kutt database's user. | -| db.port | string | `""` | The port number on which the Kutt database server is listening. Default: `"5432"`. | -| db.ssl | bool | `false` | Specifies whether the Kutt database server should use SSL. | -| db.user | string | `""` | The username or user account for accessing the Kutt database. | | image.kutt.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Kutt container image. Default: `"IfNotPresent"`. | | image.kutt.registry | string | `""` | The registry where the Kutt container image is hosted. Default: `"docker.io"`. | | image.kutt.repository | string | `""` | The name of the repository that contains the Kutt container image used. Default: `"kutt/kutt"`. | @@ -122,6 +116,12 @@ helm uninstall $release_name --namespace $namespace --wait | kutt.name | string | `""` | The name of the site where Kutt is hosted. Default: `"Kutt"`. | | kutt.secret | string | `""` | A 50-character secret key used for encrypting JSON Web Tokens (JWTs). | | kutt.useHttps | bool | `true` | Specifies whether Kutt should use HTTPS for custom domains. | +| postgres.host | string | `""` | The hostname or IP address of the Kutt database server. | +| postgres.name | string | `""` | The name of the database being used by Kutt. | +| postgres.password | string | `""` | The password associated with the Kutt database user. | +| postgres.port | string | `""` | The port number the Kutt database server is listening for connections. Default: `"5432"`. | +| postgres.ssl | string | `""` | Specifies whether the Kutt database server should use SSL. Default: `"false"`. | +| postgres.user | string | `""` | The username or user account for accessing the Kutt database. | | redis.external | bool | `false` | Specifies whether Kutt should use an external Redis server. | | redis.host | string | `""` | The hostname or IP address of the Redis server. Default: `"localhost"`. | | redis.password | string | `""` | The password for authenticating with the Redis server. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 3e35bcf7..65c6ce81 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -174,6 +174,35 @@ redis: # password: "password" password: "" +# PostgreSQL configurations. +postgres: + # The hostname or IP address of the Kutt database server. + # Example: + # host: "kutt.default.svc.cluster.local" + host: "" + # The port number the Kutt database server is listening for connections. + # Default: "5432" + # Example: + # port: "3306" + port: "" + # Specifies whether the Kutt database server should use SSL. + # Default: "false" + # Example: + # ssl: "true" + ssl: "" + # The name of the database being used by Kutt. + # Example: + # name: "kutt" + name: "" + # The username or user account for accessing the Kutt database. + # Example: + # user: "root" + user: "" + # The password associated with the Kutt database user. + # Example: + # password: "password" + password: "" + # Ingress configurations. ingress: # Specifies whether Ingress should be enabled for hosting Kutt services. @@ -271,34 +300,6 @@ storage: # storageClassName: "smb" storageClassName: "" -# Database configurations. -db: - # The hostname or IP address of the Kutt database server. - # Example: - # host: "kutt.default.svc.cluster.local" - host: "" - # The port number on which the Kutt database server is listening. - # Default: "5432" - # Example: - # port: "5432" - port: "" - # The name of the database used by Kutt. - # Example: - # name: "kutt" - name: "" - # The username or user account for accessing the Kutt database. - # Example: - # user: "root" - user: "" - # The password associated with the Kutt database's user. - # Example: - # password: "password" - password: "" - # Specifies whether the Kutt database server should use SSL. - # Example: - # ssl: true - ssl: false - # Resource requirements and limits for Kutt containers. resources: # Kutt container resources. From 177ee9ca105f114659cafa8e0570c9fe6687150c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:55:32 +0800 Subject: [PATCH 256/363] Add separator --- mika/kutt/templates/configmap.yaml | 1 + mika/kutt/templates/deployment.yaml | 1 + mika/kutt/templates/secret.yaml | 1 + 3 files changed, 3 insertions(+) diff --git a/mika/kutt/templates/configmap.yaml b/mika/kutt/templates/configmap.yaml index 5ba7344b..0b66702a 100644 --- a/mika/kutt/templates/configmap.yaml +++ b/mika/kutt/templates/configmap.yaml @@ -13,6 +13,7 @@ {{- if not $ingress }} {{- $domain = $domain | default (printf "localhost:%s" $kutt_port) }} {{- end }} +--- apiVersion: v1 kind: ConfigMap metadata: diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index b2fb02d2..9bbdcbba 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -9,6 +9,7 @@ {{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $external_redis := .Values.redis.external }} {{- $redis_password := .Values.redis.password | toString }} +--- apiVersion: apps/v1 kind: Deployment metadata: diff --git a/mika/kutt/templates/secret.yaml b/mika/kutt/templates/secret.yaml index 2cc2203f..5ed6747a 100644 --- a/mika/kutt/templates/secret.yaml +++ b/mika/kutt/templates/secret.yaml @@ -21,6 +21,7 @@ {{- $recaptchaSecretKey := .Values.kutt.google.recaptchaSecretKey | toString | b64enc }} {{- $recaptchaSiteKey := .Values.kutt.google.recaptchaSiteKey | toString | b64enc }} {{- $safeBrowsingKey := .Values.kutt.google.safeBrowsingKey | toString | b64enc }} +--- apiVersion: v1 kind: Secret metadata: From 48f88809c5852e9f249a028e0958278e4b0b50bd Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 11:59:32 +0800 Subject: [PATCH 257/363] Refactor db config --- mika/kutt/templates/secret.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/kutt/templates/secret.yaml b/mika/kutt/templates/secret.yaml index 5ed6747a..0bf3401d 100644 --- a/mika/kutt/templates/secret.yaml +++ b/mika/kutt/templates/secret.yaml @@ -1,10 +1,10 @@ {{- $secret := .Values.kutt.secret | toString | b64enc }} -{{- $db_name := .Values.db.name | toString | b64enc }} -{{- $db_user := .Values.db.user | toString | b64enc }} -{{- $db_password := .Values.db.password | toString | b64enc }} -{{- $db_host := .Values.db.host | toString | b64enc }} -{{- $db_port := .Values.db.port | default "5432" | toString | b64enc }} -{{- $db_ssl := .Values.db.ssl | toString | b64enc }} +{{- $db_name := .Values.postgres.name | toString | b64enc }} +{{- $db_user := .Values.postgres.user | toString | b64enc }} +{{- $db_password := .Values.postgres.password | toString | b64enc }} +{{- $db_host := .Values.postgres.host | toString | b64enc }} +{{- $db_port := .Values.postgres.port | default "5432" | toString | b64enc }} +{{- $db_ssl := .Values.postgres.ssl | default "false" | toString | b64enc }} {{- $mail_host := .Values.kutt.mail.host | default "smtp.gmail.com" | toString | b64enc }} {{- $mail_port := .Values.kutt.mail.port | default "465" | toString | b64enc }} {{- $mail_secure := .Values.kutt.mail.secure | toString | b64enc }} From 50c47e7e5c830bbb666664f324125f5900d35d2d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:02:48 +0800 Subject: [PATCH 258/363] Updated container resources --- mika/kutt/README.md | 10 +---- mika/kutt/values.yaml | 88 ++++++++++++++++++++++--------------------- 2 files changed, 48 insertions(+), 50 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index b08dd4c5..8a39d2c0 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -127,14 +127,8 @@ helm uninstall $release_name --namespace $namespace --wait | redis.password | string | `""` | The password for authenticating with the Redis server. | | redis.port | string | `""` | The port number on which the EXTERNAL Redis server is listening. Default: `"6379"`. | | replicaCount | string | `""` | The desired number of running replicas for Kutt. Default: `"1"`. | -| resources.kutt.limits.cpu | string | `"150m"` | The maximum amount of CPU resources allowed for the kutt. | -| resources.kutt.limits.memory | string | `"400Mi"` | The maximum amount of memory allowed for the kutt. | -| resources.kutt.requests.cpu | string | `"100m"` | The minimum amount of CPU resources required by the kutt. | -| resources.kutt.requests.memory | string | `"200Mi"` | The minimum amount of memory required by the kutt. | -| resources.redis.limits.cpu | string | `"20m"` | The maximum amount of CPU resources allowed for the redis. | -| resources.redis.limits.memory | string | `"50Mi"` | The maximum amount of memory allowed for the redis. | -| resources.redis.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by the redis. | -| resources.redis.requests.memory | string | `"20Mi"` | The minimum amount of memory required by the redis. | +| resources.kutt | object | `{}` | Kutt container resources. | +| resources.redis | object | `{}` | Redis container resources. | | service.kutt.nodePort | string | `""` | The optional node port to expose for Kutt when the service type is NodePort. | | service.kutt.port | string | `""` | The Kutt port on which the Kutt server should listen for connections. Default: `"3000"`. | | service.redis.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 65c6ce81..69f0eea5 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -303,46 +303,50 @@ storage: # Resource requirements and limits for Kutt containers. resources: # Kutt container resources. - kutt: - # The minimum amount of resources required by the kutt to run. - requests: - # The minimum amount of CPU resources required by the kutt. - # Example: - # cpu: "10m" - cpu: "100m" - # The minimum amount of memory required by the kutt. - # Example: - # memory: "10Mi" - memory: "200Mi" - # The maximum amount of resources allowed for the kutt. - limits: - # The maximum amount of CPU resources allowed for the kutt. - # Example: - # cpu: "250m" - cpu: "150m" - # The maximum amount of memory allowed for the kutt. - # Example: - # memory: "250Mi" - memory: "400Mi" + # Example: + # kutt: + # # The minimum amount of resources required by Kutt to run. + # requests: + # # The minimum amount of CPU resources required by Kutt. + # # Example: + # # cpu: "10m" + # cpu: "100m" + # # The minimum amount of memory required by Kutt. + # # Example: + # # memory: "10Mi" + # memory: "200Mi" + # # The maximum amount of resources allowed for Kutt. + # limits: + # # The maximum amount of CPU resources allowed for Kutt. + # # Example: + # # cpu: "250m" + # cpu: "150m" + # # The maximum amount of memory allowed for Kutt. + # # Example: + # # memory: "250Mi" + # memory: "400Mi" + kutt: {} # Redis container resources. - redis: - # The minimum amount of resources required by the redis to run. - requests: - # The minimum amount of CPU resources required by the redis. - # Example: - # cpu: "10m" - cpu: "10m" - # The minimum amount of memory required by the redis. - # Example: - # memory: "10Mi" - memory: "20Mi" - # The maximum amount of resources allowed for the redis. - limits: - # The maximum amount of CPU resources allowed for the redis. - # Example: - # cpu: "250m" - cpu: "20m" - # The maximum amount of memory allowed for the redis. - # Example: - # memory: "250Mi" - memory: "50Mi" + # Example: + # redis: + # # The minimum amount of resources required by Redis to run. + # requests: + # # The minimum amount of CPU resources required by Redis. + # # Example: + # # cpu: "10m" + # cpu: "10m" + # # The minimum amount of memory required by Redis. + # # Example: + # # memory: "10Mi" + # memory: "20Mi" + # # The maximum amount of resources allowed for Redis. + # limits: + # # The maximum amount of CPU resources allowed for Redis. + # # Example: + # # cpu: "250m" + # cpu: "20m" + # # The maximum amount of memory allowed for Redis. + # # Example: + # # memory: "250Mi" + # memory: "50Mi" + redis: {} From 2b8631652475e3f5e1cc98ed29b47b2002aecfc4 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:23:00 +0800 Subject: [PATCH 259/363] Moved mail config --- mika/kutt/README.md | 16 ++++----- mika/kutt/values.yaml | 80 +++++++++++++++++++++++-------------------- 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 8a39d2c0..e29bba4f 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -105,17 +105,17 @@ helm uninstall $release_name --namespace $namespace --wait | kutt.google.recaptchaSiteKey | string | `""` | The Google reCAPTCHA site key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. | | kutt.google.safeBrowsingKey | string | `""` | The Google API key used for Google Safe Browsing to prevent malicious links. Refer to https://developers.google.com/safe-browsing/v4/get-started. | | kutt.link_length | string | `""` | The length of the generated short links. Default: `"6"`. | -| kutt.mail.contact_email | string | `""` | The email address to be displayed as the contact email in the application. | -| kutt.mail.from_email | string | `""` | The email address used as the "from" address for sent emails. Default: `"$name <$mail.user>"`. | -| kutt.mail.host | string | `""` | The hostname or IP address of the SMTP server for sending emails. Default: `"smtp.gmail.com"`. | -| kutt.mail.password | string | `""` | The password for authenticating with the SMTP server. | -| kutt.mail.port | string | `""` | The port number on the SMTP server used for sending emails. Default: `"465"`. | -| kutt.mail.report_email | string | `""` | The email address that will receive submitted reports. | -| kutt.mail.secure | bool | `true` | Specifies whether Kutt should use a secure TLS connection when sending emails. | -| kutt.mail.user | string | `""` | The username for authenticating with the SMTP server. | | kutt.name | string | `""` | The name of the site where Kutt is hosted. Default: `"Kutt"`. | | kutt.secret | string | `""` | A 50-character secret key used for encrypting JSON Web Tokens (JWTs). | | kutt.useHttps | bool | `true` | Specifies whether Kutt should use HTTPS for custom domains. | +| mail.contact_email | string | `""` | The email address to be displayed as the contact email in the application. | +| mail.from_email | string | `""` | The email address used as the "from" address for sent emails. Default: `"$name <$mail.smtp.user>"`. | +| mail.report_email | string | `""` | The email address that will receive submitted reports. | +| mail.secure | string | `""` | Specifies whether Kutt should use a secure TLS connection when sending emails. Default: `"true"`. | +| mail.smtp.host | string | `""` | The hostname or IP address of the SMTP server for sending emails. Default: `"smtp.gmail.com"`. | +| mail.smtp.password | string | `""` | The password for authenticating with the SMTP server. | +| mail.smtp.port | string | `""` | The port number on the SMTP server used for sending emails. Default: `"465"`. | +| mail.smtp.user | string | `""` | The username for authenticating with the SMTP server. | | postgres.host | string | `""` | The hostname or IP address of the Kutt database server. | | postgres.name | string | `""` | The name of the database being used by Kutt. | | postgres.password | string | `""` | The password associated with the Kutt database user. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 69f0eea5..653295af 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -114,44 +114,6 @@ kutt: # Example: # safeBrowsingKey: "Z0VNqFK9NqYYwFP27v9-eC1St4HTz3uRTJRfii5" safeBrowsingKey: "" - # Kutt mail configurations. - mail: - # The hostname or IP address of the SMTP server for sending emails. - # Default: "smtp.gmail.com" - # Example: - # host: "" - host: "" - # The port number on the SMTP server used for sending emails. - # Default: "465" - # Example: - # port: "" - port: "" - # The username for authenticating with the SMTP server. - # Example: - # user: "kutt@example.com" - user: "" - # The password for authenticating with the SMTP server. - # Example: - # password: "password" - password: "" - # Specifies whether Kutt should use a secure TLS connection when sending emails. - # Note: In most cases, set this to true if the SMTP port is 465 (SSL) and false if you are using port 587 (TLS) or 25 (SSL/TLS). - # Example - # secure: false - secure: true - # The email address used as the "from" address for sent emails. - # Default: "$name <$mail.user>" - # Example: - # from_email: "Example User " - from_email: "" - # The email address to be displayed as the contact email in the application. - # Example: - # contact_email: "contact@example.com" - contact_email: "" - # The email address that will receive submitted reports. - # Example: - # report_email: "report@example.com" - report_email: "" # Redis configurations. redis: @@ -174,6 +136,48 @@ redis: # password: "password" password: "" +# Mail configurations. +mail: + # The email address to be displayed as the contact email in the application. + # Example: + # contact_email: "contact@example.com" + contact_email: "" + # The email address used as the "from" address for sent emails. + # Default: "$name <$mail.user>" + # Example: + # from_email: "Example User " + from_email: "" + # The email address that will receive submitted reports. + # Example: + # report_email: "report@example.com" + report_email: "" + # Specifies whether Kutt should use a secure TLS connection when sending emails. + # Note: In most cases, set this to true if the SMTP port is 465 (SSL) and false if you are using port 587 (TLS) or 25 (SSL/TLS). + # Default: "true" + # Example + # secure: "false" + secure: "" + # SMTP server configurations. + smtp: + # The hostname or IP address of the SMTP server for sending emails. + # Default: "smtp.gmail.com" + # Example: + # host: "smtp.mail.yahoo.com" + host: "" + # The port number on the SMTP server used for sending emails. + # Default: "465" + # Example: + # port: "587" + port: "" + # The username for authenticating with the SMTP server. + # Example: + # user: "kutt@example.com" + user: "" + # The password for authenticating with the SMTP server. + # Example: + # password: "password" + password: "" + # PostgreSQL configurations. postgres: # The hostname or IP address of the Kutt database server. From 4dc06ee02169a21fcdee66eca1b6822b1bb5851d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:32:45 +0800 Subject: [PATCH 260/363] Refactor mail config vals --- mika/kutt/templates/secret.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/mika/kutt/templates/secret.yaml b/mika/kutt/templates/secret.yaml index 0bf3401d..f6a0a673 100644 --- a/mika/kutt/templates/secret.yaml +++ b/mika/kutt/templates/secret.yaml @@ -5,15 +5,15 @@ {{- $db_host := .Values.postgres.host | toString | b64enc }} {{- $db_port := .Values.postgres.port | default "5432" | toString | b64enc }} {{- $db_ssl := .Values.postgres.ssl | default "false" | toString | b64enc }} -{{- $mail_host := .Values.kutt.mail.host | default "smtp.gmail.com" | toString | b64enc }} -{{- $mail_port := .Values.kutt.mail.port | default "465" | toString | b64enc }} -{{- $mail_secure := .Values.kutt.mail.secure | toString | b64enc }} -{{- $mail_user := .Values.kutt.mail.user | toString }} -{{- $mail_password := .Values.kutt.mail.password | toString | b64enc }} {{- $name := .Values.kutt.name | default "Kutt" | toString }} -{{- $from_email := .Values.kutt.mail.from_email | default (printf "%s <%s>" $name $mail_user) | toString | b64enc }} -{{- $contact_email := .Values.kutt.mail.contact_email | toString | b64enc }} -{{- $report_email := .Values.kutt.mail.report_email | toString | b64enc }} +{{- $mailHost := .Values.mail.smtp.host | default "smtp.gmail.com" | toString | b64enc }} +{{- $mailPort := .Values.mail.smtp.port | default "465" | toString | b64enc }} +{{- $mailUser := .Values.mail.smtp.user | toString }} +{{- $mailPassword := .Values.mail.smtp.password | toString | b64enc }} +{{- $mailContact := .Values.mail.contact_email | toString | b64enc }} +{{- $mailFrom := .Values.mail.from_email | default (printf "%s <%s>" $name $mailUser) | toString | b64enc }} +{{- $mailReport := .Values.mail.report_email | toString | b64enc }} +{{- $mailSecure := .Values.mail.secure | default "true" | toString | b64enc }} {{- $external_redis := .Values.redis.external }} {{- $redis_host := .Values.redis.host | default "localhost" | toString | b64enc }} {{- $redis_port := .Values.redis.port | default "6379" | toString | b64enc }} @@ -37,14 +37,14 @@ data: DB_HOST: {{ $db_host }} DB_PORT: {{ $db_port }} DB_SSL: {{ $db_ssl }} - MAIL_HOST: {{ $mail_host }} - MAIL_PORT: {{ $mail_port }} - MAIL_SECURE: {{ $mail_secure }} - MAIL_USER: {{ $mail_user | b64enc }} - MAIL_PASSWORD: {{ $mail_password }} - MAIL_FROM: {{ $from_email }} - CONTACT_EMAIL: {{ $contact_email }} - REPORT_EMAIL: {{ $report_email }} + MAIL_HOST: {{ $mailHost }} + MAIL_PORT: {{ $mailPort }} + MAIL_SECURE: {{ $mailSecure }} + MAIL_USER: {{ $mailUser | b64enc }} + MAIL_PASSWORD: {{ $mailPassword }} + MAIL_FROM: {{ $mailFrom }} + CONTACT_EMAIL: {{ $mailContact }} + REPORT_EMAIL: {{ $mailReport }} {{- if $recaptchaSiteKey }} RECAPTCHA_SITE_KEY: {{ $recaptchaSiteKey }} {{- end }} From 5b7ff97e485af3fb4fbcea5ec53ba3b60d880b19 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:36:11 +0800 Subject: [PATCH 261/363] Moved google config --- mika/kutt/README.md | 6 +++--- mika/kutt/values.yaml | 29 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index e29bba4f..943896ea 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -81,6 +81,9 @@ helm uninstall $release_name --namespace $namespace --wait | Key | Type | Default | Description | |-----|------|---------|-------------| +| google.recaptchaSecretKey | string | `""` | The Google reCAPTCHA secret key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. | +| google.recaptchaSiteKey | string | `""` | The Google reCAPTCHA site key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. | +| google.safeBrowsingKey | string | `""` | The Google API key used for Google Safe Browsing to prevent malicious links. Refer to https://developers.google.com/safe-browsing/v4/get-started. | | image.kutt.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Kutt container image. Default: `"IfNotPresent"`. | | image.kutt.registry | string | `""` | The registry where the Kutt container image is hosted. Default: `"docker.io"`. | | image.kutt.repository | string | `""` | The name of the repository that contains the Kutt container image used. Default: `"kutt/kutt"`. | @@ -101,9 +104,6 @@ helm uninstall $release_name --namespace $namespace --wait | kutt.administration.nonUserCooldown | string | `""` | The number of minutes an anonymous user must wait before creating another link. Default: `"0"`. | | kutt.admins | list | `[]` | Email addresses of the administrators of the Kutt application so they can access admin actions. | | kutt.domain | string | `""` | The ingress domain name that hosts the Kutt server. | -| kutt.google.recaptchaSecretKey | string | `""` | The Google reCAPTCHA secret key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. | -| kutt.google.recaptchaSiteKey | string | `""` | The Google reCAPTCHA site key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. | -| kutt.google.safeBrowsingKey | string | `""` | The Google API key used for Google Safe Browsing to prevent malicious links. Refer to https://developers.google.com/safe-browsing/v4/get-started. | | kutt.link_length | string | `""` | The length of the generated short links. Default: `"6"`. | | kutt.name | string | `""` | The name of the site where Kutt is hosted. Default: `"Kutt"`. | | kutt.secret | string | `""` | A 50-character secret key used for encrypting JSON Web Tokens (JWTs). | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 653295af..8622149a 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -100,20 +100,6 @@ kutt: # Example: # nonUserCooldown: "1" nonUserCooldown: "" - # Kutt Google configurations. - google: - # The Google reCAPTCHA secret key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. - # Example: - # recaptchaSecretKey: "01eHZ5I71tcYAhDOG9IlJqDk6sOx4X8rNsOFBcXz" - recaptchaSecretKey: "" - # The Google reCAPTCHA site key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. - # Example: - # recaptchaSiteKey: "01eHZ5I71tcYA4DYuVcw7mUqZAWujE7SUr9r7XAm" - recaptchaSiteKey: "" - # The Google API key used for Google Safe Browsing to prevent malicious links. Refer to https://developers.google.com/safe-browsing/v4/get-started. - # Example: - # safeBrowsingKey: "Z0VNqFK9NqYYwFP27v9-eC1St4HTz3uRTJRfii5" - safeBrowsingKey: "" # Redis configurations. redis: @@ -136,6 +122,21 @@ redis: # password: "password" password: "" +# Google configurations. +google: + # The Google reCAPTCHA secret key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. + # Example: + # recaptchaSecretKey: "01eHZ5I71tcYAhDOG9IlJqDk6sOx4X8rNsOFBcXz" + recaptchaSecretKey: "" + # The Google reCAPTCHA site key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. + # Example: + # recaptchaSiteKey: "01eHZ5I71tcYA4DYuVcw7mUqZAWujE7SUr9r7XAm" + recaptchaSiteKey: "" + # The Google API key used for Google Safe Browsing to prevent malicious links. Refer to https://developers.google.com/safe-browsing/v4/get-started. + # Example: + # safeBrowsingKey: "Z0VNqFK9NqYYwFP27v9-eC1St4HTz3uRTJRfii5" + safeBrowsingKey: "" + # Mail configurations. mail: # The email address to be displayed as the contact email in the application. From 5861c00614e778ec19fcdf02aaf7e3083d763980 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:37:45 +0800 Subject: [PATCH 262/363] Refactored google config --- mika/kutt/templates/secret.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/kutt/templates/secret.yaml b/mika/kutt/templates/secret.yaml index f6a0a673..8a1997e7 100644 --- a/mika/kutt/templates/secret.yaml +++ b/mika/kutt/templates/secret.yaml @@ -18,9 +18,9 @@ {{- $redis_host := .Values.redis.host | default "localhost" | toString | b64enc }} {{- $redis_port := .Values.redis.port | default "6379" | toString | b64enc }} {{- $redis_password := .Values.redis.password | toString | b64enc }} -{{- $recaptchaSecretKey := .Values.kutt.google.recaptchaSecretKey | toString | b64enc }} -{{- $recaptchaSiteKey := .Values.kutt.google.recaptchaSiteKey | toString | b64enc }} -{{- $safeBrowsingKey := .Values.kutt.google.safeBrowsingKey | toString | b64enc }} +{{- $recaptchaSecretKey := .Values.google.recaptchaSecretKey | toString | b64enc }} +{{- $recaptchaSiteKey := .Values.google.recaptchaSiteKey | toString | b64enc }} +{{- $safeBrowsingKey := .Values.google.safeBrowsingKey | toString | b64enc }} --- apiVersion: v1 kind: Secret @@ -45,12 +45,12 @@ data: MAIL_FROM: {{ $mailFrom }} CONTACT_EMAIL: {{ $mailContact }} REPORT_EMAIL: {{ $mailReport }} - {{- if $recaptchaSiteKey }} - RECAPTCHA_SITE_KEY: {{ $recaptchaSiteKey }} - {{- end }} {{- if $recaptchaSecretKey }} RECAPTCHA_SECRET_KEY: {{ $recaptchaSecretKey }} {{- end }} + {{- if $recaptchaSiteKey }} + RECAPTCHA_SITE_KEY: {{ $recaptchaSiteKey }} + {{- end }} {{- if $safeBrowsingKey }} GOOGLE_SAFE_BROWSING_KEY: {{ $safeBrowsingKey }} {{- end }} From 6ab4850fd559a7d79f50bfcd9b709e98f69b505a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:41:06 +0800 Subject: [PATCH 263/363] Define as string --- mika/kutt/README.md | 4 ++-- mika/kutt/values.yaml | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 943896ea..83acacdf 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -98,8 +98,8 @@ helm uninstall $release_name --namespace $namespace --wait | ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Kutt services. | | ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | | kutt.administration.dailyUserLimit | string | `""` | The maximum number of links that can be created by a user in a day. Default: `"50"`. | -| kutt.administration.disableAnonLinks | bool | `false` | Specifies whether Kutt should disallow creating links without an account. | -| kutt.administration.disableRegistration | bool | `false` | Specifies whether Kutt should disallow user registrations. | +| kutt.administration.disableAnonLinks | string | `""` | Specifies whether Kutt should disallow creating links without an account. Default: `"false"`. | +| kutt.administration.disableRegistration | string | `""` | Specifies whether Kutt should disallow user registrations. Default: `"false"`. | | kutt.administration.maxStatsPerLink | string | `""` | The maximum number of visits for a link to have detailed statistics. Default: `"5000"`. | | kutt.administration.nonUserCooldown | string | `""` | The number of minutes an anonymous user must wait before creating another link. Default: `"0"`. | | kutt.admins | list | `[]` | Email addresses of the administrators of the Kutt application so they can access admin actions. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 8622149a..a181ea19 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -83,13 +83,15 @@ kutt: # dailyUserLimit: "15" dailyUserLimit: "" # Specifies whether Kutt should disallow creating links without an account. + # Default: "false" # Example: - # disableAnonLinks: true - disableAnonLinks: false + # disableAnonLinks: "true" + disableAnonLinks: "" # Specifies whether Kutt should disallow user registrations. + # Default: "false" # Example: - # disableRegistration: true - disableRegistration: false + # disableRegistration: "true" + disableRegistration: "" # The maximum number of visits for a link to have detailed statistics. # Default: "5000" # Example: From e430c8d57ba7d7af7de0dfaa2cf5ebc567fe9809 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:41:16 +0800 Subject: [PATCH 264/363] Add default value --- mika/kutt/templates/configmap.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/kutt/templates/configmap.yaml b/mika/kutt/templates/configmap.yaml index 0b66702a..d2e4cf88 100644 --- a/mika/kutt/templates/configmap.yaml +++ b/mika/kutt/templates/configmap.yaml @@ -1,7 +1,7 @@ {{- $admins := .Values.kutt.admins | join "," | toString | quote }} {{- $dailyUserLimit := .Values.kutt.administration.dailyUserLimit | default "50" | toString | quote }} -{{- $disableAnonLinks := .Values.kutt.administration.disableAnonLinks | toString | quote }} -{{- $disableRegistration := .Values.kutt.administration.disableRegistration | toString | quote }} +{{- $disableAnonLinks := .Values.kutt.administration.disableAnonLinks | default "false" | toString | quote }} +{{- $disableRegistration := .Values.kutt.administration.disableRegistration | default "false" | toString | quote }} {{- $domain := .Values.kutt.domain | toString }} {{- $ingress := .Values.ingress.enabled }} {{- $kutt_port := .Values.service.kutt.port | default "3000" | toString }} From a536b7233568bffaff7aac1f031b8f5bdf9e50a9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:43:18 +0800 Subject: [PATCH 265/363] Define as str --- mika/kutt/README.md | 2 +- mika/kutt/values.yaml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 83acacdf..6d354b27 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -107,7 +107,7 @@ helm uninstall $release_name --namespace $namespace --wait | kutt.link_length | string | `""` | The length of the generated short links. Default: `"6"`. | | kutt.name | string | `""` | The name of the site where Kutt is hosted. Default: `"Kutt"`. | | kutt.secret | string | `""` | A 50-character secret key used for encrypting JSON Web Tokens (JWTs). | -| kutt.useHttps | bool | `true` | Specifies whether Kutt should use HTTPS for custom domains. | +| kutt.useHttps | string | `""` | Specifies whether Kutt should use HTTPS for custom domains. Default: `"true"`. | | mail.contact_email | string | `""` | The email address to be displayed as the contact email in the application. | | mail.from_email | string | `""` | The email address used as the "from" address for sent emails. Default: `"$name <$mail.smtp.user>"`. | | mail.report_email | string | `""` | The email address that will receive submitted reports. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index a181ea19..878915bd 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -72,9 +72,10 @@ kutt: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" secret: "" # Specifies whether Kutt should use HTTPS for custom domains. + # Default: "true" # Example: # useHttps: false - useHttps: true + useHttps: "" # Kutt administration configurations. administration: # The maximum number of links that can be created by a user in a day. From 715e7a70bbd5fb7cb8bdf48758d195ba27d7d329 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 12:43:26 +0800 Subject: [PATCH 266/363] Set default val --- mika/kutt/templates/configmap.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/kutt/templates/configmap.yaml b/mika/kutt/templates/configmap.yaml index d2e4cf88..6c9081da 100644 --- a/mika/kutt/templates/configmap.yaml +++ b/mika/kutt/templates/configmap.yaml @@ -9,7 +9,7 @@ {{- $maxStatsPerLink := .Values.kutt.administration.maxStatsPerLink | default "5000" | toString | quote }} {{- $name := .Values.kutt.name | default "Kutt" | toString | quote }} {{- $nonUserCooldown := .Values.kutt.administration.nonUserCooldown | default "0" | toString | quote }} -{{- $useHttps := .Values.kutt.useHttps | toString | quote }} +{{- $useHttps := .Values.kutt.useHttps | default "true" | toString | quote }} {{- if not $ingress }} {{- $domain = $domain | default (printf "localhost:%s" $kutt_port) }} {{- end }} From 5ab8409d5fb7d76fda3ecf7f8617ff77a01c6354 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 14:40:52 +0800 Subject: [PATCH 267/363] Update sample value --- mika/kutt/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 878915bd..191605fa 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -65,7 +65,7 @@ kutt: # The name of the site where Kutt is hosted. # Default: "Kutt" # Example: - # name: "Kutt" + # name: "URL Shortener" name: "" # A 50-character secret key used for encrypting JSON Web Tokens (JWTs). # Example: From d0ecc9bcf21c8b1e3626f1b787d8b740b10bbd9b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 14:51:30 +0800 Subject: [PATCH 268/363] Update default port --- mika/kutt/templates/service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/kutt/templates/service.yaml b/mika/kutt/templates/service.yaml index 52bf506b..b2f7c486 100644 --- a/mika/kutt/templates/service.yaml +++ b/mika/kutt/templates/service.yaml @@ -1,5 +1,5 @@ {{- $externalRedis := .Values.redis.external }} -{{- $kuttPort := .Values.service.kutt.port | default "80" | toString }} +{{- $kuttPort := .Values.service.kutt.port | default "3000" | toString }} {{- $kuttNodePort := .Values.service.kutt.nodePort | toString }} {{- $redisPort := .Values.service.redis.port | default "6379" | toString }} {{- $redisNodePort := .Values.service.redis.nodePort | toString }} From 8ce008395f5f94f5f20210f5dba81758b9456335 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 14:58:32 +0800 Subject: [PATCH 269/363] Update var names --- mika/kutt/templates/configmap.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/kutt/templates/configmap.yaml b/mika/kutt/templates/configmap.yaml index 6c9081da..6185058e 100644 --- a/mika/kutt/templates/configmap.yaml +++ b/mika/kutt/templates/configmap.yaml @@ -1,17 +1,17 @@ +{{- $ingress := .Values.ingress.enabled }} {{- $admins := .Values.kutt.admins | join "," | toString | quote }} {{- $dailyUserLimit := .Values.kutt.administration.dailyUserLimit | default "50" | toString | quote }} {{- $disableAnonLinks := .Values.kutt.administration.disableAnonLinks | default "false" | toString | quote }} {{- $disableRegistration := .Values.kutt.administration.disableRegistration | default "false" | toString | quote }} {{- $domain := .Values.kutt.domain | toString }} -{{- $ingress := .Values.ingress.enabled }} -{{- $kutt_port := .Values.service.kutt.port | default "3000" | toString }} -{{- $link_length := .Values.kutt.link_length | default "6" | toString | quote }} +{{- $kuttPort := .Values.service.kutt.port | default "3000" | toString }} +{{- $linkLength := .Values.kutt.link_length | default "6" | toString | quote }} {{- $maxStatsPerLink := .Values.kutt.administration.maxStatsPerLink | default "5000" | toString | quote }} {{- $name := .Values.kutt.name | default "Kutt" | toString | quote }} {{- $nonUserCooldown := .Values.kutt.administration.nonUserCooldown | default "0" | toString | quote }} {{- $useHttps := .Values.kutt.useHttps | default "true" | toString | quote }} {{- if not $ingress }} -{{- $domain = $domain | default (printf "localhost:%s" $kutt_port) }} +{{- $domain = $domain | default (printf "localhost:%s" $kuttPort) }} {{- end }} --- apiVersion: v1 @@ -21,10 +21,10 @@ metadata: labels: {{- include "kutt.labels" . | nindent 4 }} data: - PORT: {{ $kutt_port | quote }} + PORT: {{ $kuttPort | quote }} SITE_NAME: {{ $name }} DEFAULT_DOMAIN: {{ $domain | quote }} - LINK_LENGTH: {{ $link_length }} + LINK_LENGTH: {{ $linkLength }} DISALLOW_REGISTRATION: {{ $disableRegistration }} DISALLOW_ANONYMOUS_LINKS: {{ $disableAnonLinks }} USER_LIMIT_PER_DAY: {{ $dailyUserLimit }} From b3ce8af6d5feac9a0a029b04a5de856ee2cb7679 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 15:10:18 +0800 Subject: [PATCH 270/363] Update default domain val with svc --- mika/kutt/templates/configmap.yaml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mika/kutt/templates/configmap.yaml b/mika/kutt/templates/configmap.yaml index 6185058e..26516637 100644 --- a/mika/kutt/templates/configmap.yaml +++ b/mika/kutt/templates/configmap.yaml @@ -1,18 +1,14 @@ -{{- $ingress := .Values.ingress.enabled }} {{- $admins := .Values.kutt.admins | join "," | toString | quote }} {{- $dailyUserLimit := .Values.kutt.administration.dailyUserLimit | default "50" | toString | quote }} {{- $disableAnonLinks := .Values.kutt.administration.disableAnonLinks | default "false" | toString | quote }} {{- $disableRegistration := .Values.kutt.administration.disableRegistration | default "false" | toString | quote }} -{{- $domain := .Values.kutt.domain | toString }} -{{- $kuttPort := .Values.service.kutt.port | default "3000" | toString }} +{{- $domain := .Values.kutt.domain | default (printf "%s-kutt-svc:kutt" .Release.Name) | toString | quote }} +{{- $kuttPort := .Values.service.kutt.port | default "3000" | toString | quote }} {{- $linkLength := .Values.kutt.link_length | default "6" | toString | quote }} {{- $maxStatsPerLink := .Values.kutt.administration.maxStatsPerLink | default "5000" | toString | quote }} {{- $name := .Values.kutt.name | default "Kutt" | toString | quote }} {{- $nonUserCooldown := .Values.kutt.administration.nonUserCooldown | default "0" | toString | quote }} {{- $useHttps := .Values.kutt.useHttps | default "true" | toString | quote }} -{{- if not $ingress }} -{{- $domain = $domain | default (printf "localhost:%s" $kuttPort) }} -{{- end }} --- apiVersion: v1 kind: ConfigMap @@ -21,9 +17,9 @@ metadata: labels: {{- include "kutt.labels" . | nindent 4 }} data: - PORT: {{ $kuttPort | quote }} + PORT: {{ $kuttPort }} SITE_NAME: {{ $name }} - DEFAULT_DOMAIN: {{ $domain | quote }} + DEFAULT_DOMAIN: {{ $domain }} LINK_LENGTH: {{ $linkLength }} DISALLOW_REGISTRATION: {{ $disableRegistration }} DISALLOW_ANONYMOUS_LINKS: {{ $disableAnonLinks }} From ebc80e11d703214eb8b0529d3aaa9286b400e257 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 15:15:35 +0800 Subject: [PATCH 271/363] Update redis vals --- mika/kutt/templates/secret.yaml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/mika/kutt/templates/secret.yaml b/mika/kutt/templates/secret.yaml index 8a1997e7..f20bf09f 100644 --- a/mika/kutt/templates/secret.yaml +++ b/mika/kutt/templates/secret.yaml @@ -14,10 +14,9 @@ {{- $mailFrom := .Values.mail.from_email | default (printf "%s <%s>" $name $mailUser) | toString | b64enc }} {{- $mailReport := .Values.mail.report_email | toString | b64enc }} {{- $mailSecure := .Values.mail.secure | default "true" | toString | b64enc }} -{{- $external_redis := .Values.redis.external }} -{{- $redis_host := .Values.redis.host | default "localhost" | toString | b64enc }} -{{- $redis_port := .Values.redis.port | default "6379" | toString | b64enc }} -{{- $redis_password := .Values.redis.password | toString | b64enc }} +{{- $redisHost := .Values.redis.host | default "localhost" | toString | b64enc }} +{{- $redisPort := .Values.redis.port | default "6379" | toString | b64enc }} +{{- $redisPassword := .Values.redis.password | toString | b64enc }} {{- $recaptchaSecretKey := .Values.google.recaptchaSecretKey | toString | b64enc }} {{- $recaptchaSiteKey := .Values.google.recaptchaSiteKey | toString | b64enc }} {{- $safeBrowsingKey := .Values.google.safeBrowsingKey | toString | b64enc }} @@ -63,13 +62,9 @@ metadata: {{- include "kutt.labels" . | nindent 4 }} type: Opaque data: - REDIS_HOST: {{ $redis_host }} - {{- if not $external_redis }} - REDIS_PORT: {{ "6379" | toString | b64enc }} - {{- else }} - REDIS_PORT: {{ $redis_port }} - {{- end }} - {{- if $redis_password }} + REDIS_HOST: {{ $redisHost }} + REDIS_PORT: {{ $redisPort }} + {{- if $redisPassword }} REDIS_PASSWORD: {{ $redis_password }} {{- end }} # REDIS_DB: "" From 95441e228a10e5447dd4c12ccda89b7fa56aee98 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 15:38:57 +0800 Subject: [PATCH 272/363] Update var names --- mika/kutt/templates/deployment.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index 9bbdcbba..27ace19e 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -1,3 +1,4 @@ +{{- $externalRedis := .Values.redis.external }} {{- $kutt_registry := .Values.image.kutt.registry | default "docker.io" | toString }} {{- $kutt_repository := .Values.image.kutt.repository | default "kutt/kutt" | toString }} {{- $kutt_tag := .Values.image.kutt.tag | default .Chart.AppVersion | toString }} @@ -7,8 +8,7 @@ {{- $redis_tag := .Values.image.redis.tag | default "6.0-alpine" | toString }} {{- $redis_pullPolicy := .Values.image.redis.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} -{{- $external_redis := .Values.redis.external }} -{{- $redis_password := .Values.redis.password | toString }} +{{- $redisPassword := .Values.redis.password | toString }} --- apiVersion: apps/v1 kind: Deployment @@ -56,11 +56,11 @@ spec: name: {{ .Release.Name }}-kutt-secret - secretRef: name: {{ .Release.Name }}-kutt-redis-secret - {{- if not $external_redis }} + {{- if not $externalRedis }} - name: redis image: {{ printf "%s/%s:%s" $redis_registry $redis_repository $redis_tag | quote }} imagePullPolicy: {{ $redis_pullPolicy }} - {{- if $redis_password }} + {{- if $redisPassword }} command: ["redis-server"] args: - "--requirepass" From b4978c1eb84778f046970c2059217a065951b8df Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 15:47:17 +0800 Subject: [PATCH 273/363] Update vol mount --- mika/kutt/templates/deployment.yaml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index 27ace19e..1303c79d 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -1,4 +1,5 @@ {{- $externalRedis := .Values.redis.external }} +{{- $dataPersistence := .Values.storage.data.enabled }} {{- $kutt_registry := .Values.image.kutt.registry | default "docker.io" | toString }} {{- $kutt_repository := .Values.image.kutt.repository | default "kutt/kutt" | toString }} {{- $kutt_tag := .Values.image.kutt.tag | default .Chart.AppVersion | toString }} @@ -8,6 +9,8 @@ {{- $redis_tag := .Values.image.redis.tag | default "6.0-alpine" | toString }} {{- $redis_pullPolicy := .Values.image.redis.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $dataMountPath := .Values.storage.data.mountPath | default "/data" | toString | quote }} +{{- $dataSubPath := .Values.storage.data.subPath | toString }} {{- $redisPassword := .Values.redis.password | toString }} --- apiVersion: apps/v1 @@ -75,13 +78,20 @@ spec: envFrom: - secretRef: name: {{ .Release.Name }}-kutt-redis-secret + {{- if or $dataPersistence }} volumeMounts: + {{- if $dataPersistence }} - name: {{ .Release.Name }}-kutt-redis-data - mountPath: /data + mountPath: {{ $dataMountPath }} + {{- if $dataSubPath }} + subPath: {{ $dataSubPath | quote }} + {{- end }} + {{- end }} + {{- end }} {{- end }} - {{- if not $external_redis }} + {{- if and (not $externalRedis) $dataPersistence }} volumes: - - name: {{ .Release.Name }}-kutt-redis-data + - name: {{ .Release.Name }}-redis-data persistentVolumeClaim: - claimName: {{ .Release.Name }}-kutt-redis-data-pvc + claimName: {{ .Release.Name }}-redis-data-pvc {{- end }} From 63dd0f0550108ebe2a6008acabb83680b40a27bf Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 15:49:50 +0800 Subject: [PATCH 274/363] Source logo from own repo --- logos/kutt.svg | 1 + mika/kutt/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 logos/kutt.svg diff --git a/logos/kutt.svg b/logos/kutt.svg new file mode 100644 index 00000000..031ea53f --- /dev/null +++ b/logos/kutt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/mika/kutt/Chart.yaml b/mika/kutt/Chart.yaml index a373ed0d..d33b5f74 100644 --- a/mika/kutt/Chart.yaml +++ b/mika/kutt/Chart.yaml @@ -9,7 +9,7 @@ keywords: - "url" - "shortener" home: "https://github.com/thedevs-network/kutt" -icon: "https://raw.githubusercontent.com/thedevs-network/kutt/develop/static/images/icons/icon-512x512.png" +icon: "https://irfanhakim-as.github.io/charts/logos/kutt.svg" sources: - "https://github.com/thedevs-network/kutt" - "https://github.com/irfanhakim-as/charts" From 4ae3d8f93dfe8ff66eaa564414e9d8c487c98d4e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 16:00:34 +0800 Subject: [PATCH 275/363] Update chart notes --- mika/kutt/templates/NOTES.txt | 59 ++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/mika/kutt/templates/NOTES.txt b/mika/kutt/templates/NOTES.txt index dd23e0c4..a19497d2 100644 --- a/mika/kutt/templates/NOTES.txt +++ b/mika/kutt/templates/NOTES.txt @@ -1,22 +1,51 @@ -{{- $domain := .Values.kutt.domain | toString }} +{{- $serviceAddress := "" }} +{{- $urlProtocol := "http" | toString }} {{- $ingress := .Values.ingress.enabled }} -{{- $kutt_port := .Values.service.kutt.port | default "3000" | toString }} -{{- $useHttps := .Values.kutt.useHttps }} -{{- if not $ingress }} -{{- $domain = $domain | default (printf "localhost:%s" $kutt_port) | printf "http://%s" }} -{{- else }} -{{- if $useHttps }} -{{- $domain = $domain | printf "https://%s" }} -{{- else }} -{{- $domain = $domain | printf "http://%s" }} +{{- $domain := .Values.kutt.domain | toString }} +{{- $port := .Values.service.port | default "80" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +{{- $serviceName := printf "%s-kutt-svc" .Release.Name | toString }} +{{- $useHttps := .Values.kutt.useHttps | default "true" | toString | quote }} +{{- if eq $useHttps "true" }} + {{- $urlProtocol = "https" | toString }} {{- end }} +Kutt has been installed and configured for {{ .Release.Name | toString }} 🎉 + +{{- if $ingress }} + {{- $serviceAddress = printf "%s://%s" $urlProtocol $domain | toString }} +{{- else if or (eq $type "ClusterIP") (eq $type "LoadBalancer") (eq $type "NodePort") }} + +Please run the following command(s) to obtain the right address to the service: + + ```sh + {{- if eq $type "ClusterIP" }} + {{- $forwardPort := "8080" | toString }} + {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} + export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "kutt.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} + {{- else if eq $type "LoadBalancer" }} + {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $port | toString }} + export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} --template "{{"{{- range (index .status.loadBalancer.ingress 0) }}{{ . }}{{- end }}"}}") + {{- else if eq $type "NodePort" }} + {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") + {{- end }} + ``` + {{- end }} -Kutt is now installed and configured for {{ .Release.Name | toString }}. -Visit the Kutt portal to get started: +Visit the following service(s) at the provided address: + +{{- if $serviceAddress }} + + - Kutt: {{ $serviceAddress }} - - {{ $domain }} +{{- else }} + + ⚠️ This chart may have no accessible services available -See the values.yaml file of this chart for more configuration options. +{{- end }} -Please refer to the official documentation for more information on how to use Kutt. +For more information on how to use and configure Kutt, please refer to the official documentation. \ No newline at end of file From d8b8cdea9626931ada2f34598c6278347b63798c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 16:40:02 +0800 Subject: [PATCH 276/363] Dedicate redis config to external redis server --- mika/kutt/README.md | 6 +++--- mika/kutt/values.yaml | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 6d354b27..6595b944 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -123,9 +123,9 @@ helm uninstall $release_name --namespace $namespace --wait | postgres.ssl | string | `""` | Specifies whether the Kutt database server should use SSL. Default: `"false"`. | | postgres.user | string | `""` | The username or user account for accessing the Kutt database. | | redis.external | bool | `false` | Specifies whether Kutt should use an external Redis server. | -| redis.host | string | `""` | The hostname or IP address of the Redis server. Default: `"localhost"`. | -| redis.password | string | `""` | The password for authenticating with the Redis server. | -| redis.port | string | `""` | The port number on which the EXTERNAL Redis server is listening. Default: `"6379"`. | +| redis.host | string | `""` | The hostname or IP address of the external Redis server. | +| redis.password | string | `""` | The password for authenticating with the external Redis server. | +| redis.port | string | `""` | The port number on which the external Redis server is listening for connections. Default: `"6379"`. | | replicaCount | string | `""` | The desired number of running replicas for Kutt. Default: `"1"`. | | resources.kutt | object | `{}` | Kutt container resources. | | resources.redis | object | `{}` | Redis container resources. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 191605fa..731f714e 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -104,23 +104,22 @@ kutt: # nonUserCooldown: "1" nonUserCooldown: "" -# Redis configurations. +# External Redis configurations. redis: # Specifies whether Kutt should use an external Redis server. # Example: # external: true external: false - # The hostname or IP address of the Redis server. - # Default: "localhost" + # The hostname or IP address of the external Redis server. # Example: # host: "redis.default.svc.cluster.local" host: "" - # The port number on which the EXTERNAL Redis server is listening. + # The port number on which the external Redis server is listening for connections. # Default: "6379" # Example: # port: "9763" port: "" - # The password for authenticating with the Redis server. + # The password for authenticating with the external Redis server. # Example: # password: "password" password: "" From 74f45661365f3546d8d09d98efb9acb0ded9eb84 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 16:42:03 +0800 Subject: [PATCH 277/363] Update redis values depending on internal or ext --- mika/kutt/templates/secret.yaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/mika/kutt/templates/secret.yaml b/mika/kutt/templates/secret.yaml index f20bf09f..2d55827f 100644 --- a/mika/kutt/templates/secret.yaml +++ b/mika/kutt/templates/secret.yaml @@ -1,3 +1,7 @@ +{{- $redisHost := "" }} +{{- $redisPort := "" }} +{{- $redisPassword := "" }} +{{- $externalRedis := .Values.redis.external }} {{- $secret := .Values.kutt.secret | toString | b64enc }} {{- $db_name := .Values.postgres.name | toString | b64enc }} {{- $db_user := .Values.postgres.user | toString | b64enc }} @@ -14,9 +18,14 @@ {{- $mailFrom := .Values.mail.from_email | default (printf "%s <%s>" $name $mailUser) | toString | b64enc }} {{- $mailReport := .Values.mail.report_email | toString | b64enc }} {{- $mailSecure := .Values.mail.secure | default "true" | toString | b64enc }} -{{- $redisHost := .Values.redis.host | default "localhost" | toString | b64enc }} -{{- $redisPort := .Values.redis.port | default "6379" | toString | b64enc }} -{{- $redisPassword := .Values.redis.password | toString | b64enc }} +{{- if $externalRedis }} + {{- $redisHost = .Values.redis.host | toString | b64enc }} + {{- $redisPort = .Values.redis.port | default "6379" | toString | b64enc }} + {{- $redisPassword = .Values.redis.password | toString | b64enc }} +{{- else }} + {{- $redisHost = "localhost" | toString | b64enc }} + {{- $redisPort = .Values.service.redis.port | default "6379" | toString | b64enc }} +{{- end }} {{- $recaptchaSecretKey := .Values.google.recaptchaSecretKey | toString | b64enc }} {{- $recaptchaSiteKey := .Values.google.recaptchaSiteKey | toString | b64enc }} {{- $safeBrowsingKey := .Values.google.safeBrowsingKey | toString | b64enc }} From de6ec4872fb556f34d5545612cda7a8a4f017d86 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 16:42:57 +0800 Subject: [PATCH 278/363] Include optional password only for external redis --- mika/kutt/templates/deployment.yaml | 11 ++++------- mika/kutt/templates/secret.yaml | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index 1303c79d..f779c0e7 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -11,7 +11,6 @@ {{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $dataMountPath := .Values.storage.data.mountPath | default "/data" | toString | quote }} {{- $dataSubPath := .Values.storage.data.subPath | toString }} -{{- $redisPassword := .Values.redis.password | toString }} --- apiVersion: apps/v1 kind: Deployment @@ -63,12 +62,10 @@ spec: - name: redis image: {{ printf "%s/%s:%s" $redis_registry $redis_repository $redis_tag | quote }} imagePullPolicy: {{ $redis_pullPolicy }} - {{- if $redisPassword }} - command: ["redis-server"] - args: - - "--requirepass" - - "$(REDIS_PASSWORD)" - {{- end }} + # command: ["redis-server"] + # args: + # - "--requirepass" + # - "$(REDIS_PASSWORD)" ports: - name: redis containerPort: 6379 diff --git a/mika/kutt/templates/secret.yaml b/mika/kutt/templates/secret.yaml index 2d55827f..cbb5f450 100644 --- a/mika/kutt/templates/secret.yaml +++ b/mika/kutt/templates/secret.yaml @@ -73,7 +73,7 @@ type: Opaque data: REDIS_HOST: {{ $redisHost }} REDIS_PORT: {{ $redisPort }} - {{- if $redisPassword }} - REDIS_PASSWORD: {{ $redis_password }} + {{- if and $externalRedis $redisPassword }} + REDIS_PASSWORD: {{ $redisPassword }} {{- end }} # REDIS_DB: "" From 6add033b73ca790cfed0fd1b24da944fc497ebf4 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 16:43:30 +0800 Subject: [PATCH 279/363] Update docs --- mika/kutt/README.md | 152 ++++++++++++++++++++++++++++++-------------- 1 file changed, 106 insertions(+), 46 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 6595b944..63ad39af 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -1,83 +1,143 @@ -# [`kutt`](https://github.com/thedevs-network/kutt) +# [Kutt](https://github.com/thedevs-network/kutt) + +Kutt is a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics. ## Prerequisites +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + - Kubernetes 1.19+ - Helm 3.2.0+ +- Longhorn 1.4.1+ + +--- ## Preflight checklist -### Generate secret key for `kutt.secret` +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +### Generate secret key + +A unique, secure secret key is required for each Kutt installation. + +1. Generate a secret key using the following command: + + ```sh + python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' + ``` + +2. Set the generated secret key as the value of the `kutt.secret` setting in your installation's values file: + + ```yaml + secret: "" + ``` + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: + + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` + +2. Update the repo to retrieve the latest versions of the packages: + + ```sh + helm repo update + ``` + +--- + +## How to install or upgrade a chart release -```sh -python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' -``` +1. Get the values file of the Kutt chart or an existing installation (release). -### Provision a PostgreSQL database + Get the latest Kutt chart values file for a new installation: -Deploy [`mika/postgres-agent`](../postgres-agent/) with `postgres.mode.create` set to `true`. This step can be skipped if you have an existing PostgreSQL database. + ```sh + helm show values mika/kutt > values.yaml + ``` -## How to add repo + Alternatively, get the values file of an existing Kutt release: -Add the repo to your local helm client. + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Update the repo to retrieve the latest versions of the packages. +2. Edit your Kutt values file with the intended configurations: -```sh -helm repo update -``` + ```sh + nano values.yaml + ``` -## How to install + Pay extra attention to the descriptions and sample values provided in the chart values file. -### Prepare chart values +3. Install a new release for Kutt or upgrade an existing Kutt release: -Copy `values.yaml` from the chart you would like to install. + ```sh + helm upgrade --install ${releaseName} mika/kutt --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` -```sh -cp mika/kutt/values.yaml . -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Edit `values.yaml` with the appropriate values. Please refer to the [Configurations](#configurations) section below, or the `values.yaml` file itself for details and sample values. +4. Verify that your Kutt release has been installed: -```sh -nano values.yaml -``` + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -### Perform installation + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. +--- -```sh -helm install $release_name mika/kutt --namespace $namespace --create-namespace --values values.yaml --wait -``` +## How to uninstall a chart release -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. -```sh -helm ls --namespace $namespace | grep "$release_name" -``` +1. Uninstall the desired release: -## How to upgrade + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` -After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${releaseName}` and `${namespace}` accordingly. -```sh -helm upgrade $release_name mika/kutt --namespace $namespace --values values.yaml --wait -``` +2. Verify that the release has been uninstalled: -## How to uninstall + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. -```sh -helm uninstall $release_name --namespace $namespace --wait -``` +--- -## Configurations +## Chart configurations | Key | Type | Default | Description | |-----|------|---------|-------------| From a335e23cb2959c10b74caa8a33d57f8f26483248 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 16:43:36 +0800 Subject: [PATCH 280/363] Upgrade chart version --- mika/kutt/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/kutt/Chart.yaml b/mika/kutt/Chart.yaml index d33b5f74..710a93a5 100644 --- a/mika/kutt/Chart.yaml +++ b/mika/kutt/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kutt description: Kutt is a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics. type: application -version: 0.1.1 +version: 0.1.2 appVersion: "v2.7.4" keywords: - "kutt" From df195bebb10672f7e6a115707d6bbdc2c805f675 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 1 Aug 2024 16:48:10 +0800 Subject: [PATCH 281/363] Remove unused template --- mika/kutt/templates/_helpers.tpl | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/mika/kutt/templates/_helpers.tpl b/mika/kutt/templates/_helpers.tpl index f7211f3d..bbc0f10a 100644 --- a/mika/kutt/templates/_helpers.tpl +++ b/mika/kutt/templates/_helpers.tpl @@ -60,29 +60,3 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} - -{{/* -Nginx common.conf template -*/}} -{{- define "kutt.common-conf" -}} -charset utf-8; - -location / { - try_files $uri /index.php$is_args$query_string; -} - -location ~* .(jpg|jpeg|png|gif|ico|css|js)$ { - expires 365d; -} - -location ~ \.php$ { - fastcgi_pass {{ .Release.Name }}-kutt-svc:9000; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; -} - -location ~ /\.ht { - deny all; -} -{{- end }} From 49ae896894517f79872ff9029474676ab7ce2c46 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 4 Aug 2024 12:57:38 +0800 Subject: [PATCH 282/363] Remove unnecessary ingress res --- mika/postgres-agent/templates/ingress.yaml | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 mika/postgres-agent/templates/ingress.yaml diff --git a/mika/postgres-agent/templates/ingress.yaml b/mika/postgres-agent/templates/ingress.yaml deleted file mode 100644 index 8ad324bd..00000000 --- a/mika/postgres-agent/templates/ingress.yaml +++ /dev/null @@ -1,60 +0,0 @@ -{{- $ingress := .Values.ingress.enabled }} -{{- $www := .Values.ingress.www }} -{{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} -{{- $customAnnotations := .Values.ingress.customAnnotations }} -{{- $domain := .Values.postgres.domain | toString }} -{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} -{{- if and $ingress $domain }} ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ .Release.Name }}-postgres-ingress - labels: - {{- include "postgres.labels" . | nindent 4 }} - annotations: - cert-manager.io/cluster-issuer: {{ $clusterIssuer }} - cert-manager.io/private-key-algorithm: "ECDSA" - nginx.ingress.kubernetes.io/affinity: "cookie" - nginx.ingress.kubernetes.io/affinity-mode: "persistent" - nginx.ingress.kubernetes.io/proxy-body-size: "100m" - nginx.ingress.kubernetes.io/session-cookie-expires: "172800" - nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" - nginx.ingress.kubernetes.io/session-cookie-name: "route" - nginx.org/client-max-body-size: "100m" - {{- range $customAnnotations }} - {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} - {{- end }} -spec: - ingressClassName: "nginx" - rules: - - host: {{ $domain | quote }} - http: - paths: - - backend: - service: - name: {{ .Release.Name }}-postgres-svc - port: - name: postgres - path: / - pathType: Prefix - {{- if $www }} - - host: {{ $wwwDomain }} - http: - paths: - - backend: - service: - name: {{ .Release.Name }}-postgres-svc - port: - name: postgres - path: / - pathType: Prefix - {{- end }} - tls: - - hosts: - - {{ $domain | quote }} - {{- if $www }} - - {{ $wwwDomain }} - {{- end }} - secretName: {{ .Release.Name }}-postgres-tls-cert -{{- end }} From ca357e8f60709fc2ef29b68c38227dbc37ef881e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 5 Aug 2024 10:05:23 +0800 Subject: [PATCH 283/363] Fix pvc name --- mika/kutt/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index f779c0e7..d68fd61c 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -88,7 +88,7 @@ spec: {{- end }} {{- if and (not $externalRedis) $dataPersistence }} volumes: - - name: {{ .Release.Name }}-redis-data + - name: {{ .Release.Name }}-kutt-redis-data persistentVolumeClaim: - claimName: {{ .Release.Name }}-redis-data-pvc + claimName: {{ .Release.Name }}-kutt-redis-data-pvc {{- end }} From 11865ecb5ad1d050a03a3da377068401a144c7c7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 5 Aug 2024 10:15:24 +0800 Subject: [PATCH 284/363] Data persistence enable by default for redis to work --- mika/kutt/README.md | 2 +- mika/kutt/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 63ad39af..52ce5509 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -195,7 +195,7 @@ A unique, secure secret key is required for each Kutt installation. | service.redis.port | string | `""` | The Redis port on which the Kutt server should listen for connections. Default: `"6379"`. | | service.type | string | `""` | The type of service used to expose Kutt services. Default: `"ClusterIP"`. | | storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteOnce"`. | -| storage.data.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for data storage. | +| storage.data.enabled | bool | `true` | Specifies whether persistent storage should be provisioned for data storage. | | storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/data"`. | | storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"100Mi"`. | | storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 731f714e..a1569697 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -280,8 +280,8 @@ storage: data: # Specifies whether persistent storage should be provisioned for data storage. # Example: - # enabled: true - enabled: false + # enabled: false + enabled: true # The access mode defining how the data storage can be mounted. # Default: "ReadWriteOnce" # Example: From 42928cd97977fbed2f079a5598f72f8c36c6a808 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:09:59 +0800 Subject: [PATCH 285/363] rizz: Rename rizz.mastodon as generic rizz.account --- mika/rizz/README.md | 2 +- mika/rizz/values.yaml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mika/rizz/README.md b/mika/rizz/README.md index 359a6902..4702d6c0 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -221,10 +221,10 @@ A secure application access token is required for each configured Mastodon accou | replicaCount | string | `""` | The desired number of running replicas for Rizz. Default: `"1"`. | | resources.rizz | object | `{}` | Rizz container resources. | | resources.scheduler | object | `{}` | Scheduler container resources. | +| rizz.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | rizz.debug | string | `""` | Specifies whether Rizz should run in debug mode. Default: `"false"`. | | rizz.domain | string | `""` | The ingress domain name that hosts the Rizz server. Default: `"localhost"`. | | rizz.feed | list | `[]` | RSS feed configurations. Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled`. | -| rizz.mastodon | list | `[]` | Mastodon configurations. Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | rizz.organic | string | `""` | Specifies whether to enable posting in organic numbers. Default: `"true"`. | | rizz.post_limit | string | `""` | The limit number of posts to be scheduled for posting per run. Default: `"3"`. | | rizz.retry_post | string | `""` | Specifies whether to retry posting if the post fails to be sent. Default: `"true"`. | diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 3c3a0ed4..dd652669 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -109,19 +109,19 @@ rizz: # # enabled: "false" # enabled: "" feed: [] - # Mastodon configurations. + # Account configurations. # Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note` # Example: - # mastodon: - # # API endpoint or URL for the Mastodon instance of the Rizz bot. + # account: + # # API endpoint or URL for the server instance of the Rizz bot. # # Example: # # api: "https://botsin.space" # - api: "" - # # The username or user account for the Mastodon instance of the Rizz bot. + # # The username or user account for the server instance of the Rizz bot. # # Example: # # id: "rizz" # id: "" - # # The application access token required to authenticate the Rizz service with the Mastodon instance's API. + # # The application access token required to authenticate the Rizz service with the server instance's API. # # Example: # # token: "rinoSZiIvRHLw6PL1QCSia+8liGDau0MZ336JAnL0IQ" # token: "" @@ -163,7 +163,7 @@ rizz: # # Example: # # note: "This is the bio of the Rizz bot." # note: "" - mastodon: [] + account: [] # Scheduler configurations. scheduler: From d27580552c673cde2196845c009facf056222f02 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:12:03 +0800 Subject: [PATCH 286/363] Rizz: Move config --- mika/rizz/values.yaml | 46 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index dd652669..bf9e8b24 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -86,29 +86,6 @@ rizz: # Example: # visibility: "unlisted" visibility: "" - # RSS feed configurations. - # Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled` - # Example: - # feed: - # # The URL of the RSS feed to be tracked by Rizz. - # # Example: - # # endpoint: "https://www.reddit.com/r/programming/.rss" - # - endpoint: "" - # # The publishing date format of the RSS feed entry. - # # Default: "%a, %d %b %Y %H:%M:%S %z" - # # Example: - # # pubdate_format: "%a, %d %b %Y %H:%M:%S %Z" - # pubdate_format: "" - # # The unique identifier of the RSS feed entry. - # # Example: - # # id: "MyFeed" - # id: "" - # # Specifies whether the RSS feed entry should be actively processed. - # # Default: "true" - # # Example: - # # enabled: "false" - # enabled: "" - feed: [] # Account configurations. # Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note` # Example: @@ -164,6 +141,29 @@ rizz: # # note: "This is the bio of the Rizz bot." # note: "" account: [] + # RSS feed configurations. + # Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled` + # Example: + # feed: + # # The URL of the RSS feed to be tracked by Rizz. + # # Example: + # # endpoint: "https://www.reddit.com/r/programming/.rss" + # - endpoint: "" + # # The publishing date format of the RSS feed entry. + # # Default: "%a, %d %b %Y %H:%M:%S %z" + # # Example: + # # pubdate_format: "%a, %d %b %Y %H:%M:%S %Z" + # pubdate_format: "" + # # The unique identifier of the RSS feed entry. + # # Example: + # # id: "MyFeed" + # id: "" + # # Specifies whether the RSS feed entry should be actively processed. + # # Default: "true" + # # Example: + # # enabled: "false" + # enabled: "" + feed: [] # Scheduler configurations. scheduler: From 9bf9eebbd0206d243ba009686a359ffe26066538 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:35:23 +0800 Subject: [PATCH 287/363] rizz: Refactor mastodon to generic account --- mika/rizz/templates/NOTES.txt | 2 +- mika/rizz/templates/accounts.json.tpl | 2 +- mika/rizz/templates/deployment.yaml | 10 +++++----- mika/rizz/templates/secret.yaml | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mika/rizz/templates/NOTES.txt b/mika/rizz/templates/NOTES.txt index 7c311b10..6a4d5438 100644 --- a/mika/rizz/templates/NOTES.txt +++ b/mika/rizz/templates/NOTES.txt @@ -4,7 +4,7 @@ {{- $rizzPort := .Values.service.rizz.port | default "80" | toString }} {{- $type := .Values.service.type | default "ClusterIP" | toString }} {{- $serviceName := printf "%s-rizz-svc" .Release.Name | toString }} -{{- $accounts := .Values.rizz.mastodon }} +{{- $accounts := .Values.rizz.account }} {{- $feeds := .Values.rizz.feed }} Rizz has been installed and configured for {{ .Release.Name | toString }} 🎉 diff --git a/mika/rizz/templates/accounts.json.tpl b/mika/rizz/templates/accounts.json.tpl index 834d21c5..28e9e6c5 100644 --- a/mika/rizz/templates/accounts.json.tpl +++ b/mika/rizz/templates/accounts.json.tpl @@ -4,7 +4,7 @@ Mastodon /base/lib/accounts.json template {{- define "rizz.accounts-json" -}} { "accounts": [ - {{- $accounts := .Values.rizz.mastodon }} + {{- $accounts := .Values.rizz.account }} {{- range $index, $account := $accounts }} {{- $normalised_api := $account.api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" $account.id $normalised_api | toString | replace " " "" }} diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index 622f248c..1d85e04e 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -13,7 +13,7 @@ {{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString | quote }} {{- $logSubPath := .Values.storage.log.subPath | toString }} -{{- $accounts := .Values.rizz.mastodon }} +{{- $accounts := .Values.rizz.account }} apiVersion: apps/v1 kind: Deployment metadata: @@ -62,7 +62,7 @@ spec: mountPath: /base/data/feeds.json subPath: feeds.json readOnly: true - - name: {{ .Release.Name }}-rizz-mastodon-config + - name: {{ .Release.Name }}-rizz-account-config mountPath: /base/data/accounts.json subPath: accounts.json readOnly: true @@ -121,7 +121,7 @@ spec: mountPath: /base/data/feeds.json subPath: feeds.json readOnly: true - - name: {{ .Release.Name }}-rizz-mastodon-config + - name: {{ .Release.Name }}-rizz-account-config mountPath: /base/data/accounts.json subPath: accounts.json readOnly: true @@ -167,9 +167,9 @@ spec: - name: {{ .Release.Name }}-rizz-feed-config configMap: name: {{ .Release.Name }}-rizz-feed-config - - name: {{ .Release.Name }}-rizz-mastodon-config + - name: {{ .Release.Name }}-rizz-account-config secret: - secretName: {{ .Release.Name }}-rizz-mastodon-config + secretName: {{ .Release.Name }}-rizz-account-config {{- if $apscheduler }} - name: {{ .Release.Name }}-rizz-apscheduler-config configMap: diff --git a/mika/rizz/templates/secret.yaml b/mika/rizz/templates/secret.yaml index c66417ff..a92a6be9 100644 --- a/mika/rizz/templates/secret.yaml +++ b/mika/rizz/templates/secret.yaml @@ -5,7 +5,7 @@ {{- $db_password := .Values.db.password | toString | b64enc }} {{- $db_host := .Values.db.host | toString | b64enc }} {{- $db_port := .Values.db.port | default "5432" | toString | b64enc }} -{{- $accounts := .Values.rizz.mastodon }} +{{- $accounts := .Values.rizz.account }} --- apiVersion: v1 kind: Secret @@ -26,7 +26,7 @@ data: apiVersion: v1 kind: Secret metadata: - name: {{ .Release.Name }}-rizz-mastodon-config + name: {{ .Release.Name }}-rizz-account-config labels: {{- include "rizz.labels" . | nindent 4 }} type: Opaque From a01c34ad0c29771425e87c0c67738102fb2413d5 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:36:10 +0800 Subject: [PATCH 288/363] Rizz: Update tpl desc --- mika/rizz/templates/accounts.json.tpl | 2 +- mika/rizz/templates/feeds.json.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/rizz/templates/accounts.json.tpl b/mika/rizz/templates/accounts.json.tpl index 28e9e6c5..ed4edce7 100644 --- a/mika/rizz/templates/accounts.json.tpl +++ b/mika/rizz/templates/accounts.json.tpl @@ -1,5 +1,5 @@ {{/* -Mastodon /base/lib/accounts.json template +Rizz /base/lib/accounts.json template */}} {{- define "rizz.accounts-json" -}} { diff --git a/mika/rizz/templates/feeds.json.tpl b/mika/rizz/templates/feeds.json.tpl index ef69dbd7..4a1406c5 100644 --- a/mika/rizz/templates/feeds.json.tpl +++ b/mika/rizz/templates/feeds.json.tpl @@ -1,5 +1,5 @@ {{/* -Mastodon /base/lib/feeds.json template +Rizz /base/lib/feeds.json template */}} {{- define "rizz.feeds-json" -}} { From a2f4ff08870339c6d6c7f53e6b62d8c50db01c05 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:40:37 +0800 Subject: [PATCH 289/363] rizz: Add missing newline --- mika/rizz/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/rizz/README.md b/mika/rizz/README.md index 4702d6c0..5873bce2 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -71,6 +71,7 @@ A secure application access token is required for each configured Mastodon accou 3. In the **Preferences** page, navigate to the **Development** section. 4. From the **Your applications** list, click the **New application** button. + 5. In the **New application** form, fill in the following required details: - Application name: Add in a unique, descriptive name for your application i.e. `Rizz` From d9a9707cb52fd4599681c5d52cd91dd9875c9de2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:41:00 +0800 Subject: [PATCH 290/363] rizz: Update chart desc --- mika/rizz/Chart.yaml | 2 +- mika/rizz/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/rizz/Chart.yaml b/mika/rizz/Chart.yaml index 6ca06c2a..bfe7cd2b 100644 --- a/mika/rizz/Chart.yaml +++ b/mika/rizz/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: rizz -description: Rizz is a simple web application that tracks and posts content from RSS Feeds to Mastodon. +description: Rizz is a simple web application that tracks and posts content from RSS Feeds to federated social network. type: application version: 0.1.3 appVersion: "0.1.1-stable-r1" diff --git a/mika/rizz/README.md b/mika/rizz/README.md index 5873bce2..c41ee19a 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -3,7 +3,7 @@ > [!WARNING] > This chart requires access to a private image registry, please request access from the owner of the repository. -Rizz is a simple web application that tracks and posts content from RSS Feeds to Mastodon. +Rizz is a simple web application that tracks and posts content from RSS Feeds to federated social network. ## Prerequisites From f08fe488a86170551624458e9688d2ad9c703f7a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:41:19 +0800 Subject: [PATCH 291/363] rizz: Add bluesky to chart keyword --- mika/rizz/Chart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/rizz/Chart.yaml b/mika/rizz/Chart.yaml index bfe7cd2b..056cd473 100644 --- a/mika/rizz/Chart.yaml +++ b/mika/rizz/Chart.yaml @@ -8,6 +8,7 @@ keywords: - "rss" - "monitor" - "mastodon" + - "bluesky" home: "https://github.com/irfanhakim-as/rizz" icon: "https://irfanhakim-as.github.io/charts/logos/mika.png" sources: From c1f0f182a6f788faf66986c9d309cd5cf66878a2 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:41:54 +0800 Subject: [PATCH 292/363] rizz: Make warning generic --- mika/rizz/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/templates/NOTES.txt b/mika/rizz/templates/NOTES.txt index 6a4d5438..a2e7add6 100644 --- a/mika/rizz/templates/NOTES.txt +++ b/mika/rizz/templates/NOTES.txt @@ -49,7 +49,7 @@ The following are a list of account(s) you have supplied to be managed: {{- if not $accounts }} - ⚠️ No Mastodon accounts were supplied for Rizz to manage + ⚠️ No accounts were supplied for Rizz to manage {{- else }} From b6b8d42688bf8242398a1fa4bbe2d8de66523b0a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 21:58:10 +0800 Subject: [PATCH 293/363] rizz: Add step to generate access token for bsky --- mika/rizz/README.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/mika/rizz/README.md b/mika/rizz/README.md index c41ee19a..b73770f8 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -62,7 +62,19 @@ A unique, secure secret key is required for each Rizz installation. ### Application access token -A secure application access token is required for each configured Mastodon account. +A secure application access token is required for each configured account. + +1. Follow the subsections below on how to generate an access token for each account. + +2. Set the access token as the value of the `rizz.account` account's `token` setting in your installation's values file: + + ```yaml + token: "" + ``` + + Replace `` with the account's generated access token. + +#### Mastodon 1. Login to your Mastodon (bot) account. If you do not currently have one, you will need to register one first on any available Mastodon instance. @@ -87,11 +99,19 @@ A secure application access token is required for each configured Mastodon accou 8. In the specific **Application** page, copy the value of the confidential **Your access token** field. -9. Set the access token as the value of the `rizz.mastodon` account's `token` setting in your installation's values file: +#### Bluesky - ```yaml - token: "" - ``` +1. Login to your Bluesky (bot) account. If you do not currently have one, you will need to register one first on any available Bluesky instance. + +2. Click the **Settings** menu item. + +3. In the **Settings** page, navigate to the **App Passwords** section. + +4. In the **App Passwords** page, click the **Add App Password** button. + +5. In the prompted form, add in a unique, descriptive name for the App Password (i.e. `Rizz`) and click the **Create App Password** button to submit the form. + +6. Copy the value of the confidential App Password that has been generated and click the **Done** button. --- From 144e88bea1845a02f99f7e3afd424a151a76c5b7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 8 Nov 2024 22:06:04 +0800 Subject: [PATCH 294/363] rizz: Note fields not currently supported by bsky --- mika/rizz/values.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index bf9e8b24..057b5871 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -103,11 +103,13 @@ rizz: # # token: "rinoSZiIvRHLw6PL1QCSia+8liGDau0MZ336JAnL0IQ" # token: "" # # Specifies whether the Rizz bot should be marked as a bot. + # # Note: Bluesky does not currently support this field. # # Default: "true" # # Example: # # bot: "false" # bot: "" # # Specifies whether the Rizz bot should appear in the user directory. + # # Note: Bluesky does not currently support this field. # # Default: "true" # # Example: # # discoverable: "false" @@ -118,11 +120,13 @@ rizz: # # enabled: "false" # enabled: "" # # The display name of the Rizz bot. + # # Note: Bluesky does not currently support this field. # # Default: "null" # # Example: # # display_name: "Rizz" # display_name: "" # # A list of up to four name-value pairs information to be displayed on the Rizz bot's profile. + # # Note: Bluesky does not currently support this field. # # Example: # # fields: # # - name: "Website 1" @@ -131,11 +135,13 @@ rizz: # # value: "https://domain2.example.org" # fields: [] # # Specifies whether the Rizz bot needs to manually approve follow requests. + # # Note: Bluesky does not currently support this field. # # Default: "false" # # Example: # # locked: "true" # locked: "" # # The bio of the Rizz bot. + # # Note: Bluesky does not currently support this field. # # Default: "null" # # Example: # # note: "This is the bio of the Rizz bot." From 2301471361f48aa1ec887566753747cb91a0657c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 9 Nov 2024 12:59:07 +0800 Subject: [PATCH 295/363] rizz: Add host setting to account --- mika/rizz/README.md | 2 +- mika/rizz/templates/accounts.json.tpl | 1 + mika/rizz/values.yaml | 7 ++++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mika/rizz/README.md b/mika/rizz/README.md index b73770f8..37d9d7d2 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -242,7 +242,7 @@ A secure application access token is required for each configured account. | replicaCount | string | `""` | The desired number of running replicas for Rizz. Default: `"1"`. | | resources.rizz | object | `{}` | Rizz container resources. | | resources.scheduler | object | `{}` | Scheduler container resources. | -| rizz.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | +| rizz.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | rizz.debug | string | `""` | Specifies whether Rizz should run in debug mode. Default: `"false"`. | | rizz.domain | string | `""` | The ingress domain name that hosts the Rizz server. Default: `"localhost"`. | | rizz.feed | list | `[]` | RSS feed configurations. Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled`. | diff --git a/mika/rizz/templates/accounts.json.tpl b/mika/rizz/templates/accounts.json.tpl index ed4edce7..aeafa22e 100644 --- a/mika/rizz/templates/accounts.json.tpl +++ b/mika/rizz/templates/accounts.json.tpl @@ -29,6 +29,7 @@ Rizz /base/lib/accounts.json template ]{{ if ne $i (sub (len $fields) 1) }},{{ end }} {{- end }} ], + "host": {{ $account.host | default "mastodon" | toString | quote }}, "is_locked": {{ $account.locked | default "false" | toString }}, {{- if $account.note }} "note": {{ $account.note | toString | quote }} diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 057b5871..9f178dfc 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -87,7 +87,7 @@ rizz: # visibility: "unlisted" visibility: "" # Account configurations. - # Items: `.api`, `.id`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note` + # Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note` # Example: # account: # # API endpoint or URL for the server instance of the Rizz bot. @@ -98,6 +98,11 @@ rizz: # # Example: # # id: "rizz" # id: "" + # # The underlying host service of the server instance. + # # Default: "mastodon" + # # Example: + # # host: "bluesky" + # host: "" # # The application access token required to authenticate the Rizz service with the server instance's API. # # Example: # # token: "rinoSZiIvRHLw6PL1QCSia+8liGDau0MZ336JAnL0IQ" From 82dc3f8c581b374c1f91ab416ac432a81f793077 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 13 Nov 2024 17:45:30 +0800 Subject: [PATCH 296/363] rizz: Update recommended resource values --- mika/rizz/values.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 9f178dfc..0da50b58 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -383,21 +383,21 @@ resources: # # The minimum amount of CPU resources required by Rizz. # # Example: # # cpu: "10m" - # cpu: "30m" + # cpu: "200m" # # The minimum amount of memory required by Rizz. # # Example: # # memory: "10Mi" - # memory: "60Mi" + # memory: "100Mi" # # The maximum amount of resources allowed for Rizz. # limits: # # The maximum amount of CPU resources allowed for Rizz. # # Example: # # cpu: "250m" - # cpu: "50m" + # cpu: "300m" # # The maximum amount of memory allowed for Rizz. # # Example: # # memory: "250Mi" - # memory: "120Mi" + # memory: "250Mi" rizz: {} # Scheduler container resources. # Example: @@ -407,19 +407,19 @@ resources: # # The minimum amount of CPU resources required by Scheduler. # # Example: # # cpu: "10m" - # cpu: "10m" + # cpu: "200m" # # The minimum amount of memory required by Scheduler. # # Example: # # memory: "10Mi" - # memory: "100Mi" + # memory: "250Mi" # # The maximum amount of resources allowed for Scheduler. # limits: # # The maximum amount of CPU resources allowed for Scheduler. # # Example: # # cpu: "250m" - # cpu: "20m" + # cpu: "300m" # # The maximum amount of memory allowed for Scheduler. # # Example: # # memory: "250Mi" - # memory: "200Mi" + # memory: "350Mi" scheduler: {} From 6fa8cf8cbd9f99ce23ae0ac60390fb65823af49b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 00:41:02 +0800 Subject: [PATCH 297/363] rizz: Upgrade chart version --- mika/rizz/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/Chart.yaml b/mika/rizz/Chart.yaml index 056cd473..6eb0a140 100644 --- a/mika/rizz/Chart.yaml +++ b/mika/rizz/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: rizz description: Rizz is a simple web application that tracks and posts content from RSS Feeds to federated social network. type: application -version: 0.1.3 +version: 0.2.0 appVersion: "0.1.1-stable-r1" keywords: - "rss" From e18213b0136f6d03c6d456a41b7e4827217454ac Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 12:44:20 +0800 Subject: [PATCH 298/363] rizz: Update app version to 0.2.0-stable-r1 --- mika/rizz/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/Chart.yaml b/mika/rizz/Chart.yaml index 6eb0a140..a3c0b752 100644 --- a/mika/rizz/Chart.yaml +++ b/mika/rizz/Chart.yaml @@ -3,7 +3,7 @@ name: rizz description: Rizz is a simple web application that tracks and posts content from RSS Feeds to federated social network. type: application version: 0.2.0 -appVersion: "0.1.1-stable-r1" +appVersion: "0.2.0-stable-r1" keywords: - "rss" - "monitor" From eb015316a78781af534da781801753249734a6ea Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 14:28:20 +0800 Subject: [PATCH 299/363] waktusolat: Update domain desc and sample --- mika/waktusolat/README.md | 2 +- mika/waktusolat/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 4c2dc712..b86456b3 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -110,7 +110,7 @@ helm uninstall $release_name --namespace $namespace --wait | resources.waktusolat.requests.cpu | string | `"30m"` | The minimum amount of CPU resources required by WaktuSolat. | | resources.waktusolat.requests.memory | string | `"60Mi"` | The minimum amount of memory required by WaktuSolat. | | waktusolat.debug | bool | `false` | Specifies whether WaktuSolat should run in debug mode. Default: `false`. | -| waktusolat.domain | string | `""` | The domain name of the WaktuSolat service. Default: `"localhost"`. | +| waktusolat.domain | string | `""` | The ingress domain name that hosts the WaktuSolat server. Default: `"localhost"`. | | waktusolat.feed | list | `[]` | WaktuSolat feed configurations. | | waktusolat.location | list | `[]` | The code of locations WaktuSolat should fetch and update prayer times for. Default: `"wlp-0"`. | | waktusolat.mastodon | list | `[]` | WaktuSolat Mastodon configurations. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 539c3dac..0d0e369e 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -50,10 +50,10 @@ waktusolat: # Example: # debug: true debug: false - # The domain name of the WaktuSolat service. + # The ingress domain name that hosts the WaktuSolat server. # Default: "localhost" # Example: - # domain: "localhost" + # domain: "waktusolat.example.com" domain: "" # The limit number of posts to be scheduled for posting per run. # Default: "0" (Unlimited) From 2aed65434e9d0084140db140bf12c4dc54bbda4d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 14:28:39 +0800 Subject: [PATCH 300/363] waktusolat: Add image source --- mika/waktusolat/values.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 0d0e369e..ae979850 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -9,6 +9,7 @@ replicaCount: "" # Container images used for WaktuSolat. image: # WaktuSolat container image configurations. + # Source: https://github.com/irfanhakim-as/waktusolat/pkgs/container/waktusolat waktusolat: # The registry where the WaktuSolat container image is hosted. # Default: "ghcr.io" @@ -23,6 +24,7 @@ image: # Default: "IfNotPresent" pullPolicy: "" # Redis container image configurations. + # Source: https://hub.docker.com/_/redis redis: # The registry where the Redis container image is hosted. # Default: "docker.io" From a9d830e5d525b81ddf27828794d46636ed576447 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 14:30:18 +0800 Subject: [PATCH 301/363] waktusolat: Make value string instead of bool --- mika/waktusolat/README.md | 2 +- mika/waktusolat/values.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index b86456b3..4ae28b18 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -118,7 +118,7 @@ helm uninstall $release_name --namespace $namespace --wait | waktusolat.persistence.logs.storage | string | `""` | The amount of persistent storage allocated for WaktuSolat logs. Default: `"20Mi"`. | | waktusolat.persistence.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the WaktuSolat storage. Default: `"longhorn"`. | | waktusolat.post_limit | string | `""` | The limit number of posts to be scheduled for posting per run. Default: `"0"` (Unlimited). | -| waktusolat.retry_post | bool | `false` | Specifies whether to retry posting if the post fails to be sent. Default: `false`. | +| waktusolat.retry_post | string | `""` | Specifies whether to retry posting if the post fails to be sent. Default: `"false"`. | | waktusolat.scheduler.apscheduler | bool | `true` | Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. | | waktusolat.scheduler.celery | bool | `false` | Specifies whether Celery should be used by WaktuSolat as the task scheduler. | | waktusolat.scheduler.schedule.clean_db.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index ae979850..1812edfa 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -63,10 +63,10 @@ waktusolat: # post_limit: "5" post_limit: "" # Specifies whether to retry posting if the post fails to be sent. - # Default: false + # Default: "false" # Example: - # retry_post: true - retry_post: false + # retry_post: "true" + retry_post: "" # A 50-character secret key used for secure session management and cryptographic operations within the WaktuSolat service. # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" From 7c70d17ad38822a007e9a146aae3088acabfe08b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 14:31:47 +0800 Subject: [PATCH 302/363] waktusolat: Add new serverAdmin value --- mika/waktusolat/README.md | 1 + mika/waktusolat/values.yaml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 4ae28b18..7f288c63 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -135,4 +135,5 @@ helm uninstall $release_name --namespace $namespace --wait | waktusolat.scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"*/1"`. | | waktusolat.scheduler.timezone | string | `""` | The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. Default: `"Asia/Kuala_Lumpur"`. | | waktusolat.secret | string | `""` | A 50-character secret key used for secure session management and cryptographic operations within the WaktuSolat service. | +| waktusolat.serverAdmin | string | `""` | The email address displayed by Apache for server administration contact. Default: "admin@example.com". | | waktusolat.visibility | string | `""` | The default visibility of posts made by the WaktuSolat service. Default: `"public"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 1812edfa..f993856b 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -71,6 +71,11 @@ waktusolat: # Example: # secret: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" secret: "" + # The email address displayed by Apache for server administration contact. + # Default: "admin@example.com" + # Example: + # serverAdmin: "foo@example.com" + serverAdmin: "" # The default visibility of posts made by the WaktuSolat service. # Default: "public" # Example: From 9e4d72ba754e9a6febf63c1693ce6fe01ea1aa4e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 14:34:23 +0800 Subject: [PATCH 303/363] waktusolat: Replace old mastodon value with account Adds in a new `host` setting for specifying underlying service --- mika/waktusolat/README.md | 2 +- mika/waktusolat/values.yaml | 47 +++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 7f288c63..47a1f9d4 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -109,11 +109,11 @@ helm uninstall $release_name --namespace $namespace --wait | resources.waktusolat.limits.memory | string | `"120Mi"` | The maximum amount of memory allowed for WaktuSolat. | | resources.waktusolat.requests.cpu | string | `"30m"` | The minimum amount of CPU resources required by WaktuSolat. | | resources.waktusolat.requests.memory | string | `"60Mi"` | The minimum amount of memory required by WaktuSolat. | +| waktusolat.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | waktusolat.debug | bool | `false` | Specifies whether WaktuSolat should run in debug mode. Default: `false`. | | waktusolat.domain | string | `""` | The ingress domain name that hosts the WaktuSolat server. Default: `"localhost"`. | | waktusolat.feed | list | `[]` | WaktuSolat feed configurations. | | waktusolat.location | list | `[]` | The code of locations WaktuSolat should fetch and update prayer times for. Default: `"wlp-0"`. | -| waktusolat.mastodon | list | `[]` | WaktuSolat Mastodon configurations. | | waktusolat.persistence.enabled | bool | `false` | Specifies whether WaktuSolat should persist its storage. | | waktusolat.persistence.logs.storage | string | `""` | The amount of persistent storage allocated for WaktuSolat logs. Default: `"20Mi"`. | | waktusolat.persistence.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the WaktuSolat storage. Default: `"longhorn"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index f993856b..89b3c8d4 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -88,43 +88,52 @@ waktusolat: # - "swk-33" # - "wlp-1" location: [] - # WaktuSolat Mastodon configurations. + # Account configurations. + # Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note` # Example: - # mastodon: - # # API endpoint or URL for the Mastodon instance of the WaktuSolat bot. + # account: + # # API endpoint or URL for the server instance of the WaktuSolat bot. # # Example: # # api: "https://botsin.space" # - api: "" - # # The username or user account for the Mastodon instance of the WaktuSolat bot. + # # The username or user account for the server instance of the WaktuSolat bot. # # Example: # # id: "waktusolat" # id: "" - # # A secure token required to authenticate the WaktuSolat service with the Mastodon instance's API. + # # The underlying host service of the server instance. + # # Default: "mastodon" # # Example: - # # token: "6&p4%t)-$8a14fmfh92py8j55+us51r6%e52dzy&=a3-6yd4#e" + # # host: "bluesky" + # host: "" + # # The application access token required to authenticate the WaktuSolat service with the server instance's API. + # # Example: + # # token: "rinoSZiIvRHLw6PL1QCSia+8liGDau0MZ336JAnL0IQ" # token: "" # # Specifies whether the WaktuSolat bot should be marked as a bot. - # # Default: true + # # Note: Bluesky does not currently support this field. + # # Default: "true" # # Example: - # # bot: false + # # bot: "false" # bot: "" # # Specifies whether the WaktuSolat bot should appear in the user directory. - # # Default: true + # # Note: Bluesky does not currently support this field. + # # Default: "true" # # Example: - # # discoverable: false + # # discoverable: "false" # discoverable: "" # # Specifies whether the WaktuSolat bot should be active. - # # Default: true + # # Default: "true" # # Example: - # # enabled: false + # # enabled: "false" # enabled: "" # # The display name of the WaktuSolat bot. - # # Default: null + # # Note: Bluesky does not currently support this field. + # # Default: "null" # # Example: # # display_name: "WaktuSolat" # display_name: "" # # A list of up to four name-value pairs information to be displayed on the WaktuSolat bot's profile. - # # Default: [] + # # Note: Bluesky does not currently support this field. # # Example: # # fields: # # - name: "Website 1" @@ -133,16 +142,18 @@ waktusolat: # # value: "https://domain2.example.org" # fields: [] # # Specifies whether the WaktuSolat bot needs to manually approve follow requests. - # # Default: false + # # Note: Bluesky does not currently support this field. + # # Default: "false" # # Example: - # # locked: true + # # locked: "true" # locked: "" # # The bio of the WaktuSolat bot. - # # Default: null + # # Note: Bluesky does not currently support this field. + # # Default: "null" # # Example: # # note: "This is the bio of the WaktuSolat bot." # note: "" - mastodon: [] + account: [] # WaktuSolat storage persistence configurations. persistence: # Specifies whether WaktuSolat should persist its storage. From 86ab76287655598f8f7baafbb654d57a1e8e6851 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 14:37:10 +0800 Subject: [PATCH 304/363] waktusolat: Update feed value desc --- mika/waktusolat/README.md | 2 +- mika/waktusolat/values.yaml | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 47a1f9d4..a38c5346 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -112,7 +112,7 @@ helm uninstall $release_name --namespace $namespace --wait | waktusolat.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | waktusolat.debug | bool | `false` | Specifies whether WaktuSolat should run in debug mode. Default: `false`. | | waktusolat.domain | string | `""` | The ingress domain name that hosts the WaktuSolat server. Default: `"localhost"`. | -| waktusolat.feed | list | `[]` | WaktuSolat feed configurations. | +| waktusolat.feed | list | `[]` | WaktuSolat feed configurations. Items: `.endpoint`, `.id`, `.enabled`. | | waktusolat.location | list | `[]` | The code of locations WaktuSolat should fetch and update prayer times for. Default: `"wlp-0"`. | | waktusolat.persistence.enabled | bool | `false` | Specifies whether WaktuSolat should persist its storage. | | waktusolat.persistence.logs.storage | string | `""` | The amount of persistent storage allocated for WaktuSolat logs. Default: `"20Mi"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 89b3c8d4..3b557194 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -173,20 +173,21 @@ waktusolat: # storage: "1Gi" storage: "" # WaktuSolat feed configurations. + # Items: `.endpoint`, `.id`, `.enabled` # Example: # feed: - # # The URL of the prayer time API feed to be used by WaktuSolat. + # # The URL of the prayer time API feed to be tracked by WaktuSolat. # # Example: # # endpoint: "https://mpt.i906.my/api/prayer/%s" # - endpoint: "" - # # The unique identifier of the API feed entry, must be an ISO 3166 Alpha-2 country code in uppercase. + # # The unique identifier of the API feed entry - must be an ISO 3166 Alpha-2 country code in uppercase. # # Example: # # id: "MY" # id: "" - # # Specifies whether the API feed entry should be active to be used. - # # Default: true + # # Specifies whether the prayer time API feed entry should be actively processed. + # # Default: "true" # # Example: - # # enabled: false + # # enabled: "false" # enabled: "" feed: [] # WaktuSolat scheduler configurations. From 4730ab3bc535f76ae1a7fc68e1f566b886f036ce Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 14:37:30 +0800 Subject: [PATCH 305/363] waktusolat: Move feed value --- mika/waktusolat/values.yaml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 3b557194..e6111835 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -154,24 +154,6 @@ waktusolat: # # note: "This is the bio of the WaktuSolat bot." # note: "" account: [] - # WaktuSolat storage persistence configurations. - persistence: - # Specifies whether WaktuSolat should persist its storage. - # Example: - # enabled: true - enabled: false - # The storage class name used for dynamically provisioning a persistent volume for the WaktuSolat storage. - # Default: "longhorn" - # Example: - # storageClassName: "longhorn" - storageClassName: "" - # WaktuSolat logs persistence configurations. - logs: - # The amount of persistent storage allocated for WaktuSolat logs. - # Default: "20Mi" - # Example: - # storage: "1Gi" - storage: "" # WaktuSolat feed configurations. # Items: `.endpoint`, `.id`, `.enabled` # Example: @@ -190,6 +172,24 @@ waktusolat: # # enabled: "false" # enabled: "" feed: [] + # WaktuSolat storage persistence configurations. + persistence: + # Specifies whether WaktuSolat should persist its storage. + # Example: + # enabled: true + enabled: false + # The storage class name used for dynamically provisioning a persistent volume for the WaktuSolat storage. + # Default: "longhorn" + # Example: + # storageClassName: "longhorn" + storageClassName: "" + # WaktuSolat logs persistence configurations. + logs: + # The amount of persistent storage allocated for WaktuSolat logs. + # Default: "20Mi" + # Example: + # storage: "1Gi" + storage: "" # WaktuSolat scheduler configurations. scheduler: # Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. From bf6aadd7dc752026af90e7147b07c3e1385e896c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 14:41:43 +0800 Subject: [PATCH 306/363] waktusolat: Move waktusolat.scheduler value to scheduler --- mika/waktusolat/README.md | 30 +++---- mika/waktusolat/values.yaml | 173 ++++++++++++++++++------------------ 2 files changed, 102 insertions(+), 101 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index a38c5346..47124099 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -109,6 +109,21 @@ helm uninstall $release_name --namespace $namespace --wait | resources.waktusolat.limits.memory | string | `"120Mi"` | The maximum amount of memory allowed for WaktuSolat. | | resources.waktusolat.requests.cpu | string | `"30m"` | The minimum amount of CPU resources required by WaktuSolat. | | resources.waktusolat.requests.memory | string | `"60Mi"` | The minimum amount of memory required by WaktuSolat. | +| scheduler.apscheduler | bool | `true` | Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. | +| scheduler.celery | bool | `false` | Specifies whether Celery should be used by WaktuSolat as the task scheduler. | +| scheduler.schedule.clean_db.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | +| scheduler.schedule.clean_db.minute | string | `""` | The minutes at which the task scheduler cleans up the database. Default: `"0"`. | +| scheduler.schedule.clean_db.second | string | `""` | The seconds at which the task scheduler cleans up the database. Default: `"0"` for `apscheduler`. | +| scheduler.schedule.notify_solat_schedule.hour | string | `""` | The hours at which the task scheduler schedules the daily prayer time schedule posts. Default: `"5"`. | +| scheduler.schedule.notify_solat_schedule.minute | string | `""` | The minutes at which the task scheduler schedules the daily prayer time schedule posts. Default: `"0"`. | +| scheduler.schedule.notify_solat_schedule.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time schedule posts. Default: `"0"` for `apscheduler`. | +| scheduler.schedule.notify_solat_times.hour | string | `""` | The hours at which the task scheduler schedules prayer time notifications. Default: `"*"`. | +| scheduler.schedule.notify_solat_times.minute | string | `""` | The minutes at which the task scheduler schedules prayer time notifications. Default: `"*/1"`. | +| scheduler.schedule.notify_solat_times.second | string | `""` | The seconds at which the task scheduler schedules prayer time notifications. Default: `"0"` for `apscheduler`. | +| scheduler.schedule.post_scheduler.hour | string | `""` | The hours at which the task scheduler posts scheduled posts. Default: `"*"`. | +| scheduler.schedule.post_scheduler.minute | string | `""` | The minutes at which the task scheduler posts scheduled posts. Default: `"*"`. | +| scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"*/1"`. | +| scheduler.timezone | string | `""` | The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. Default: `"Asia/Kuala_Lumpur"`. | | waktusolat.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | waktusolat.debug | bool | `false` | Specifies whether WaktuSolat should run in debug mode. Default: `false`. | | waktusolat.domain | string | `""` | The ingress domain name that hosts the WaktuSolat server. Default: `"localhost"`. | @@ -119,21 +134,6 @@ helm uninstall $release_name --namespace $namespace --wait | waktusolat.persistence.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the WaktuSolat storage. Default: `"longhorn"`. | | waktusolat.post_limit | string | `""` | The limit number of posts to be scheduled for posting per run. Default: `"0"` (Unlimited). | | waktusolat.retry_post | string | `""` | Specifies whether to retry posting if the post fails to be sent. Default: `"false"`. | -| waktusolat.scheduler.apscheduler | bool | `true` | Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. | -| waktusolat.scheduler.celery | bool | `false` | Specifies whether Celery should be used by WaktuSolat as the task scheduler. | -| waktusolat.scheduler.schedule.clean_db.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | -| waktusolat.scheduler.schedule.clean_db.minute | string | `""` | The minutes at which the task scheduler cleans up the database. Default: `"0"`. | -| waktusolat.scheduler.schedule.clean_db.second | string | `""` | The seconds at which the task scheduler cleans up the database. Default: `"0"` for `apscheduler`. | -| waktusolat.scheduler.schedule.notify_solat_schedule.hour | string | `""` | The hours at which the task scheduler schedules the daily prayer time schedule posts. Default: `"5"`. | -| waktusolat.scheduler.schedule.notify_solat_schedule.minute | string | `""` | The minutes at which the task scheduler schedules the daily prayer time schedule posts. Default: `"0"`. | -| waktusolat.scheduler.schedule.notify_solat_schedule.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time schedule posts. Default: `"0"` for `apscheduler`. | -| waktusolat.scheduler.schedule.notify_solat_times.hour | string | `""` | The hours at which the task scheduler schedules prayer time notifications. Default: `"*"`. | -| waktusolat.scheduler.schedule.notify_solat_times.minute | string | `""` | The minutes at which the task scheduler schedules prayer time notifications. Default: `"*/1"`. | -| waktusolat.scheduler.schedule.notify_solat_times.second | string | `""` | The seconds at which the task scheduler schedules prayer time notifications. Default: `"0"` for `apscheduler`. | -| waktusolat.scheduler.schedule.post_scheduler.hour | string | `""` | The hours at which the task scheduler posts scheduled posts. Default: `"*"`. | -| waktusolat.scheduler.schedule.post_scheduler.minute | string | `""` | The minutes at which the task scheduler posts scheduled posts. Default: `"*"`. | -| waktusolat.scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"*/1"`. | -| waktusolat.scheduler.timezone | string | `""` | The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. Default: `"Asia/Kuala_Lumpur"`. | | waktusolat.secret | string | `""` | A 50-character secret key used for secure session management and cryptographic operations within the WaktuSolat service. | | waktusolat.serverAdmin | string | `""` | The email address displayed by Apache for server administration contact. Default: "admin@example.com". | | waktusolat.visibility | string | `""` | The default visibility of posts made by the WaktuSolat service. Default: `"public"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index e6111835..a7bc7cb0 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -190,92 +190,93 @@ waktusolat: # Example: # storage: "1Gi" storage: "" - # WaktuSolat scheduler configurations. - scheduler: - # Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. - # Example: - # apscheduler: false - apscheduler: true - # Specifies whether Celery should be used by WaktuSolat as the task scheduler. - # Example: - # celery: true - celery: false - # The schedule for the task scheduler used by WaktuSolat. - # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. - schedule: - # The schedule for cleaning up the database. - clean_db: - # The hours at which the task scheduler cleans up the database. - # Default: "0" - # Example: - # hour: "1" - hour: "" - # The minutes at which the task scheduler cleans up the database. - # Default: "0" - # Example: - # minute: "15" - minute: "" - # The seconds at which the task scheduler cleans up the database. - # Default: "0" for `apscheduler` - # Example: - # second: "30" - second: "" - # The schedule for scheduling the daily prayer time schedule posts. - notify_solat_schedule: - # The hours at which the task scheduler schedules the daily prayer time schedule posts. - # Default: "5" - # Example: - # hour: "4" - hour: "" - # The minutes at which the task scheduler schedules the daily prayer time schedule posts. - # Default: "0" - # Example: - # minute: "15" - minute: "" - # The seconds at which the task scheduler schedules the daily prayer time schedule posts. - # Default: "0" for `apscheduler` - # Example: - # second: "30" - second: "" - # The schedule for scheduling prayer time notifications. - notify_solat_times: - # The hours at which the task scheduler schedules prayer time notifications. - # Default: "*" - # Example: - # hour: "6,13,16,19,20" - hour: "" - # The minutes at which the task scheduler schedules prayer time notifications. - # Default: "*/1" - # Example: - # minute: "*" - minute: "" - # The seconds at which the task scheduler schedules prayer time notifications. - # Default: "0" for `apscheduler` - # Example: - # second: "30" - second: "" - # The schedule for posting scheduled posts. - post_scheduler: - # The hours at which the task scheduler posts scheduled posts. - # Default: "*" - # Example: - # hour: "4-20" - hour: "" - # The minutes at which the task scheduler posts scheduled posts. - # Default: "*" - # Example: - # minute: "0" - minute: "" - # The seconds at which the task scheduler posts scheduled posts. - # Default: "*/1" - # Example: - # second: "5" - second: "" - # The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. - # Default: "Asia/Kuala_Lumpur" - # Example: - # timezone: "Asia/Kuala_Lumpur" - timezone: "" + +# WaktuSolat scheduler configurations. +scheduler: + # Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. + # Example: + # apscheduler: false + apscheduler: true + # Specifies whether Celery should be used by WaktuSolat as the task scheduler. + # Example: + # celery: true + celery: false + # The schedule for the task scheduler used by WaktuSolat. + # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. + schedule: + # The schedule for cleaning up the database. + clean_db: + # The hours at which the task scheduler cleans up the database. + # Default: "0" + # Example: + # hour: "1" + hour: "" + # The minutes at which the task scheduler cleans up the database. + # Default: "0" + # Example: + # minute: "15" + minute: "" + # The seconds at which the task scheduler cleans up the database. + # Default: "0" for `apscheduler` + # Example: + # second: "30" + second: "" + # The schedule for scheduling the daily prayer time schedule posts. + notify_solat_schedule: + # The hours at which the task scheduler schedules the daily prayer time schedule posts. + # Default: "5" + # Example: + # hour: "4" + hour: "" + # The minutes at which the task scheduler schedules the daily prayer time schedule posts. + # Default: "0" + # Example: + # minute: "15" + minute: "" + # The seconds at which the task scheduler schedules the daily prayer time schedule posts. + # Default: "0" for `apscheduler` + # Example: + # second: "30" + second: "" + # The schedule for scheduling prayer time notifications. + notify_solat_times: + # The hours at which the task scheduler schedules prayer time notifications. + # Default: "*" + # Example: + # hour: "6,13,16,19,20" + hour: "" + # The minutes at which the task scheduler schedules prayer time notifications. + # Default: "*/1" + # Example: + # minute: "*" + minute: "" + # The seconds at which the task scheduler schedules prayer time notifications. + # Default: "0" for `apscheduler` + # Example: + # second: "30" + second: "" + # The schedule for posting scheduled posts. + post_scheduler: + # The hours at which the task scheduler posts scheduled posts. + # Default: "*" + # Example: + # hour: "4-20" + hour: "" + # The minutes at which the task scheduler posts scheduled posts. + # Default: "*" + # Example: + # minute: "0" + minute: "" + # The seconds at which the task scheduler posts scheduled posts. + # Default: "*/1" + # Example: + # second: "5" + second: "" + # The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. + # Default: "Asia/Kuala_Lumpur" + # Example: + # timezone: "Asia/Kuala_Lumpur" + timezone: "" # Database configurations. db: From 90a6cdf5166d8fcbf92bab8b86ceba489ad1031d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 15:19:44 +0800 Subject: [PATCH 307/363] waktusolat: Update sample values --- mika/waktusolat/values.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index a7bc7cb0..29f5bcb5 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -214,10 +214,10 @@ scheduler: # The minutes at which the task scheduler cleans up the database. # Default: "0" # Example: - # minute: "15" + # minute: "30" minute: "" # The seconds at which the task scheduler cleans up the database. - # Default: "0" for `apscheduler` + # Default: "0" (`apscheduler`) # Example: # second: "30" second: "" @@ -234,7 +234,7 @@ scheduler: # minute: "15" minute: "" # The seconds at which the task scheduler schedules the daily prayer time schedule posts. - # Default: "0" for `apscheduler` + # Default: "0" (`apscheduler`) # Example: # second: "30" second: "" @@ -251,7 +251,7 @@ scheduler: # minute: "*" minute: "" # The seconds at which the task scheduler schedules prayer time notifications. - # Default: "0" for `apscheduler` + # Default: "0" (`apscheduler`) # Example: # second: "30" second: "" @@ -265,12 +265,12 @@ scheduler: # The minutes at which the task scheduler posts scheduled posts. # Default: "*" # Example: - # minute: "0" + # minute: "*/30" minute: "" # The seconds at which the task scheduler posts scheduled posts. # Default: "*/1" # Example: - # second: "5" + # second: "30" second: "" # The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. # Default: "Asia/Kuala_Lumpur" From 74d8d2dc27f873ba1fc2359feebc746d62d74af4 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 15:20:29 +0800 Subject: [PATCH 308/363] waktusolat: Update scheduler value desc --- mika/waktusolat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 29f5bcb5..ee0e408f 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -191,7 +191,7 @@ waktusolat: # storage: "1Gi" storage: "" -# WaktuSolat scheduler configurations. +# Scheduler configurations. scheduler: # Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. # Example: From 116cfff846eac60c5e110305cb8a77d647d32ec5 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 15:21:17 +0800 Subject: [PATCH 309/363] waktusolat: Update scheduler.schedule value note --- mika/waktusolat/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index ee0e408f..d58e481f 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -202,7 +202,8 @@ scheduler: # celery: true celery: false # The schedule for the task scheduler used by WaktuSolat. - # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. + # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. + # The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. schedule: # The schedule for cleaning up the database. clean_db: From 1c5ec18b304949f5d5d69204d535cef838ac1a36 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 15:22:24 +0800 Subject: [PATCH 310/363] waktusolat: Reorder scheduler.timezone value --- mika/waktusolat/values.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index d58e481f..0aef3b30 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -201,6 +201,11 @@ scheduler: # Example: # celery: true celery: false + # The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. + # Default: "Asia/Kuala_Lumpur" + # Example: + # timezone: "Asia/Kuala_Lumpur" + timezone: "" # The schedule for the task scheduler used by WaktuSolat. # Note: The `apscheduler` scheduler supports the `hour`, `minute`, and `second` fields simultaneously. # The `celery` scheduler only supports a combination of the `hour` and `minute` fields, or the `second` field alone. @@ -273,11 +278,6 @@ scheduler: # Example: # second: "30" second: "" - # The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. - # Default: "Asia/Kuala_Lumpur" - # Example: - # timezone: "Asia/Kuala_Lumpur" - timezone: "" # Database configurations. db: From 638c5cd58e73f33ddbd31bdf24123872077a0f9d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 15:23:26 +0800 Subject: [PATCH 311/363] waktusolat: Update default timezone to "Etc/UTC" --- mika/waktusolat/README.md | 2 +- mika/waktusolat/templates/configmap.yaml | 2 +- mika/waktusolat/values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 47124099..1e9571f0 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -123,7 +123,7 @@ helm uninstall $release_name --namespace $namespace --wait | scheduler.schedule.post_scheduler.hour | string | `""` | The hours at which the task scheduler posts scheduled posts. Default: `"*"`. | | scheduler.schedule.post_scheduler.minute | string | `""` | The minutes at which the task scheduler posts scheduled posts. Default: `"*"`. | | scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"*/1"`. | -| scheduler.timezone | string | `""` | The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. Default: `"Asia/Kuala_Lumpur"`. | +| scheduler.timezone | string | `""` | The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. Default: `"Etc/UTC"`. | | waktusolat.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | waktusolat.debug | bool | `false` | Specifies whether WaktuSolat should run in debug mode. Default: `false`. | | waktusolat.domain | string | `""` | The ingress domain name that hosts the WaktuSolat server. Default: `"localhost"`. | diff --git a/mika/waktusolat/templates/configmap.yaml b/mika/waktusolat/templates/configmap.yaml index bfa3193b..3993069e 100644 --- a/mika/waktusolat/templates/configmap.yaml +++ b/mika/waktusolat/templates/configmap.yaml @@ -3,7 +3,7 @@ {{- $visibility := .Values.waktusolat.visibility | default "public" | toString | quote }} {{- $post_limit := .Values.waktusolat.post_limit | default "0" | toString | quote }} {{- $retry_post := .Values.waktusolat.retry_post | default "false" | toString | quote }} -{{- $scheduler_timezone := .Values.waktusolat.scheduler.timezone | default "Asia/Kuala_Lumpur" | toString | quote }} +{{- $scheduler_timezone := .Values.scheduler.timezone | default "Etc/UTC" | toString | quote }} {{- $redis_service := printf "redis://%s-waktusolat-svc" .Release.Name | quote }} {{- $domain := .Values.waktusolat.domain | default "localhost" | toString }} {{- $apscheduler := .Values.waktusolat.scheduler.apscheduler }} diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 0aef3b30..0edcf70a 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -202,7 +202,7 @@ scheduler: # celery: true celery: false # The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. - # Default: "Asia/Kuala_Lumpur" + # Default: "Etc/UTC" # Example: # timezone: "Asia/Kuala_Lumpur" timezone: "" From 02994d9cc70a3b1814a2206184ffdfde98b42f0c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 15:26:31 +0800 Subject: [PATCH 312/363] waktusolat: Update schedule values desc --- mika/waktusolat/README.md | 12 ++++++------ mika/waktusolat/values.yaml | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 1e9571f0..50c5647c 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -114,12 +114,12 @@ helm uninstall $release_name --namespace $namespace --wait | scheduler.schedule.clean_db.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | | scheduler.schedule.clean_db.minute | string | `""` | The minutes at which the task scheduler cleans up the database. Default: `"0"`. | | scheduler.schedule.clean_db.second | string | `""` | The seconds at which the task scheduler cleans up the database. Default: `"0"` for `apscheduler`. | -| scheduler.schedule.notify_solat_schedule.hour | string | `""` | The hours at which the task scheduler schedules the daily prayer time schedule posts. Default: `"5"`. | -| scheduler.schedule.notify_solat_schedule.minute | string | `""` | The minutes at which the task scheduler schedules the daily prayer time schedule posts. Default: `"0"`. | -| scheduler.schedule.notify_solat_schedule.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time schedule posts. Default: `"0"` for `apscheduler`. | -| scheduler.schedule.notify_solat_times.hour | string | `""` | The hours at which the task scheduler schedules prayer time notifications. Default: `"*"`. | -| scheduler.schedule.notify_solat_times.minute | string | `""` | The minutes at which the task scheduler schedules prayer time notifications. Default: `"*/1"`. | -| scheduler.schedule.notify_solat_times.second | string | `""` | The seconds at which the task scheduler schedules prayer time notifications. Default: `"0"` for `apscheduler`. | +| scheduler.schedule.notify_solat_schedule.hour | string | `""` | The hours at which the task scheduler schedules the daily prayer time post. Default: `"5"`. | +| scheduler.schedule.notify_solat_schedule.minute | string | `""` | The minutes at which the task scheduler schedules the daily prayer time post. Default: `"0"`. | +| scheduler.schedule.notify_solat_schedule.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time post. Default: `"0"` for `apscheduler`. | +| scheduler.schedule.notify_solat_times.hour | string | `""` | The hours at which the task scheduler schedules the daily prayer time notifications. Default: `"*"`. | +| scheduler.schedule.notify_solat_times.minute | string | `""` | The minutes at which the task scheduler schedules the daily prayer time notifications. Default: `"*/1"`. | +| scheduler.schedule.notify_solat_times.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time notifications. Default: `"0"` for `apscheduler`. | | scheduler.schedule.post_scheduler.hour | string | `""` | The hours at which the task scheduler posts scheduled posts. Default: `"*"`. | | scheduler.schedule.post_scheduler.minute | string | `""` | The minutes at which the task scheduler posts scheduled posts. Default: `"*"`. | | scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"*/1"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 0edcf70a..ee1c2b2a 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -227,36 +227,36 @@ scheduler: # Example: # second: "30" second: "" - # The schedule for scheduling the daily prayer time schedule posts. + # The schedule for the daily prayer time post. notify_solat_schedule: - # The hours at which the task scheduler schedules the daily prayer time schedule posts. + # The hours at which the task scheduler schedules the daily prayer time post. # Default: "5" # Example: # hour: "4" hour: "" - # The minutes at which the task scheduler schedules the daily prayer time schedule posts. + # The minutes at which the task scheduler schedules the daily prayer time post. # Default: "0" # Example: # minute: "15" minute: "" - # The seconds at which the task scheduler schedules the daily prayer time schedule posts. + # The seconds at which the task scheduler schedules the daily prayer time post. # Default: "0" (`apscheduler`) # Example: # second: "30" second: "" - # The schedule for scheduling prayer time notifications. + # The schedule for the daily prayer time notifications. notify_solat_times: - # The hours at which the task scheduler schedules prayer time notifications. + # The hours at which the task scheduler schedules the daily prayer time notifications. # Default: "*" # Example: # hour: "6,13,16,19,20" hour: "" - # The minutes at which the task scheduler schedules prayer time notifications. + # The minutes at which the task scheduler schedules the daily prayer time notifications. # Default: "*/1" # Example: # minute: "*" minute: "" - # The seconds at which the task scheduler schedules prayer time notifications. + # The seconds at which the task scheduler schedules the daily prayer time notifications. # Default: "0" (`apscheduler`) # Example: # second: "30" From 53e3d580e5134a51855d5bb1f06dcf78abbf829f Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 15:30:52 +0800 Subject: [PATCH 313/363] waktusolat: Update db value desc and order --- mika/waktusolat/README.md | 8 ++++---- mika/waktusolat/values.yaml | 26 +++++++++++++------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 50c5647c..652c61f3 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -86,10 +86,10 @@ helm uninstall $release_name --namespace $namespace --wait | Key | Type | Default | Description | |-----|------|---------|-------------| | db.host | string | `""` | The hostname or IP address of the WaktuSolat database server. | -| db.name | string | `""` | The name of the database used by WaktuSolat. | -| db.password | string | `""` | The password associated with the WaktuSolat database's user. | -| db.port | string | `""` | The port number on which the WaktuSolat database server is listening. Default: `"5432"`. | -| db.type | string | `""` | The type of the database used by WaktuSolat. Default: `"postgresql"`. | +| db.name | string | `""` | The name of the database being used by WaktuSolat. | +| db.password | string | `""` | The password associated with the WaktuSolat database user. | +| db.port | string | `""` | The port number the WaktuSolat database server is listening for connections. Default: `"5432"`. | +| db.type | string | `""` | The database engine or backend being used by WaktuSolat. Default: `"postgresql"`. | | db.user | string | `""` | The username or user account for accessing the WaktuSolat database. | | image.redis.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Redis container image. Default: `"alpine"`. | | image.redis.registry | string | `""` | The registry where the Redis container image is hosted. Default: `"docker.io"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index ee1c2b2a..a3aeb847 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -281,12 +281,21 @@ scheduler: # Database configurations. db: - # The type of the database used by WaktuSolat. + # The database engine or backend being used by WaktuSolat. # Default: "postgresql" # Example: - # type: "postgresql" + # type: "mysql" type: "" - # The name of the database used by WaktuSolat. + # The hostname or IP address of the WaktuSolat database server. + # Example: + # host: "waktusolat.default.svc.cluster.local" + host: "" + # The port number the WaktuSolat database server is listening for connections. + # Default: "5432" + # Example: + # port: "3306" + port: "" + # The name of the database being used by WaktuSolat. # Example: # name: "waktusolat" name: "" @@ -294,19 +303,10 @@ db: # Example: # user: "root" user: "" - # The password associated with the WaktuSolat database's user. + # The password associated with the WaktuSolat database user. # Example: # password: "password" password: "" - # The hostname or IP address of the WaktuSolat database server. - # Example: - # host: "waktusolat.default.svc.cluster.local" - host: "" - # The port number on which the WaktuSolat database server is listening. - # Default: "5432" - # Example: - # port: "5432" - port: "" # Resource requirements and limits for WaktuSolat containers. resources: From 45d7d14f8606d8f83ad7f07915618f7a31856c89 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 14 Nov 2024 18:13:20 +0800 Subject: [PATCH 314/363] waktusolat: Add ingress value --- mika/waktusolat/README.md | 4 ++++ mika/waktusolat/values.yaml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 652c61f3..c9f23f65 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -100,6 +100,10 @@ helm uninstall $release_name --namespace $namespace --wait | image.waktusolat.repository | string | `""` | The name of the repository that contains the WaktuSolat container image used. Default: `"irfanhakim-as/waktusolat"`. | | image.waktusolat.tag | string | `""` | The tag that specifies the version of the WaktuSolat container image used. Default: `Chart appVersion`. | | imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. | +| ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. | +| ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. Items: `.prefix`, `.name`, `.value`. | +| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting WaktuSolat services. | +| ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | | replicaCount | string | `""` | The desired number of running replicas for WaktuSolat. Default: `"1"`. | | resources.scheduler.limits.cpu | string | `"20m"` | The maximum amount of CPU resources allowed for Scheduler. | | resources.scheduler.limits.memory | string | `"200Mi"` | The maximum amount of memory allowed for Scheduler. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index a3aeb847..995e8bde 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -308,6 +308,40 @@ db: # password: "password" password: "" +# Ingress configurations. +ingress: + # Specifies whether Ingress should be enabled for hosting WaktuSolat services. + # Example: + # enabled: true + enabled: false + # The name of the cluster issuer for Ingress. + # Default: "letsencrypt-dns-prod" + # Example: + # clusterIssuer: "letsencrypt-http-prod" + clusterIssuer: "" + # Specifies whether the WWW subdomain should be enabled. + # Example: + # www: true + www: false + # Additional configuration annotations to be added to the Ingress resource. + # Items: `.prefix`, `.name`, `.value` + # Example: + # customAnnotations: + # # The prefix of the annotation. + # # Default: "nginx.ingress.kubernetes.io" + # # Example: + # # prefix: "nginx.org" + # - prefix: "" + # # The name of the annotation. + # # Example: + # # name: "proxy-connect-timeout" + # name: "" + # # The value of the annotation. + # # Example: + # # value: "120" + # value: "" + customAnnotations: [] + # Resource requirements and limits for WaktuSolat containers. resources: # WaktuSolat container resources. From 37469a91ea3000b8ab953ea15313a99a67904ac7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Fri, 15 Nov 2024 13:04:21 +0800 Subject: [PATCH 315/363] waktusolat: Add new service setting --- mika/waktusolat/README.md | 5 +++++ mika/waktusolat/values.yaml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index c9f23f65..bd2fd87a 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -128,6 +128,11 @@ helm uninstall $release_name --namespace $namespace --wait | scheduler.schedule.post_scheduler.minute | string | `""` | The minutes at which the task scheduler posts scheduled posts. Default: `"*"`. | | scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"*/1"`. | | scheduler.timezone | string | `""` | The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. Default: `"Etc/UTC"`. | +| service.redis.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | +| service.redis.port | string | `""` | The Redis port on which the WaktuSolat server should listen for connections. Default: `"6379"`. | +| service.type | string | `""` | The type of service used to expose WaktuSolat services. Default: `"ClusterIP"`. | +| service.waktusolat.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | +| service.waktusolat.port | string | `""` | The Redis port on which the WaktuSolat server should listen for connections. Default: `"6379"`. | | waktusolat.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | waktusolat.debug | bool | `false` | Specifies whether WaktuSolat should run in debug mode. Default: `false`. | | waktusolat.domain | string | `""` | The ingress domain name that hosts the WaktuSolat server. Default: `"localhost"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 995e8bde..fdb69b67 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -342,6 +342,36 @@ ingress: # value: "" customAnnotations: [] +# Service configurations. +service: + # The type of service used to expose WaktuSolat services. + # Default: "ClusterIP" + # Example: + # type: "NodePort" + type: "" + # WaktuSolat service port configurations. + waktusolat: + # The optional node port to expose for WaktuSolat when the service type is NodePort. + # Example: + # nodePort: "30000" + nodePort: "" + # The WaktuSolat port on which the WaktuSolat server should listen for connections. + # Default: "80" + # Example: + # port: "8080" + port: "" + # Redis service port configurations. + redis: + # The optional node port to expose for Redis when the service type is NodePort. + # Example: + # nodePort: "32000" + nodePort: "" + # The Redis port on which the WaktuSolat server should listen for connections. + # Default: "6379" + # Example: + # port: "8443" + port: "" + # Resource requirements and limits for WaktuSolat containers. resources: # WaktuSolat container resources. From c69ca1007a3000c9ac987c1bc523bd1e076f04c9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 16 Nov 2024 18:36:43 +0800 Subject: [PATCH 316/363] waktusolat: Update resources value --- mika/waktusolat/README.md | 10 +--- mika/waktusolat/values.yaml | 104 +++++++++++++++++++----------------- 2 files changed, 56 insertions(+), 58 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index bd2fd87a..8ac00210 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -105,14 +105,8 @@ helm uninstall $release_name --namespace $namespace --wait | ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting WaktuSolat services. | | ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | | replicaCount | string | `""` | The desired number of running replicas for WaktuSolat. Default: `"1"`. | -| resources.scheduler.limits.cpu | string | `"20m"` | The maximum amount of CPU resources allowed for Scheduler. | -| resources.scheduler.limits.memory | string | `"200Mi"` | The maximum amount of memory allowed for Scheduler. | -| resources.scheduler.requests.cpu | string | `"10m"` | The minimum amount of CPU resources required by Scheduler. | -| resources.scheduler.requests.memory | string | `"100Mi"` | The minimum amount of memory required by Scheduler. | -| resources.waktusolat.limits.cpu | string | `"50m"` | The maximum amount of CPU resources allowed for WaktuSolat. | -| resources.waktusolat.limits.memory | string | `"120Mi"` | The maximum amount of memory allowed for WaktuSolat. | -| resources.waktusolat.requests.cpu | string | `"30m"` | The minimum amount of CPU resources required by WaktuSolat. | -| resources.waktusolat.requests.memory | string | `"60Mi"` | The minimum amount of memory required by WaktuSolat. | +| resources.scheduler | object | `{}` | WaktuSolat container resources. | +| resources.waktusolat | object | `{}` | Scheduler container resources. | | scheduler.apscheduler | bool | `true` | Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. | | scheduler.celery | bool | `false` | Specifies whether Celery should be used by WaktuSolat as the task scheduler. | | scheduler.schedule.clean_db.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index fdb69b67..9a46eba3 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -375,54 +375,58 @@ service: # Resource requirements and limits for WaktuSolat containers. resources: # WaktuSolat container resources. - waktusolat: - # The minimum amount of resources required by WaktuSolat to run. - requests: - # The minimum amount of CPU resources required by WaktuSolat. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100m" or more if using `celery` as the scheduler. - # Example: - # cpu: "20m" - cpu: "30m" - # The minimum amount of memory required by WaktuSolat. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "250Mi" or more if using `celery` as the scheduler. - # Example: - # memory: "250Mi" - memory: "60Mi" - # The maximum amount of resources allowed for WaktuSolat. - limits: - # The maximum amount of CPU resources allowed for WaktuSolat. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "200m" or more if using `celery` as the scheduler. - # Example: - # cpu: "50m" - cpu: "50m" - # The maximum amount of memory allowed for WaktuSolat. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "400Mi" or more if using `celery` as the scheduler. - # Example: - # memory: "450Mi" - memory: "120Mi" + # Example: + # waktusolat: + # # The minimum amount of resources required by WaktuSolat to run. + # requests: + # # The minimum amount of CPU resources required by WaktuSolat. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100m" or more if using `celery` as the scheduler. + # # Example: + # # cpu: "20m" + # cpu: "30m" + # # The minimum amount of memory required by WaktuSolat. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "250Mi" or more if using `celery` as the scheduler. + # # Example: + # # memory: "250Mi" + # memory: "60Mi" + # # The maximum amount of resources allowed for WaktuSolat. + # limits: + # # The maximum amount of CPU resources allowed for WaktuSolat. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "200m" or more if using `celery` as the scheduler. + # # Example: + # # cpu: "50m" + # cpu: "50m" + # # The maximum amount of memory allowed for WaktuSolat. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "400Mi" or more if using `celery` as the scheduler. + # # Example: + # # memory: "450Mi" + # memory: "120Mi" + waktusolat: {} # Scheduler container resources. - scheduler: - # The minimum amount of resources required by Scheduler to run. - requests: - # The minimum amount of CPU resources required by Scheduler. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "10m" or more if using `celery` as the scheduler. - # Example: - # cpu: "5m" - cpu: "10m" - # The minimum amount of memory required by Scheduler. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "50Mi" or more if using `celery` as the scheduler. - # Example: - # memory: "30Mi" - memory: "100Mi" - # The maximum amount of resources allowed for Scheduler. - limits: - # The maximum amount of CPU resources allowed for Scheduler. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "20m" or more if using `celery` as the scheduler. - # Example: - # cpu: "15m" - cpu: "20m" - # The maximum amount of memory allowed for Scheduler. - # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100Mi" or more if using `celery` as the scheduler. - # Example: - # memory: "50Mi" - memory: "200Mi" + # Example: + # scheduler: + # # The minimum amount of resources required by Scheduler to run. + # requests: + # # The minimum amount of CPU resources required by Scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "10m" or more if using `celery` as the scheduler. + # # Example: + # # cpu: "5m" + # cpu: "10m" + # # The minimum amount of memory required by Scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "50Mi" or more if using `celery` as the scheduler. + # # Example: + # # memory: "30Mi" + # memory: "100Mi" + # # The maximum amount of resources allowed for Scheduler. + # limits: + # # The maximum amount of CPU resources allowed for Scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "20m" or more if using `celery` as the scheduler. + # # Example: + # # cpu: "15m" + # cpu: "20m" + # # The maximum amount of memory allowed for Scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100Mi" or more if using `celery` as the scheduler. + # # Example: + # # memory: "50Mi" + # memory: "200Mi" + scheduler: {} From d7103f84e93d4ce70672da6a6a62c280c9c4329e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 16 Nov 2024 18:42:26 +0800 Subject: [PATCH 317/363] bsky: account.fields is supported unofficially Workaround was added to add relevant fields to note (desc) --- mika/waktusolat/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 9a46eba3..f2a8f111 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -133,7 +133,7 @@ waktusolat: # # display_name: "WaktuSolat" # display_name: "" # # A list of up to four name-value pairs information to be displayed on the WaktuSolat bot's profile. - # # Note: Bluesky does not currently support this field. + # # Note: Bluesky does not officially support this field. # # Example: # # fields: # # - name: "Website 1" From d70db3669cdd25a507563396a0e41b0c4a5d8a71 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 16 Nov 2024 18:56:22 +0800 Subject: [PATCH 318/363] waktusolat: Update chart desc --- mika/waktusolat/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/Chart.yaml b/mika/waktusolat/Chart.yaml index 487f0d48..dd835ce7 100644 --- a/mika/waktusolat/Chart.yaml +++ b/mika/waktusolat/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: waktusolat -description: Waktu Solat is a simple web application that posts local prayer times on Mastodon. +description: Waktu Solat is a simple web application that posts local prayer times to federated social network. type: application version: 0.3.4 appVersion: "0.2.2-stable-r1" From 0eb874847da72e1460820a68523ec9ba0bc05215 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 16 Nov 2024 18:56:38 +0800 Subject: [PATCH 319/363] waktusolat: Add bluesky to chart keywords --- mika/waktusolat/Chart.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/waktusolat/Chart.yaml b/mika/waktusolat/Chart.yaml index dd835ce7..1ff9ac3a 100644 --- a/mika/waktusolat/Chart.yaml +++ b/mika/waktusolat/Chart.yaml @@ -8,6 +8,7 @@ keywords: - "waktu solat" - "prayer time" - "mastodon" + - "bluesky" home: "https://github.com/irfanhakim-as/waktusolat" icon: "https://irfanhakim-as.github.io/charts/logos/mika.png" sources: From 314794bc927e5a23773da045556b9ff874edeac1 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 16 Nov 2024 23:53:49 +0800 Subject: [PATCH 320/363] waktusolat: Replace and move old storage values --- mika/waktusolat/README.md | 9 ++++--- mika/waktusolat/values.yaml | 51 ++++++++++++++++++++++++------------- 2 files changed, 39 insertions(+), 21 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 8ac00210..354aff25 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -127,14 +127,17 @@ helm uninstall $release_name --namespace $namespace --wait | service.type | string | `""` | The type of service used to expose WaktuSolat services. Default: `"ClusterIP"`. | | service.waktusolat.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | | service.waktusolat.port | string | `""` | The Redis port on which the WaktuSolat server should listen for connections. Default: `"6379"`. | +| storage.log.accessMode | string | `""` | The access mode defining how the log storage can be mounted. Default: `"ReadWriteMany"`. | +| storage.log.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for log storage. | +| storage.log.mountPath | string | `""` | The path where the log storage should be mounted on the container. Default: `"/var/log/apache2"`. | +| storage.log.storage | string | `""` | The default amount of persistent storage allocated for the log storage. Default: `"20Mi"`. | +| storage.log.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the log storage. Default: `"longhorn"`. | +| storage.log.subPath | string | `""` | The subpath within the log storage to mount to the container. Leave empty if not required. | | waktusolat.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | waktusolat.debug | bool | `false` | Specifies whether WaktuSolat should run in debug mode. Default: `false`. | | waktusolat.domain | string | `""` | The ingress domain name that hosts the WaktuSolat server. Default: `"localhost"`. | | waktusolat.feed | list | `[]` | WaktuSolat feed configurations. Items: `.endpoint`, `.id`, `.enabled`. | | waktusolat.location | list | `[]` | The code of locations WaktuSolat should fetch and update prayer times for. Default: `"wlp-0"`. | -| waktusolat.persistence.enabled | bool | `false` | Specifies whether WaktuSolat should persist its storage. | -| waktusolat.persistence.logs.storage | string | `""` | The amount of persistent storage allocated for WaktuSolat logs. Default: `"20Mi"`. | -| waktusolat.persistence.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the WaktuSolat storage. Default: `"longhorn"`. | | waktusolat.post_limit | string | `""` | The limit number of posts to be scheduled for posting per run. Default: `"0"` (Unlimited). | | waktusolat.retry_post | string | `""` | Specifies whether to retry posting if the post fails to be sent. Default: `"false"`. | | waktusolat.secret | string | `""` | A 50-character secret key used for secure session management and cryptographic operations within the WaktuSolat service. | diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index f2a8f111..ac95f755 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -172,24 +172,6 @@ waktusolat: # # enabled: "false" # enabled: "" feed: [] - # WaktuSolat storage persistence configurations. - persistence: - # Specifies whether WaktuSolat should persist its storage. - # Example: - # enabled: true - enabled: false - # The storage class name used for dynamically provisioning a persistent volume for the WaktuSolat storage. - # Default: "longhorn" - # Example: - # storageClassName: "longhorn" - storageClassName: "" - # WaktuSolat logs persistence configurations. - logs: - # The amount of persistent storage allocated for WaktuSolat logs. - # Default: "20Mi" - # Example: - # storage: "1Gi" - storage: "" # Scheduler configurations. scheduler: @@ -372,6 +354,39 @@ service: # port: "8443" port: "" +# Storage configurations. +storage: + # Log storage configurations. + log: + # Specifies whether persistent storage should be provisioned for log storage. + # Example: + # enabled: true + enabled: false + # The access mode defining how the log storage can be mounted. + # Default: "ReadWriteMany" + # Example: + # accessMode: "ReadWriteOnce" + accessMode: "" + # The path where the log storage should be mounted on the container. + # Default: "/var/log/apache2" + # Example: + # mountPath: "/log" + mountPath: "" + # The subpath within the log storage to mount to the container. Leave empty if not required. + # Example: + # subPath: "Log" + subPath: "" + # The default amount of persistent storage allocated for the log storage. + # Default: "20Mi" + # Example: + # storage: "10Gi" + storage: "" + # The storage class name used for dynamically provisioning a persistent volume for the log storage. + # Default: "longhorn" + # Example: + # storageClassName: "smb" + storageClassName: "" + # Resource requirements and limits for WaktuSolat containers. resources: # WaktuSolat container resources. From e3367044185eef4c8945bc1b592a0132603a8d71 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 16 Nov 2024 23:55:48 +0800 Subject: [PATCH 321/363] waktusolat: Rename and refactor old pvc --- mika/waktusolat/templates/pvc.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/mika/waktusolat/templates/pvc.yaml b/mika/waktusolat/templates/pvc.yaml index 40ea8c1d..dfc94aeb 100644 --- a/mika/waktusolat/templates/pvc.yaml +++ b/mika/waktusolat/templates/pvc.yaml @@ -1,18 +1,20 @@ -{{- $logs_storage := .Values.waktusolat.persistence.logs.storage | default "20Mi" | toString | quote }} -{{- $storage_class_name := .Values.waktusolat.persistence.storageClassName | default "longhorn" | toString | quote }} -{{- $persistence := .Values.waktusolat.persistence.enabled }} -{{- if $persistence }} +{{- $logPersistence := .Values.storage.log.enabled }} +{{- $logAccessMode := .Values.storage.log.accessMode | default "ReadWriteMany" | toString | quote }} +{{- $logStorage := .Values.storage.log.storage | default "20Mi" | toString | quote }} +{{- $logStorageClassName := .Values.storage.log.storageClassName | default "longhorn" | toString | quote }} +{{- if $logPersistence }} +--- apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ .Release.Name }}-waktusolat-logs-pvc + name: {{ .Release.Name }}-waktusolat-log-pvc labels: {{- include "waktusolat.labels" . | nindent 4 }} spec: accessModes: - - ReadWriteMany + - {{ $logAccessMode }} resources: requests: - storage: {{ $logs_storage }} - storageClassName: {{ $storage_class_name }} + storage: {{ $logStorage }} + storageClassName: {{ $logStorageClassName }} {{- end }} From 9d4ed2f9a9a5ea935e2d494163a47f70a61193c6 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sat, 16 Nov 2024 23:56:32 +0800 Subject: [PATCH 322/363] waktusolat: Set default log storage size to 50Mi --- mika/waktusolat/README.md | 2 +- mika/waktusolat/templates/pvc.yaml | 2 +- mika/waktusolat/values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 354aff25..88a76783 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -130,7 +130,7 @@ helm uninstall $release_name --namespace $namespace --wait | storage.log.accessMode | string | `""` | The access mode defining how the log storage can be mounted. Default: `"ReadWriteMany"`. | | storage.log.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for log storage. | | storage.log.mountPath | string | `""` | The path where the log storage should be mounted on the container. Default: `"/var/log/apache2"`. | -| storage.log.storage | string | `""` | The default amount of persistent storage allocated for the log storage. Default: `"20Mi"`. | +| storage.log.storage | string | `""` | The default amount of persistent storage allocated for the log storage. Default: `"50Mi"`. | | storage.log.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the log storage. Default: `"longhorn"`. | | storage.log.subPath | string | `""` | The subpath within the log storage to mount to the container. Leave empty if not required. | | waktusolat.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | diff --git a/mika/waktusolat/templates/pvc.yaml b/mika/waktusolat/templates/pvc.yaml index dfc94aeb..2f8fd038 100644 --- a/mika/waktusolat/templates/pvc.yaml +++ b/mika/waktusolat/templates/pvc.yaml @@ -1,6 +1,6 @@ {{- $logPersistence := .Values.storage.log.enabled }} {{- $logAccessMode := .Values.storage.log.accessMode | default "ReadWriteMany" | toString | quote }} -{{- $logStorage := .Values.storage.log.storage | default "20Mi" | toString | quote }} +{{- $logStorage := .Values.storage.log.storage | default "50Mi" | toString | quote }} {{- $logStorageClassName := .Values.storage.log.storageClassName | default "longhorn" | toString | quote }} {{- if $logPersistence }} --- diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index ac95f755..7d36a29c 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -377,7 +377,7 @@ storage: # subPath: "Log" subPath: "" # The default amount of persistent storage allocated for the log storage. - # Default: "20Mi" + # Default: "50Mi" # Example: # storage: "10Gi" storage: "" From 811f708b7a4551306331644ddd0b430def2f005d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 00:00:57 +0800 Subject: [PATCH 323/363] waktusolat: Update and refactor service --- mika/waktusolat/templates/service.yaml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/mika/waktusolat/templates/service.yaml b/mika/waktusolat/templates/service.yaml index c423e77a..76f80ac1 100644 --- a/mika/waktusolat/templates/service.yaml +++ b/mika/waktusolat/templates/service.yaml @@ -1,4 +1,10 @@ -{{- $celery := .Values.waktusolat.scheduler.celery }} +{{- $celery := .Values.scheduler.celery }} +{{- $waktusolatPort := .Values.service.waktusolat.port | default "80" | toString }} +{{- $waktusolatNodePort := .Values.service.waktusolat.nodePort | toString }} +{{- $redisPort := .Values.service.redis.port | default "6379" | toString }} +{{- $redisNodePort := .Values.service.redis.nodePort | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +--- apiVersion: v1 kind: Service metadata: @@ -6,17 +12,23 @@ metadata: labels: {{- include "waktusolat.labels" . | nindent 4 }} spec: - type: ClusterIP + type: {{ $type }} ports: - - port: 80 + - port: {{ int $waktusolatPort }} targetPort: waktusolat + {{- if and (eq $type "NodePort") $waktusolatNodePort }} + nodePort: {{ int $waktusolatNodePort }} + {{- end }} protocol: TCP - name: {{ .Release.Name }}-waktusolat + name: waktusolat {{- if $celery }} - - port: 6379 + - port: {{ int $redisPort }} targetPort: redis + {{- if and (eq $type "NodePort") $redisNodePort }} + nodePort: {{ int $redisNodePort }} + {{- end }} protocol: TCP - name: {{ .Release.Name }}-redis + name: redis {{- end }} selector: {{- include "waktusolat.selectorLabels" . | nindent 4 }} From eb7be788aed5eccb0551518caa5d05fc11245b1a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 00:06:32 +0800 Subject: [PATCH 324/363] waktusolat: Minor update and rename of secret --- mika/waktusolat/templates/secret.yaml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mika/waktusolat/templates/secret.yaml b/mika/waktusolat/templates/secret.yaml index fd1ae2ea..961e0755 100644 --- a/mika/waktusolat/templates/secret.yaml +++ b/mika/waktusolat/templates/secret.yaml @@ -5,6 +5,8 @@ {{- $db_password := .Values.db.password | toString | b64enc }} {{- $db_host := .Values.db.host | toString | b64enc }} {{- $db_port := .Values.db.port | default "5432" | toString | b64enc }} +{{- $accounts := .Values.waktusolat.account }} +--- apiVersion: v1 kind: Secret metadata: @@ -24,14 +26,14 @@ data: apiVersion: v1 kind: Secret metadata: - name: {{ .Release.Name }}-waktusolat-mastodon-config + name: {{ .Release.Name }}-waktusolat-account-config labels: {{- include "waktusolat.labels" . | nindent 4 }} type: Opaque data: accounts.json: |- {{- include "waktusolat.accounts-json" . | toString | b64enc | nindent 4 }} -{{- if .Values.waktusolat.mastodon }} +{{- if $accounts }} --- apiVersion: v1 kind: Secret @@ -41,10 +43,10 @@ metadata: {{- include "waktusolat.labels" . | nindent 4 }} type: Opaque data: - {{- range .Values.waktusolat.mastodon }} + {{- range $accounts }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} {{ $token_secret }}: |- - {{ .token | toString | b64enc | nindent 4 }} + {{- .token | toString | b64enc | nindent 4 }} {{- end }} {{- end }} From 88eba0a71c87f942eec09ea9964854df1d7d4553 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 00:28:38 +0800 Subject: [PATCH 325/363] waktusolat: Update and refactor configmap --- mika/waktusolat/templates/configmap.yaml | 40 ++++++++++++++---------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/mika/waktusolat/templates/configmap.yaml b/mika/waktusolat/templates/configmap.yaml index 3993069e..d7db4afd 100644 --- a/mika/waktusolat/templates/configmap.yaml +++ b/mika/waktusolat/templates/configmap.yaml @@ -1,13 +1,18 @@ +{{- $apscheduler := .Values.scheduler.apscheduler }} +{{- $celery := .Values.scheduler.celery }} +{{- $feeds := .Values.waktusolat.feed }} {{- $debug := .Values.waktusolat.debug | default "false" | toString | quote }} -{{- $location := .Values.waktusolat.location | default "wlp-0" | join "," | toString | quote }} +{{- $scheduler_timezone := .Values.scheduler.timezone | default "Etc/UTC" | toString | quote }} {{- $visibility := .Values.waktusolat.visibility | default "public" | toString | quote }} +{{- $location := .Values.waktusolat.location | default "wlp-0" | join "," | toString | quote }} +{{- $organic := .Values.waktusolat.organic | default "true" | toString | quote }} {{- $post_limit := .Values.waktusolat.post_limit | default "0" | toString | quote }} -{{- $retry_post := .Values.waktusolat.retry_post | default "false" | toString | quote }} -{{- $scheduler_timezone := .Values.scheduler.timezone | default "Etc/UTC" | toString | quote }} +{{- $retry_post := .Values.waktusolat.retry_post | default "true" | toString | quote }} {{- $redis_service := printf "redis://%s-waktusolat-svc" .Release.Name | quote }} {{- $domain := .Values.waktusolat.domain | default "localhost" | toString }} -{{- $apscheduler := .Values.waktusolat.scheduler.apscheduler }} -{{- $celery := .Values.waktusolat.scheduler.celery }} +{{- $serverAdmin := .Values.waktusolat.serverAdmin | default "admin@example.com" | toString }} +{{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString }} +--- apiVersion: v1 kind: ConfigMap metadata: @@ -16,8 +21,9 @@ metadata: {{- include "waktusolat.labels" . | nindent 4 }} data: DEBUG: {{ $debug }} - LOCATION_CODES: {{ $location }} DEFAULT_VISIBILITY: {{ $visibility }} + LOCATION_CODES: {{ $location }} + ORGANIC_POSTS: {{ $organic }} POST_LIMIT: {{ $post_limit }} RETRY_POST: {{ $retry_post }} {{- if $celery }} @@ -36,8 +42,8 @@ metadata: {{- include "waktusolat.labels" . | nindent 4 }} data: site-config.conf: |- - {{- include "waktusolat.site-config-conf" . | replace "DOMAIN" $domain | nindent 4 }} -{{- if .Values.waktusolat.feed }} + {{- include "waktusolat.site-config-conf" . | toString | replace "DOMAIN" $domain | replace "SERVER_ADMIN" $serverAdmin | replace "LOG_MOUNT_PATH" $logMountPath | nindent 4 }} +{{- if $feeds }} --- apiVersion: v1 kind: ConfigMap @@ -59,7 +65,7 @@ metadata: {{- include "waktusolat.labels" . | nindent 4 }} data: entrypoint.sh: |- - {{- include "waktusolat.apscheduler-entrypoint-sh" . | nindent 4 }} + {{- include "waktusolat.apscheduler-entrypoint-sh" . | toString | nindent 4 }} {{- else if $celery }} --- apiVersion: v1 @@ -70,7 +76,7 @@ metadata: {{- include "waktusolat.labels" . | nindent 4 }} data: celeryd: |- - {{- include "waktusolat.default-celeryd" . | nindent 4 }} + {{- include "waktusolat.default-celeryd" . | toString | nindent 4 }} --- apiVersion: v1 kind: ConfigMap @@ -80,9 +86,9 @@ metadata: {{- include "waktusolat.labels" . | nindent 4 }} data: celerybeat: |- - {{- include "waktusolat.initd-celerybeat" . | nindent 4 }} + {{- include "waktusolat.initd-celerybeat" . | toString | nindent 4 }} celeryd: |- - {{- include "waktusolat.initd-celeryd" . | nindent 4 }} + {{- include "waktusolat.initd-celeryd" . | toString | nindent 4 }} {{- end }} {{- if or $apscheduler $celery }} --- @@ -95,17 +101,17 @@ metadata: data: {{- if $apscheduler }} apps.py: |- - {{- include "waktusolat.apscheduler-apps-py" . | nindent 4 }} + {{- include "waktusolat.apscheduler-apps-py" . | toString | nindent 4 }} {{- else if $celery }} celery.py: |- - {{- include "waktusolat.celery-py" . | nindent 4 }} + {{- include "waktusolat.celery-py" . | toString | nindent 4 }} init.py: |- - {{- include "waktusolat.celery-init-py" . | nindent 4 }} + {{- include "waktusolat.celery-init-py" . | toString | nindent 4 }} {{- end }} tasks.py: |- {{- if $apscheduler }} - {{- include "waktusolat.apscheduler-tasks-py" . | nindent 4 }} + {{- include "waktusolat.apscheduler-tasks-py" . | toString | nindent 4 }} {{- else if $celery }} - {{- include "waktusolat.celery-tasks-py" . | nindent 4 }} + {{- include "waktusolat.celery-tasks-py" . | toString | nindent 4 }} {{- end }} {{- end }} From 8933ead547de3fed8690d151f6db6e424c63df3b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 00:30:19 +0800 Subject: [PATCH 326/363] waktusolat: Move var declaration --- mika/waktusolat/templates/secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/templates/secret.yaml b/mika/waktusolat/templates/secret.yaml index 961e0755..f15579a7 100644 --- a/mika/waktusolat/templates/secret.yaml +++ b/mika/waktusolat/templates/secret.yaml @@ -1,3 +1,4 @@ +{{- $accounts := .Values.waktusolat.account }} {{- $secret := .Values.waktusolat.secret | toString | b64enc }} {{- $db_type := .Values.db.type | default "postgresql" | toString | b64enc }} {{- $db_name := .Values.db.name | toString | b64enc }} @@ -5,7 +6,6 @@ {{- $db_password := .Values.db.password | toString | b64enc }} {{- $db_host := .Values.db.host | toString | b64enc }} {{- $db_port := .Values.db.port | default "5432" | toString | b64enc }} -{{- $accounts := .Values.waktusolat.account }} --- apiVersion: v1 kind: Secret From 3f42af9e5139c760f8a9b34616a7efa070b27467 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 00:46:43 +0800 Subject: [PATCH 327/363] waktusolat: Remove trailing comma --- mika/waktusolat/templates/feeds.json.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/templates/feeds.json.tpl b/mika/waktusolat/templates/feeds.json.tpl index 56fd6175..6b8e5fdb 100644 --- a/mika/waktusolat/templates/feeds.json.tpl +++ b/mika/waktusolat/templates/feeds.json.tpl @@ -9,7 +9,7 @@ Mastodon /base/lib/feeds.json template { "uid": {{ $feed.id | toString | quote }}, "endpoint": {{ $feed.endpoint | toString | quote }}, - "is_enabled": {{ $feed.enabled | default "true" | toString }}, + "is_enabled": {{ $feed.enabled | default "true" | toString }} }{{ if ne $index (sub (len $feeds) 1) }},{{ end }} {{- end }} ] From fd572ed7b0148ead8f12f70064263578667d402d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 00:47:09 +0800 Subject: [PATCH 328/363] waktusolat: Update and refactor templates --- mika/waktusolat/templates/accounts.json.tpl | 5 ++-- mika/waktusolat/templates/celery.py.tpl | 24 +++++++++---------- mika/waktusolat/templates/feeds.json.tpl | 2 +- .../waktusolat/templates/site-config-conf.tpl | 6 ++--- mika/waktusolat/templates/tasks.py.tpl | 24 +++++++++---------- 5 files changed, 31 insertions(+), 30 deletions(-) diff --git a/mika/waktusolat/templates/accounts.json.tpl b/mika/waktusolat/templates/accounts.json.tpl index 28080f56..9e80ace8 100644 --- a/mika/waktusolat/templates/accounts.json.tpl +++ b/mika/waktusolat/templates/accounts.json.tpl @@ -1,10 +1,10 @@ {{/* -Mastodon /base/lib/accounts.json template +WaktuSolat /base/lib/accounts.json template */}} {{- define "waktusolat.accounts-json" -}} { "accounts": [ - {{- $accounts := .Values.waktusolat.mastodon }} + {{- $accounts := .Values.waktusolat.account }} {{- range $index, $account := $accounts }} {{- $normalised_api := $account.api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" $account.id $normalised_api | toString | replace " " "" }} @@ -29,6 +29,7 @@ Mastodon /base/lib/accounts.json template ]{{ if ne $i (sub (len $fields) 1) }},{{ end }} {{- end }} ], + "host": {{ $account.host | default "mastodon" | toString | quote }}, "is_locked": {{ $account.locked | default "false" | toString }}, {{- if $account.note }} "note": {{ $account.note | toString | quote }} diff --git a/mika/waktusolat/templates/celery.py.tpl b/mika/waktusolat/templates/celery.py.tpl index ec0d1644..5303214f 100644 --- a/mika/waktusolat/templates/celery.py.tpl +++ b/mika/waktusolat/templates/celery.py.tpl @@ -3,18 +3,18 @@ Celery /base/base/celery.py template */}} {{- define "waktusolat.celery-py" -}} -{{- $clean_db_hour := .Values.waktusolat.scheduler.schedule.clean_db.hour | default "0" | toString -}} -{{- $clean_db_minute := .Values.waktusolat.scheduler.schedule.clean_db.minute | default "0" | toString -}} -{{- $clean_db_second := .Values.waktusolat.scheduler.schedule.clean_db.second | toString -}} -{{- $notify_solat_schedule_hour := .Values.waktusolat.scheduler.schedule.notify_solat_schedule.hour | default "5" | toString -}} -{{- $notify_solat_schedule_minute := .Values.waktusolat.scheduler.schedule.notify_solat_schedule.minute | default "0" | toString -}} -{{- $notify_solat_schedule_second := .Values.waktusolat.scheduler.schedule.notify_solat_schedule.second | toString -}} -{{- $notify_solat_times_hour := .Values.waktusolat.scheduler.schedule.notify_solat_times.hour | default "*" | toString -}} -{{- $notify_solat_times_minute := .Values.waktusolat.scheduler.schedule.notify_solat_times.minute | default "*/1" | toString -}} -{{- $notify_solat_times_second := .Values.waktusolat.scheduler.schedule.notify_solat_times.second | toString -}} -{{- $post_scheduler_hour := .Values.waktusolat.scheduler.schedule.post_scheduler.hour | default "*" | toString -}} -{{- $post_scheduler_minute := .Values.waktusolat.scheduler.schedule.post_scheduler.minute | default "*" | toString -}} -{{- $post_scheduler_second := .Values.waktusolat.scheduler.schedule.post_scheduler.second | default "*/1" | toString -}} +{{- $clean_db_hour := .Values.scheduler.schedule.clean_db.hour | default "0" | toString -}} +{{- $clean_db_minute := .Values.scheduler.schedule.clean_db.minute | default "0" | toString -}} +{{- $clean_db_second := .Values.scheduler.schedule.clean_db.second | toString -}} +{{- $notify_solat_schedule_hour := .Values.scheduler.schedule.notify_solat_schedule.hour | default "5" | toString -}} +{{- $notify_solat_schedule_minute := .Values.scheduler.schedule.notify_solat_schedule.minute | default "0" | toString -}} +{{- $notify_solat_schedule_second := .Values.scheduler.schedule.notify_solat_schedule.second | toString -}} +{{- $notify_solat_times_hour := .Values.scheduler.schedule.notify_solat_times.hour | default "*" | toString -}} +{{- $notify_solat_times_minute := .Values.scheduler.schedule.notify_solat_times.minute | default "*/1" | toString -}} +{{- $notify_solat_times_second := .Values.scheduler.schedule.notify_solat_times.second | toString -}} +{{- $post_scheduler_hour := .Values.scheduler.schedule.post_scheduler.hour | default "*" | toString -}} +{{- $post_scheduler_minute := .Values.scheduler.schedule.post_scheduler.minute | default "*" | toString -}} +{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | default "*/1" | toString -}} from __future__ import absolute_import, unicode_literals import os diff --git a/mika/waktusolat/templates/feeds.json.tpl b/mika/waktusolat/templates/feeds.json.tpl index 6b8e5fdb..38ea6201 100644 --- a/mika/waktusolat/templates/feeds.json.tpl +++ b/mika/waktusolat/templates/feeds.json.tpl @@ -1,5 +1,5 @@ {{/* -Mastodon /base/lib/feeds.json template +WaktuSolat /base/lib/feeds.json template */}} {{- define "waktusolat.feeds-json" -}} { diff --git a/mika/waktusolat/templates/site-config-conf.tpl b/mika/waktusolat/templates/site-config-conf.tpl index bfd17433..994fd5c4 100644 --- a/mika/waktusolat/templates/site-config-conf.tpl +++ b/mika/waktusolat/templates/site-config-conf.tpl @@ -5,7 +5,7 @@ Apache site-config.conf template ServerName DOMAIN:443 UseCanonicalName On - ServerAdmin support@mikahomelab.com + ServerAdmin SERVER_ADMIN DocumentRoot /base WSGIScriptAlias / /base/base/wsgi.py WSGIDaemonProcess DOMAIN python-path=/base @@ -22,7 +22,7 @@ Apache site-config.conf template Require all granted - ErrorLog /var/log/apache2/apache.error.log - CustomLog /var/log/apache2/apache.access.log combined + ErrorLog LOG_MOUNT_PATH/apache.error.log + CustomLog LOG_MOUNT_PATH/apache.access.log combined {{- end }} diff --git a/mika/waktusolat/templates/tasks.py.tpl b/mika/waktusolat/templates/tasks.py.tpl index ce7693b6..9caac9da 100644 --- a/mika/waktusolat/templates/tasks.py.tpl +++ b/mika/waktusolat/templates/tasks.py.tpl @@ -3,18 +3,18 @@ APScheduler /base/base/tasks.py template */}} {{- define "waktusolat.apscheduler-tasks-py" -}} -{{- $clean_db_hour := .Values.waktusolat.scheduler.schedule.clean_db.hour | default "0" | toString -}} -{{- $clean_db_minute := .Values.waktusolat.scheduler.schedule.clean_db.minute | default "0" | toString -}} -{{- $clean_db_second := .Values.waktusolat.scheduler.schedule.clean_db.second | default "0" | toString -}} -{{- $notify_solat_schedule_hour := .Values.waktusolat.scheduler.schedule.notify_solat_schedule.hour | default "5" | toString -}} -{{- $notify_solat_schedule_minute := .Values.waktusolat.scheduler.schedule.notify_solat_schedule.minute | default "0" | toString -}} -{{- $notify_solat_schedule_second := .Values.waktusolat.scheduler.schedule.notify_solat_schedule.second | default "0" | toString -}} -{{- $notify_solat_times_hour := .Values.waktusolat.scheduler.schedule.notify_solat_times.hour | default "*" | toString -}} -{{- $notify_solat_times_minute := .Values.waktusolat.scheduler.schedule.notify_solat_times.minute | default "*/1" | toString -}} -{{- $notify_solat_times_second := .Values.waktusolat.scheduler.schedule.notify_solat_times.second | default "0" | toString -}} -{{- $post_scheduler_hour := .Values.waktusolat.scheduler.schedule.post_scheduler.hour | default "*" | toString -}} -{{- $post_scheduler_minute := .Values.waktusolat.scheduler.schedule.post_scheduler.minute | default "*" | toString -}} -{{- $post_scheduler_second := .Values.waktusolat.scheduler.schedule.post_scheduler.second | default "*/1" | toString -}} +{{- $clean_db_hour := .Values.scheduler.schedule.clean_db.hour | default "0" | toString -}} +{{- $clean_db_minute := .Values.scheduler.schedule.clean_db.minute | default "0" | toString -}} +{{- $clean_db_second := .Values.scheduler.schedule.clean_db.second | default "0" | toString -}} +{{- $notify_solat_schedule_hour := .Values.scheduler.schedule.notify_solat_schedule.hour | default "5" | toString -}} +{{- $notify_solat_schedule_minute := .Values.scheduler.schedule.notify_solat_schedule.minute | default "0" | toString -}} +{{- $notify_solat_schedule_second := .Values.scheduler.schedule.notify_solat_schedule.second | default "0" | toString -}} +{{- $notify_solat_times_hour := .Values.scheduler.schedule.notify_solat_times.hour | default "*" | toString -}} +{{- $notify_solat_times_minute := .Values.scheduler.schedule.notify_solat_times.minute | default "*/1" | toString -}} +{{- $notify_solat_times_second := .Values.scheduler.schedule.notify_solat_times.second | default "0" | toString -}} +{{- $post_scheduler_hour := .Values.scheduler.schedule.post_scheduler.hour | default "*" | toString -}} +{{- $post_scheduler_minute := .Values.scheduler.schedule.post_scheduler.minute | default "*" | toString -}} +{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | default "*/1" | toString -}} from apscheduler.schedulers.blocking import BlockingScheduler from django.conf import settings From cd1978da0aedfde04ff138e51cf810c14d638b4e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 01:31:11 +0800 Subject: [PATCH 329/363] waktusolat: Update and refactor deployment --- mika/waktusolat/templates/deployment.yaml | 60 +++++++++++++---------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/mika/waktusolat/templates/deployment.yaml b/mika/waktusolat/templates/deployment.yaml index 0a531188..1f14a7b4 100644 --- a/mika/waktusolat/templates/deployment.yaml +++ b/mika/waktusolat/templates/deployment.yaml @@ -1,5 +1,8 @@ -{{- $release_name := .Release.Name | toString }} -{{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $accounts := .Values.waktusolat.account }} +{{- $apscheduler := .Values.scheduler.apscheduler }} +{{- $celery := .Values.scheduler.celery }} +{{- $feeds := .Values.waktusolat.feed }} +{{- $logPersistence := .Values.storage.log.enabled }} {{- $waktusolat_registry := .Values.image.waktusolat.registry | default "ghcr.io" | toString }} {{- $waktusolat_repository := .Values.image.waktusolat.repository | default "irfanhakim-as/waktusolat" | toString }} {{- $waktusolat_tag := .Values.image.waktusolat.tag | default .Chart.AppVersion | toString }} @@ -8,9 +11,10 @@ {{- $redis_repository := .Values.image.redis.repository | default "redis" | toString }} {{- $redis_tag := .Values.image.redis.tag | default "alpine" | toString }} {{- $redis_pullPolicy := .Values.image.redis.pullPolicy | default "IfNotPresent" | toString | quote }} -{{- $apscheduler := .Values.waktusolat.scheduler.apscheduler }} -{{- $celery := .Values.waktusolat.scheduler.celery }} -{{- $persistence := .Values.waktusolat.persistence.enabled }} +{{- $release_name := .Release.Name | toString }} +{{- $replica_count := .Values.replicaCount | default "1" | toString }} +{{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString | quote }} +{{- $logSubPath := .Values.storage.log.subPath | toString }} apiVersion: apps/v1 kind: Deployment metadata: @@ -55,11 +59,11 @@ spec: mountPath: /etc/apache2/sites-available/000-default.conf subPath: site-config.conf readOnly: true - - name: {{ .Release.Name }}-waktusolat-mastodon-config + - name: {{ .Release.Name }}-waktusolat-account-config mountPath: /base/data/accounts.json subPath: accounts.json readOnly: true - {{- if .Values.waktusolat.feed }} + {{- if $feeds }} - name: {{ .Release.Name }}-waktusolat-feed-config mountPath: /base/data/feeds.json subPath: feeds.json @@ -85,7 +89,7 @@ spec: mountPath: /base/base/__init__.py subPath: init.py {{- end }} - {{- range .Values.waktusolat.mastodon }} + {{- range $accounts }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - name: {{ $release_name }}-waktusolat-token-secret @@ -93,9 +97,12 @@ spec: subPath: {{ $token_secret }} readOnly: true {{- end }} - {{- if $persistence }} - - name: {{ .Release.Name }}-waktusolat-logs - mountPath: /var/log/apache2 + {{- if $logPersistence }} + - name: {{ .Release.Name }}-waktusolat-log + mountPath: {{ $logMountPath }} + {{- if $logSubPath }} + subPath: {{ $logSubPath | quote }} + {{- end }} {{- end }} {{- if $apscheduler }} - name: apscheduler @@ -113,7 +120,7 @@ spec: - secretRef: name: {{ .Release.Name }}-waktusolat-secret volumeMounts: - - name: {{ .Release.Name }}-waktusolat-mastodon-config + - name: {{ .Release.Name }}-waktusolat-account-config mountPath: /base/data/accounts.json subPath: accounts.json readOnly: true @@ -126,7 +133,7 @@ spec: - name: {{ .Release.Name }}-waktusolat-scheduler-config mountPath: /base/base/tasks.py subPath: tasks.py - {{- range .Values.waktusolat.mastodon }} + {{- range $accounts }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - name: {{ $release_name }}-waktusolat-token-secret @@ -134,15 +141,18 @@ spec: subPath: {{ $token_secret }} readOnly: true {{- end }} - {{- if .Values.waktusolat.feed }} + {{- if $feeds }} - name: {{ .Release.Name }}-waktusolat-feed-config mountPath: /base/data/feeds.json subPath: feeds.json readOnly: true {{- end }} - {{- if $persistence }} - - name: {{ .Release.Name }}-waktusolat-logs - mountPath: /var/log/apache2 + {{- if $logPersistence }} + - name: {{ .Release.Name }}-waktusolat-log + mountPath: {{ $logMountPath }} + {{- if $logSubPath }} + subPath: {{ $logSubPath | quote }} + {{- end }} {{- end }} {{- else if $celery }} - name: redis @@ -159,10 +169,10 @@ spec: - name: {{ .Release.Name }}-waktusolat-site-config configMap: name: {{ .Release.Name }}-waktusolat-site-config - - name: {{ .Release.Name }}-waktusolat-mastodon-config + - name: {{ .Release.Name }}-waktusolat-account-config secret: - secretName: {{ .Release.Name }}-waktusolat-mastodon-config - {{- if .Values.waktusolat.feed }} + secretName: {{ .Release.Name }}-waktusolat-account-config + {{- if $feeds }} - name: {{ .Release.Name }}-waktusolat-feed-config configMap: name: {{ .Release.Name }}-waktusolat-feed-config @@ -211,22 +221,22 @@ spec: - key: tasks.py path: tasks.py {{- end }} - {{- if .Values.waktusolat.mastodon }} + {{- if $accounts }} - name: {{ .Release.Name }}-waktusolat-token-secret secret: secretName: {{ .Release.Name }}-waktusolat-token-secret items: - {{- range .Values.waktusolat.mastodon }} + {{- range $accounts }} {{- $normalised_api := .api | toString | replace "https" "" | replace ":" "" | replace "/" "" | replace "." "-" }} {{- $token_secret := printf "%s-%s.secret" .id $normalised_api | toString | replace " " "" }} - key: {{ $token_secret }} path: {{ $token_secret }} {{- end }} {{- end }} - {{- if $persistence }} - - name: {{ .Release.Name }}-waktusolat-logs + {{- if $logPersistence }} + - name: {{ .Release.Name }}-waktusolat-log persistentVolumeClaim: - claimName: {{ .Release.Name }}-waktusolat-logs-pvc + claimName: {{ .Release.Name }}-waktusolat-log-pvc {{- end }} securityContext: fsGroup: 33 From f336068c1660a186e3ab5507424cd2a194688fb7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 01:32:05 +0800 Subject: [PATCH 330/363] waktusolat: Add ingress manifest --- mika/waktusolat/templates/ingress.yaml | 60 ++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 mika/waktusolat/templates/ingress.yaml diff --git a/mika/waktusolat/templates/ingress.yaml b/mika/waktusolat/templates/ingress.yaml new file mode 100644 index 00000000..9f3413a0 --- /dev/null +++ b/mika/waktusolat/templates/ingress.yaml @@ -0,0 +1,60 @@ +{{- $ingress := .Values.ingress.enabled }} +{{- $www := .Values.ingress.www }} +{{- $clusterIssuer := .Values.ingress.clusterIssuer | default "letsencrypt-dns-prod" | toString | quote }} +{{- $customAnnotations := .Values.ingress.customAnnotations }} +{{- $domain := .Values.waktusolat.domain | toString }} +{{- $wwwDomain := printf "www.%s" $domain | toString | quote }} +{{- if and $ingress $domain }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ .Release.Name }}-waktusolat-ingress + labels: + {{- include "waktusolat.labels" . | nindent 4 }} + annotations: + cert-manager.io/cluster-issuer: {{ $clusterIssuer }} + cert-manager.io/private-key-algorithm: "ECDSA" + nginx.ingress.kubernetes.io/affinity: "cookie" + nginx.ingress.kubernetes.io/affinity-mode: "persistent" + nginx.ingress.kubernetes.io/proxy-body-size: "100m" + nginx.ingress.kubernetes.io/session-cookie-expires: "172800" + nginx.ingress.kubernetes.io/session-cookie-max-age: "172800" + nginx.ingress.kubernetes.io/session-cookie-name: "route" + nginx.org/client-max-body-size: "100m" + {{- range $customAnnotations }} + {{ printf "%s/%s" (.prefix | default "nginx.ingress.kubernetes.io") .name }}: {{ .value | quote }} + {{- end }} +spec: + ingressClassName: "nginx" + rules: + - host: {{ $domain | quote }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-waktusolat-svc + port: + name: waktusolat + path: / + pathType: Prefix + {{- if $www }} + - host: {{ $wwwDomain }} + http: + paths: + - backend: + service: + name: {{ .Release.Name }}-waktusolat-svc + port: + name: waktusolat + path: / + pathType: Prefix + {{- end }} + tls: + - hosts: + - {{ $domain | quote }} + {{- if $www }} + - {{ $wwwDomain }} + {{- end }} + secretName: {{ .Release.Name }}-waktusolat-tls-cert +{{- end }} From a66d69b23ddba4c7a7c13d19e77e52403fd5c3f8 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 01:39:04 +0800 Subject: [PATCH 331/363] waktusolat: Update post-install chart notes --- mika/waktusolat/templates/NOTES.txt | 106 +++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 3 deletions(-) diff --git a/mika/waktusolat/templates/NOTES.txt b/mika/waktusolat/templates/NOTES.txt index 786eb894..a8c0376f 100644 --- a/mika/waktusolat/templates/NOTES.txt +++ b/mika/waktusolat/templates/NOTES.txt @@ -1,5 +1,105 @@ -waktusolat is now installed and configured for {{ .Release.Name | toString }}. +{{- $serviceAddress := "" }} +{{- $accounts := .Values.waktusolat.account }} +{{- $feeds := .Values.waktusolat.feed }} +{{- $ingress := .Values.ingress.enabled }} +{{- $domain := .Values.waktusolat.domain | toString }} +{{- $waktusolatPort := .Values.service.waktusolat.port | default "80" | toString }} +{{- $type := .Values.service.type | default "ClusterIP" | toString }} +{{- $serviceName := printf "%s-waktusolat-svc" .Release.Name | toString }} +WaktuSolat has been installed and configured for {{ .Release.Name | toString }} 🎉 -See the values.yaml file of this chart for more configuration options. +{{- if $ingress }} + {{- $serviceAddress = printf "https://%s" $domain | toString }} +{{- else if or (eq $type "ClusterIP") (eq $type "LoadBalancer") (eq $type "NodePort") }} -Please refer to the official documentation for more information on how to use waktusolat. +Please run the following command(s) to obtain the right address to the service: + + ```sh + {{- if eq $type "ClusterIP" }} + {{- $forwardPort := "8080" | toString }} + {{- $serviceAddress = printf "http://127.0.0.1:%s" $forwardPort | toString }} + export POD_NAME=$(kubectl get pod --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "waktusolat.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} ${POD_NAME} -o jsonpath="{.spec.containers[0].ports[0].containerPort}") + kubectl port-forward --namespace {{ .Release.Namespace }} ${POD_NAME} {{ $forwardPort }}:${CONTAINER_PORT} + {{- else if eq $type "LoadBalancer" }} + {{- $serviceAddress = printf "$(echo http://${SERVICE_IP}:%s)" $waktusolatPort | toString }} + export SERVICE_IP=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} --template "{{"{{- range (index .status.loadBalancer.ingress 0) }}{{ . }}{{- end }}"}}") + {{- else if eq $type "NodePort" }} + {{- $serviceAddress = "$(echo http://${NODE_IP}:${NODE_PORT})" | toString }} + export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") + export NODE_PORT=$(kubectl get service --namespace {{ .Release.Namespace }} {{ $serviceName }} -o jsonpath="{.spec.ports[0].nodePort}") + {{- end }} + ``` + +{{- end }} + +Visit the following service(s) at the provided address: + +{{- if $serviceAddress }} + + - WaktuSolat: {{ $serviceAddress }} + +{{- else }} + + ⚠️ This chart may have no accessible services available + +{{- end }} + +The following are a list of account(s) you have supplied to be managed: + +{{- if not $accounts }} + + ⚠️ No accounts were supplied for WaktuSolat to manage + +{{- else }} + + {{- range $index, $account := $accounts }} + {{- $enabled := $account.enabled | default "true" | toString }} + {{- $api := $account.api | toString }} + {{- $id := $account.id | toString }} + {{- $url := printf "%s/%s" ($api | trimSuffix "/") $id | toString }} + {{- $entry := printf "%s. %s (%s)" ($index | add1 | toString) $id $url | toString }} + + {{- if eq $enabled "true" }} + + {{ $entry }} + + {{- else }} + + {{ printf "%s [%s]" $entry "disabled" }} + + {{- end }} + + {{- end }} + +The following are a list of prayer time feed(s) you have supplied to be monitored: + + {{- if not $feeds }} + + ⚠️ No prayer time feeds were supplied for WaktuSolat to monitor - image defaults will apply instead + + {{- else }} + + {{- range $index, $feed := $feeds }} + {{- $enabled := $feed.enabled | default "true" | toString }} + {{- $uid := $feed.id | toString }} + {{- $endpoint := $feed.endpoint | toString | trimSuffix "/" }} + {{- $entry := printf "%s. %s (%s)" ($index | add1 | toString) $uid $endpoint | toString }} + + {{- if eq $enabled "true" }} + + {{ $entry }} + + {{- else }} + + {{ printf "%s [%s]" $entry "disabled" }} + + {{- end }} + + {{- end }} + + {{- end }} + +{{- end }} + +For more information on how to use and configure WaktuSolat, please refer to the official documentation. \ No newline at end of file From 2e4a9ac65babb4163f313125ec51cf89347eed31 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 01:56:08 +0800 Subject: [PATCH 332/363] waktusolat: Update docs --- mika/waktusolat/README.md | 233 ++++++++++++++++++++++++++++++-------- 1 file changed, 184 insertions(+), 49 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 88a76783..318c2b25 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -1,87 +1,222 @@ -# [`waktusolat`](https://github.com/irfanhakim-as/waktusolat) 🔒 +# [WaktuSolat](https://github.com/irfanhakim-as/waktusolat) + +> [!WARNING] +> This chart requires access to a private image registry, please request access from the owner of the repository. + +Waktu Solat is a simple web application that posts local prayer times to federated social network. ## Prerequisites +> [!NOTE] +> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites. + - Kubernetes 1.19+ - Helm 3.2.0+ +- Longhorn 1.4.1+ + +--- ## Preflight checklist -### Create image pull secret +> [!IMPORTANT] +> The following items are required to be set up prior to installing this chart. + +### Image pull secret + +An image pull secret is required to access the private image registry that hosts the required image. + +1. If you have the necessary credentials, create a named image pull secret (i.e. `ghcr-token-secret`) in the `default` namespace: + + ```sh + kubectl create secret docker-registry ghcr-token-secret --docker-server= --docker-username= --docker-password= --docker-email= -n default + ``` + +2. Copy the image pull secret from the `default` namespace to the destination namespace: + + ```sh + kubectl get secret ghcr-token-secret -n default -o yaml | sed "s/namespace: .*/namespace: /" | kubectl apply -f - + ``` + +3. Add the name of the image pull secret to the `imagePullSecrets` array in your installation's values file: + + ```yaml + imagePullSecrets: + - name: "ghcr-token-secret" + ``` + +### Generate secret key + +A unique, secure secret key is required for each WaktuSolat installation. + +1. Generate a secret key using the following command: + + ```sh + python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' + ``` + +2. Set the generated secret key as the value of the `waktusolat.secret` setting in your installation's values file: + + ```yaml + secret: "" + ``` + +### Application access token + +A secure application access token is required for each configured account. + +1. Follow the subsections below on how to generate an access token for each account. + +2. Set the access token as the value of the `waktusolat.account` account's `token` setting in your installation's values file: + + ```yaml + token: "" + ``` + + Replace `` with the account's generated access token. + +#### Mastodon + +1. Login to your Mastodon (bot) account. If you do not currently have one, you will need to register one first on any available Mastodon instance. + +2. Click the **Preferences** menu item. + +3. In the **Preferences** page, navigate to the **Development** section. + +4. From the **Your applications** list, click the **New application** button. + +5. In the **New application** form, fill in the following required details: + + - Application name: Add in a unique, descriptive name for your application i.e. `WaktuSolat` + + - Scopes: + + - `read` + - `write` + +6. Click the **Save changes** button. + +7. After being redirected back to the **Your applications** page, click the link on the name of the application you just created. + +8. In the specific **Application** page, copy the value of the confidential **Your access token** field. + +#### Bluesky + +1. Login to your Bluesky (bot) account. If you do not currently have one, you will need to register one first on any available Bluesky instance. + +2. Click the **Settings** menu item. + +3. In the **Settings** page, navigate to the **App Passwords** section. + +4. In the **App Passwords** page, click the **Add App Password** button. + +5. In the prompted form, add in a unique, descriptive name for the App Password (i.e. `WaktuSolat`) and click the **Create App Password** button to submit the form. + +6. Copy the value of the confidential App Password that has been generated and click the **Done** button. + +--- + +## Recommended configurations + +> [!NOTE] +> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation. + +**This section does not apply to this chart.** + +--- + +## Application configurations + +> [!NOTE] +> The following configurations are expected or recommended to be set up from within the application after completing the installation. + +**This section does not apply to this chart.** + +--- + +## How to add the chart repo + +1. Add the repo to your local helm client: + + ```sh + helm repo add mika https://irfanhakim-as.github.io/charts + ``` + +2. Update the repo to retrieve the latest versions of the packages: + + ```sh + helm repo update + ``` + +--- -Replace `$github-username`, `$github-pass`, `$github-email` and `$namespace` accordingly. +## How to install or upgrade a chart release -```sh -kubectl create secret docker-registry ghcr-token-secret --docker-server=https://ghcr.io --docker-username="$github-username" --docker-password="$github-pass" --docker-email="$github-email" -n $namespace -``` +1. Get the values file of the WaktuSolat chart or an existing installation (release). -### Generate secret key for `waktusolat.secret` + Get the latest WaktuSolat chart values file for a new installation: -```sh -python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' -``` + ```sh + helm show values mika/waktusolat > values.yaml + ``` -## How to add repo + Alternatively, get the values file of an existing WaktuSolat release: -Add the repo to your local helm client. + ```sh + helm get values ${releaseName} --namespace ${namespace} > values.yaml + ``` -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Update the repo to retrieve the latest versions of the packages. +2. Edit your WaktuSolat values file with the intended configurations: -```sh -helm repo update -``` + ```sh + nano values.yaml + ``` -## How to install + Pay extra attention to the descriptions and sample values provided in the chart values file. -### Prepare chart values +3. Install a new release for WaktuSolat or upgrade an existing WaktuSolat release: -Copy `values.yaml` from the chart you would like to install. + ```sh + helm upgrade --install ${releaseName} mika/waktusolat --namespace ${namespace} --create-namespace --values values.yaml --wait + ``` -```sh -cp mika/waktusolat/values.yaml . -``` + Replace `${releaseName}` and `${namespace}` accordingly. -Edit `values.yaml` with the appropriate values. Refer to the [Configurations](#Configurations) section for available options. +4. Verify that your WaktuSolat release has been installed: -```sh -nano values.yaml -``` + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -### Perform installation + Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed. -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. +--- -```sh -helm install $release_name mika/waktusolat --namespace $namespace --create-namespace --values values.yaml --wait -``` +## How to uninstall a chart release -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. +> [!CAUTION] +> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data. -```sh -helm ls --namespace $namespace | grep "$release_name" -``` +1. Uninstall the desired release: -## How to upgrade + ```sh + helm uninstall ${releaseName} --namespace ${namespace} --wait + ``` -After making any necessary changes to the `values.yaml` file, upgrade the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${releaseName}` and `${namespace}` accordingly. -```sh -helm upgrade $release_name mika/waktusolat --namespace $namespace --values values.yaml --wait -``` +2. Verify that the release has been uninstalled: -## How to uninstall + ```sh + helm ls --namespace ${namespace} | grep "${releaseName}" + ``` -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. + Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled. -```sh -helm uninstall $release_name --namespace $namespace --wait -``` +--- -## Configurations +## Chart configurations | Key | Type | Default | Description | |-----|------|---------|-------------| From c5e6ef4b156d5de0494143f193377e9a944eef83 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 01:56:22 +0800 Subject: [PATCH 333/363] waktusolat: Fix wrong value desc --- mika/waktusolat/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index 318c2b25..d648e449 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -240,8 +240,8 @@ A secure application access token is required for each configured account. | ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting WaktuSolat services. | | ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | | replicaCount | string | `""` | The desired number of running replicas for WaktuSolat. Default: `"1"`. | -| resources.scheduler | object | `{}` | WaktuSolat container resources. | -| resources.waktusolat | object | `{}` | Scheduler container resources. | +| resources.scheduler | object | `{}` | Scheduler container resources. | +| resources.waktusolat | object | `{}` | WaktuSolat container resources. | | scheduler.apscheduler | bool | `true` | Specifies whether APScheduler should be used by WaktuSolat as the task scheduler. | | scheduler.celery | bool | `false` | Specifies whether Celery should be used by WaktuSolat as the task scheduler. | | scheduler.schedule.clean_db.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | @@ -260,8 +260,8 @@ A secure application access token is required for each configured account. | service.redis.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | | service.redis.port | string | `""` | The Redis port on which the WaktuSolat server should listen for connections. Default: `"6379"`. | | service.type | string | `""` | The type of service used to expose WaktuSolat services. Default: `"ClusterIP"`. | -| service.waktusolat.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | -| service.waktusolat.port | string | `""` | The Redis port on which the WaktuSolat server should listen for connections. Default: `"6379"`. | +| service.waktusolat.nodePort | string | `""` | The optional node port to expose for WaktuSolat when the service type is NodePort. | +| service.waktusolat.port | string | `""` | The WaktuSolat port on which the WaktuSolat server should listen for connections. Default: `"80"`. | | storage.log.accessMode | string | `""` | The access mode defining how the log storage can be mounted. Default: `"ReadWriteMany"`. | | storage.log.enabled | bool | `false` | Specifies whether persistent storage should be provisioned for log storage. | | storage.log.mountPath | string | `""` | The path where the log storage should be mounted on the container. Default: `"/var/log/apache2"`. | From 8f3974aaaa68d3a9b5add88cbb82eac1576c8e91 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 01:58:44 +0800 Subject: [PATCH 334/363] waktusolat: Upgrade chart version to 0.4.0 --- mika/waktusolat/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/Chart.yaml b/mika/waktusolat/Chart.yaml index 1ff9ac3a..262ab92f 100644 --- a/mika/waktusolat/Chart.yaml +++ b/mika/waktusolat/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: waktusolat description: Waktu Solat is a simple web application that posts local prayer times to federated social network. type: application -version: 0.3.4 +version: 0.4.0 appVersion: "0.2.2-stable-r1" keywords: - "waktu solat" From e35e7646c9e62ad45a38bdd7242102b25291c626 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 11:53:26 +0800 Subject: [PATCH 335/363] waktusolat: Remove post_scheduler.second default for celery --- mika/waktusolat/templates/celery.py.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/templates/celery.py.tpl b/mika/waktusolat/templates/celery.py.tpl index 5303214f..189d9852 100644 --- a/mika/waktusolat/templates/celery.py.tpl +++ b/mika/waktusolat/templates/celery.py.tpl @@ -14,7 +14,7 @@ Celery /base/base/celery.py template {{- $notify_solat_times_second := .Values.scheduler.schedule.notify_solat_times.second | toString -}} {{- $post_scheduler_hour := .Values.scheduler.schedule.post_scheduler.hour | default "*" | toString -}} {{- $post_scheduler_minute := .Values.scheduler.schedule.post_scheduler.minute | default "*" | toString -}} -{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | default "*/1" | toString -}} +{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | toString -}} from __future__ import absolute_import, unicode_literals import os From 753b35a7c0098ac91772e427cac93d035e19a73e Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Sun, 17 Nov 2024 11:53:50 +0800 Subject: [PATCH 336/363] waktusolat: Change post_scheduler.second default to 0 Only for apscheduler --- mika/waktusolat/templates/tasks.py.tpl | 2 +- mika/waktusolat/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/waktusolat/templates/tasks.py.tpl b/mika/waktusolat/templates/tasks.py.tpl index 9caac9da..370a2e7e 100644 --- a/mika/waktusolat/templates/tasks.py.tpl +++ b/mika/waktusolat/templates/tasks.py.tpl @@ -14,7 +14,7 @@ APScheduler /base/base/tasks.py template {{- $notify_solat_times_second := .Values.scheduler.schedule.notify_solat_times.second | default "0" | toString -}} {{- $post_scheduler_hour := .Values.scheduler.schedule.post_scheduler.hour | default "*" | toString -}} {{- $post_scheduler_minute := .Values.scheduler.schedule.post_scheduler.minute | default "*" | toString -}} -{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | default "*/1" | toString -}} +{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | default "0" | toString -}} from apscheduler.schedulers.blocking import BlockingScheduler from django.conf import settings diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 7d36a29c..38bd8250 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -256,7 +256,7 @@ scheduler: # minute: "*/30" minute: "" # The seconds at which the task scheduler posts scheduled posts. - # Default: "*/1" + # Default: "0" (`apscheduler`) # Example: # second: "30" second: "" From 5e2b571e96ff367992af60c168c4fcb84bcc4589 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 11:05:11 +0800 Subject: [PATCH 337/363] waktusolat: Update sample recommended resources --- mika/waktusolat/values.yaml | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index 38bd8250..dbaef2c2 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -395,27 +395,27 @@ resources: # # The minimum amount of resources required by WaktuSolat to run. # requests: # # The minimum amount of CPU resources required by WaktuSolat. - # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100m" or more if using `celery` as the scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "500m" or more if using `celery` as the scheduler. # # Example: - # # cpu: "20m" - # cpu: "30m" + # # cpu: "10m" + # cpu: "200m" # # The minimum amount of memory required by WaktuSolat. - # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "250Mi" or more if using `celery` as the scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "550Mi" or more if using `celery` as the scheduler. # # Example: - # # memory: "250Mi" - # memory: "60Mi" + # # memory: "10Mi" + # memory: "100Mi" # # The maximum amount of resources allowed for WaktuSolat. # limits: # # The maximum amount of CPU resources allowed for WaktuSolat. - # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "200m" or more if using `celery` as the scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "1" or more if using `celery` as the scheduler. # # Example: - # # cpu: "50m" - # cpu: "50m" + # # cpu: "250m" + # cpu: "300m" # # The maximum amount of memory allowed for WaktuSolat. - # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "400Mi" or more if using `celery` as the scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "650Mi" or more if using `celery` as the scheduler. # # Example: - # # memory: "450Mi" - # memory: "120Mi" + # # memory: "250Mi" + # memory: "350Mi" waktusolat: {} # Scheduler container resources. # Example: @@ -425,23 +425,23 @@ resources: # # The minimum amount of CPU resources required by Scheduler. # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "10m" or more if using `celery` as the scheduler. # # Example: - # # cpu: "5m" - # cpu: "10m" + # # cpu: "10m" + # cpu: "200m" # # The minimum amount of memory required by Scheduler. # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "50Mi" or more if using `celery` as the scheduler. # # Example: - # # memory: "30Mi" - # memory: "100Mi" + # # memory: "10Mi" + # memory: "250Mi" # # The maximum amount of resources allowed for Scheduler. # limits: # # The maximum amount of CPU resources allowed for Scheduler. # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "20m" or more if using `celery` as the scheduler. # # Example: - # # cpu: "15m" - # cpu: "20m" + # # cpu: "250m" + # cpu: "300m" # # The maximum amount of memory allowed for Scheduler. # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100Mi" or more if using `celery` as the scheduler. # # Example: - # # memory: "50Mi" - # memory: "200Mi" + # # memory: "250Mi" + # memory: "350Mi" scheduler: {} From f3073a702c3b5313c35284b440d6f742a1fdfc48 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 12:25:03 +0800 Subject: [PATCH 338/363] waktusolat: Upgrade appversion to 0.3.0-stable-r1 --- mika/waktusolat/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/Chart.yaml b/mika/waktusolat/Chart.yaml index 262ab92f..29e32463 100644 --- a/mika/waktusolat/Chart.yaml +++ b/mika/waktusolat/Chart.yaml @@ -3,7 +3,7 @@ name: waktusolat description: Waktu Solat is a simple web application that posts local prayer times to federated social network. type: application version: 0.4.0 -appVersion: "0.2.2-stable-r1" +appVersion: "0.3.0-stable-r1" keywords: - "waktu solat" - "prayer time" From 9b82837f2284869fee721ee78ca0c2241e1b37d3 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 12:30:21 +0800 Subject: [PATCH 339/363] rizz: Update recommended res value --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 0da50b58..a51cda37 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -397,7 +397,7 @@ resources: # # The maximum amount of memory allowed for Rizz. # # Example: # # memory: "250Mi" - # memory: "250Mi" + # memory: "350Mi" rizz: {} # Scheduler container resources. # Example: From 317ba435e9140274660ba354aafe72b8664cb548 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 12:32:59 +0800 Subject: [PATCH 340/363] rizz: Add recommended celery res values --- mika/rizz/values.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index a51cda37..e13228ae 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -381,20 +381,24 @@ resources: # # The minimum amount of resources required by Rizz to run. # requests: # # The minimum amount of CPU resources required by Rizz. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "500m" or more if using `celery` as the scheduler. # # Example: # # cpu: "10m" # cpu: "200m" # # The minimum amount of memory required by Rizz. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "550Mi" or more if using `celery` as the scheduler. # # Example: # # memory: "10Mi" # memory: "100Mi" # # The maximum amount of resources allowed for Rizz. # limits: # # The maximum amount of CPU resources allowed for Rizz. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "1" or more if using `celery` as the scheduler. # # Example: # # cpu: "250m" # cpu: "300m" # # The maximum amount of memory allowed for Rizz. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "650Mi" or more if using `celery` as the scheduler. # # Example: # # memory: "250Mi" # memory: "350Mi" @@ -405,20 +409,24 @@ resources: # # The minimum amount of resources required by Scheduler to run. # requests: # # The minimum amount of CPU resources required by Scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "10m" or more if using `celery` as the scheduler. # # Example: # # cpu: "10m" # cpu: "200m" # # The minimum amount of memory required by Scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "50Mi" or more if using `celery` as the scheduler. # # Example: # # memory: "10Mi" # memory: "250Mi" # # The maximum amount of resources allowed for Scheduler. # limits: # # The maximum amount of CPU resources allowed for Scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "20m" or more if using `celery` as the scheduler. # # Example: # # cpu: "250m" # cpu: "300m" # # The maximum amount of memory allowed for Scheduler. + # # Note: This is the recommended default when using `apscheduler` as the scheduler. Allocate "100Mi" or more if using `celery` as the scheduler. # # Example: # # memory: "250Mi" # memory: "350Mi" From bffe62bf4630d110b427b99ab2dd68755dab70db Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 12:33:58 +0800 Subject: [PATCH 341/363] rizz: Note no official support for account.fields But there is unofficial support for adding it to desc (note) --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index e13228ae..c59d3434 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -131,7 +131,7 @@ rizz: # # display_name: "Rizz" # display_name: "" # # A list of up to four name-value pairs information to be displayed on the Rizz bot's profile. - # # Note: Bluesky does not currently support this field. + # # Note: Bluesky does not officially support this field. # # Example: # # fields: # # - name: "Website 1" From c55c00f9bea6d6f08adb96e6757d76dae55a9b34 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 12:36:26 +0800 Subject: [PATCH 342/363] rizz: Fix missing timedelta import --- mika/rizz/templates/celery.py.tpl | 1 + 1 file changed, 1 insertion(+) diff --git a/mika/rizz/templates/celery.py.tpl b/mika/rizz/templates/celery.py.tpl index 7d688175..6b308789 100644 --- a/mika/rizz/templates/celery.py.tpl +++ b/mika/rizz/templates/celery.py.tpl @@ -18,6 +18,7 @@ import os import re from celery import Celery from celery.schedules import crontab +from datetime import timedelta os.environ.setdefault("DJANGO_SETTINGS_MODULE", "base.conf.main") app = Celery("base") app.config_from_object("django.conf:settings", namespace="CELERY") From c6ac8ca9cc243a24f5678cc578bff2fa5a758fd5 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 12:39:35 +0800 Subject: [PATCH 343/363] rizz: Remove leading whitespace before colon --- mika/rizz/templates/celery.py.tpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mika/rizz/templates/celery.py.tpl b/mika/rizz/templates/celery.py.tpl index 6b308789..de8a5c2f 100644 --- a/mika/rizz/templates/celery.py.tpl +++ b/mika/rizz/templates/celery.py.tpl @@ -27,8 +27,8 @@ app.autodiscover_tasks() app.conf.beat_schedule = { # clean data - "clean_data" : { - "task" : "base.tasks.clean_data_task", + "clean_data": { + "task": "base.tasks.clean_data_task", {{- if $clean_data_second }} "schedule": timedelta(seconds=int(re.sub(r"\D", "", {{ $clean_data_second | quote }}))), {{- else }} @@ -36,8 +36,8 @@ app.conf.beat_schedule = { {{- end }} }, # check for any posts that need to be posted - "post_scheduler" : { - "task" : "base.tasks.post_scheduler_task", + "post_scheduler": { + "task": "base.tasks.post_scheduler_task", {{- if $post_scheduler_second }} "schedule": timedelta(seconds=int(re.sub(r"\D", "", {{ $post_scheduler_second | quote }}))), {{- else }} @@ -45,8 +45,8 @@ app.conf.beat_schedule = { {{- end }} }, # update data - "update_data" : { - "task" : "base.tasks.update_data_task", + "update_data": { + "task": "base.tasks.update_data_task", {{- if $update_data_second }} "schedule": timedelta(seconds=int(re.sub(r"\D", "", {{ $update_data_second | quote }}))), {{- else }} From 16a737ff89dc4bd2e12bd8c2aa049c8cc6c68d2a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 12:49:02 +0800 Subject: [PATCH 344/363] rizz: Move bool-ish like var declaration to top --- mika/rizz/templates/NOTES.txt | 4 ++-- mika/rizz/templates/deployment.yaml | 2 +- mika/rizz/templates/secret.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/rizz/templates/NOTES.txt b/mika/rizz/templates/NOTES.txt index a2e7add6..124c454f 100644 --- a/mika/rizz/templates/NOTES.txt +++ b/mika/rizz/templates/NOTES.txt @@ -1,11 +1,11 @@ {{- $serviceAddress := "" }} +{{- $accounts := .Values.rizz.account }} +{{- $feeds := .Values.rizz.feed }} {{- $ingress := .Values.ingress.enabled }} {{- $domain := .Values.rizz.domain | toString }} {{- $rizzPort := .Values.service.rizz.port | default "80" | toString }} {{- $type := .Values.service.type | default "ClusterIP" | toString }} {{- $serviceName := printf "%s-rizz-svc" .Release.Name | toString }} -{{- $accounts := .Values.rizz.account }} -{{- $feeds := .Values.rizz.feed }} Rizz has been installed and configured for {{ .Release.Name | toString }} 🎉 {{- if $ingress }} diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index 1d85e04e..a1ac6ab4 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -1,3 +1,4 @@ +{{- $accounts := .Values.rizz.account }} {{- $apscheduler := .Values.scheduler.apscheduler }} {{- $celery := .Values.scheduler.celery }} {{- $logPersistence := .Values.storage.log.enabled }} @@ -13,7 +14,6 @@ {{- $replica_count := .Values.replicaCount | default "1" | toString }} {{- $logMountPath := .Values.storage.log.mountPath | default "/var/log/apache2" | toString | quote }} {{- $logSubPath := .Values.storage.log.subPath | toString }} -{{- $accounts := .Values.rizz.account }} apiVersion: apps/v1 kind: Deployment metadata: diff --git a/mika/rizz/templates/secret.yaml b/mika/rizz/templates/secret.yaml index a92a6be9..398a84fa 100644 --- a/mika/rizz/templates/secret.yaml +++ b/mika/rizz/templates/secret.yaml @@ -1,3 +1,4 @@ +{{- $accounts := .Values.rizz.account }} {{- $secret := .Values.rizz.secret | toString | b64enc }} {{- $db_type := .Values.db.type | default "postgresql" | toString | b64enc }} {{- $db_name := .Values.db.name | toString | b64enc }} @@ -5,7 +6,6 @@ {{- $db_password := .Values.db.password | toString | b64enc }} {{- $db_host := .Values.db.host | toString | b64enc }} {{- $db_port := .Values.db.port | default "5432" | toString | b64enc }} -{{- $accounts := .Values.rizz.account }} --- apiVersion: v1 kind: Secret From 360ffbf2eb89ed182237012efe534d9af486d9c7 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 12:49:26 +0800 Subject: [PATCH 345/363] rizz: Reorder feed-config volumes Alphabetical order --- mika/rizz/templates/deployment.yaml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mika/rizz/templates/deployment.yaml b/mika/rizz/templates/deployment.yaml index a1ac6ab4..cb086cba 100644 --- a/mika/rizz/templates/deployment.yaml +++ b/mika/rizz/templates/deployment.yaml @@ -58,14 +58,14 @@ spec: mountPath: /etc/apache2/sites-available/000-default.conf subPath: site-config.conf readOnly: true - - name: {{ .Release.Name }}-rizz-feed-config - mountPath: /base/data/feeds.json - subPath: feeds.json - readOnly: true - name: {{ .Release.Name }}-rizz-account-config mountPath: /base/data/accounts.json subPath: accounts.json readOnly: true + - name: {{ .Release.Name }}-rizz-feed-config + mountPath: /base/data/feeds.json + subPath: feeds.json + readOnly: true {{- if $celery }} - name: {{ .Release.Name }}-rizz-default-celery-config mountPath: /etc/default/celeryd @@ -117,14 +117,14 @@ spec: - secretRef: name: {{ .Release.Name }}-rizz-secret volumeMounts: - - name: {{ .Release.Name }}-rizz-feed-config - mountPath: /base/data/feeds.json - subPath: feeds.json - readOnly: true - name: {{ .Release.Name }}-rizz-account-config mountPath: /base/data/accounts.json subPath: accounts.json readOnly: true + - name: {{ .Release.Name }}-rizz-feed-config + mountPath: /base/data/feeds.json + subPath: feeds.json + readOnly: true - name: {{ .Release.Name }}-rizz-apscheduler-config mountPath: /entrypoint.sh subPath: entrypoint.sh @@ -164,12 +164,12 @@ spec: - name: {{ .Release.Name }}-rizz-site-config configMap: name: {{ .Release.Name }}-rizz-site-config - - name: {{ .Release.Name }}-rizz-feed-config - configMap: - name: {{ .Release.Name }}-rizz-feed-config - name: {{ .Release.Name }}-rizz-account-config secret: secretName: {{ .Release.Name }}-rizz-account-config + - name: {{ .Release.Name }}-rizz-feed-config + configMap: + name: {{ .Release.Name }}-rizz-feed-config {{- if $apscheduler }} - name: {{ .Release.Name }}-rizz-apscheduler-config configMap: From 9de09ca244a196851d80955d5e57706e8d7daeb9 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 16:33:21 +0800 Subject: [PATCH 346/363] rizz: Remove deprecated pubdate_format field --- mika/rizz/README.md | 2 +- mika/rizz/templates/feeds.json.tpl | 3 +-- mika/rizz/values.yaml | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/mika/rizz/README.md b/mika/rizz/README.md index 37d9d7d2..1314bea5 100644 --- a/mika/rizz/README.md +++ b/mika/rizz/README.md @@ -245,7 +245,7 @@ A secure application access token is required for each configured account. | rizz.account | list | `[]` | Account configurations. Items: `.api`, `.id`, `.host`, `.token`, `.bot`, `.discoverable`, `.enabled`, `.display_name`, `.fields`, `.locked`, `.note`. | | rizz.debug | string | `""` | Specifies whether Rizz should run in debug mode. Default: `"false"`. | | rizz.domain | string | `""` | The ingress domain name that hosts the Rizz server. Default: `"localhost"`. | -| rizz.feed | list | `[]` | RSS feed configurations. Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled`. | +| rizz.feed | list | `[]` | RSS feed configurations. Items: `.endpoint`, `.id`, `.enabled`. | | rizz.organic | string | `""` | Specifies whether to enable posting in organic numbers. Default: `"true"`. | | rizz.post_limit | string | `""` | The limit number of posts to be scheduled for posting per run. Default: `"3"`. | | rizz.retry_post | string | `""` | Specifies whether to retry posting if the post fails to be sent. Default: `"true"`. | diff --git a/mika/rizz/templates/feeds.json.tpl b/mika/rizz/templates/feeds.json.tpl index 4a1406c5..c7b041cc 100644 --- a/mika/rizz/templates/feeds.json.tpl +++ b/mika/rizz/templates/feeds.json.tpl @@ -9,8 +9,7 @@ Rizz /base/lib/feeds.json template { "uid": {{ $feed.id | toString | quote }}, "endpoint": {{ $feed.endpoint | toString | quote }}, - "is_enabled": {{ $feed.enabled | default "true" | toString }}, - "date_format": {{ $feed.pubdate_format | default "%a, %d %b %Y %H:%M:%S %z" | toString | quote }} + "is_enabled": {{ $feed.enabled | default "true" | toString }} }{{ if ne $index (sub (len $feeds) 1) }},{{ end }} {{- end }} ] diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index c59d3434..68f0f71b 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -153,18 +153,13 @@ rizz: # note: "" account: [] # RSS feed configurations. - # Items: `.endpoint`, `.pubdate_format`, `.id`, `.enabled` + # Items: `.endpoint`, `.id`, `.enabled` # Example: # feed: # # The URL of the RSS feed to be tracked by Rizz. # # Example: # # endpoint: "https://www.reddit.com/r/programming/.rss" # - endpoint: "" - # # The publishing date format of the RSS feed entry. - # # Default: "%a, %d %b %Y %H:%M:%S %z" - # # Example: - # # pubdate_format: "%a, %d %b %Y %H:%M:%S %Z" - # pubdate_format: "" # # The unique identifier of the RSS feed entry. # # Example: # # id: "MyFeed" From cdc4bf4c880533b99873156e477d12226db0c3bd Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 16:43:25 +0800 Subject: [PATCH 347/363] rizz: Minor update to value desc --- mika/rizz/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/values.yaml b/mika/rizz/values.yaml index 68f0f71b..41d37f98 100644 --- a/mika/rizz/values.yaml +++ b/mika/rizz/values.yaml @@ -224,7 +224,7 @@ scheduler: # Example: # second: "30" second: "" - # The schedule for updating up the database. + # The schedule for updating the database. update_data: # The hours at which the task scheduler updates the database. # Default: "7-22/3" From 31065cf7f533683361dcd121513e756d6f86e0bc Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 17:12:28 +0800 Subject: [PATCH 348/363] mango: Deprecate the mango chart Not really useful for testing the framework - use rizz/waktusolat instead --- README.md | 1 - mika/mango/.helmignore | 23 ----- mika/mango/Chart.yaml | 19 ---- mika/mango/README.md | 110 ----------------------- mika/mango/templates/NOTES.txt | 1 - mika/mango/templates/_helpers.tpl | 62 ------------- mika/mango/templates/configmap.yaml | 46 ---------- mika/mango/templates/deployment.yaml | 125 --------------------------- mika/mango/templates/secret.yaml | 26 ------ mika/mango/templates/service.yaml | 19 ---- mika/mango/values.yaml | 83 ------------------ 11 files changed, 515 deletions(-) delete mode 100644 mika/mango/.helmignore delete mode 100644 mika/mango/Chart.yaml delete mode 100644 mika/mango/README.md delete mode 100644 mika/mango/templates/NOTES.txt delete mode 100644 mika/mango/templates/_helpers.tpl delete mode 100644 mika/mango/templates/configmap.yaml delete mode 100644 mika/mango/templates/deployment.yaml delete mode 100644 mika/mango/templates/secret.yaml delete mode 100644 mika/mango/templates/service.yaml delete mode 100644 mika/mango/values.yaml diff --git a/README.md b/README.md index 150d2567..e78ce160 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,6 @@ Applications, developed or curated by [mika](https://github.com/irfanhakim-as), | [grocy](mika/grocy) | Grocy is a web-based self-hosted groceries & household management solution for your home. | ✅ | ✅ | | [kutt](mika/kutt) | Kutt is a modern URL shortener with support for custom domains. Shorten URLs, manage your links and view the click rate statistics. | ✅ | ✅ | | [linkstack](mika/linkstack) | LinkStack is a highly customizable link sharing platform with an intuitive, easy to use user interface. | ✅ | ✅ | -| [mango](mika/mango) | Mango is an easy to use Mastodon bot framework built on top of Django. | ✅ | 🔒 | | [mariadb-agent](mika/mariadb-agent) | Easily create or delete multiple pairs of databases and users in a remote MariaDB instance. | ✅ | ✅ | | [postgres](mika/postgres) | Easy tool to deploy a PostgreSQL instance on Kubernetes. | ✅ | ✅ | | [postgres-agent](mika/postgres-agent) | Easily create or delete a database and user pair in a remote PostgreSQL instance. | ✅ | ✅ | diff --git a/mika/mango/.helmignore b/mika/mango/.helmignore deleted file mode 100644 index 0e8a0eb3..00000000 --- a/mika/mango/.helmignore +++ /dev/null @@ -1,23 +0,0 @@ -# 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 -*.orig -*~ -# Various IDEs -.project -.idea/ -*.tmproj -.vscode/ diff --git a/mika/mango/Chart.yaml b/mika/mango/Chart.yaml deleted file mode 100644 index de747295..00000000 --- a/mika/mango/Chart.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v2 -name: mango -description: Mango is an easy to use Mastodon bot framework built on top of Django. -type: application -version: 0.2.1 -appVersion: "0.0.1-stable" -keywords: - - mango - - django - - mastodon -home: https://github.com/irfanhakim-as/mango -icon: https://irfanhakim-as.github.io/charts/logos/mika.png -sources: - - https://github.com/irfanhakim-as/mango - - https://github.com/irfanhakim-as/charts -maintainers: - - name: Irfan Hakim - email: irfanhakim.as@yahoo.com - url: https://github.com/irfanhakim-as diff --git a/mika/mango/README.md b/mika/mango/README.md deleted file mode 100644 index 633672d2..00000000 --- a/mika/mango/README.md +++ /dev/null @@ -1,110 +0,0 @@ -# [`mango`](https://github.com/irfanhakim-as/mango) 🔒 - -## Prerequisites - -- Kubernetes 1.19+ -- Helm 3.2.0+ - -## Preflight checklist - -### Create image pull secret - -Replace `$github-username`, `$github-pass`, `$github-email` and `$namespace` accordingly. - -```sh -kubectl create secret docker-registry ghcr-token-secret --docker-server=https://ghcr.io --docker-username="$github-username" --docker-password="$github-pass" --docker-email="$github-email" -n $namespace -``` - -### Generate secret key for `mango.secret` - -```sh -python -c 'import random; print("".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]))' -``` - -## How to add repo - -Add the repo to your local helm client. - -```sh -helm repo add mika https://irfanhakim-as.github.io/charts -``` - -Update the repo to retrieve the latest versions of the packages. - -```sh -helm repo update -``` - -## How to install - -### Prepare chart values - -Copy `values.yaml` from the chart you would like to install. - -```sh -cp mika/mango/values.yaml . -``` - -Edit `values.yaml` with the appropriate values. Refer to the [Configurations](#Configurations) section for available options. - -```sh -nano values.yaml -``` - -### Perform installation - -Install the desired chart. Replace `$release_name` and `$namespace` accordingly. - -```sh -helm install $release_name mika/mango --namespace $namespace --create-namespace --values values.yaml --wait -``` - -Verify that your chart has been installed. Replace `$namespace` and `$release_name` accordingly. - -```sh -helm ls --namespace $namespace | grep "$release_name" -``` - -## How to uninstall - -Uninstall the desired chart. Replace `$release_name` and `$namespace` accordingly. - -```sh -helm uninstall $release_name --namespace $namespace --wait -``` - -## Configurations - -| Key | Type | Default | Description | -|-----|------|---------|-------------| -| db.host | string | `"postgres.default.svc.cluster.local"` | Database server | -| db.name | string | `""` | Database name | -| db.password | string | `""` | Database user password | -| db.port | string | `"5432"` | Database port | -| db.type | string | `"postgresql"` | Database type | -| db.user | string | `""` | Database user | -| image.mango.pullPolicy | string | `"IfNotPresent"` | Mango image pull policy | -| image.mango.registry | string | `"ghcr.io"` | Mango image registry | -| image.mango.repository | string | `"irfanhakim-as/mango"` | Mango image repository | -| image.mango.tag | string | `""` | Mango image version | -| image.redis.pullPolicy | string | `"IfNotPresent"` | Redis image pull policy | -| image.redis.registry | string | `"docker.io"` | Redis image registry | -| image.redis.repository | string | `"redis"` | Redis image repository | -| image.redis.tag | string | `"alpine"` | Redis image version | -| imagePullSecrets[0].name | string | `"ghcr-token-secret"` | Image pull secret name | -| mango.celery_timezone | string | `"Asia/Kuala_Lumpur"` | Timezone of the background scheduler | -| mango.debug | bool | `false` | Mango debug mode | -| mango.mastodon.api | string | `"https://botsin.space/"` | Mastodon base API URL | -| mango.mastodon.id | string | `"mango"` | Mastodon bot ID | -| mango.mastodon.token | string | `""` | Mastodon token secret | -| mango.secret | string | `""` | Mango secret key | -| mango.support | string | `"support@mikahomelab.com"` | Support email address | -| replicaCount | int | `1` | Mango replica count | -| resources.mango.limits.cpu | string | `"50m"` | Mango maximum cpu allocation | -| resources.mango.limits.memory | string | `"500Mi"` | Mango maximum memory allocation | -| resources.mango.requests.cpu | string | `"10m"` | Mango minimum cpu allocation | -| resources.mango.requests.memory | string | `"250Mi"` | Mango minimum memory allocation | -| resources.redis.limits.cpu | string | `"15m"` | Redis maximum cpu allocation | -| resources.redis.limits.memory | string | `"80Mi"` | Redis maximum memory allocation | -| resources.redis.requests.cpu | string | `"5m"` | Redis minimum cpu allocation | -| resources.redis.requests.memory | string | `"30Mi"` | Redis minimum memory allocation | diff --git a/mika/mango/templates/NOTES.txt b/mika/mango/templates/NOTES.txt deleted file mode 100644 index 2f4adba0..00000000 --- a/mika/mango/templates/NOTES.txt +++ /dev/null @@ -1 +0,0 @@ -mango is now installed and configured for {{ .Release.Name }}. diff --git a/mika/mango/templates/_helpers.tpl b/mika/mango/templates/_helpers.tpl deleted file mode 100644 index b2a967ed..00000000 --- a/mika/mango/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "mango.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 "mango.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 "mango.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "mango.labels" -}} -helm.sh/chart: {{ include "mango.chart" . }} -{{ include "mango.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "mango.selectorLabels" -}} -app.kubernetes.io/name: {{ include "mango.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "mango.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "mango.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/mika/mango/templates/configmap.yaml b/mika/mango/templates/configmap.yaml deleted file mode 100644 index 43f2047c..00000000 --- a/mika/mango/templates/configmap.yaml +++ /dev/null @@ -1,46 +0,0 @@ -{{- $domain := .Values.mango.domain | default "localhost" | toString }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }}-mango-cm - labels: - {{- include "mango.labels" . | nindent 4 }} -data: - BOT_ID: {{ .Values.mango.mastodon.id | toString | quote }} - DEBUG: {{ .Values.mango.debug | toString | quote }} - API_BASE_URL: {{ .Values.mango.mastodon.api | toString | quote }} - CELERY_BROKER: redis://{{ .Release.Name }}-mango-svc - CELERY_BACKEND: redis://{{ .Release.Name }}-mango-svc - CELERY_TIMEZONE: {{ .Values.mango.celery_timezone | toString | quote }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ .Release.Name }}-mango-site-config - labels: - {{- include "mango.labels" . | nindent 4 }} -data: - site-config.conf: |- - - {{ "ServerName $domain:443" | replace "$domain" $domain }} - UseCanonicalName On - ServerAdmin {{ .Values.mango.support | toString }} - DocumentRoot /base - WSGIScriptAlias / /base/base/wsgi.py - {{ "WSGIDaemonProcess $domain python-path=/base" | replace "$domain" $domain }} - {{ "WSGIProcessGroup $domain" | replace "$domain" $domain }} - - - - Require all granted - - - - Alias /static /static - - Require all granted - - - ErrorLog /var/log/apache2/apache.error.log - CustomLog /var/log/apache2/apache.access.log combined - diff --git a/mika/mango/templates/deployment.yaml b/mika/mango/templates/deployment.yaml deleted file mode 100644 index 80e54551..00000000 --- a/mika/mango/templates/deployment.yaml +++ /dev/null @@ -1,125 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Release.Name }}-mango - labels: - {{- include "mango.labels" . | nindent 4 }} -spec: - replicas: {{ .Values.replicaCount | default 1 }} - selector: - matchLabels: - {{- include "mango.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "mango.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - containers: - - name: mango - image: "{{ .Values.image.mango.registry }}/{{ .Values.image.mango.repository }}:{{ .Values.image.mango.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.mango.pullPolicy }} - ports: - - name: mango - containerPort: 80 - protocol: TCP - resources: - {{- toYaml .Values.resources.mango | nindent 12 }} - env: - - name: BOT_ID - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-mango-cm - key: BOT_ID - - name: DEBUG - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-mango-cm - key: DEBUG - - name: API_BASE_URL - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-mango-cm - key: API_BASE_URL - - name: CELERY_BROKER - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-mango-cm - key: CELERY_BROKER - - name: CELERY_BACKEND - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-mango-cm - key: CELERY_BACKEND - - name: CELERY_TIMEZONE - valueFrom: - configMapKeyRef: - name: {{ .Release.Name }}-mango-cm - key: CELERY_TIMEZONE - - name: SECRET_KEY - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-mango-secret - key: SECRET_KEY - - name: DB_TYPE - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-mango-secret - key: DB_TYPE - - name: DB_NAME - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-mango-secret - key: DB_NAME - - name: DB_USER - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-mango-secret - key: DB_USER - - name: DB_PASS - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-mango-secret - key: DB_PASS - - name: DB_HOST - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-mango-secret - key: DB_HOST - - name: DB_PORT - valueFrom: - secretKeyRef: - name: {{ .Release.Name }}-mango-secret - key: DB_PORT - volumeMounts: - - name: {{ .Release.Name }}-mango-site-config - mountPath: /etc/apache2/sites-available/000-default.conf - subPath: site-config.conf - readOnly: true - - name: {{ .Release.Name }}-mango-token-secret - mountPath: /base/base/mastodon.secret - subPath: mastodon.secret - readOnly: true - - name: redis - image: "{{ .Values.image.redis.registry }}/{{ .Values.image.redis.repository }}:{{ .Values.image.redis.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.redis.pullPolicy }} - ports: - - name: redis - containerPort: 6379 - protocol: TCP - resources: - {{- toYaml .Values.resources.redis | nindent 12 }} - volumes: - - name: {{ .Release.Name }}-mango-site-config - configMap: - name: {{ .Release.Name }}-mango-site-config - - name: {{ .Release.Name }}-mango-token-secret - secret: - secretName: {{ .Release.Name }}-mango-token-secret diff --git a/mika/mango/templates/secret.yaml b/mika/mango/templates/secret.yaml deleted file mode 100644 index 96c649c0..00000000 --- a/mika/mango/templates/secret.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Release.Name }}-mango-secret - labels: - {{- include "mango.labels" . | nindent 4 }} -type: Opaque -data: - SECRET_KEY: {{ .Values.mango.secret | toString | b64enc }} - DB_TYPE: {{ .Values.db.type | toString | b64enc }} - DB_NAME: {{ .Values.db.name | toString | b64enc }} - DB_USER: {{ .Values.db.user | toString | b64enc }} - DB_PASS: {{ .Values.db.password | toString | b64enc }} - DB_HOST: {{ .Values.db.host | toString | b64enc }} - DB_PORT: {{ .Values.db.port | toString | b64enc }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ .Release.Name }}-mango-token-secret - labels: - {{- include "mango.labels" . | nindent 4 }} -type: Opaque -data: - mastodon.secret: |- - {{ .Values.mango.mastodon.token | toString | b64enc | nindent 4 }} diff --git a/mika/mango/templates/service.yaml b/mika/mango/templates/service.yaml deleted file mode 100644 index c9d9b1b2..00000000 --- a/mika/mango/templates/service.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }}-mango-svc - labels: - {{- include "mango.labels" . | nindent 4 }} -spec: - type: ClusterIP - ports: - - port: 80 - targetPort: mango - protocol: TCP - name: {{ .Release.Name }}-mango - - port: 6379 - targetPort: redis - protocol: TCP - name: {{ .Release.Name }}-redis - selector: - {{- include "mango.selectorLabels" . | nindent 4 }} diff --git a/mika/mango/values.yaml b/mika/mango/values.yaml deleted file mode 100644 index 2f9ffbff..00000000 --- a/mika/mango/values.yaml +++ /dev/null @@ -1,83 +0,0 @@ -# Default values for mango. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -# Mango image configuration -image: - mango: - registry: ghcr.io - repository: irfanhakim-as/mango - tag: "" - pullPolicy: IfNotPresent - redis: - registry: docker.io - repository: redis - tag: "alpine" - pullPolicy: IfNotPresent - -# Image pull secrets for private registries -imagePullSecrets: - - name: ghcr-token-secret - -# Mango configuration -mango: - # Mango debug mode - debug: false - # Mango secret key - secret: "" - # Mango support email address - support: "support@mikahomelab.com" - # Timezone of the background scheduler - celery_timezone: "Asia/Kuala_Lumpur" - # Mastodon configuration - mastodon: - # ID of the bot account - id: "mango" - # Base API URL - api: "https://botsin.space/" - # Mastodon token secret - token: "" - -# Database configuration -db: - # Database type - type: "postgresql" - # Database name - name: "" - # Database user - user: "" - # Database user password - password: "" - # Database server - host: "postgres.default.svc.cluster.local" - # Database port - port: "5432" - -# Mango system resources -resources: - # Mango container resources - mango: - requests: - # Minimum CPU allocation - cpu: "10m" - # Minimum memory allocation - memory: "250Mi" - limits: - # Maximum CPU allocation - cpu: "50m" - # Maximum memory allocation - memory: "500Mi" - # Redis container resources - redis: - requests: - # Minimum CPU allocation - cpu: "5m" - # Minimum memory allocation - memory: "30Mi" - limits: - # Maximum CPU allocation - cpu: "15m" - # Maximum memory allocation - memory: "80Mi" From b003aae6ec0cca0466508ac71faec44df7e3a8a3 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 20:14:34 +0800 Subject: [PATCH 349/363] kutt: Move admins value --- mika/kutt/README.md | 2 +- mika/kutt/templates/configmap.yaml | 2 +- mika/kutt/values.yaml | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 52ce5509..47376ec4 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -157,12 +157,12 @@ A unique, secure secret key is required for each Kutt installation. | ingress.customAnnotations | list | `[]` | Additional configuration annotations to be added to the Ingress resource. Items: `.prefix`, `.name`, `.value`. | | ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Kutt services. | | ingress.www | bool | `false` | Specifies whether the WWW subdomain should be enabled. | +| kutt.administration.admins | list | `[]` | Email addresses of the administrators of the Kutt application so they can access admin actions. | | kutt.administration.dailyUserLimit | string | `""` | The maximum number of links that can be created by a user in a day. Default: `"50"`. | | kutt.administration.disableAnonLinks | string | `""` | Specifies whether Kutt should disallow creating links without an account. Default: `"false"`. | | kutt.administration.disableRegistration | string | `""` | Specifies whether Kutt should disallow user registrations. Default: `"false"`. | | kutt.administration.maxStatsPerLink | string | `""` | The maximum number of visits for a link to have detailed statistics. Default: `"5000"`. | | kutt.administration.nonUserCooldown | string | `""` | The number of minutes an anonymous user must wait before creating another link. Default: `"0"`. | -| kutt.admins | list | `[]` | Email addresses of the administrators of the Kutt application so they can access admin actions. | | kutt.domain | string | `""` | The ingress domain name that hosts the Kutt server. | | kutt.link_length | string | `""` | The length of the generated short links. Default: `"6"`. | | kutt.name | string | `""` | The name of the site where Kutt is hosted. Default: `"Kutt"`. | diff --git a/mika/kutt/templates/configmap.yaml b/mika/kutt/templates/configmap.yaml index 26516637..df9cb31b 100644 --- a/mika/kutt/templates/configmap.yaml +++ b/mika/kutt/templates/configmap.yaml @@ -1,4 +1,4 @@ -{{- $admins := .Values.kutt.admins | join "," | toString | quote }} +{{- $admins := .Values.kutt.administration.admins | join "," | toString | quote }} {{- $dailyUserLimit := .Values.kutt.administration.dailyUserLimit | default "50" | toString | quote }} {{- $disableAnonLinks := .Values.kutt.administration.disableAnonLinks | default "false" | toString | quote }} {{- $disableRegistration := .Values.kutt.administration.disableRegistration | default "false" | toString | quote }} diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index a1569697..878fd8e8 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -47,12 +47,6 @@ imagePullSecrets: [] # Kutt configurations. kutt: - # Email addresses of the administrators of the Kutt application so they can access admin actions. - # Example: - # admins: - # - "admin@example.com" - # - "su@example.com" - admins: [] # The ingress domain name that hosts the Kutt server. # Example: # domain: "kutt.example.com" @@ -78,6 +72,12 @@ kutt: useHttps: "" # Kutt administration configurations. administration: + # Email addresses of the administrators of the Kutt application so they can access admin actions. + # Example: + # admins: + # - "admin@example.com" + # - "su@example.com" + admins: [] # The maximum number of links that can be created by a user in a day. # Default: "50" # Example: From ac263f76d3c67770837ac7988b7c0ac2f9379f33 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 20:16:14 +0800 Subject: [PATCH 350/363] kutt: Reorder ext redis values --- mika/kutt/values.yaml | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 878fd8e8..d75ff126 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -104,26 +104,6 @@ kutt: # nonUserCooldown: "1" nonUserCooldown: "" -# External Redis configurations. -redis: - # Specifies whether Kutt should use an external Redis server. - # Example: - # external: true - external: false - # The hostname or IP address of the external Redis server. - # Example: - # host: "redis.default.svc.cluster.local" - host: "" - # The port number on which the external Redis server is listening for connections. - # Default: "6379" - # Example: - # port: "9763" - port: "" - # The password for authenticating with the external Redis server. - # Example: - # password: "password" - password: "" - # Google configurations. google: # The Google reCAPTCHA secret key used for preventing spam. Refer to https://developers.google.com/recaptcha/intro. @@ -181,6 +161,26 @@ mail: # password: "password" password: "" +# External Redis configurations. +redis: + # Specifies whether Kutt should use an external Redis server. + # Example: + # external: true + external: false + # The hostname or IP address of the external Redis server. + # Example: + # host: "redis.default.svc.cluster.local" + host: "" + # The port number on which the external Redis server is listening for connections. + # Default: "6379" + # Example: + # port: "9763" + port: "" + # The password for authenticating with the external Redis server. + # Example: + # password: "password" + password: "" + # PostgreSQL configurations. postgres: # The hostname or IP address of the Kutt database server. From c1ae48a497e7b70fa755c57e14d136f8c8b4cf9d Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 20:26:30 +0800 Subject: [PATCH 351/363] kutt: Reorder value declaration --- mika/kutt/templates/deployment.yaml | 2 +- mika/kutt/templates/pvc.yaml | 2 +- mika/kutt/templates/secret.yaml | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index d68fd61c..6ecac8d9 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -1,5 +1,5 @@ -{{- $externalRedis := .Values.redis.external }} {{- $dataPersistence := .Values.storage.data.enabled }} +{{- $externalRedis := .Values.redis.external }} {{- $kutt_registry := .Values.image.kutt.registry | default "docker.io" | toString }} {{- $kutt_repository := .Values.image.kutt.repository | default "kutt/kutt" | toString }} {{- $kutt_tag := .Values.image.kutt.tag | default .Chart.AppVersion | toString }} diff --git a/mika/kutt/templates/pvc.yaml b/mika/kutt/templates/pvc.yaml index 6748703a..bc43cde8 100644 --- a/mika/kutt/templates/pvc.yaml +++ b/mika/kutt/templates/pvc.yaml @@ -1,5 +1,5 @@ -{{- $externalRedis := .Values.redis.external }} {{- $dataPersistence := .Values.storage.data.enabled }} +{{- $externalRedis := .Values.redis.external }} {{- $dataAccessMode := .Values.storage.data.accessMode | default "ReadWriteOnce" | toString | quote }} {{- $dataStorage := .Values.storage.data.storage | default "100Mi" | toString | quote }} {{- $dataStorageClassName := .Values.storage.data.storageClassName | default "longhorn" | toString | quote }} diff --git a/mika/kutt/templates/secret.yaml b/mika/kutt/templates/secret.yaml index cbb5f450..f0bf153c 100644 --- a/mika/kutt/templates/secret.yaml +++ b/mika/kutt/templates/secret.yaml @@ -18,6 +18,9 @@ {{- $mailFrom := .Values.mail.from_email | default (printf "%s <%s>" $name $mailUser) | toString | b64enc }} {{- $mailReport := .Values.mail.report_email | toString | b64enc }} {{- $mailSecure := .Values.mail.secure | default "true" | toString | b64enc }} +{{- $recaptchaSecretKey := .Values.google.recaptchaSecretKey | toString | b64enc }} +{{- $recaptchaSiteKey := .Values.google.recaptchaSiteKey | toString | b64enc }} +{{- $safeBrowsingKey := .Values.google.safeBrowsingKey | toString | b64enc }} {{- if $externalRedis }} {{- $redisHost = .Values.redis.host | toString | b64enc }} {{- $redisPort = .Values.redis.port | default "6379" | toString | b64enc }} @@ -26,9 +29,6 @@ {{- $redisHost = "localhost" | toString | b64enc }} {{- $redisPort = .Values.service.redis.port | default "6379" | toString | b64enc }} {{- end }} -{{- $recaptchaSecretKey := .Values.google.recaptchaSecretKey | toString | b64enc }} -{{- $recaptchaSiteKey := .Values.google.recaptchaSiteKey | toString | b64enc }} -{{- $safeBrowsingKey := .Values.google.safeBrowsingKey | toString | b64enc }} --- apiVersion: v1 kind: Secret From d6b82d5af89fae5f00322a887f37de76e9d5cd6c Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 20:42:52 +0800 Subject: [PATCH 352/363] kutt: Minor update to condition --- mika/kutt/templates/deployment.yaml | 2 +- mika/kutt/templates/pvc.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index 6ecac8d9..b9799942 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -86,7 +86,7 @@ spec: {{- end }} {{- end }} {{- end }} - {{- if and (not $externalRedis) $dataPersistence }} + {{- if and $dataPersistence (not $externalRedis) }} volumes: - name: {{ .Release.Name }}-kutt-redis-data persistentVolumeClaim: diff --git a/mika/kutt/templates/pvc.yaml b/mika/kutt/templates/pvc.yaml index bc43cde8..a3827ff3 100644 --- a/mika/kutt/templates/pvc.yaml +++ b/mika/kutt/templates/pvc.yaml @@ -3,7 +3,7 @@ {{- $dataAccessMode := .Values.storage.data.accessMode | default "ReadWriteOnce" | toString | quote }} {{- $dataStorage := .Values.storage.data.storage | default "100Mi" | toString | quote }} {{- $dataStorageClassName := .Values.storage.data.storageClassName | default "longhorn" | toString | quote }} -{{- if and (not $externalRedis) $dataPersistence }} +{{- if and $dataPersistence (not $externalRedis) }} --- apiVersion: v1 kind: PersistentVolumeClaim From 588e903be23fe8be0f077ee9607d108516c2c090 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 20:52:02 +0800 Subject: [PATCH 353/363] kutt: Rename and refactor storage.data to storage.redis As data storage only applies to local redis deployment --- mika/kutt/README.md | 12 ++++++------ mika/kutt/templates/deployment.yaml | 18 +++++++++--------- mika/kutt/templates/pvc.yaml | 16 ++++++++-------- mika/kutt/values.yaml | 18 +++++++++--------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 47376ec4..071a8070 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -194,9 +194,9 @@ A unique, secure secret key is required for each Kutt installation. | service.redis.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | | service.redis.port | string | `""` | The Redis port on which the Kutt server should listen for connections. Default: `"6379"`. | | service.type | string | `""` | The type of service used to expose Kutt services. Default: `"ClusterIP"`. | -| storage.data.accessMode | string | `""` | The access mode defining how the data storage can be mounted. Default: `"ReadWriteOnce"`. | -| storage.data.enabled | bool | `true` | Specifies whether persistent storage should be provisioned for data storage. | -| storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/data"`. | -| storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"100Mi"`. | -| storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. | -| storage.data.subPath | string | `""` | The subpath within the data storage to mount to the container. Leave empty if not required. | \ No newline at end of file +| storage.redis.accessMode | string | `""` | The access mode defining how the Redis storage can be mounted. Default: `"ReadWriteOnce"`. | +| storage.redis.enabled | bool | `true` | Specifies whether persistent storage should be provisioned for Redis storage. | +| storage.redis.mountPath | string | `""` | The path where the Redis storage should be mounted on the container. Default: `"/data"`. | +| storage.redis.storage | string | `""` | The default amount of persistent storage allocated for the Redis storage. Default: `"100Mi"`. | +| storage.redis.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the Redis storage. Default: `"longhorn"`. | +| storage.redis.subPath | string | `""` | The subpath within the Redis storage to mount to the container. Leave empty if not required. | \ No newline at end of file diff --git a/mika/kutt/templates/deployment.yaml b/mika/kutt/templates/deployment.yaml index b9799942..9a16997b 100644 --- a/mika/kutt/templates/deployment.yaml +++ b/mika/kutt/templates/deployment.yaml @@ -1,5 +1,5 @@ -{{- $dataPersistence := .Values.storage.data.enabled }} {{- $externalRedis := .Values.redis.external }} +{{- $redisPersistence := .Values.storage.redis.enabled }} {{- $kutt_registry := .Values.image.kutt.registry | default "docker.io" | toString }} {{- $kutt_repository := .Values.image.kutt.repository | default "kutt/kutt" | toString }} {{- $kutt_tag := .Values.image.kutt.tag | default .Chart.AppVersion | toString }} @@ -9,8 +9,8 @@ {{- $redis_tag := .Values.image.redis.tag | default "6.0-alpine" | toString }} {{- $redis_pullPolicy := .Values.image.redis.pullPolicy | default "IfNotPresent" | toString | quote }} {{- $replica_count := .Values.replicaCount | default "1" | toString }} -{{- $dataMountPath := .Values.storage.data.mountPath | default "/data" | toString | quote }} -{{- $dataSubPath := .Values.storage.data.subPath | toString }} +{{- $redisMountPath := .Values.storage.redis.mountPath | default "/data" | toString | quote }} +{{- $redisSubPath := .Values.storage.redis.subPath | toString }} --- apiVersion: apps/v1 kind: Deployment @@ -75,18 +75,18 @@ spec: envFrom: - secretRef: name: {{ .Release.Name }}-kutt-redis-secret - {{- if or $dataPersistence }} + {{- if or $redisPersistence }} volumeMounts: - {{- if $dataPersistence }} + {{- if $redisPersistence }} - name: {{ .Release.Name }}-kutt-redis-data - mountPath: {{ $dataMountPath }} - {{- if $dataSubPath }} - subPath: {{ $dataSubPath | quote }} + mountPath: {{ $redisMountPath }} + {{- if $redisSubPath }} + subPath: {{ $redisSubPath | quote }} {{- end }} {{- end }} {{- end }} {{- end }} - {{- if and $dataPersistence (not $externalRedis) }} + {{- if and (not $externalRedis) $redisPersistence }} volumes: - name: {{ .Release.Name }}-kutt-redis-data persistentVolumeClaim: diff --git a/mika/kutt/templates/pvc.yaml b/mika/kutt/templates/pvc.yaml index a3827ff3..fc02dad8 100644 --- a/mika/kutt/templates/pvc.yaml +++ b/mika/kutt/templates/pvc.yaml @@ -1,9 +1,9 @@ -{{- $dataPersistence := .Values.storage.data.enabled }} {{- $externalRedis := .Values.redis.external }} -{{- $dataAccessMode := .Values.storage.data.accessMode | default "ReadWriteOnce" | toString | quote }} -{{- $dataStorage := .Values.storage.data.storage | default "100Mi" | toString | quote }} -{{- $dataStorageClassName := .Values.storage.data.storageClassName | default "longhorn" | toString | quote }} -{{- if and $dataPersistence (not $externalRedis) }} +{{- $redisPersistence := .Values.storage.redis.enabled }} +{{- $redisAccessMode := .Values.storage.redis.accessMode | default "ReadWriteOnce" | toString | quote }} +{{- $redisStorage := .Values.storage.redis.storage | default "100Mi" | toString | quote }} +{{- $redisStorageClassName := .Values.storage.redis.storageClassName | default "longhorn" | toString | quote }} +{{- if and (not $externalRedis) $redisPersistence }} --- apiVersion: v1 kind: PersistentVolumeClaim @@ -13,9 +13,9 @@ metadata: {{- include "kutt.labels" . | nindent 4 }} spec: accessModes: - - {{ $dataAccessMode }} + - {{ $redisAccessMode }} resources: requests: - storage: {{ $dataStorage }} - storageClassName: {{ $dataStorageClassName }} + storage: {{ $redisStorage }} + storageClassName: {{ $redisStorageClassName }} {{- end }} diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index d75ff126..79d55de9 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -276,32 +276,32 @@ service: # Storage configurations. storage: - # Data storage configurations. - data: - # Specifies whether persistent storage should be provisioned for data storage. + # Redis storage configurations. + redis: + # Specifies whether persistent storage should be provisioned for Redis storage. # Example: # enabled: false enabled: true - # The access mode defining how the data storage can be mounted. + # The access mode defining how the Redis storage can be mounted. # Default: "ReadWriteOnce" # Example: # accessMode: "ReadWriteMany" accessMode: "" - # The path where the data storage should be mounted on the container. + # The path where the Redis storage should be mounted on the container. # Default: "/data" # Example: # mountPath: "/config" mountPath: "" - # The subpath within the data storage to mount to the container. Leave empty if not required. + # The subpath within the Redis storage to mount to the container. Leave empty if not required. # Example: - # subPath: "Data" + # subPath: "Redis" subPath: "" - # The default amount of persistent storage allocated for the data storage. + # The default amount of persistent storage allocated for the Redis storage. # Default: "100Mi" # Example: # storage: "10Gi" storage: "" - # The storage class name used for dynamically provisioning a persistent volume for the data storage. + # The storage class name used for dynamically provisioning a persistent volume for the Redis storage. # Default: "longhorn" # Example: # storageClassName: "smb" From bc1c594c5f83d71f654123804da93d166f2efab4 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Mon, 18 Nov 2024 21:15:48 +0800 Subject: [PATCH 354/363] cloudflareddns: Reorder subdomains value --- mika/cloudflareddns/values.yaml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/mika/cloudflareddns/values.yaml b/mika/cloudflareddns/values.yaml index e631756a..b74597ae 100644 --- a/mika/cloudflareddns/values.yaml +++ b/mika/cloudflareddns/values.yaml @@ -52,6 +52,19 @@ cloudflareddns: # Example: # purge: "true" purge: "" + # The Cloudflare API token used to authenticate with the Cloudflare API. + # Example: + # token: "Na9E7VEY58COhA03l1ytm1r70u7jBsf8bNqh5AlZ" + token: "" + # The Time-To-Live (TTL) duration defining how long DNS records are cached in seconds. + # Default: "300" + # Example: + # ttl: "86400" + ttl: "" + # The ID of the zone that will get the records. + # Example: + # zoneID: "71fovu74p100z856k795umzl32h3240p" + zoneID: "" # The list of subdomains to be updated for a specified domain (zone). # Items: `.hostname`, `.proxied` # Example: @@ -66,19 +79,6 @@ cloudflareddns: # # proxied: "true" # proxied: "" subdomains: [] - # The Cloudflare API token used to authenticate with the Cloudflare API. - # Example: - # token: "Na9E7VEY58COhA03l1ytm1r70u7jBsf8bNqh5AlZ" - token: "" - # The Time-To-Live (TTL) duration defining how long DNS records are cached in seconds. - # Default: "300" - # Example: - # ttl: "86400" - ttl: "" - # The ID of the zone that will get the records. - # Example: - # zoneID: "71fovu74p100z856k795umzl32h3240p" - zoneID: "" # Resource requirements and limits for Cloudflare DDNS containers. resources: From e120237781e18c1d40d08070b07ee28634c1be4a Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 19 Nov 2024 11:20:36 +0800 Subject: [PATCH 355/363] kutt: Add quote to sample value --- mika/kutt/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 79d55de9..62dcb662 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -68,7 +68,7 @@ kutt: # Specifies whether Kutt should use HTTPS for custom domains. # Default: "true" # Example: - # useHttps: false + # useHttps: "false" useHttps: "" # Kutt administration configurations. administration: From 9f6926bd706fe67cc28790ed4deb57346d9b9084 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 19 Nov 2024 11:43:02 +0800 Subject: [PATCH 356/363] kutt: Note domain default value --- mika/kutt/README.md | 2 +- mika/kutt/values.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mika/kutt/README.md b/mika/kutt/README.md index 071a8070..269185a5 100644 --- a/mika/kutt/README.md +++ b/mika/kutt/README.md @@ -163,7 +163,7 @@ A unique, secure secret key is required for each Kutt installation. | kutt.administration.disableRegistration | string | `""` | Specifies whether Kutt should disallow user registrations. Default: `"false"`. | | kutt.administration.maxStatsPerLink | string | `""` | The maximum number of visits for a link to have detailed statistics. Default: `"5000"`. | | kutt.administration.nonUserCooldown | string | `""` | The number of minutes an anonymous user must wait before creating another link. Default: `"0"`. | -| kutt.domain | string | `""` | The ingress domain name that hosts the Kutt server. | +| kutt.domain | string | `""` | The ingress domain name that hosts the Kutt server. Default: `"%s-kutt-svc:kutt .Release.Name"`. | | kutt.link_length | string | `""` | The length of the generated short links. Default: `"6"`. | | kutt.name | string | `""` | The name of the site where Kutt is hosted. Default: `"Kutt"`. | | kutt.secret | string | `""` | A 50-character secret key used for encrypting JSON Web Tokens (JWTs). | diff --git a/mika/kutt/values.yaml b/mika/kutt/values.yaml index 62dcb662..6ab3cdd9 100644 --- a/mika/kutt/values.yaml +++ b/mika/kutt/values.yaml @@ -48,6 +48,7 @@ imagePullSecrets: [] # Kutt configurations. kutt: # The ingress domain name that hosts the Kutt server. + # Default: "%s-kutt-svc:kutt .Release.Name" # Example: # domain: "kutt.example.com" domain: "" From 846dd8bfdcbac9236352513831e0f058dcc25981 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 19 Nov 2024 14:24:33 +0800 Subject: [PATCH 357/363] postgres-agent: Support easily resetting the db By enabling both create and drop --- mika/postgres-agent/templates/job.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mika/postgres-agent/templates/job.yaml b/mika/postgres-agent/templates/job.yaml index 28055893..58bfdeae 100644 --- a/mika/postgres-agent/templates/job.yaml +++ b/mika/postgres-agent/templates/job.yaml @@ -47,6 +47,11 @@ spec: {{- $db := .name | toString }} {{- $user := .user | toString }} {{- $password := .password | toString }} + {{- if $drop }} + DROP DATABASE IF EXISTS {{ $db | quote }}; + REVOKE ALL ON SCHEMA PUBLIC FROM {{ $user | quote }}; + DROP USER IF EXISTS {{ $user | quote }}; + {{- end }} {{- if $create }} CREATE USER {{ $user | quote }} WITH ENCRYPTED PASSWORD '{{ $password }}'; CREATE DATABASE {{ $db | quote }}; @@ -54,11 +59,6 @@ spec: ALTER DATABASE {{ $db | quote }} OWNER TO {{ $user | quote }}; GRANT USAGE, CREATE ON SCHEMA PUBLIC TO {{ $user | quote }}; {{- end }} - {{- if $drop }} - DROP DATABASE IF EXISTS {{ $db | quote }}; - REVOKE ALL ON SCHEMA PUBLIC FROM {{ $user | quote }}; - DROP USER IF EXISTS {{ $user | quote }}; - {{- end }} {{- if and $custom $command }} \connect {{ $db | quote }}; {{- $command | toString | replace "$.name" $db | replace "$.user" $user | replace "$.password" $password | nindent 16 }} From 188abd8dc978253f11f4a7e9e04c288fc28323fc Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 19 Nov 2024 14:25:04 +0800 Subject: [PATCH 358/363] mariadb-agent: Support easily resetting the db By enabling both create and drop --- mika/mariadb-agent/templates/job.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/mariadb-agent/templates/job.yaml b/mika/mariadb-agent/templates/job.yaml index b3b230c8..0af8eb2e 100644 --- a/mika/mariadb-agent/templates/job.yaml +++ b/mika/mariadb-agent/templates/job.yaml @@ -46,16 +46,16 @@ spec: {{- $db := .name | toString }} {{- $user := .user | toString }} {{- $password := .password | toString }} + {{- if $drop }} + DROP DATABASE IF EXISTS {{ $db }}; + DROP USER IF EXISTS {{ $user | quote }}@"%"; + {{- end }} {{- if $create }} CREATE USER IF NOT EXISTS {{ $user | quote }}@"%"; SET PASSWORD FOR {{ $user | quote }}@"%" = PASSWORD({{ $password | quote }}); CREATE DATABASE IF NOT EXISTS {{ $db }}; GRANT ALL PRIVILEGES ON {{ $db }}.* TO {{ $user | quote }}@"%"; {{- end }} - {{- if $drop }} - DROP DATABASE IF EXISTS {{ $db }}; - DROP USER IF EXISTS {{ $user | quote }}@"%"; - {{- end }} {{- if and $custom $command }} {{- $command | toString | replace "$.name" $db | replace "$.user" $user | replace "$.password" $password | nindent 16 }} {{- end }} From 227a002915c913b9af94c8fc48e350093e8b1723 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 19 Nov 2024 20:44:53 +0800 Subject: [PATCH 359/363] rizz: Upgrade app version to 0.2.0-stable-r2 --- mika/rizz/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/rizz/Chart.yaml b/mika/rizz/Chart.yaml index a3c0b752..8f179b6f 100644 --- a/mika/rizz/Chart.yaml +++ b/mika/rizz/Chart.yaml @@ -3,7 +3,7 @@ name: rizz description: Rizz is a simple web application that tracks and posts content from RSS Feeds to federated social network. type: application version: 0.2.0 -appVersion: "0.2.0-stable-r1" +appVersion: "0.2.0-stable-r2" keywords: - "rss" - "monitor" From 88c556da23db996161238c1d9024a554f97be897 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Tue, 19 Nov 2024 20:45:25 +0800 Subject: [PATCH 360/363] waktusolat: Upgrade app version to 0.3.0-stable-r2 --- mika/waktusolat/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/waktusolat/Chart.yaml b/mika/waktusolat/Chart.yaml index 29e32463..85b5e47e 100644 --- a/mika/waktusolat/Chart.yaml +++ b/mika/waktusolat/Chart.yaml @@ -3,7 +3,7 @@ name: waktusolat description: Waktu Solat is a simple web application that posts local prayer times to federated social network. type: application version: 0.4.0 -appVersion: "0.3.0-stable-r1" +appVersion: "0.3.0-stable-r2" keywords: - "waktu solat" - "prayer time" From 9ef886fee2ba794d128deb5709be444576c2ae01 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 20 Nov 2024 08:59:51 +0800 Subject: [PATCH 361/363] waktusolat: Revert post_scheduler.second default for apscheduler --- mika/waktusolat/templates/tasks.py.tpl | 2 +- mika/waktusolat/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mika/waktusolat/templates/tasks.py.tpl b/mika/waktusolat/templates/tasks.py.tpl index 370a2e7e..9caac9da 100644 --- a/mika/waktusolat/templates/tasks.py.tpl +++ b/mika/waktusolat/templates/tasks.py.tpl @@ -14,7 +14,7 @@ APScheduler /base/base/tasks.py template {{- $notify_solat_times_second := .Values.scheduler.schedule.notify_solat_times.second | default "0" | toString -}} {{- $post_scheduler_hour := .Values.scheduler.schedule.post_scheduler.hour | default "*" | toString -}} {{- $post_scheduler_minute := .Values.scheduler.schedule.post_scheduler.minute | default "*" | toString -}} -{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | default "0" | toString -}} +{{- $post_scheduler_second := .Values.scheduler.schedule.post_scheduler.second | default "*/1" | toString -}} from apscheduler.schedulers.blocking import BlockingScheduler from django.conf import settings diff --git a/mika/waktusolat/values.yaml b/mika/waktusolat/values.yaml index dbaef2c2..68553712 100644 --- a/mika/waktusolat/values.yaml +++ b/mika/waktusolat/values.yaml @@ -256,7 +256,7 @@ scheduler: # minute: "*/30" minute: "" # The seconds at which the task scheduler posts scheduled posts. - # Default: "0" (`apscheduler`) + # Default: "*/1" (`apscheduler`) # Example: # second: "30" second: "" From aad8c76f993d1911fbc194d4473fd98c81a75fe4 Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Wed, 20 Nov 2024 09:00:12 +0800 Subject: [PATCH 362/363] waktusolat: Update default value desc --- mika/waktusolat/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mika/waktusolat/README.md b/mika/waktusolat/README.md index d648e449..956e9c75 100644 --- a/mika/waktusolat/README.md +++ b/mika/waktusolat/README.md @@ -246,16 +246,16 @@ A secure application access token is required for each configured account. | scheduler.celery | bool | `false` | Specifies whether Celery should be used by WaktuSolat as the task scheduler. | | scheduler.schedule.clean_db.hour | string | `""` | The hours at which the task scheduler cleans up the database. Default: `"0"`. | | scheduler.schedule.clean_db.minute | string | `""` | The minutes at which the task scheduler cleans up the database. Default: `"0"`. | -| scheduler.schedule.clean_db.second | string | `""` | The seconds at which the task scheduler cleans up the database. Default: `"0"` for `apscheduler`. | +| scheduler.schedule.clean_db.second | string | `""` | The seconds at which the task scheduler cleans up the database. Default: "0" (`apscheduler`). | | scheduler.schedule.notify_solat_schedule.hour | string | `""` | The hours at which the task scheduler schedules the daily prayer time post. Default: `"5"`. | | scheduler.schedule.notify_solat_schedule.minute | string | `""` | The minutes at which the task scheduler schedules the daily prayer time post. Default: `"0"`. | -| scheduler.schedule.notify_solat_schedule.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time post. Default: `"0"` for `apscheduler`. | +| scheduler.schedule.notify_solat_schedule.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time post. Default: "0" (`apscheduler`). | | scheduler.schedule.notify_solat_times.hour | string | `""` | The hours at which the task scheduler schedules the daily prayer time notifications. Default: `"*"`. | | scheduler.schedule.notify_solat_times.minute | string | `""` | The minutes at which the task scheduler schedules the daily prayer time notifications. Default: `"*/1"`. | -| scheduler.schedule.notify_solat_times.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time notifications. Default: `"0"` for `apscheduler`. | +| scheduler.schedule.notify_solat_times.second | string | `""` | The seconds at which the task scheduler schedules the daily prayer time notifications. Default: "0" (`apscheduler`). | | scheduler.schedule.post_scheduler.hour | string | `""` | The hours at which the task scheduler posts scheduled posts. Default: `"*"`. | | scheduler.schedule.post_scheduler.minute | string | `""` | The minutes at which the task scheduler posts scheduled posts. Default: `"*"`. | -| scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: `"*/1"`. | +| scheduler.schedule.post_scheduler.second | string | `""` | The seconds at which the task scheduler posts scheduled posts. Default: "*/1" (`apscheduler`). | | scheduler.timezone | string | `""` | The timezone for the task scheduler used by WaktuSolat to schedule time-dependent operations. Default: `"Etc/UTC"`. | | service.redis.nodePort | string | `""` | The optional node port to expose for Redis when the service type is NodePort. | | service.redis.port | string | `""` | The Redis port on which the WaktuSolat server should listen for connections. Default: `"6379"`. | From f187a9a54fb629aab5990ce95719a8eb8b72269b Mon Sep 17 00:00:00 2001 From: Irfan Hakim Date: Thu, 21 Nov 2024 16:31:37 +0800 Subject: [PATCH 363/363] linkstack: Revert changes temporarily Postpone chart update --- mika/linkstack/templates/NOTES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mika/linkstack/templates/NOTES.txt b/mika/linkstack/templates/NOTES.txt index 32095002..e4f1ca0b 100644 --- a/mika/linkstack/templates/NOTES.txt +++ b/mika/linkstack/templates/NOTES.txt @@ -1,9 +1,9 @@ -{{- $serviceAddress := "" }} {{- $ingress := .Values.ingress.enabled }} {{- $domain := .Values.linkstack.domain | toString }} {{- $http := .Values.service.http.port | default "80" | toString }} {{- $type := .Values.service.type | default "ClusterIP" | toString }} {{- $serviceName := printf "%s-linkstack-svc" .Release.Name | toString }} +{{- $serviceAddress := "" }} LinkStack has been installed and configured for {{ .Release.Name | toString }} 🎉 {{- if $ingress }}