Skip to content
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

feat: add charts for shlink and shlink-web #1370

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

jon4hz
Copy link
Member

@jon4hz jon4hz commented Jan 22, 2025

Description

This PR introduces new charts to deploy shlink and the corresponding web UI "shlink-web".
The chart is will be used in our internal initiative to replace our current URL shortener.

Thanks for the review!

Checklist

  • This PR contains a description of the changes I'm making
  • I updated the version in Chart.yaml
  • I updated the changelog with an artifacthub.io/changes annotation in Chart.yaml, check the example in the documentation.
  • I updated applicable README.md files using pre-commit run
  • I documented any high-level concepts I'm introducing in docs/
  • CI is currently green and this is ready for review
  • I am ready to test changes after they are applied and released

@jon4hz jon4hz self-assigned this Jan 22, 2025
@jon4hz jon4hz requested a review from a team as a code owner January 22, 2025 01:29
@jon4hz jon4hz requested review from 4censord and gianklug January 22, 2025 01:29
@github-actions github-actions bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 22, 2025
@jon4hz jon4hz force-pushed the feat/shlink-chart branch from c8a5f4d to 10d35f0 Compare January 22, 2025 01:31
@hairmare hairmare self-requested a review January 22, 2025 01:32
@hairmare
Copy link
Contributor

I'll have to find some time for an in depth review, some initial questions

  • can you link any other efforts about shlink and k8s in description, why do we need to maintain a helm-chart, did we ask upstream if they wanted it, are there any
  • why two charts? are there any deployment consideration that warrant exposing shlink in this way towards users?

@jon4hz
Copy link
Member Author

jon4hz commented Jan 22, 2025

can you link any other efforts about shlink and k8s in description, why do we need to maintain a helm-chart, did we ask upstream if they wanted it, are there any

A few years ago there were some efforts regarding a chart and the maintainer was interested, but unfortunately the existing helm chart is extremely outdated and unmaintained. See shlinkio/shlink#668

why two charts? are there any deployment consideration that warrant exposing shlink in this way towards users?

Technically, you don't need shlink-web in order to use the service since as you can connect any shlink service to the public webui on https://app.shlink.io/. However, we decided to host our own shlink-web so we can preconfigure an API key and use SSO (with oauth2-proxy) to offer the service in a more user-friendly manner.

@jon4hz
Copy link
Member Author

jon4hz commented Jan 22, 2025

btw, will take a look at the failing test tomorrow.

@eyenx
Copy link
Member

eyenx commented Jan 22, 2025

Can you please add the maintainer of this charts to the CODEOWNERs file?

Thanks.

@eyenx
Copy link
Member

eyenx commented Jan 22, 2025

can you link any other efforts about shlink and k8s in description, why do we need to maintain a helm-chart, did we ask upstream if they wanted it, are there any

A few years ago there were some efforts regarding a chart and the maintainer was interested, but unfortunately the existing helm chart is extremely outdated and unmaintained. See shlinkio/shlink#668

What About @christianhuth charts? They seem updated

https://github.com/christianhuth/helm-charts/tree/main/charts

I suggest just using those instead of maintaining our own if nothing is against it.

appVersion: 4.3.0
home: https://shlink.io
sources:
- https://github.com/shlinkio/shlink-web-client/tree/main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: The URL could be canonicalized

Suggested change
- https://github.com/shlinkio/shlink-web-client/tree/main
- https://github.com/shlinkio/shlink-web-client/

@jon4hz
Copy link
Member Author

jon4hz commented Jan 22, 2025

What About @christianhuth charts? They seem updated

Oh... I did not know this chart existed :(
I quickly skimmed through the code and I noticed two things that currently prevent us from using those charts:

  1. shlink-backend has no option to set an externalDatabase.
  2. shlink-web only supports a configMap to add preconfigured shlink services and has no option to configure it with environment variables. This means we can't pass the predefined API token as a secret.

Both things should be easily fixable, so I guess I'll start working on some PRs.

@christianhuth
Copy link

Hi guys :)
I try to keep the Chart up-to-date. If there are any issues feel free to open up Issues and/or PRs.
Cheers ✌️

@christianhuth
Copy link

christianhuth commented Jan 22, 2025

What About @christianhuth charts? They seem updated

Oh... I did not know this chart existed :(
I quickly skimmed through the code and I noticed two things that currently prevent us from using those charts:

  1. shlink-backend has no option to set an externalDatabase.
  2. shlink-web only supports a configMap to add preconfigured shlink services and has no option to configure it with environment variables. This means we can't pass the predefined API token as a secret.

Both things should be easily fixable, so I guess I'll start working on some PRs.

Thanks for pointing out that there is no option for using an external database. Will add this with the next release.

There is an option to define extra environment variables. As I started with the development of the Chart this seemed like a good approach. Today I would take another approach and make it possible to define common env variables through Value attributes. Is there a list of all env variables supported by shlink?

@jon4hz
Copy link
Member Author

jon4hz commented Jan 22, 2025

Hey @christianhuth, thanks for checking in and maintaining the chart!

I saw that you can define extra variables and if christianhuth/helm-charts#1249 gets merged, you could technically configure an external database without exposing any secrets, but I suppose having dedicated values for that might be more idiomatic.

All environment variables supported by shlink are documented here and shlink-web supports preconfiguring servers by env vars.

@christianhuth
Copy link

Will check this out in the next couple of days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants