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

Add helm chart #248

Merged
merged 3 commits into from
May 12, 2024
Merged

Add helm chart #248

merged 3 commits into from
May 12, 2024

Conversation

hollanbm
Copy link
Contributor

@hollanbm hollanbm commented Apr 17, 2024

I recently found your app and wanted to get it set up on my cluster. I noticed there wasn't a helm chart, so I went ahead and created one. I made a README.md for the chart, which goes over each setting in the chart, the default values, and provides some examples

I also added a workflow to package/publish the chart using gh-pages automatically.

There is a little repo setup in order to configure gh-pages.

git switch --orphan gh-pages
git commit --allow-empty -m "Initial commit on gh-pages branch"
git push -u origin gh-pages

See chart-releaser-action#pre-requisites for more details

@hollanbm
Copy link
Contributor Author

@RickDB

Confirmed chart deploys successfully

  values:
    custom_mappings: |
      remote-urls:
        - https://raw.githubusercontent.com/RickDB/PlexAniSync-Custom-Mappings/main/series-tvdb.en.yaml
        - https://raw.githubusercontent.com/RickDB/PlexAniSync-Custom-Mappings/main/movies-tmdb.en.yaml

    image: ghcr.io/rickdb/plexanisync:1.4

    settings:
      plex_section: Anime|Anime Movies
      plex_url: https://plex.tld.org
      ani_username: <username>
      plex_episode_count_priority: true

    tokens:
      ani: <ani-token>
      plex: <plex-token>
plexanisync-bd5f4956f-rxwfp › plexanisync
plexanisync-bd5f4956f-rxwfp plexanisync Updating settings.ini
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:54 PlexAniSync - version: 1.4.0
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:54 [MAPPING] Custom mapping found locally, using: custom_mappings.yaml
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:54 [MAPPING] Adding remote mapping url: https://raw.githubusercontent.com/RickDB/PlexAniSync-Custom-Mappings/main/series-tvdb.en.yaml
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:54 [MAPPING] Adding remote mapping url: https://raw.githubusercontent.com/RickDB/PlexAniSync-Custom-Mappings/main/movies-tmdb.en.yaml
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:55 AniList skip list update enabled in settings, will match but NOT update your list
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:55 Plex episode watched count will take priority over AniList, this will always update AniList watched count over Plex data
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:55 [ANILIST] Retrieving AniList list for user: <username>
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:56 [ANILIST] Found 0 anime series on list
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:56 [PLEX] Retrieving anime series from section: Anime
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:56 [PLEX] Found 213 anime series in section: Anime
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:56 [PLEX] Retrieving anime series from section: Anime Movies
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:10:57 [PLEX] Found 95 anime series in section: Anime Movies
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:14:15 [PLEX] Found 135 watched series
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:14:15 [PLEX] Watched series also contained 25 releases with no episode attribute (probably movie / OVA), support for this is still experimental
plexanisync-bd5f4956f-rxwfp plexanisync 2024-04-17 06:14:15 [ANILIST] Matching Plex series to Anilist

@hollanbm
Copy link
Contributor Author

hollanbm commented May 9, 2024

@reconman Thoughts on getting this merged?

@@ -0,0 +1,81 @@
---
apiVersion: apps/v1
kind: Deployment
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not 100 % sure but I think this could also be solved with a CronJob instead of starting a pod that does nothing 99 % of the time.

The entrypoint.sh needs to be adjusted so the docker image can also be run without the sleep loop, like by quitting the script if INTERVAL is <= 0.

Copy link
Contributor Author

@hollanbm hollanbm May 12, 2024

Choose a reason for hiding this comment

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

Yep, you're definitely right, a cronjob is the better solution.

I wasn't sure if the changes needed to support the cronjob would be welcomed, so I was pretty conservative with the chart.

I've gone ahead and updated the entrypoint script.

The chart defaults to a cronjob, with a user configurable schedule, but you can disable the cronjob, in which case a deployment will be created, and the interval setting used instead.

I inspected the chart outputs with all of the various setting, as well as linting with lube-lint. I haven't had the opportunity to test the chart since I also need a new container image built.

Can you kick off the workflow for a container image? If you don't want to, I can get something built on my fork. Hopefully take care of that tomorrow

Copy link
Collaborator

Choose a reason for hiding this comment

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

The PR workflow doesn't actually push docker images so I adjusted the entrypoint myself in the master branch.

Use the latest master image to test your changes.

@hollanbm
Copy link
Contributor Author

@reconman I ended up making some changes, and removed the option for a deployment, it was redundant, and I didn't like how it unnecessarily complicated the chart.

I've deployed the chart to my cluster, and tested with the latest master. It worked as expected, and exited after it finished.

values:
  custom_mappings: |
    remote-urls:
      - https://raw.githubusercontent.com/hollanbm/PlexAniSync-Custom-Mappings/main/series-tvdb.en.yaml
      - https://raw.githubusercontent.com/hollanbm/PlexAniSync-Custom-Mappings/main/movies-tmdb.en.yaml

  image: ghcr.io/rickdb/plexanisync:master

  settings:
    plex_section: Anime|Anime Movies
    plex_url: https://plex.tld.org
    ani_username: <username>
    plex_episode_count_priority: true

  tokens:
    ani: <ani-token>
    plex: <plex-token>
...
plexanisync-28592350-g6zm5 plexanisync 2024-05-12 19:16:34 [ANILIST] --------------------------------------------------
plexanisync-28592350-g6zm5 plexanisync 2024-05-12 19:16:34 [ANILIST] Used custom mapping | title: My Hero Academia: Two Heroes | season: 1 | anilist id: 100723
plexanisync-28592350-g6zm5 plexanisync 2024-05-12 19:16:34 [ANILIST] --------------------------------------------------
plexanisync-28592350-g6zm5 plexanisync 2024-05-12 19:16:34 [ANILIST] Found AniList entry for Plex title: My Hero Academia: World Heroes' Mission
plexanisync-28592350-g6zm5 plexanisync 2024-05-12 19:16:34 [ANILIST] --------------------------------------------------
plexanisync-28592350-g6zm5 plexanisync 2024-05-12 19:16:34 [ANILIST] Used custom mapping | title: That Time I Got Reincarnated as a Slime the Movie: Scarlet Bond | season: 1 | anilist id: 139498
plexanisync-28592350-g6zm5 plexanisync 2024-05-12 19:16:34 Plex to AniList sync finished
plexanisync-28592350-g6zm5 plexanisync Sync was completed and INTERVAL <= 0, quitting

@hollanbm hollanbm requested a review from reconman May 12, 2024 19:26
@reconman reconman merged commit 131b60f into RickDB:master May 12, 2024
@reconman
Copy link
Collaborator

Regarding the github pages, I don't have the permission to change the settings to enable them. Only @RickDB can do it:

In your repo, go to Settings/Pages. Change the Source Branch to gh-pages.

@hollanbm hollanbm deleted the add_helm_chart branch May 12, 2024 19:52
@hollanbm
Copy link
Contributor Author

Regarding the github pages, I don't have the permission to change the settings to enable them. Only @RickDB can do it:

In your repo, go to Settings/Pages. Change the Source Branch to gh-pages.

Does he still contribute or manage the repo at all?

@RickDB
Copy link
Owner

RickDB commented May 13, 2024

Regarding the github pages, I don't have the permission to change the settings to enable them. Only @RickDB can do it:

In your repo, go to Settings/Pages. Change the Source Branch to gh-pages.

Updated 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants