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

How to add/install additional Netbox Plugins using helm chart #173

Open
manusys64 opened this issue Dec 20, 2023 · 2 comments
Open

How to add/install additional Netbox Plugins using helm chart #173

manusys64 opened this issue Dec 20, 2023 · 2 comments

Comments

@manusys64
Copy link

Hello,

I would like to know if is possible to add custom plugins through helm chart ?
I saw that in default values there are 2 variables related to plugins:
plugins: []
pluginsConfig: {}

I have tried to add a plugin within plugin list variable like so:
plugins:
- netbox_dns
but helm chart fail to deploy due to this error (which is legit)
image

So how we can install new plugins to netbox deployed via helm chart ?

Thank you and best regards !

@JevgenijsKonevs
Copy link

JevgenijsKonevs commented Jan 23, 2024

@manusys64
One way how you can install the plugins is to create custom Netbox Docker image.

Example of Dockerfile config :

FROM netboxcommunity/netbox:v3.5.1

RUN 
    echo "netbox-plugin-dns" >> requirements.txt && \
    echo "netbox-plugin-dns" >> local_requirements.txt 

RUN . /opt/netbox/venv/bin/activate && \
    pip install netbox-plugin-dns 

RUN echo "PLUGINS = [ 'netbox_dns'']" >> /opt/netbox/netbox/netbox/configuration.py

Add reference to the custom Dockerfile in Helm chart :

netbox:
  commonValue:
  image:
    repository: YOUR_REPOSITORY
    tag: "IMAGE_TAG"

Do not add 'netbox_dns' into plugins section of Helm chart, keep it empty, do it in Dockerfile

@viperbmw
Copy link

viperbmw commented Mar 21, 2024

@manusys64 One way how you can install the plugins is to create custom Netbox Docker image.

Example of Dockerfile config :

FROM netboxcommunity/netbox:v3.5.1

RUN 
    echo "netbox-plugin-dns" >> requirements.txt && \
    echo "netbox-plugin-dns" >> local_requirements.txt 

RUN . /opt/netbox/venv/bin/activate && \
    pip install netbox-plugin-dns 

RUN echo "PLUGINS = [ 'netbox_dns'']" >> /opt/netbox/netbox/netbox/configuration.py

Add reference to the custom Dockerfile in Helm chart :

netbox:
  commonValue:
  image:
    repository: YOUR_REPOSITORY
    tag: "IMAGE_TAG"

Do not add 'netbox_dns' into plugins section of Helm chart, keep it empty, do it in Dockerfile

I have tried to use this Dockerfile to build a custom image.

FROM netboxcommunity/netbox:latest
RUN echo "netbox-secrets" >> requirements.txt && \
    echo "netbox-secrets" >> local_requirements.txt \
    echo "netbox-topology-views" >> requirements.txt && \
    echo "netbox-topology-views" >> local_requirements.txt \
    echo "netbox-bgp" >> requirements.txt && \
    echo "netbox-bgp" >> local_requirements.txt
RUN . /opt/netbox/venv/bin/activate && pip install netbox-secrets netbox-topology-views netbox-bgp
RUN mkdir -p /opt/netbox/netbox/static/netbox_topology_views/img
SHELL ["/bin/bash", "-c"]
RUN echo $'\n\
PLUGINS = ["netbox_secrets", "netbox_bgp","netbox_topology_views"]\n\
PLUGINS_CONFIG = {\n\
    \'netbox_topology_views\': {\n\
        \'static_image_directory\': \'netbox_topology_views/img\',\n\
        \'allow_coordinates_saving\': True,\n\
        \'always_save_coordinates\': True\n\
    }\n\
}' >> /opt/netbox/netbox/netbox/configuration.py
RUN SECRET_KEY="dummydummydummydummydummydummydummydummydummydummy" /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py collectstatic --no-input

When I try to use the custom image in the Helm Chart I get

/opt/netbox/docker-entrypoint.sh: line 20: ./manage.py: No such file or directory
[ Use DB_WAIT_DEBUG=1 in netbox.env to print full traceback for errors here ]
⏳ Waiting on DB... (18s / 30s)

What am I doing wrong?

When using the image in docker compose it works.........

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

No branches or pull requests

3 participants