---
# Example: Custom Plugins from S3 Wheelhouse
#
# This example demonstrates how to install custom Python plugins from a wheelhouse
# tarball stored in an S3-compatible bucket (AWS S3, MinIO, etc.).
#
# ## Prerequisites
#
# 1. Upload your wheelhouse.tar.gz to an S3 bucket
# 2. Create a Kubernetes Secret with your S3 credentials
#
# ## Step 1: Create the credentials secret
#
#   kubectl create secret generic s3-wheelhouse-credentials \
#     --from-literal=AWS_ACCESS_KEY_ID=your-access-key \
#     --from-literal=AWS_SECRET_ACCESS_KEY=your-secret-key
#
# ## Step 2: Upload your wheelhouse tarball to S3
#
#   aws s3 cp wheelhouse.tar.gz s3://my-wheelhouse-bucket/media/wheelhouse.tar.gz
#
# ## Step 3: Deploy NetBox with S3 wheelhouse
#
#   kubectl apply -f netbox-managed-with-custom-python-from-s3.yaml
#
# The init container will download and extract the wheelhouse before NetBox starts.
#
# ---
# NetBoxEnterprise with custom plugins from S3 wheelhouse
#
# The operator downloads the wheelhouse tarball from S3 during pod initialization
# and installs the packages before starting NetBox.
apiVersion: netboxlabs.com/v1alpha1
kind: NetBoxEnterprise
metadata:
  name: netbox-with-s3-plugins
  namespace: default
spec:
  imagePullPolicy: IfNotPresent
  netbox:
    replicas: 1
    image:
      pullPolicy: IfNotPresent
    worker:
      replicas: 1
    # Configuration for custom plugins
    config:
      # Custom plugins configuration for installing Python packages from wheelhouse
      plugins:
        wheelhouse:
          # S3 source for wheelhouse tarball
          s3:
            bucket: my-wheelhouse-bucket
            # Object key within the bucket (default: media/wheelhouse.tar.gz)
            key: media/wheelhouse.tar.gz
            # AWS region (default: us-east-1)
            region: us-east-1
            # Reference to Secret containing S3 credentials
            credentialsSecret:
              name: s3-wheelhouse-credentials
              # Keys within the secret (these are the defaults)
              accessKeyId: AWS_ACCESS_KEY_ID
              secretAccessKey: AWS_SECRET_ACCESS_KEY
            # Whether to verify SSL certificates (default: true)
            verifySSL: true
            # Custom S3 endpoint URL (optional, for MinIO or other S3-compatible services)
            # endpoint: https://minio.example.com:9000
      # Custom Python configuration to enable and configure the installed plugins
      customPythonConfig: |
        # Enable your custom plugins
        PLUGINS = [
            'ipfabric_netbox',
            'netpicker-netbox-plugin',
        ]
  diode:
    enabled: false
  postgresql:
    external: false
  redis:
    external: false
