Netbox server is a docker compose application running on host - dockerhost-int01.god.de - located in /srv/netbox folder.
Test server is hosted on - dockerhost-test.god.de in the same folder - all image building files are there as well.
It uses Postgres as SQL database with redis cache.
Docker compose on both servers is configured to use Traefik as proxy - update the configuration if need be.
NETBOX UPDATE
We use the standard netbox image from https://github.com/netbox-community/netbox-docker docker-hub - docker.io/netboxcommunity/netbox. For production Dockerfile-Plugins-3.7 is used, this is a special image taking the defaults from git-repo and applying the plugins configuration on top, we will not need to change the default image.
To update image:
1. Change the base image in Dockerfile-Plugins-3.7 file on test host - Change from version 3.7.6 to 3.8.0
"FROM netboxcommunity/netbox:v3.7.6" => "FROM netboxcommunity/netbox:v3.8.0"
2. Save and exit the file
3. In the /srv/netbox folder run command - this will build new docker image
"docker build -t nexus.dev.god.de:5006/godmbh/netbox-plugins:v3..8.0 -f Dockerfile-Plugins-3.7 ."
4. Push the new docker image to nexus repo - you need to have rights to do that, root user can do it by default
"docker push nexus.dev.god.de:5006/godmbh/netbox-plugins:v3..8.0"
5. Change the ".env" file to use the new image - file is located in /srv/netbox/.env
NETBOX_IMAGE='nexus.dev.god.de:5006/godmbh/netbox-plugins:v3.7.6' => NETBOX_IMAGE='nexus.dev.god.de:5006/godmbh/netbox-plugins:v3.8.0'
6. Test if new release works on test server - use '-d' flag to not get attached to a container i/o
"docker compose down" => wait for containers to be removed
"docker compose up -d" => wait for status healthy of all 3 containers before testing
7. If everything works fine you can repeat steps 5. and 6. on production server
INSTALLING PLUGINS
Installing plugins is simple and straight forward usually well documented on plugins git-repo but here are main concepts.
1. Update the "plugin_requirements.txt" file in /srv/netbox folder on test host
2. Enable plugin ihn configuration:
2.1. Update the /srv/netbox/configuration/plugins.py file with the plugin name and configuration - details are specific to each plugin
3. Build and deploy the image:
3.1. Follow steps 3 to 7 from update section to build a image with plugins
3.2. This Dockerfile-Plugins-3.7 file is tweaked to work for our needs and should support all plugins, we might need to modify it for future plugins.
4. Plugin will now be available in Netbox GUI
MISCS
There is a NOTES_HOW_TO file in the test server with some info on database migration.
There is a SHELL script to backup Netbox database in /home/msmet/netbox_backup.sh - this was run as a CRON job but got disabled by someone - might be useful in future.