Availability
| Edition | Deployment Type |
|---|---|
| Community & Enterprise | Self-Managed, Hybrid |
file://), remote gRPC (grpc://), and OCI registry (oci://). Choose the deployment method based on your environment and requirements.
Deployment Methods Comparison
| Method | Use Case | Pros | Cons |
|---|---|---|---|
file:// | Development, testing | Fast, simple, easy debugging | Not suitable for production, requires filesystem access |
grpc:// | Production, distributed systems | Remote deployment, scalable | Requires network setup, more complex |
oci:// | Production, containerized | Version control, registry management | Requires OCI registry, packaging overhead |
file:// - Local Filesystem
Deploy plugins from the local filesystem.Safety settings: By default, local filesystem plugin loading has safety restrictions that prevent loading from arbitrary paths. For development, you may need to adjust these settings in your configuration to allow local path loading and absolute paths. See the Security Considerations section below for details onALLOW_INTERNAL_NETWORK_ACCESSandPLUGIN_COMMAND_ALLOWLIST.
Building Your Plugin
Creating Plugin via API
file://:
Docker Deployment
When deploying with Docker, mount plugins into the container:Kubernetes Deployment
Mount plugins via ConfigMap or PersistentVolume:Expandable
grpc:// - Remote gRPC
Deploy plugins as remote gRPC services.Running Plugin as gRPC Server
Your plugin already implements gRPC via go-plugin. To run it as a remote service, you need a gRPC wrapper:Expandable
Deploying with Docker
Register Remote Plugin
Network Configuration
Internal Network Access
By default, plugins cannot access internal networks. For development:Load Balancing
Use Kubernetes services for load balancing:oci:// - OCI Registry
Deploy plugins as OCI artifacts in container registries.Prerequisites
- Docker or Podman
- OCI-compatible registry (Docker Hub, GHCR, ECR, GCR, Harbor, etc.)
- Registry credentials configured
Packaging Plugin as OCI Artifact
Create a simple OCI image:Registering OCI Plugin
Registry Authentication
OCI registry authentication is configured via environment variables using the pattern:<REGISTRY_NAME> is the registry hostname with dots replaced by underscores (e.g., docker.tyk.io → DOCKER_TYK_IO).
Authentication Methods
Entitlement Token (Cloudsmith and similar registries):AI Studio vs Edge Gateway
Both runtimes use the sameOCI_PLUGINS_REGISTRY_* environment variables for auth. The difference is in how OCI support is enabled:
| Setting | AI Studio | Edge Gateway |
|---|---|---|
| Enable OCI | AI_STUDIO_OCI_CACHE_DIR=/path | OCI_PLUGINS_CACHE_DIR=/path (default: /var/lib/microgateway/plugins) |
| Require signatures | AI_STUDIO_OCI_REQUIRE_SIGNATURE=true | OCI_PLUGINS_REQUIRE_SIGNATURE=true |
| Registry auth | OCI_PLUGINS_REGISTRY_* (shared) | OCI_PLUGINS_REGISTRY_* (shared) |
AI_STUDIO_OCI_CACHE_DIR must be set for OCI plugin support to be enabled in AI Studio. Without it, OCI plugins cannot be installed or loaded, and registry auth configuration is ignored.
Signature Verification
When signature verification is enabled (Enterprise Edition), thecosign tool verifies plugin signatures against the registry. Cosign uses the standard Docker credential store (~/.docker/config.json) for registry authentication — it does not use the OCI_PLUGINS_REGISTRY_* environment variables.
To configure cosign auth in containerized environments:
Cloudsmith-Specific Notes
When using Cloudsmith with a custom Docker domain (e.g.,docker.tyk.io):
- Entitlement auth is the recommended method for programmatic access
- Entitlements bypass the Docker token exchange, which avoids scope issues with Cloudsmith’s namespace-level scope requirements
- Each Cloudsmith repository has its own entitlement tokens — use repository-level entitlements
- The
ENTITLEMENTauth type sends Basic auth directly on every request, which Cloudsmith supports natively
Version Management
Use tags for version management:Caching
OCI plugins are pulled and cached locally:Security Considerations
Command Validation
The platform validates plugin commands for security:- Absolute Paths:
file://commands must use absolute paths - Internal Network Block: By default,
grpc://commands cannot target internal IPs (10.x.x.x, 172.16-31.x.x, 192.168.x.x, 127.x.x.x, localhost) - Allowlist: Configure allowed commands via
PLUGIN_COMMAND_ALLOWLIST
Production Security
For production deployments:-
Disable Internal Network Access:
-
Use Allowlist:
-
Use OCI with Signed Images:
- Sign images with Cosign or Notary
- Verify signatures before deployment
- Use content trust
-
Principle of Least Privilege:
- Run plugins with minimal permissions
- Use read-only filesystems where possible
- Implement network policies in Kubernetes
Troubleshooting
Plugin Not Loading
Plugin Not Loading
Symptoms: Plugin shows as inactive, errors in logsSolutions:
- Verify plugin binary has execute permissions (
chmod +x) - Check absolute path is correct for
file:// - Verify network connectivity for
grpc:// - Check registry authentication for
oci:// - Review plugin logs for initialization errors
Permission Denied
Permission Denied
Symptoms: “Permission denied” error when loading pluginSolutions:
Network Connection Errors
Network Connection Errors
Symptoms: “connection refused”, “no route to host” for
grpc://Solutions:- Verify plugin server is running:
telnet plugin-host 50051 - Check firewall rules
- Verify Kubernetes service is created
- Check DNS resolution
- Enable internal network access if needed (development only)
OCI Pull Failures
OCI Pull Failures
Symptoms: “Failed to pull image”, “authentication required”Solutions:
- Verify registry URL is correct
- Check credentials are configured
- Test manual pull:
docker pull registry.example.com/plugins/my-plugin:v1.0.0 - Check registry permissions
- Verify image exists with correct tag
Plugin Crashes on Start
Plugin Crashes on Start
Symptoms: Plugin loads but immediately crashesSolutions:
- Check plugin logs for panics
- Verify Go version compatibility
- Check for missing dependencies
- Test plugin standalone:
./my-plugin - Review initialization code for errors
Best Practices
Development Workflow
- Local Development: Use
file://for fast iteration - Reload Loop: Use
POST /api/v1/plugins/{id}/reloadto test changes instantly - Testing: Deploy to staging with
grpc://oroci:// - Production: Use
oci://with versioned tags
Version Management
- Use semantic versioning
- Tag releases in Git and OCI registry
- Never reuse tags (immutable releases)
- Document breaking changes
Deployment Pipeline
Expandable
Monitoring
- Monitor plugin health via
/api/v1/plugins/{id}/health - Track plugin performance metrics
- Set up alerts for plugin failures
- Log all plugin operations