feat: plant-it

This commit is contained in:
auricom
2024-08-01 11:52:16 +02:00
parent 3384d86610
commit c4e5076656
7 changed files with 275 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ resources:
- ./navidrome/ks.yaml
- ./outline/ks.yaml
- ./paperless/ks.yaml
- ./plant-it/ks.yaml
- ./pgadmin/ks.yaml
- ./prowlarr/ks.yaml
- ./pushover-notifier/ks.yaml

View File

@@ -0,0 +1,30 @@
---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: plant-it
namespace: default
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: plant-it-secret
template:
engineVersion: v2
data:
MYSQL_DATABASE: bootdb
MYSQL_HOST: plant-it-db.default.svc.cluster.local.
MYSQL_PORT: "3306"
MYSQL_ROOT_PASSWORD: &dbPass "{{ .PLANTIT__MARIADB_ROOT_PASS }}"
MYSQL_USERNAME: "{{ .PLANTIT__MARIADB_USER }}"
MYSQL_PSW: *dbPass
FLORACODEX_KEY: "{{ .PLANTIT__FLORACODEX_KEY }}"
JWT_SECRET: "{{ .PLANTIT__JWT_SECRET }}"
dataFrom:
- extract:
key: plant-it
- extract:
key: cloudnative-pg

View File

@@ -0,0 +1,112 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app plant-it
namespace: default
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.3.1
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
maxHistory: 2
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
uninstall:
keepHistory: false
values:
controllers:
plant-it:
annotations:
reloader.stakater.com/auto: "true"
containers:
app:
image:
repository: msdeluise/plant-it-server
tag: 0.7.4@sha256:fb1c0d12cdca5d1d2cd83188f3636660f85c649b02e69570fc71932a36608fd1
env:
ALLOWED_ORIGINS: "*"
API_PORT: "8080"
CACHE_TTL: "86400"
CACHE_HOST: dragonfly.database.svc.cluster.local.
CACHE_PORT: "6379"
CERTIFICATE_PATH: /config/certs
LOG_LEVEL: INFO
JWT_EXPL: "1"
SSL_ENABLED: "false"
UPLOAD_DIR: /config/uploads
USERS_LIMIT: "-1"
envFrom:
- secretRef:
name: plant-it-secret
probes:
liveness: &probes
enabled: true
custom: true
spec:
httpGet:
path: /
port: &port 3000
initialDelaySeconds: 0
periodSeconds: 10
timeoutSeconds: 1
failureThreshold: 3
readiness: *probes
startup:
enabled: false
resources:
requests:
cpu: 100m
memory: 512Mi
service:
app:
controller: *app
ports:
http:
port: *port
ingress:
app:
enabled: true
className: nginx
annotations:
hajimari.io/icon: mdi:leaf
gethomepage.dev/enabled: "true"
gethomepage.dev/description: Gardening companion
gethomepage.dev/group: Home
gethomepage.dev/name: Plant-it
gethomepage.dev/icon: plant-it.png
gethomepage.dev/pod-selector: >-
app in (
plant-it,
plant-it-db
)
hosts:
- host: &host "{{ .Release.Name }}.${SECRET_EXTERNAL_DOMAIN}"
paths:
- path: /
pathType: Prefix
service:
identifier: app
port: http
tls:
- hosts:
- *host
persistence:
config:
enabled: true
existingClaim: *app
globalMounts:
- path: /config

View File

@@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
resources:
- ./externalsecret.yaml
- ./helmrelease.yaml
- ../../../../templates/gatus/guarded
- ../../../../templates/volsync

View File

@@ -0,0 +1,58 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app plant-it-db
namespace: default
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.3.1
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
maxHistory: 2
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
uninstall:
keepHistory: false
values:
controllers:
plant-it-db:
annotations:
reloader.stakater.com/auto: "true"
containers:
app:
image:
repository: mariadb
tag: 11.4.2-ubi9
envFrom:
- secretRef:
name: plant-it-secret
resources:
requests:
cpu: 100m
memory: 256Mi
service:
app:
controller: *app
ports:
http:
port: 3306
persistence:
config:
enabled: true
existingClaim: *app
globalMounts:
- path: /var/lib/mysql

View File

@@ -0,0 +1,8 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/kustomization.json
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: default
resources:
- ./helmrelease.yaml
- ../../../../templates/volsync

View File

@@ -0,0 +1,56 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app plant-it
namespace: flux-system
spec:
targetNamespace: default
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/default/plant-it/app
prune: true
sourceRef:
kind: GitRepository
name: home-ops-kubernetes
dependsOn:
- name: external-secrets-stores
- name: volsync
wait: false
interval: 30m
retryInterval: 1m
timeout: 5m
postBuild:
substitute:
APP: *app
VOLSYNC_CAPACITY: 2Gi
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: &app plant-it-db
namespace: flux-system
spec:
targetNamespace: default
commonMetadata:
labels:
app.kubernetes.io/name: *app
path: ./kubernetes/apps/default/plant-it/db
prune: true
sourceRef:
kind: GitRepository
name: home-ops-kubernetes
dependsOn:
- name: external-secrets-stores
- name: volsync
wait: false
interval: 30m
retryInterval: 1m
timeout: 5m
postBuild:
substitute:
APP: *app
VOLSYNC_CAPACITY: 2Gi