From d418e0ffb3b05a2db93b82c9b61fc579c91a2c7b Mon Sep 17 00:00:00 2001 From: Arlan Lloyd Date: Mon, 23 Dec 2024 01:37:24 +0000 Subject: [PATCH 1/3] update docs --- chart/README.md | 86 +++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 72 insertions(+), 14 deletions(-) diff --git a/chart/README.md b/chart/README.md index 901cbca91..d8c6bd68b 100644 --- a/chart/README.md +++ b/chart/README.md @@ -1,20 +1,15 @@ -# helm chart +# Kyoo Helm Chart +Kyoo consists of multiple interconnected workloads, leveraging a variety of technologies including Meilisearch, Postgres, and RabbitMQ. This helm chart is designed to simplify configurations for basic setups while offering advanced customization options. Naming and opinionation aims to follow structures described in [diagrams](../DIAGRAMS.md). -# Recomendations -This helm chart includes subcharts for Meilisearch, Postgres, and RabbitMQ. Those resources should be managed outside of this Helm release. - -## Postgres -Kyoo consists of multiple microservices. Best practice is for each microservice to use its own database. Kyoo workloads support best practices or sharing a single postgres database. Please see the `POSTGRES_SCHEMA` setting for additional information. +## Subchart Support +This chart includes subcharts for deploying Meilisearch, PostgreSQL, and RabbitMQ as a demonstration of how these resources can be configured. However, subcharts are frequently updated, and upgrades between versions are **NOT** supported. -Strongly recomended to use a Kubernetes operator for managing Postgres. +Deploying these resources independently of Kyoo ensures operational independence and long-term maintainability. This approach provides better control over versioning, lifecycle management, and the ability to apply updates or patches without impacting Kyoo's deployment. -## Storage -Kyoo currently uses storage volumes for media, backend-storage, and transcoder-storage. Media content tends to consume a large amount of space and Kubernetes storage interfaces tend to replicate across nodes. Consider hosting the data outside of Kubernetes or assigning one node to handle storage. -Storage for backend and transcoder will eventually be moved into a datastore application. - -# Quickstart -Below provides an example for deploying Kyoo and its dependencies. This is a minimalist setup that is not intended for longterm use. This approach uses a single Postgres instance and initializes mutliple databases. +# Examples +## Quickstart +Below provides an example for deploying Kyoo and its dependencies. This is a minimalist setup that is not intended for longterm use. This approach uses a single Postgres instance and initializes mutliple databases. ```sh helm upgrade kyoo . --install --values myvalues.yaml @@ -64,4 +59,67 @@ extraObjects: resources: requests: storage: "3Gi" -``` \ No newline at end of file +``` + +## Common Setup + +values.yaml configuration +```yaml +# specify external hosts for backend resources +global: + meilisearch: + kyoo_back: + host: kyoo-meilisearch.kyoo + postgres: + # postgres instance information to connect to back's database + kyoo_back: + host: cluster01.postgres + # postgres instance information to connect to transcoder's database + kyoo_transcoder: + host: cluster01.postgres + rabbitmq: + host: cluster01.rabbitmq +kyoo: + address: https://kyoo.mydomain.com +# leverage NFS for media +media: + volumes: + - name: media + nfs: + server: mynasserver + path: /spin0/media + volumeMounts: + - name: media + mountPath: /data + readOnly: true +``` +by default the chart expects to consume a Kubernetes secret named `bigsecret`. That secret should look similar to: + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: bigsecret +type: Opaque +stringData: + kyoo_apikeys: yHXWGsjfjE6sy6UxavqmTUYxgCFYek + tmdb_apikey: "" + tvdb_apikey: "" + tvdb_pin: "" + MEILI_MASTER_KEY: barkLike8SuperDucks + postgres_user: kyoo_all + postgres_password: watchSomething4me + rabbitmq_user: kyoo_all + rabbitmq_password: youAreAmazing2 +``` + +# Recomendations +## Secret + + + +## Postgres +Kyoo consists of multiple microservices. Best practice is for each microservice to use its own database. Kyoo workloads support best practices or sharing a single postgres database. Please see the `POSTGRES_SCHEMA` setting for additional information. Strongly recomended to use a Kubernetes operator for managing Postgres. + +## Media +Media is condiered an read-only external resource for Kyoo. Media content tends to consume a large amount of space and Kubernetes storage interfaces tend to replicate across nodes. Consider hosting the data outside of Kubernetes or assigning one node to handle storage. From d90f4f35268e672daef7051b4fa54aea50d6bc52 Mon Sep 17 00:00:00 2001 From: Arlan Lloyd Date: Mon, 23 Dec 2024 01:39:34 +0000 Subject: [PATCH 2/3] cleanup --- chart/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/chart/README.md b/chart/README.md index d8c6bd68b..450b76c2e 100644 --- a/chart/README.md +++ b/chart/README.md @@ -114,10 +114,6 @@ stringData: ``` # Recomendations -## Secret - - - ## Postgres Kyoo consists of multiple microservices. Best practice is for each microservice to use its own database. Kyoo workloads support best practices or sharing a single postgres database. Please see the `POSTGRES_SCHEMA` setting for additional information. Strongly recomended to use a Kubernetes operator for managing Postgres. From b1fb2a0038aa7e1eebff1928964d02bea9e89096 Mon Sep 17 00:00:00 2001 From: Arlan Lloyd Date: Mon, 23 Dec 2024 16:24:31 +0000 Subject: [PATCH 3/3] update media path --- chart/README.md | 12 ++++-------- chart/values.yaml | 12 ++++++++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/chart/README.md b/chart/README.md index 450b76c2e..fe6c25795 100644 --- a/chart/README.md +++ b/chart/README.md @@ -69,16 +69,16 @@ values.yaml configuration global: meilisearch: kyoo_back: - host: kyoo-meilisearch.kyoo + host: kyoo-meilisearch.kyoo.svc.cluster.local postgres: # postgres instance information to connect to back's database kyoo_back: - host: cluster01.postgres + host: cluster01.postgres.svc.cluster.local # postgres instance information to connect to transcoder's database kyoo_transcoder: - host: cluster01.postgres + host: cluster01.postgres.svc.cluster.local rabbitmq: - host: cluster01.rabbitmq + host: cluster01.rabbitmq.svc.cluster.local kyoo: address: https://kyoo.mydomain.com # leverage NFS for media @@ -88,10 +88,6 @@ media: nfs: server: mynasserver path: /spin0/media - volumeMounts: - - name: media - mountPath: /data - readOnly: true ``` by default the chart expects to consume a Kubernetes secret named `bigsecret`. That secret should look similar to: diff --git a/chart/values.yaml b/chart/values.yaml index 5cc3f8e1d..bdbbc60b7 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -140,17 +140,25 @@ kyoo: media: # specifies the volumes to use volumes: + # default volume configuration to allow for easier demo + # most setups will aim to leverage NFS to access media + # - name: media + # nfs: + # server: mynasserver.mydomain.com + # path: /spin0/media - name: media persistentVolumeClaim: claimName: media + # specifies where to mount the volumes # note that this should align with .media.baseMountPath volumeMounts: - - mountPath: /data + - mountPath: /media name: media + readOnly: true # configures kyoo workloads to search # note that this should align with .media.volumeMounts[].mountPath - baseMountPath: "/data" + baseMountPath: "/media" # configures workloads that require access to contentdatabase contentdatabase: