netbox-chart
netbox-chart copied to clipboard
Explain use of RWX volume for media
closes #87
Thanks for this, I think having a note about this makes sense, though I'd like it to include more about the various other ways around the issue.
- Users may prefer to use
podAffinityto keep pods on the same node as each other, which is more friendly on clusters with arbitrarily named and/or ephemeral nodes (such as on most cloud providers). - An easy way to get a
ReadWriteManystorage provider is with the NFS Ganesha server and external provisioner. - Another way around this is to use the
storageBackendandstorageConfigsettings and use object storage such as S3 or a compatible system such as Minio, etc... This is in fact what I do. - Finally, users might just disable the persistent storage altogether and just not store any media attachments.
For the podAffinity option you want (totally untested):
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: netbox
topologyKey: kubernetes.io/hostname
housekeeping:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: netbox
topologyKey: kubernetes.io/hostname
worker:
affinity:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: netbox
topologyKey: kubernetes.io/hostname
To disable the storage you want:
persistence:
enabled: false
For AWS S3 storage you want something like this:
persistence:
enabled: false
storageBackend: storages.backends.s3boto3.S3Boto3Storage
storageConfig:
AWS_STORAGE_BUCKET_NAME: my-netbox-media-bucket
AWS_S3_REGION_NAME: eu-west-2
AWS_S3_SIGNATURE_VERSION: s3v4
See also django-storages: Amazon S3.