diff --git a/charts/recipes/.helmignore b/charts/recipes/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/charts/recipes/.helmignore @@ -0,0 +1,23 @@ +# 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/charts/recipes/Chart.yaml b/charts/recipes/Chart.yaml new file mode 100644 index 00000000..df34a720 --- /dev/null +++ b/charts/recipes/Chart.yaml @@ -0,0 +1,19 @@ +apiVersion: v2 +appVersion: 0.13.0 +description: Recipes is a Django application to manage, tag and search recipes using either built in models or external storage providers hosting PDF's, Images or other files. +name: recipes +version: 2.2.1 +keywords: + - recipes + - cooking +home: https://github.com/k8s-at-home/charts/tree/master/charts/recipes +sources: + - https://github.com/vabene1111/recipes + - https://hub.docker.com/r/vabene1111/recipes +maintainers: + - name: auricom + email: k8s-at-home@xpander.eml.cc +dependencies: + - name: common + repository: https://k8s-at-home.com/charts/ + version: 2.2.0 diff --git a/charts/recipes/OWNERS b/charts/recipes/OWNERS new file mode 100644 index 00000000..e882d048 --- /dev/null +++ b/charts/recipes/OWNERS @@ -0,0 +1,4 @@ +approvers: +- auricom +reviewers: +- auricom diff --git a/charts/recipes/README.md b/charts/recipes/README.md new file mode 100644 index 00000000..c2cf8196 --- /dev/null +++ b/charts/recipes/README.md @@ -0,0 +1,89 @@ +# Recipes + +This is a helm chart for [Recipes](https://github.com/vabene1111/recipes). + +**This chart is not maintained by the upstream project and any issues with the chart should be raised [here](https://github.com/k8s-at-home/charts/issues/new/choose)** + +## TL;DR; + +```shell +$ helm repo add k8s-at-home https://k8s-at-home.com/charts/ +$ helm install k8s-at-home/recipes +``` + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +helm install --name my-release k8s-at-home/recipes +``` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```console +helm delete my-release --purge +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following table lists the configurable parameters of the recipes chart and their default values that have to be overriden. + +| Parameter | Description | Default | +| -------------------------------------| ------------------------------------------------------------------------------------------- | ------------------------------------------- | +| `env.DEBUG` | Only set this to true when testing/debugging | `0` | +| `env.ALLOWED_HOSTS` | Hosts the application can run under e.g. recipes.mydomain.com,cooking.mydomain.com,... | `*` | +| `env.SECRET_KEY` | Random secret key, use for example `openssl rand -base64 24` to generate one | `changeme` | +| `env.TIMEZONE` | Your default timezone | `America/New_York` | +| `env.DB_ENGINE` | Database connector | `django.db.backends.postgresql_psycopg2` | +| `env.POSTGRES_HOST` | External PostreSQL hostname | | +| `env.POSTGRES_PORT` | External PostreSQL port | | +| `env.POSTGRES_USER` | External PostreSQL user | | +| `env.POSTGRES_DB` | External PostreSQL database name | | +| `env.POSTGRES_PASSWORD` | External PostreSQL database password | | +| `env.GUNICORN_MEDIA` | Serve mediafiles directly using gunicorn. Basically everyone recommends not doing this. | `0` | +| `env.FRACTION_PREF_DEFAULT` | Enable/disable fraction support | `0` | +| `env.COMMENT_PREF_DEFAULT` | Enable/disable commenting system | `1` | +| `env.SHOPPING_MIN_AUTOSYNC_INTERVAL` | Amount of time after which the shopping list is refreshed when they are in viewing mode | `5` | + +You can add more environment variables, read through Recipes [.env.template](https://github.com/vabene1111/recipes/blob/master/.env.template) + +Read through the charts [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/recipes/values.yaml) +file. +Additionally you can take a look at the common library [values.yaml](https://github.com/k8s-at-home/charts/blob/master/charts/common/values.yaml) for more (advanced) configuration options. + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, +```console +helm install recipes \ + --set env.POSTGRES_HOST="postgresql.domain" \ + k8s-at-home/recipes +``` +Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the +chart. For example, +```console +helm install recipes k8s-at-home/recipes --values values.yaml +``` + +```yaml +image: + tag: ... +``` + +--- +**NOTE** + +If you get +```console +Error: rendered manifests contain a resource that already exists. Unable to continue with install: existing resource conflict: ...` +``` +it may be because you uninstalled the chart with `skipuninstall` enabled, you need to manually delete the pvc or use `existingClaim`. + +--- + +## Upgrading an existing Release to a new major version + +A major chart version change (like 1.0.1 -> 2.0.0) indicates that there is an incompatible breaking change potentially needing manual actions. diff --git a/charts/recipes/templates/NOTES.txt b/charts/recipes/templates/NOTES.txt new file mode 100644 index 00000000..90f7b653 --- /dev/null +++ b/charts/recipes/templates/NOTES.txt @@ -0,0 +1 @@ +{{- include "common.notes.defaultNotes" . -}} diff --git a/charts/recipes/templates/common.yaml b/charts/recipes/templates/common.yaml new file mode 100644 index 00000000..a6613c2c --- /dev/null +++ b/charts/recipes/templates/common.yaml @@ -0,0 +1 @@ +{{ include "common.all" . }} diff --git a/charts/recipes/templates/configmap.yaml b/charts/recipes/templates/configmap.yaml new file mode 100644 index 00000000..d55a6329 --- /dev/null +++ b/charts/recipes/templates/configmap.yaml @@ -0,0 +1,35 @@ + +{{/* +Recipes Configuration files. +*/}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: "recipes-config" + labels: + {{- include "common.labels" . | nindent 4 }} +data: + nginx-config: |- + events { + worker_connections 1024; + } + http { + server { + listen 80; + server_name _; + client_max_body_size 16M; + # serve media files + location /media/ { + alias /media/; + } + # serve static files + location /static/ { + alias /static/; + } + # pass requests for dynamic content to gunicorn + location / { + proxy_set_header Host $host; + proxy_pass http://localhost:8080; + } + } + } diff --git a/charts/recipes/values.yaml b/charts/recipes/values.yaml new file mode 100644 index 00000000..f380fde6 --- /dev/null +++ b/charts/recipes/values.yaml @@ -0,0 +1,89 @@ +# Default values for Recipes. + +image: + repository: vabene1111/recipes + pullPolicy: IfNotPresent + tag: 0.13.0 + +strategy: + type: Recreate + +service: + port: + port: 80 + +env: + DEBUG: "0" + ALLOWED_HOSTS: "*" + SECRET_KEY: changeme + DB_ENGINE: django.db.backends.sqlite3 + POSTGRES_HOST: + POSTGRES_PORT: + POSTGRES_USER: + POSTGRES_DB: + POSTGRES_PASSWORD: + GUNICORN_MEDIA: "0" + TIMEZONE: America/New_York + FRACTION_PREF_DEFAULT: "0" + COMMENT_PREF_DEFAULT: "1" + SHOPPING_MIN_AUTOSYNC_INTERVAL: "5" + +persistence: + config: + enabled: false + media: + enabled: false + emptyDir: false + mountPath: /opt/recipes/mediafiles + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + # storageClass: "-" + # accessMode: ReadWriteOnce + # size: 1Gi + ## Do not delete the pvc upon helm uninstall + # skipuninstall: false + # existingClaim: "" + static: + enabled: false + emptyDir: false + mountPath: /opt/recipes/staticfiles + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + # storageClass: "-" + # accessMode: ReadWriteOnce + # size: 1Gi + ## Do not delete the pvc upon helm uninstall + # skipuninstall: false + # existingClaim: "" + +additionalContainers: +- name: nginx + image: nginx:1.19.6 + ports: + - containerPort: 80 + name: http + volumeMounts: + ## + ## If persistent volumes are enabled ; please uncomment the following lines + ## + # - name: media + # mountPath: '/media' + # - name: static + # mountPath: '/static' + - name: recipes-config + mountPath: /etc/nginx/nginx.conf + subPath: nginx-config + readOnly: true + +additionalVolumes: +- name: recipes-config + configMap: + name: recipes-config