-
-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helm chart for Kubernetes deployments #1622
Comments
I'd love to support a helm/k8s deployment of Piped, but I have no clue how they work at all, unfortunately! |
First question would be that should the chart live inside the same repository as the app itself or should it be in a separate repository? |
I would say a new repository, since we've got multiple components - the frontend, backend, proxy, a reverse proxy for caching, etc |
Hmm, the issue probably actually belongs to the Docker repository, but probably one for Kubernetes makes sense. I have my own charts at samipsolutions/helm-charts and I can try to get it going there first which would become artifacthub discoverable too. What are you thoughts on creating a new repository under TeamPiped and adding me as outside collaborator on it so I can work on this? |
I created a repo for it called Piped-Kubernetes as that seems to be the syntax of the other ones. :) |
That works! Thanks for the help! :) |
@FireMasterK I have faced an obstacle and that has to do with ytproxy requiring to use sockets, that's not possible when the container is not running inside the same pod, much less host. I believe this is blocked by TeamPiped/http3-ytproxy#3 / TeamPiped/http3-ytproxy#2. |
use a PVC, and bind the Pods to run on the same host. :D |
That sounds like a whack hack, but then again it should work... Unless it doesn't get scheduled on the same host. |
If you don't bind any volumes, it will listen on port 8080! |
You'd likely want to use https://github.com/TeamPiped/piped-proxy now, it's the new replacement written in Rust! |
Hey @FireMasterK I'm getting back to working on this. Would it be possible to build a container w/o nginx integrated at all for the frontend as that does seem quite counter-intuitive for a k8s deployment as there usually is already a reverse proxy already? |
The current docker setup has 2 nginx containers - one the frontend, which cannot be removed as it's necessary to serve static files. The second one is used to link all the services together, and can be removed! |
I believe the serving of static files could be handled by express or serve npm packages but probably not worth the dependency? |
I'd stick with nginx, simply because it's much faster, and more lightweight than express / any npm package. |
@samip5 i am very interested in your work. Perhaps we can share our knowledge to get the Helm chart going? |
I have been meaning on doing it similarly how immich has done theirs. https://github.com/immich-app/immich-charts |
Hey, @FireMasterK could we at the very least not have to use sed though the assets on frontend startup? Eg, do it via environment variable? I believe that it should be possible to build the frontend according to the environment variable. |
Yes, but at this moment, that's currently going to be a lot of work to get going, unfortunately. |
Could you please elaborate on the Did I miss any? The places I found:
|
Well, one way could be to include an The proper way to do this is probably to include it as a build config variable and then, build the application. But, I want to avoid building the application at all costs. |
Why? It would make sense to dynamically build it based on environment variables on container startup. I suppose that one way would indeed be a entrypoint script, that does the sed based on the env variables, but I agree that it's not the proper way. |
One option for a Kubernetes deployment at least would be to use a initcontainer (initialization container, that starts before the main app container), that does the following:
|
The problem is docker. It would be difficult to create a mechanism to auto-update a docker-compose setup. I could add a Dockerfile to build with build environment variables, would that be of any help? |
No but if you could publish the dist-ci folder content in compressed package that would help. |
@MichaelTrip Do you happen to have ideas on how to solve this issue with the frontend as you were wanting to help? |
Hi, i Just checked the whole conversation, but the init container seems the most viable option indeed. I have to dive into the source code a bit more to understand the inner working of piped. |
I also noticed that the current setup doesn't really include any caching, could this be somehow optionally added (not all setups may need it, as you could enable it on Cloudflare with special page rules)? |
You mean like varnish? I pretty much duplicated the nginx docker compose setup except for the custom nginx config. |
Yep, exactly! Varnish doesn't play nice with docker, not sure about kubernetes tho |
When you say that, what do you mean? In what aspect doesn't it play nice? |
It doesn't like dynamic hosts / when the IP changes, it starts giving 503s when that happens. We switched from Varnish to Nginx in the docker compose setup. |
There is, but I haven't documented them yet. The default values of the chart might not be the best at the moment.
|
I have also added the tldr to README of chart. https://github.com/TeamPiped/Piped-Kubernetes/tree/main/charts/apps/piped#tldr |
Awesome! I'm curious, how would updates work for this? |
Currently it's using the latest tag (like the Docker containers), but it could be automated via eg. Renovate to pin to a specific SHA and then use that as latest tag, but it would be better to actually use release versions of things preferably via semver. It's common practice to use Renovate for automatic updates in Kubernetes environments and it can auto-update the images them self when deployed without the need to always update the chart version. |
@FireMasterK Do you have an account at ArtifactHUB? If not, please create one so I can invite you to an TeamPiped org there, so that it would show up properly there. :) |
I see, but my question is would it periodically keep checking the latest tag to see if there's a new SHA for the image?
Just created one with the username |
It wouldn't by itself, only when deploying so the options are as follows for that:
I'm not really sure which of the options is good to choose from.
Sent an invite to the org on ArtifactHUB. |
This was the reason why it's useful to be on ArtifactHUB: https://artifacthub.io/packages/search?ts_query_web=piped&sort=relevance&page=1 :) I have also made better README on the Kubernetes repo. |
@FireMasterK Could you please enable the showing of funding links on the Piped-Kubernetes respository? I have added mine and TeamPiped links to it. |
It doesn't seem to parse, I don't see it as an option on GitHub. |
Ah, it had to be inside an array, now it does parse. :) |
@FireMasterK Can I have secret access on the Piped-Kubernetes repo? I would like to add Self-Hosted Renovate there which would require some secrets and adding my bot access to the repository. |
But for renovate, why not use the free hosted one online? It's already installed and used in other piped repos |
Because the configs and things I have for Renovate I believe needs the self-hosted version, but could be mistaken. I'm talking about https://github.com/samipsolutions/helm-charts/blob/main/.github/workflows/charts-changelog.yaml and https://github.com/samipsolutions/helm-charts/blob/main/.github/workflows/schedule-renovate.yaml Renovate config https://github.com/samipsolutions/helm-charts/blob/main/.github/renovate.json5 |
Is there any feature missing in the hosted version? I think it should work fine out of the box with that configuration 🤔 We don't need the |
That's exactly what I don't want, and thus the schedule is wanted as it would be used to bump eg database dependency every 3 months automatically which is a potentially breaking change due to how one needs to do Postgres upgrades. |
That's not right I think, we can schedule updates every month/etc in the config I believe. |
I don't see why it should be ran on every commit/push. The schedule workflow does run on push when there's a need for it eg when config was changed.
|
I don't know either, but the hosted renovate runs on every commit and every few hours. 🤷 It's not our infrastructure, so I don't think its our problem |
So that's a no for the bot? |
I mean to say I don't understand the need, but we can have the bot if its really necessary. |
|
Just gave the renovate bot perms for the repo! :) |
Would it be time to close this issue as we have a helm chart? |
Describe the feature
Option to install via Helm
https://helm.sh/
Why would this be useful to add?
It would make it more simple and scalable to deploy the full app on a Kubernetes cluster.
Concept(s)
No response
Additional context
No response
Acknowledgements
The text was updated successfully, but these errors were encountered: