A Kubernetes Mutating Admission Webhook for automatic P2P capability injection in Dragonfly. This project simplifies Kubernetes Pod configuration by automating the injection of Dragonfly's P2P proxy settings, dfdaemon socket mounts, and CLI tools through annotation-based policies.
Refer to the documentation for more details.
kubectl apply -f https://raw.githubusercontent.com/dragonflyoss/dragonfly-injector/main/dist/install.yamlThere are two ways to configure the injector:
Method 1: Edit the configuration file directly
Before kubectl apply, edit the ConfigMap named dragonfly-injector-inject-config in dist/install.yaml.
Method 2: Use kubectl to edit the config
After kubectl apply, you can edit the ConfigMap named dragonfly-injector-inject-config in dragonfly-injector-system namespace.
kubectl -n dragonfly-injector-system edit configmap dragonfly-injector-inject-configDefault configuration (reload time: 15s):
config.yaml: |
enable: true # Whether to enable injection
proxy_port: 4001 # The proxy port of Dragonfly Dfdaemon
cli_tools_image: dragonflyoss/toolkits:latest # The image used for injection
cli_tools_dir_path: /dragonfly-tools # The tools directory path in the imageFor more details, please refer to the docs/install.md.