Skip to content

Conversation

@pablogarciamiranda
Copy link
Collaborator

@pablogarciamiranda pablogarciamiranda commented May 2, 2025

This PR updates the deploy-netbox.sh script to make it agnostic of any specific image repository or Artifactory instance.

Tests

Without env variables

Deploy netbox into a kind cluster with no ENV variables exported

./deploy-netbox.sh kind "4.1.8" netbox 

Deploy netbox into a vcluster with no ENV variables exported

./deploy-netbox.sh vcluster "4.1.8" netbox --vcluster

With env variables

By exporting the following variables, users can override default URLs and images to point to their repositories:

export NETBOX_HELM_CHART=YOUR_
export POSTGRESS_OPERATOR_HELM_CHART=
export IMAGE_REGISTRY=
export PYPI_REPOSITORY_URL=
export NETBOX_SQL_DUMP_URL=

Deploy netbox into a kind cluster with no ENV variables exported

./deploy-netbox.sh kind "4.1.8" netbox 

Deploy netbox into a vcluster with no ENV variables exported

./deploy-netbox.sh vcluster "4.1.8" netbox --vcluster

@pablogarciamiranda pablogarciamiranda marked this pull request as draft May 2, 2025 13:38
@pablogarciamiranda pablogarciamiranda requested a review from bruelea May 5, 2025 09:00
@pablogarciamiranda pablogarciamiranda marked this pull request as ready for review May 5, 2025 09:02
@pablogarciamiranda pablogarciamiranda marked this pull request as draft May 5, 2025 09:41
@pablogarciamiranda pablogarciamiranda marked this pull request as ready for review May 6, 2025 13:23
@pablogarciamiranda pablogarciamiranda changed the base branch from feature/deploy-netbox-vcluster to main May 6, 2025 14:11
Copy link
Collaborator

@bruelea bruelea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the netbox-db.yaml the field 'dockerImage' can be added to the spec, to define which image to use for the netbox-db pod. Otherwise it will fail with ImagePullBackOff error.

@pablogarciamiranda pablogarciamiranda merged commit f9b5216 into main Jun 11, 2025
11 checks passed
vaishutin pushed a commit to vaishutin/netbox-operator that referenced this pull request Aug 17, 2025
…oy script (netbox-community#296)

* Adapting deploy-netbox.sh to a vCluster deployment

* Debugging demo data

* Adding steps to load demo-data into NetBox inside the vcluster

* Adding description to script

* Adding kind path

* Adding namespaces

* Removing sleep used for testing purposes

* Fixing script comment

* Adding variable IS_VCLUSTER to easily check in all the if statements

* Refactoring part of loading demo-data into NetBox

* Parametrizing deploy-netbox.sh to allower using a customize artifactory instead of public repositories for binaries and helm charts

* Create patch to inject the NETBOX_SQL_DUMP_URL inside the Docker container

* Removing unnecessary code & comments

* Removing from kustomization.yaml the new changes applied in the script

* Adding comment to script and renaming SQL_DUMP_URL to NETBOX_SQL_DUMP_URL

* Adding comment to clarify that vCluster will be deployed to the NAMESPACE passed as an argument

* Adding comment to clarify that vCluster will be deployed to the NAMESPACE passed as an argument

* Adding image.registry to the values of the two helm charts to be installed

* Removing newImage & newTag from kustomization.yaml

* Simplifying use of env variables

* Assign IMAGE_REGISTRY to the helm upgrade from the env variable if this is set, otherwise, don't pass the flag and use the default one from the chart

* Fix: Assign IMAGE_REGISTRY to the helm upgrade from the env variable if this is set, otherwise, don't pass the flag and use the default one from the chart

* Setting a SCRIPT_DIR that it's used all over the script

* Using HELM_REPOS instead of HELM_CHARTS for env substitution

* Adding a patch to the kind: postgresql spec.dockerImage

* Remove Dockerfile and use a ConfigMap mounting the main.py to run the script to load the local data

* Using PYPI_REPOSITORY_URL instead of ARTIFACTORY_PYPI_URL

* Refactoring of scripts to inject dynamically env variables

* minor fixes

* add empty lines at end of file

* remove debug comments

* fix default python image registry

---------

Co-authored-by: Pablo Garcia Miranda <pablo.garciamiranda@swisscom.com>
Co-authored-by: bruelea <166021996+bruelea@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants