-
Notifications
You must be signed in to change notification settings - Fork 150
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
Support Netbox custom scripts #10
Comments
I've been pondering this myself as well. I'm not so sure about the ConfigMap for this, it feels kind of wrong for scripts, but I don't have an immediate better answer for you either. The old |
Ah I wasn't aware you could do that (re: |
something good to know is that the scripts must be also on the worker pods, a working example for me: worker:
extraContainers:
- name: git-custom-scripts
image: k8s.gcr.io/git-sync/git-sync:v3.6.0
env:
- name: GIT_SYNC_REPO
value: <some_repo>
- name: GIT_SYNC_BRANCH
value: main
- name: GIT_SYNC_ROOT
value: /data
- name: GIT_SYNC_PERIOD
value: 10m
volumeMounts:
- name: custom-scripts
mountPath: /data
extraVolumeMounts:
- name: custom-scripts
mountPath: /opt/netbox/netbox/scripts
extraVolumes:
- name: custom-scripts
emptyDir: {}
extraContainers:
- name: git-custom-scripts
image: k8s.gcr.io/git-sync/git-sync:v3.6.0
env:
- name: GIT_SYNC_REPO
value: <some_repo>
- name: GIT_SYNC_BRANCH
value: main
- name: GIT_SYNC_ROOT
value: /data
- name: GIT_SYNC_PERIOD
value: 10m
volumeMounts:
- name: custom-scripts
mountPath: /data
extraVolumeMounts:
- name: custom-scripts
mountPath: /opt/netbox/netbox/scripts
extraVolumes:
- name: custom-scripts
emptyDir: {}
extraConfig:
- values:
SCRIPTS_ROOT: /opt/netbox/netbox/scripts/netbox-scripts.git/scripts it took me a while to figure it out, as my scripts were failing with this exception when they were missing on the worker node:
|
From #148 by @florianschendel
|
I'd like to be able to use custom scripts in Netbox.
I believe this will need a volume to be mounted at
/opt/netbox/netbox/scripts
in the deployment, and a means by which Helm users can store their scripts in a configmap (which I'm not so clear on).The text was updated successfully, but these errors were encountered: