Archivo de la categoría: Domotica

HA update unhealthy y Portainer

Resulta que HA no soporta contenedores adicionales en el Docker donde se ejecuta. Dice que «system unhelthy» y no te deja actualizar nunca.

1. Existe una forma de quitar esa limitación desactivando la comprobación del system healthy:

Entramos por SSH y ejecutamos todo esto:

ha jobs options –ignore-conditions healthy
//The system remains unhealthy but it does not block any installation updates.

Actualizamos el HA

ha jobs reset
//to restore protection

ha supervisor restart

2. También podemos renombrar el contenedor del Portainer para pasar desapercibidos, dicen:

You can rename the Docker image and container. To do this, stop and delete the running container called portainer-ce and the corresponding image:

docker stop portainer-ce
docker rm portainer-ce
docker image rm portainer/portainer-ce

Then load the latest portainer-ce image, rename it and delete the image named portainer-ce, e.g.:

docker pull portainer/portainer-ce
docker image tag portainer/portainer-ce:latest example/hafen-ce:latest
docker image rm portainer/portainer-ce

The previous Portainer-ce volume remains and is allocated as before when the new container is started:

docker run -d -p 8000:8000 -p 9000:9000 –name hafen-ce –restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer-ce:/data example/hafen-ce:latest

Of course, you can also create a new volume and move the contents of the old volume to the new one. Once started, Portainer can be reached as before. After restarting the HA host, the error no longer appears in the Supervisor log.

3. También existe la posibilidad de agregar Portainer como un Community Addon:

https://community.home-assistant.io/t/home-assistant-community-add-on-portainer/68836

The installation of this add-on is pretty straightforward and not different in comparison to installing any other add-on:

  1. Search for the “Portainer” add-on in the add-on store and install it.
  2. Set the “Protection mode” switch to off.
  3. Start the “Portainer” add-on.
  4. Check the logs of the “Portainer” add-on to see if everything went well.

Actualizar Portainer en Docker

gracias a esta url, nos dio una idea y ya hemos solucionado el problema con el portainer:
https://github.com/portainer/portainer/issues/6404

como no es tema de espacio libre en disco, seguramente será que la carpeta con la BD se ha corrompido de alguna forma o no es compatible.

probamos a eliminarla:

sudo docker stop portainer
sudo docker rm portainer
sudo docker volume rm portainer_data
sudo docker image rmi portainer/portainer-ce
sudo docker image ls | grep portainer (si vemos alguna imagen referente a portainer, nos cogemos su ID y…)
sudo docker image rmi ID_de_la_imagen_portainer

Ahora que ya tenemos limpito el asunto de containers e imágenes:

sudo docker volume create portainer_data

Ubuntu:
> sudo docker run -d -p 9000:9000 -p 9443:9443 –name=portainer –restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Debian 11:
> sudo docker run -d -p 9000:9000 -p 9443:9443 –name portainer –restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
Fuente: https://kifarunix.com/install-portainer-on-debian-11-debian-10/

ahora funciona y nos pide crear credenciales de administrador para empezar. La contraseña ha de tener 12 caracteres.

También podríamos restaurar un backup a fichero de la versión anterior del portainer…