Skip to content

Allow overriding image registry and Helm chart sources in NetBox deploy script #296

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

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

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.

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 ARTIFACTORY_TRUSTED_HOST=
export IMAGE_REGISTRY=
export ARTIFACTORY_PYPI_URL=
export NETBOX_SQL_DUMP_URL=

@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
# Conflicts:
#	kind/deploy-netbox.sh
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.

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

# Allow override via environment variable, otherwise fallback to default
NETBOX_HELM_CHART="${NETBOX_HELM_CHART:-https://github.com/netbox-community/netbox-chart/releases/download/netbox-5.0.0-beta.169/netbox-5.0.0-beta.169.tgz}"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
NETBOX_HELM_CHART="${NETBOX_HELM_CHART:-https://github.com/netbox-community/netbox-chart/releases/download/netbox-5.0.0-beta.169/netbox-5.0.0-beta.169.tgz}"
NETBOX_HELM_CHART="${NETBOX_HELM_REPO:-https://github.com/}netbox-community/netbox-chart/releases/download/netbox-5.0.0-beta.169/netbox-5.0.0-beta.169.tgz"

like this the version does not need to be updated manually in the environment variable but it's managed by the script.

# Build optional set flag if registry is not defined
REGISTRY_ARG=""
if [ -n "$NETBOX_IMAGE_REGISTRY" ]; then
REGISTRY_ARG="--set image.registry=$NETBOX_IMAGE_REGISTRY"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
REGISTRY_ARG="--set image.registry=$NETBOX_IMAGE_REGISTRY"
REGISTRY_ARG="--set global.imageRegistry=$NETBOX_IMAGE_REGISTRY --set global.security.allowInsecureImages=true"

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.

2 participants