netbox-chart icon indicating copy to clipboard operation
netbox-chart copied to clipboard

Explain use of RWX volume for media

Open stblassitude opened this issue 3 years ago • 1 comments

closes #87

stblassitude avatar Apr 03 '22 10:04 stblassitude

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 podAffinity to 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 ReadWriteMany storage provider is with the NFS Ganesha server and external provisioner.
  • Another way around this is to use the storageBackend and storageConfig settings 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.

bootc avatar Apr 26 '22 19:04 bootc