瀏覽代碼

initial commit

Stavros kois 1 年之前
父節點
當前提交
003de14ef3

+ 6 - 0
library/ix-dev/community/mealie/Chart.lock

@@ -0,0 +1,6 @@
+dependencies:
+- name: common
+  repository: file://../../../common
+  version: 1.2.1
+digest: sha256:d695592ea5213fe64453171205ca326015d02df3888a7858becc0c733b0de4c7
+generated: "2023-11-03T16:04:06.480608072+02:00"

+ 26 - 0
library/ix-dev/community/mealie/Chart.yaml

@@ -0,0 +1,26 @@
+name: mealie
+description: Mealie is a self-hosted recipe manager and meal planner
+annotations:
+  title: Mealie
+type: application
+version: 1.0.0
+apiVersion: v2
+appVersion: latest
+kubeVersion: '>=1.16.0-0'
+maintainers:
+  - name: truenas
+    url: https://www.truenas.com/
+    email: dev@ixsystems.com
+dependencies:
+  - name: common
+    repository: file://../../../common
+    version: 1.2.1
+home: https://mealie.io
+icon: https://media.sys.truenas.net/apps/mealie/icons/icon.png
+sources:
+  - https://github.com/truenas/charts/tree/master/library/ix-dev/community/mealie
+  - https://github.com/ndom91/briefkasten
+  - https://nightly.mealie.io/
+keywords:
+  - recipes
+  - meal planner

二進制
library/ix-dev/community/mealie/charts/common-1.2.1.tgz


+ 8 - 0
library/ix-dev/community/mealie/item.yaml

@@ -0,0 +1,8 @@
+icon_url: https://media.sys.truenas.net/apps/mealie/icons/icon.png
+categories:
+  - productivity
+screenshots:
+  - https://media.sys.truenas.net/apps/mealie/screenshots/screenshot1.png
+tags:
+  - recipes
+  - meal planner

+ 1 - 0
library/ix-dev/community/mealie/templates/NOTES.txt

@@ -0,0 +1 @@
+{{ include "ix.v1.common.lib.chart.notes" $ }}

+ 53 - 0
library/ix-dev/community/mealie/templates/_mealie.tpl

@@ -0,0 +1,53 @@
+{{- define "mealie.workload" -}}
+workload:
+  mealie:
+    enabled: true
+    primary: true
+    type: Deployment
+    podSpec:
+      hostNetwork: {{ .Values.mealieNetwork.hostNetwork }}
+      containers:
+        mealie:
+          enabled: true
+          primary: true
+          imageSelector: image
+          securityContext:
+            # TODO: Check if we can use arbitrary user IDs
+            runAsUser: 911
+            runAsGroup: 911
+            readOnlyRootFilesystem: false
+          envFrom:
+            - secretRef:
+                name: mealie
+            - configMapRef:
+                name: mealie
+          {{ with .Values.mealieConfig.additionalEnvs }}
+          envList:
+            {{ range $env := . }}
+            - name: {{ $env.name }}
+              value: {{ $env.value }}
+            {{ end }}
+          {{ end }}
+          probes:
+            liveness:
+              enabled: true
+              type: exec
+              command:
+                - python
+                - /app/mealie/scripts/healthcheck.py
+            readiness:
+              enabled: true
+              type: exec
+              command:
+                - python
+                - /app/mealie/scripts/healthcheck.py
+            startup:
+              enabled: true
+              type: exec
+              command:
+                - python
+                - /app/mealie/scripts/healthcheck.py
+      initContainers:
+      {{- include "ix.v1.common.app.postgresWait" (dict "name" "01-postgres-wait"
+                                                        "secretName" "postgres-creds") | nindent 8 }}
+{{- end -}}

+ 6 - 0
library/ix-dev/community/mealie/templates/_postgres.tpl

@@ -0,0 +1,6 @@
+{{- define "postgres.workload" -}}
+workload:
+{{- include "ix.v1.common.app.postgres" (dict "secretName" "postgres-creds"
+                                              "resources" .Values.resources
+                                              "ixChartContext" .Values.ixChartContext) | nindent 2 }}
+{{- end -}}

+ 17 - 0
library/ix-dev/community/mealie/templates/_service.tpl

@@ -0,0 +1,17 @@
+{{- define "mealie.service" -}}
+service:
+  mealie:
+    enabled: true
+    primary: true
+    type: NodePort
+    targetSelector: mealie
+    ports:
+      webui:
+        enabled: true
+        primary: true
+        port: {{ .Values.mealieNetwork.webPort }}
+        nodePort: {{ .Values.mealieNetwork.webPort }}
+        targetSelector: mealie
+  {{- include "ix.v1.common.app.postgresService" $ | nindent 2 }}
+
+{{- end -}}

+ 13 - 0
library/ix-dev/community/mealie/templates/common.yaml

@@ -0,0 +1,13 @@
+{{- include "ix.v1.common.loader.init" . -}}
+
+{{/* Merge the templates with Values */}}
+{{- $_ := mustMergeOverwrite .Values (include "mealie.workload" $ | fromYaml) -}}
+{{- $_ := mustMergeOverwrite .Values (include "mealie.service" $ | fromYaml) -}}
+{{- $_ := mustMergeOverwrite .Values (include "mealie.persistence" $ | fromYaml) -}}
+{{- $_ := mustMergeOverwrite .Values (include "mealie.configuration" $ | fromYaml) -}}
+{{- $_ := mustMergeOverwrite .Values (include "postgres.workload" $ | fromYaml) -}}
+
+{{/* Create the configmap for portal manually*/}}
+{{- include "mealie.portal" $ -}}
+
+{{- include "ix.v1.common.loader.apply" . -}}

+ 1 - 0
library/ix-dev/community/mealie/upgrade_info.json

@@ -0,0 +1 @@
+{"filename": "values.yaml", "keys": ["image"]}

+ 31 - 0
library/ix-dev/community/mealie/upgrade_strategy

@@ -0,0 +1,31 @@
+#!/usr/bin/python3
+import json
+import re
+import sys
+
+from catalog_update.upgrade_strategy import semantic_versioning
+
+
+RE_STABLE_VERSION = re.compile(r'v\d+\.\d+\.\d+')
+
+
+def newer_mapping(image_tags):
+    key = list(image_tags.keys())[0]
+    tags = {t.strip('v'): t for t in image_tags[key] if RE_STABLE_VERSION.fullmatch(t)}
+    version = semantic_versioning(list(tags))
+    if not version:
+        return {}
+
+    return {
+        'tags': {key: tags[version]},
+        'app_version': version,
+    }
+
+
+if __name__ == '__main__':
+    try:
+        versions_json = json.loads(sys.stdin.read())
+    except ValueError:
+        raise ValueError('Invalid json specified')
+
+    print(json.dumps(newer_mapping(versions_json)))