nlopez / k8s_home

Kubernetes
48 stars 6 forks source link

automated releases #13

Closed evanrich closed 3 years ago

evanrich commented 3 years ago

I noticed that as far back as may or so (shows how long it's been since I've looked at your repo), you have automatic updates for apps. I've been looking for a way to implement this myself, seems you're doing it with flux. if possible, could you explain how you are doing this?

Edit: I've set up flux, is adding the

fluxcd.io/automated: 'true'
    fluxcd.io/tag.tautulli: 'regex:^v2\.[0-9\.]+-ls[0-9]+$'

enough to get them to auto update? I see this in the flux logs:

ts=2020-10-14T05:17:04.340163468Z caller=repocachemanager.go:215 component=warmer canonical_name=index.docker.io/linuxserver/tautulli auth={map[]} warn="aborting image tag fetching due to rate limiting, will try again later"
ts=2020-10-14T05:17:34.451981509Z caller=warming.go:206 component=warmer updated=linuxserver/tautulli successful=250 attempted=1757
ts=2020-10-14T05:43:07.633269515Z caller=warming.go:198 component=warmer info="refreshing image" image=tubaguy50035/tautulli_exporter tag_count=2 to_update=2 of_which_refresh=0 of_which_missing=2
ts=2020-10-14T05:43:08.045140535Z caller=warming.go:206 component=warmer updated=tubaguy50035/tautulli_exporter successful=2 attempted=2
ts=2020-10-14T05:43:09.132694993Z caller=warming.go:198 component=warmer info="refreshing image" image=linuxserver/tautulli tag_count=1757 to_update=1507 of_which_refresh=0 of_which_missing=1507
ts=2020-10-14T05:43:17.949246338Z caller=repocachemanager.go:215 component=warmer canonical_name=index.docker.io/linuxserver/tautulli auth={map[]} warn="aborting image tag fetching due to rate limiting, will try again later"
ts=2020-10-14T05:43:36.537492415Z caller=warming.go:206 component=warmer updated=linuxserver/tautulli successful=478 attempted=1507

but no pods have updated yet...is it only when a new tag shows up? (fwiw, I've left my pods a image or two behind to see if they update automatically) Also, how do you get it so that it commits "auto updated" to your repo? did you change the "flux starter" repo to your own?

Thanks!

evanrich commented 3 years ago

edit i might have figured it out. had to not use their sample repo, but set it to my repo...it seems to be updating things now. will report back tomorrow if things are good with steps.

evanrich commented 3 years ago

figured it out. So here's what you need to do if anyone is interested:

1.) set up fluxcd, deploy via helm. Where the instructions tell you to set flux's welcome project (it says fork theres), don't instead point it at your repository ,and add the flux key as a deploy key in your project. Make sure your yaml files are all good because i found out the hardway (alot of WIP files in my repo) that flux will complain left and right. It took me maybe 30 minutes to clean up my repo, but now I've got automatic deployments now too :D

nlopez commented 3 years ago

Hey Evan! Sorry I didn't get back to you earlier. Glad to hear you got Flux setup.

It's been working smoothly for me for several months now and I hope you have similar luck!

I have a few notes here on helpful commands for un/ignoring resources, in case you ever find yourself wanting to do that. Before I started using the automated tag to exclude certain containers from auto updates, I found them useful.

Next challenge: use Plex's playback status to suppress updates while someone's watching something, so updates can automatically get done 'off hours'. 😄

evanrich commented 3 years ago

Hey @nlopez I did get it working...but then it stopped. Currently trying to debug it. I'm hitting an issue where flux just barfs about rate limiting from docker hub, but I think everything is working because if i manually push a release it works. The logs from flux are like verbal diarrhea though so its hard to figure out whats going on. I rebuilt my cluster on new harder, from scratch, but jackett wasn't updating, despite correct regex. I was able to manually adjust the version using something like

fluxctl policy -w media:statefulset/jackett --tag-all='v0.16.*'   

and this seems to have worked, since it forced the commit to github, then pushed the image. I'll keep an eye on it but yeah your guides have been super helpful! thanks. I don't know for how long I wished there was a way to auto update pods lol.