Code Monkey home page Code Monkey logo

Comments (2)

Heavybullets8 avatar Heavybullets8 commented on June 6, 2024

Thank You!

Custom Apps do Receive Updates

as shown here:
image

  1. There is no version change, since the helm chart for the app, nor the custom-app app version (which is NOT the prowlarr version) have an update.
  2. I am not 100% sure when these are pulled, it has to do with something outside of the control of HeavyScript
  3. It does not always work. (See below)

You May Need to Enable it

You can enable image updates in the application settings

image

image


If None Of That Works

Occasionally I have ran into apps that, for whatever reason do not show that there is an update available, even days after the update has been released on the repository the container is from. A work-around is:

  1. Change Container Pullpolicy to always

image

  1. Schedule a cron job to restart the container with HeavyScript occasionally. I.E. Once a week or so, ensuring at least once a week the new container is grabbed.
bash /path/to/heavyscript/heavy_script.sh app --restart APPNAME

from heavy_script.

vk496 avatar vk496 commented on June 6, 2024

Thank you!

For first case, I think its a chart update, which triggers the update. Because Ive never saw a popup like that before, only app versions. (also, could be this: helm/helm#5696 (comment))

For the second one, I didn't realize that I have that enabled. So its sure thats its not working or buggy. Thats why I opened here a issue :)

3rd case, that works more or less. But for my case, I cant interrupt the service except if is for updating, so I came out with this script that I trigger every 10min (works with private repos too :) ) that I would like to share

#!/bin/bash

# Copyright Valentin @vk496
# For https://github.com/Heavybullets8/heavy_script/issues/155

set -e

image_name="registry.gitlab.com/test_org/test"
image_tag="latest"
image_namespace="ix-test"
image_app="test"

# username[:password]
repo_auth="gitlab+deploy-token-1234:gldt-abc-def-hij"


if [[ $repo_auth != "" ]]; then
  ctr_auth="-u $repo_auth"
fi


k3s ctr image pull $ctr_auth $image_name:$image_tag

image_sha_latest=$image_name@$(k3s ctr image ls | grep $image_name:$image_tag | awk '{print $3}')

echo $image_sha_latest

image_sha_current=$(k3s kubectl -n $image_namespace get pod --field-selector=status.phase==Running -o jsonpath="{..imageID}")

# k3s kubectl rollout restart deployment sacacitas
if [[ $image_sha_current ]] && [[ $image_sha_latest != image_sha_current ]]; then
  echo Need updade!
  # /usr/local/bin/heavyscript app -r $image_app
  k3s kubectl -n $image_namespace rollout restart deployment -l app.kubernetes.io/instance=$image_app
else
  echo Last version running
fi

PS: I think this could be a very elegant way to do it

midclt call chart.release.get_instance "$app_name" | jq

have

...
  "update_available": false,
  "human_version": "registry.gitlab.com/test_org/test:latest_2403.0.0",
  "human_latest_version": "registry.gitlab.com/test_org/sacacitas:latest_2403.0.0",
  "container_images_update_available": false,

I think manipulating update_available or container_images_update_available with PullAlways Pullpolicy, would work pretty smooth with heavyscript cronjobs

from heavy_script.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.