docs(en): upgrade docs (#673)

Signed-off-by: cndoit18 <cndoit18@outlook.com>
This commit is contained in:
cndoit18 2021-10-22 11:36:36 +08:00 committed by Gaius
parent 46d4926227
commit c849e87efd
No known key found for this signature in database
GPG Key ID: 8B4E5D1290FA2FFB
46 changed files with 775 additions and 639 deletions

View File

@ -55,11 +55,6 @@ Dragonfly is now hosted by the Cloud Native Computing Foundation (CNCF) as an In
**Dfget:** The client of Dragonfly used for downloading files. It's similar to wget. **Dfget:** The client of Dragonfly used for downloading files. It's similar to wget.
## Getting Started
- [Quick Start][quickstart]
- [Installation][installation]
## Documentation ## Documentation
You can find the full documentation [on the repo][document]. You can find the full documentation [on the repo][document].
@ -84,8 +79,6 @@ Please refer to our [Code of Conduct][codeconduct].
[arch]: docs/en/images/arch.png [arch]: docs/en/images/arch.png
[logo-linear]: docs/en/images/logo/dragonfly-linear.svg [logo-linear]: docs/en/images/logo/dragonfly-linear.svg
[quickstart]: docs/en/user-guide/quick-start.md
[installation]: docs/en/user-guide/install/README.md
[website]: https://d7y.io [website]: https://d7y.io
[discussion]: https://github.com/dragonflyoss/Dragonfly2/discussions [discussion]: https://github.com/dragonflyoss/Dragonfly2/discussions
[contributing]: CONTRIBUTING.md [contributing]: CONTRIBUTING.md

View File

@ -1,85 +1,31 @@
# Dragonfly Document # Dragonfly Document
Dragonfly Document is written, drawn, memorialized representation of all things about Dragonfly. For those who are generally interested in Dragonfly, README.md of this repo is sufficient. While for end users, all details contained in `/docs` is the best guide all should have. And for developers, contents in [Developer Guide](#Developer Guide) part is that all need. Dragonfly Document is written, drawn, memorialized representation of all things about Dragonfly. For those who are generally interested in Dragonfly, README.md of this repo is sufficient. While for end users, all details contained in `/docs` is the best guide all should have. And for developers, contents in [Developer Guide](developer-guide/developer-guide.md) part is that all need.
Organization of document is as following: Organization of document is as following:
* [Quick Start](#Quick-Start) * [Quick Start](quick-start.md)
* [User Guide](#User-Guide) * [Design](design/README.md)
* [CLI Reference](#CLI-Reference) * [architecture](design/architecture.md)
* [dfget](cli-reference/dfget.md) * [manager](design/manager.md)
* [cdn](cli-reference/cdn.md) * [TODO scheduler](design/scheduler.md)
* [scheduler](cli-reference/scheduler.md) * [TODO cdn](design/cdn.md)
* [manager](cli-reference/manager.md) * [TODO dfdaemon](desigin/dfdaemon.md)
* [API Reference](#API-Reference) * [Deployment](deployment/README.md)
* [Ecosystem](#Ecosystem) * [Installation](deployment/installation)
* [Kubernetes Integration](ecosystem/Kubernetes-with-Dragonfly.md) * [Configuration](deployment/configuration)
* [WIP Harbor Integration](ecosystem/Harbor-with-Dragonfly.md) * [CLI Reference](cli-reference/README.md)
* [Developer Guide](#Developer-Guide) * [dfget](cli-reference/dfget.md)
* [Design Doc](#Design-Doc) * [cdn](cli-reference/cdn.md)
* [Test Guide](#Test-Guide) * [scheduler](cli-reference/scheduler.md)
* [manager](cli-reference/manager.md)
## How to Contribute Document * [Runtime Integration](runtime-integration/README.md)
* [containerd](runtime-integration/containerd.md)
Find `WIP` or `TODO` in this page and follow [CONTRIBUTING](../../CONTRIBUTING.md). * [cri-o](runtime-integration/cri-o.md)
* [docker](runtime-integration/docker.md)
## Quick Start * [Preheat](preheat/README.md)
* [Console](preheat/console.md)
[Quick Started](user-guide/quick-start.md) is exactly what you need if you would give Dragonfly a try. This document includes what are the * [Api](preheat/api.md)
prerequisites, * [Developer Guide](developer-guide/developer-guide.md)
how to install Dragonfly and how to experience Dragonfly's usage. * [Test Guide](test-guide/test-guide.md)
* [API Reference](api-reference/api-reference.md)
## User Guide
[User Guide](user-guide) helps all kinds of guidance end users need to experience Dragonfly. Not only the very brief [Quick Start]
(user-guide/quick-start.md), but the detailed binary installation and configure illustration. In addition, any concept and function which help users
understand Dragonfly better would be included as well.
## CLI Reference
For almost all users, commandline is the first reference you may need. Document in directory [CLI Reference](cli-reference) is about command detailed usage of Dragonfly CLI including `dfget`, `cdn`, `scheduler` and `manager`. You can get introductions, synopsis, examples, options about command. Last but not least, Dragonfly can guarantee commandline docs is strongly consistent with Dragonfly CLI's source code. What's more, all commandline docs are auto generated via source code.
## API Reference
Commandline is the easiest way to experience Dragonfly's ability. API extension will bring more further experience of Dragonfly. Commandline is just one
kind of combination usage of API, if you wish to hack or take more advantages of Dragonfly, please see [API Reference](/api/README.md). Like command line
document, all API docs are auto generated via source code.
## Ecosystem
Ecosystem documents show connections between Dragonfly and popular tool or system in cloud native ecosystem. They guide end users how to experience cloud
native systems with Dragonfly, such as other CNCF project [Kubernetes](ecosystem/Kubernetes-with-Dragonfly.md) and [Harbor](ecosystem/Harbor-with-Dragonfly.md).
## Developer Guide
[Develop Guide](development/local.md) helps (potential) developers/contributors to understand the theory inside Dragonfly rather than the interface it exposes. With
better understanding of how Dragonfly is designed, developer could learn source code of Dragonfly much easier and know how to debug, test and hack.
### Design Doc
[Design Doc](./design/architecture.md) is content all about design of Dragonfly. It includes all things taken into consideration at the very beginning, the
architecture designed for all components in Dragonfly, the interactive workflow between components, all APIs in Dragonfly and some technical things else.
### Test Guide
[Test Guide](./test-guide/test-guide.md) is the best reference helping contributors get aware of how to setup testing environment and do it. Currently we can divide test of Dragonfly into four dimensions:
* unit test;
* API integration test;
* CLI integration test;
* node e2e test.
For more details, please refer to [test](./test-guide/test-guide.md).
## Conclusion
The folder `/docs` does not contain all the document about Dragonfly. There are still other really helpful documents in other path of this repo, like:
* [TODO FAQ.md](./FAQ.md)
* [CHANGELOG.md](../../CHANGELOG.md)
* [TODO ROADMAP.md](./ROADMAP.md)
* others.
If you are searching some document and find no one, please do not hesitate to [file an ISSUE](https://github.com/dragonflyoss/Dragonfly2/issues/new/choose) for help. In addition, if you found that there are some incorrect places or typos in document, please help submit a pull request to correct that.

View File

@ -1,4 +1,8 @@
# Dragonfly Manager # API Reference
Commandline is the easiest way to experience Dragonfly's ability. API extension will bring more further experience of Dragonfly. Commandline is just one kind of combination usage of API, if you wish to hack or take more advantages of Dragonfly, please see `API Reference`. Like command line document, all API docs are auto generated via source code.
## Dragonfly Manager
<a name="overview"></a> <a name="overview"></a>

View File

@ -0,0 +1,10 @@
# CLI Reference
For almost all users, commandline is the first reference you may need. Document in directory `CLI Reference` is about command detailed usage of Dragonfly CLI including `dfget`, `cdn`, `scheduler` and `manager`. You can get introductions, synopsis, examples, options about command. Last but not least, Dragonfly can guarantee commandline docs is strongly consistent with Dragonfly CLI's source code. What's more, all commandline docs are auto generated via source code.
Table of contents:
* [dfget](dfget.md)
* [cdn](cdn.md)
* [scheduler](scheduler.md)
* [manager](manager.md)

View File

@ -0,0 +1,14 @@
# Deployment
Table of contents:
* [installation](installation/README.md)
* [configuration](configuration)
## Installation
Installation documents provide you with several options available to deploy the Dragonfly, such as [Kubernetes](installation/kubernetes/README.md) and [Docker](installation/docker/README.md).
## Configuration
[Configuration](configuration) is content all about customizing the Dragonfly. It includes information about the configuration of all components and their corresponding explanations.

View File

@ -0,0 +1,7 @@
# Installation
Table of contents:
* [docker](docker/README.md)
* [executable-files](executable-files/README.md)
* [kubernetes](kubernetes/README.md)

View File

@ -0,0 +1,8 @@
# Installation
There are two installation methods, it is recommended to use docker-compose to install as a whole, or install separately according to modules.
Table of contents:
* [Docker Compose](docker-compose.md)
* [Standalone](standalone/README.md)

View File

@ -0,0 +1 @@
# WIP Docker-Compose Support

View File

@ -0,0 +1,20 @@
# Installation
There are two installation methods, it is recommended to use helm charts to install as a whole, or install separately according to modules
## Install with Helm Charts
> ArtifactHub Link: https://artifacthub.io/packages/helm/dragonfly/dragonfly
It is recommended to use helm charts for installation, which is a simple and quick installation. [Kubernetes-with-Dragonfly](../../kubernetes/README.md) is the installation instructions of dragonfly.
## Install separately
* [install-client](./dfdaemon.md) is the installation instructions of dfdaemon
* [install-manager](./manager.md) is the installation instructions of manager
* [install-scheduler](./scheduler.md) is the installation instructions of scheduler
* [install-cdn](./cdn.md) is the installation instructions of CDN

View File

@ -0,0 +1,67 @@
# Installing Dragonfly CDN Server
This topic explains how to install the Dragonfly CDN server.
## Prerequisites
When deploying with Docker, the following conditions must be met.
Required Software | Version Limit
---|---
Git|1.9.1+
Docker|1.12.0+
## Procedure - When Deploying with Docker
### Get cdn image
You can get it from [DockerHub](https://hub.docker.com/) directly.
1. Obtain the latest Docker image of the cdn.
```sh
docker pull dragonflyoss/cdn
```
Or you can build your own cdn image.
1. Obtain the source code of Dragonfly.
```sh
git clone https://github.com/dragonflyoss/Dragonfly2.git
```
2. Enter the project directory.
```sh
cd Dragonfly2
```
3. Build the Docker image.
```sh
TAG="2.0.0"
make docker-build-cdn D7Y_VERSION=$TAG
```
4. Obtain the latest Docker image ID of the cdn.
```sh
docker image ls | grep 'cdn' | awk '{print $3}' | head -n1
```
### Start cdn
**NOTE:** Replace ${cdnDockerImageId} with the ID obtained at the previous step.
```sh
docker run -d --name cdn --restart=always -p 8001:8001 -p 8003:8003 -v /home/admin/ftp:/home/admin/ftp ${cdnDockerImageId}
--download-port=8001
```
After cdn is installed, run the following commands to verify if Nginx and **cdn** are started, and if Port `8001` and `8003` are available.
```sh
telnet 127.0.0.1 8001
telnet 127.0.0.1 8003
```

View File

@ -0,0 +1,67 @@
# Installing Dragonfly Dfdaemon Server
This topic explains how to install the Dragonfly dfdaemon server.
## Prerequisites
When deploying with Docker, the following conditions must be met.
Required Software | Version Limit
---|---
Git|1.9.1+
Docker|1.12.0+
## Procedure - When Deploying with Docker
### Get dfdaemon image
You can get it from [DockerHub](https://hub.docker.com/) directly.
1. Obtain the latest Docker image of the dfdaemon.
```sh
docker pull dragonflyoss/dfdaemon
```
Or you can build your own dfdaemon image.
1. Obtain the source code of Dragonfly.
```sh
git clone https://github.com/dragonflyoss/Dragonfly2.git
```
2. Enter the project directory.
```sh
cd Dragonfly2
```
3. Build the Docker image.
```sh
TAG="2.0.0"
make docker-build-dfdaemon D7Y_VERSION=$TAG
```
4. Obtain the latest Docker image ID of the dfdaemon.
```sh
docker image ls | grep 'dfdaemon' | awk '{print $3}' | head -n1
```
### Start dfdaemon
**NOTE:** Replace ${dfdaemonDockerImageId} with the ID obtained at the previous step.
```sh
docker run -d --name dfdaemon --restart=always -p 65000:65000 -p 65001:65001 -p 65002:65002 ${dfdaemonDockerImageId} daemon
```
After dfget is installed, run the following commands to verify if **dfdaemon** is started, and if Port `65000`, `65001` and `65002` is available.
```sh
telnet 127.0.0.1 65000
telnet 127.0.0.1 65001
telnet 127.0.0.1 65002
```

View File

@ -0,0 +1,72 @@
# Installing Dragonfly Manager Server
This topic explains how to install the Dragonfly manager server.
## Prerequisites
When deploying with Docker, the following conditions must be met.
Required Software | Version Limit
---|---
Git|1.9.1+
Docker|1.12.0+
## Procedure - When Deploying with Docker
### Get manager image
You can get it from [DockerHub](https://hub.docker.com/) directly.
1. Obtain the latest Docker image of the manager.
```sh
docker pull d7yio/manager
```
Or you can build your own manager image.
1. Obtain the source code of Dragonfly.
```sh
git clone https://github.com/dragonflyoss/Dragonfly2.git
```
2. Enter the project directory.
```sh
cd Dragonfly2
```
3. Build the Docker image.
```sh
TAG="2.0.0"
make docker-build-manager D7Y_VERSION=$TAG
```
4. Obtain the latest Docker image ID of the manager.
```sh
docker image ls | grep 'manager' | awk '{print $3}' | head -n1
```
### Start manager
**NOTE:** Replace ${managerDockerImageId} with the ID obtained at the previous step.
```sh
docker run -d --name manager --restart=always -p 8080:8080 -p 65003:65003 ${managerDockerImageId}
```
After manager is installed, run the following commands to verify if **manager** is started, and if Port `8080` and `65003` is available.
```sh
telnet 127.0.0.1 8080
telnet 127.0.0.1 65003
```
### Manager console
Now you can open brower and visit [console](http://localhost:8080)
Console features preview reference document [console preview](../../../../design/manager.md).

View File

@ -0,0 +1,65 @@
# Installing Dragonfly Scheduler Server
This topic explains how to install the Dragonfly scheduler server.
## Prerequisites
When deploying with Docker, the following conditions must be met.
Required Software | Version Limit
---|---
Git|1.9.1+
Docker|1.12.0+
## Procedure - When Deploying with Docker
### Get scheduler image
You can get it from [DockerHub](https://hub.docker.com/) directly.
1. Obtain the latest Docker image of the scheduler.
```sh
docker pull dragonflyoss/scheduler
```
Or you can build your own scheduler image.
1. Obtain the source code of Dragonfly.
```sh
git clone https://github.com/dragonflyoss/Dragonfly2.git
```
2. Enter the project directory.
```sh
cd Dragonfly2
```
3. Build the Docker image.
```sh
TAG="2.0.0"
make docker-build-scheduler D7Y_VERSION=$TAG
```
4. Obtain the latest Docker image ID of the scheduler.
```sh
docker image ls | grep 'scheduler' | awk '{print $3}' | head -n1
```
### Start scheduler
**NOTE:** Replace ${schedulerDockerImageId} with the ID obtained at the previous step.
```sh
docker run -d --name scheduler --restart=always -p 8002:8002 ${schedulerDockerImageId}
```
After scheduler is installed, run the following commands to verify if **scheduler** is started, and if Port `8002` is available.
```sh
telnet 127.0.0.1 8002
```

View File

@ -0,0 +1,13 @@
# Installation
There are installation methods to install the executable files separately according to the modules.
## Install separately
* [install-client](dfdaemon.md) is the installation instructions of dfdaemon
* [install-manager](manager.md) is the installation instructions of manager
* [install-scheduler](scheduler.md) is the installation instructions of scheduler
* [install-cdn](cdn.md) is the installation instructions of CDN

View File

@ -2,22 +2,8 @@
This topic explains how to install the Dragonfly CDN server. This topic explains how to install the Dragonfly CDN server.
## Context
Install CDN in one of the following ways:
- Deploying with Docker.
- Deploying with physical machines: Recommended for production usage.
## Prerequisites ## Prerequisites
When deploying with Docker, the following conditions must be met.
Required Software | Version Limit
---|---
Git|1.9.1+
Docker|1.12.0+
When deploying with physical machines, the following conditions must be met. When deploying with physical machines, the following conditions must be met.
Required Software | Version Limit Required Software | Version Limit
@ -26,61 +12,6 @@ Git|1.9.1+
Golang|1.12.x Golang|1.12.x
Nginx|0.8+ Nginx|0.8+
## Procedure - When Deploying with Docker
### Get cdn image
You can get it from [DockerHub](https://hub.docker.com/) directly.
1. Obtain the latest Docker image of the cdn.
```sh
docker pull dragonflyoss/cdn
```
Or you can build your own cdn image.
1. Obtain the source code of Dragonfly.
```sh
git clone https://github.com/dragonflyoss/Dragonfly2.git
```
2. Enter the project directory.
```sh
cd Dragonfly2
```
3. Build the Docker image.
```sh
TAG="2.0.0"
make docker-build-cdn D7Y_VERSION=$TAG
```
4. Obtain the latest Docker image ID of the cdn.
```sh
docker image ls | grep 'cdn' | awk '{print $3}' | head -n1
```
### Start cdn
**NOTE:** Replace ${cdnDockerImageId} with the ID obtained at the previous step.
```sh
docker run -d --name cdn --restart=always -p 8001:8001 -p 8003:8003 -v /home/admin/ftp:/home/admin/ftp ${cdnDockerImageId}
--download-port=8001
```
After cdn is installed, run the following commands to verify if Nginx and **cdn** are started, and if Port `8001` and `8003` are available.
```sh
telnet 127.0.0.1 8001
telnet 127.0.0.1 8003
```
## Procedure - When Deploying with Physical Machines ## Procedure - When Deploying with Physical Machines
### Get cdn executable file ### Get cdn executable file

View File

@ -2,84 +2,14 @@
This topic explains how to install the Dragonfly dfdaemon server. This topic explains how to install the Dragonfly dfdaemon server.
## Context
Install dfdaemon in one of the following ways:
- Deploying with Docker: Recommended for production usage.
- Deploying with physical machines.
## Prerequisites ## Prerequisites
When deploying with Docker, the following conditions must be met.
Required Software | Version Limit
---|---
Git|1.9.1+
Docker|1.12.0+
When deploying with physical machines, the following conditions must be met. When deploying with physical machines, the following conditions must be met.
Required Software | Version Limit Required Software | Version Limit
---|--- ---|---
Git|1.9.1+ Git|1.9.1+
Golang|1.12.x Golang|1.12.x
Nginx|0.8+
## Procedure - When Deploying with Docker
### Get dfdaemon image
You can get it from [DockerHub](https://hub.docker.com/) directly.
1. Obtain the latest Docker image of the dfdaemon.
```sh
docker pull dragonflyoss/dfdaemon
```
Or you can build your own dfdaemon image.
1. Obtain the source code of Dragonfly.
```sh
git clone https://github.com/dragonflyoss/Dragonfly2.git
```
2. Enter the project directory.
```sh
cd Dragonfly2
```
3. Build the Docker image.
```sh
TAG="2.0.0"
make docker-build-dfdaemon D7Y_VERSION=$TAG
```
4. Obtain the latest Docker image ID of the dfdaemon.
```sh
docker image ls | grep 'dfdaemon' | awk '{print $3}' | head -n1
```
### Start dfdaemon
**NOTE:** Replace ${dfdaemonDockerImageId} with the ID obtained at the previous step.
```sh
docker run -d --name dfdaemon --restart=always -p 65000:65000 -p 65001:65001 -p 65002:65002 ${dfdaemonDockerImageId} daemon
```
After dfget is installed, run the following commands to verify if **dfdaemon** is started, and if Port `65000`, `65001` and `65002` is available.
```sh
telnet 127.0.0.1 65000
telnet 127.0.0.1 65001
telnet 127.0.0.1 65002
```
## Procedure - When Deploying with Physical Machines ## Procedure - When Deploying with Physical Machines

View File

@ -2,22 +2,8 @@
This topic explains how to install the Dragonfly manager server. This topic explains how to install the Dragonfly manager server.
## Context
Install manager in one of the following ways:
- Deploying with Docker: Recommended for production usage.
- Deploying with physical machines.
## Prerequisites ## Prerequisites
When deploying with Docker, the following conditions must be met.
Required Software | Version Limit
---|---
Git|1.9.1+
Docker|1.12.0+
When deploying with physical machines, the following conditions must be met. When deploying with physical machines, the following conditions must be met.
Required Software | Version Limit Required Software | Version Limit
@ -26,69 +12,9 @@ Git|1.9.1+
Golang|1.12.x Golang|1.12.x
Nginx|0.8+ Nginx|0.8+
## Procedure - When Deploying with Docker
### Get manager image
You can get it from [DockerHub](https://hub.docker.com/) directly.
1. Obtain the latest Docker image of the manager.
```sh
docker pull d7yio/manager
```
Or you can build your own manager image.
1. Obtain the source code of Dragonfly.
```sh
git clone https://github.com/dragonflyoss/Dragonfly2.git
```
2. Enter the project directory.
```sh
cd Dragonfly2
```
3. Build the Docker image.
```sh
TAG="2.0.0"
make docker-build-manager D7Y_VERSION=$TAG
```
4. Obtain the latest Docker image ID of the manager.
```sh
docker image ls | grep 'manager' | awk '{print $3}' | head -n1
```
### Start manager
**NOTE:** Replace ${managerDockerImageId} with the ID obtained at the previous step.
```sh
docker run -d --name manager --restart=always -p 8080:8080 -p 65003:65003 ${managerDockerImageId}
```
After manager is installed, run the following commands to verify if **manager** is started, and if Port `8080` and `65003` is available.
```sh
telnet 127.0.0.1 8080
telnet 127.0.0.1 65003
```
### Manager console
Now you can open brower and visit [console](http://localhost:8080)
Console features preview reference document [console preview](../../user-guide/console/preview.md).
## Procedure - When Deploying with Physical Machines ## Procedure - When Deploying with Physical Machines
### Get cdn executable file ### Get manager executable file
1. Download a binary package of the manager. You can download one of the latest builds for Dragonfly on the [github releases page](https://github. 1. Download a binary package of the manager. You can download one of the latest builds for Dragonfly on the [github releases page](https://github.
com/dragonflyoss/Dragonfly2/releases). com/dragonflyoss/Dragonfly2/releases).
@ -144,4 +70,4 @@ telnet 127.0.0.1 65003
Now you can open brower and visit [console](http://localhost:8080) Now you can open brower and visit [console](http://localhost:8080)
Console features preview reference document [console preview](../../user-guide/console/preview.md). Console features preview reference document [console preview](../../../design/manager.md).

View File

@ -2,22 +2,8 @@
This topic explains how to install the Dragonfly scheduler server. This topic explains how to install the Dragonfly scheduler server.
## Context
Install scheduler in one of the following ways:
- Deploying with Docker: Recommended for production usage.
- Deploying with physical machines.
## Prerequisites ## Prerequisites
When deploying with Docker, the following conditions must be met.
Required Software | Version Limit
---|---
Git|1.9.1+
Docker|1.12.0+
When deploying with physical machines, the following conditions must be met. When deploying with physical machines, the following conditions must be met.
Required Software | Version Limit Required Software | Version Limit
@ -26,59 +12,6 @@ Git|1.9.1+
Golang|1.12.x Golang|1.12.x
Nginx|0.8+ Nginx|0.8+
## Procedure - When Deploying with Docker
### Get scheduler image
You can get it from [DockerHub](https://hub.docker.com/) directly.
1. Obtain the latest Docker image of the scheduler.
```sh
docker pull dragonflyoss/scheduler
```
Or you can build your own scheduler image.
1. Obtain the source code of Dragonfly.
```sh
git clone https://github.com/dragonflyoss/Dragonfly2.git
```
2. Enter the project directory.
```sh
cd Dragonfly2
```
3. Build the Docker image.
```sh
TAG="2.0.0"
make docker-build-scheduler D7Y_VERSION=$TAG
```
4. Obtain the latest Docker image ID of the scheduler.
```sh
docker image ls | grep 'scheduler' | awk '{print $3}' | head -n1
```
### Start scheduler
**NOTE:** Replace ${schedulerDockerImageId} with the ID obtained at the previous step.
```sh
docker run -d --name scheduler --restart=always -p 8002:8002 ${schedulerDockerImageId}
```
After scheduler is installed, run the following commands to verify if **scheduler** is started, and if Port `8002` is available.
```sh
telnet 127.0.0.1 8002
```
## Procedure - When Deploying with Physical Machines ## Procedure - When Deploying with Physical Machines
### Get scheduler executable file ### Get scheduler executable file

View File

@ -0,0 +1,10 @@
# Kubernetes with Dragonfly
Now we can deploy all components of Dragonfly in Kubernetes cluster. We deploy scheduler and cdn as `StatefulSets`,
daemon as `DaemonSets`, manager as `Deployments`.
Table of contents:
* [Helm](helm.md)
* [Kustomize](kustomize.md)
* [TODO Upgrade Guide](upgrade-guide.md)

View File

@ -1,21 +1,10 @@
# Kubernetes with Dragonfly # Helm Support
Now we can deploy all components of Dragonfly in Kubernetes cluster. We deploy scheduler and cdn as `StatefulSets`, ## Runtime Configuration Guide for Dragonfly Helm Chart
daemon as `DaemonSets`, manager as `Deployments`.
Table of contents:
* [Helm](#helm-support)
* [Kustomize](#kustomize-support)
* [TODO Upgrade Guide](#upgrade-guide)
## Helm Support
### Runtime Configuration Guide for Dragonfly Helm Chart
When enable runtime configuration in dragonfly, you can skip [Configure Runtime](#configure-runtime-manually) manually. When enable runtime configuration in dragonfly, you can skip [Configure Runtime](#configure-runtime-manually) manually.
#### 1. Docker ### 1. Docker
> **We did not recommend to using dragonfly with docker in Kubernetes** due to many reasons: 1. no fallback image pulling policy. 2. deprecated in Kubernetes. > **We did not recommend to using dragonfly with docker in Kubernetes** due to many reasons: 1. no fallback image pulling policy. 2. deprecated in Kubernetes.
> Because the original `daemonset` in Kubernetes did not support `Surging Rolling Update` policy. > Because the original `daemonset` in Kubernetes did not support `Surging Rolling Update` policy.
@ -84,7 +73,7 @@ Limitations:
* Need restart docker daemon * Need restart docker daemon
* When upgrade dfdaemon, new image must be pulled beforehand. * When upgrade dfdaemon, new image must be pulled beforehand.
#### 2. Containerd ### 2. Containerd
The config of containerd has two version with complicated fields. These are many cases to consider: The config of containerd has two version with complicated fields. These are many cases to consider:
@ -143,7 +132,7 @@ containerRuntime:
enable: true enable: true
``` ```
#### 3. [WIP] CRI-O ### 3. [WIP] CRI-O
> DON'T USE, Work in progress > DON'T USE, Work in progress
@ -163,21 +152,21 @@ containerRuntime:
- "https://harbor.example.com:8443" - "https://harbor.example.com:8443"
``` ```
### Prepare Kubernetes Cluster ## Prepare Kubernetes Cluster
If there is no available Kubernetes cluster for testing, [minikube](https://minikube.sigs.k8s.io/docs/start/) is If there is no available Kubernetes cluster for testing, [minikube](https://minikube.sigs.k8s.io/docs/start/) is
recommended. Just run `minikube start`. recommended. Just run `minikube start`.
### Install Dragonfly ## Install Dragonfly
#### Install with default configuration ### Install with default configuration
```shell ```shell
helm repo add dragonfly https://dragonflyoss.github.io/helm-charts/ helm repo add dragonfly https://dragonflyoss.github.io/helm-charts/
helm install --create-namespace --namespace dragonfly-system dragonfly dragonfly/dragonfly helm install --create-namespace --namespace dragonfly-system dragonfly dragonfly/dragonfly
``` ```
#### Install with custom configuration ### Install with custom configuration
Create the `values.yaml` configuration file. It is recommended to use external redis and mysql instead of containers. Create the `values.yaml` configuration file. It is recommended to use external redis and mysql instead of containers.
@ -211,7 +200,7 @@ helm repo add dragonfly https://dragonflyoss.github.io/helm-charts/
helm install --create-namespace --namespace dragonfly-system dragonfly dragonfly/dragonfly -f values.yaml helm install --create-namespace --namespace dragonfly-system dragonfly dragonfly/dragonfly -f values.yaml
``` ```
#### Install with an existing manager ### Install with an existing manager
Create the `values.yaml` configuration file. Need to configure the cluster id associated with scheduler and cdn. Create the `values.yaml` configuration file. Need to configure the cluster id associated with scheduler and cdn.
@ -250,7 +239,7 @@ mysql:
enable: false enable: false
``` ```
### Wait Dragonfly Ready ## Wait Dragonfly Ready
Wait all pods running Wait all pods running
@ -258,19 +247,19 @@ Wait all pods running
kubectl -n dragonfly-system wait --for=condition=ready --all --timeout=10m pod kubectl -n dragonfly-system wait --for=condition=ready --all --timeout=10m pod
``` ```
### Manager Console ## Manager Console
The console page will be displayed on `dragonfly-manager.dragonfly-system.svc.cluster.local:8080`. The console page will be displayed on `dragonfly-manager.dragonfly-system.svc.cluster.local:8080`.
If you need to bind Ingress, you can refer to [configuration options](https://artifacthub.io/packages/helm/dragonfly/dragonfly#values) of Helm Charts, or create it manually. If you need to bind Ingress, you can refer to [configuration options](https://artifacthub.io/packages/helm/dragonfly/dragonfly#values) of Helm Charts, or create it manually.
Console features preview reference document [console preview](../user-guide/console/preview.md). Console features preview reference document [console preview](../../../design/manager.md).
### Configure Runtime Manually ## Configure Runtime Manually
Use Containerd with CRI as example, more runtimes can be found [here](../user-guide/quick-start.md) Use Containerd with CRI as example, more runtimes can be found [here](../../../quick-start.md)
> This example is for single registry, multiple registries configuration is [here](../user-guide/registry-mirror/cri-containerd.md) > This example is for single registry, multiple registries configuration is [here](../../../container-runtimes)
For private registry: For private registry:
@ -296,7 +285,7 @@ Add above config to `/etc/containerd/config.toml` and restart Containerd
systemctl restart containerd systemctl restart containerd
``` ```
### Using Dragonfly ## Using Dragonfly
After all above steps, create a new pod with target registry. Or just pull an image with `crictl`: After all above steps, create a new pod with target registry. Or just pull an image with `crictl`:
@ -321,33 +310,3 @@ Example output:
``` ```
{"level":"info","ts":"2021-06-28 06:02:30.924","caller":"peer/peertask_stream_callback.go:77","msg":"stream peer task done, cost: 2838ms","peer":"172.17.0.9-1-ed7a32ae-3f18-4095-9f54-6ccfc248b16e","task":"3c658c488fd0868847fab30976c2a079d8fd63df148fb3b53fd1a418015723d7","component":"streamPeerTask"} {"level":"info","ts":"2021-06-28 06:02:30.924","caller":"peer/peertask_stream_callback.go:77","msg":"stream peer task done, cost: 2838ms","peer":"172.17.0.9-1-ed7a32ae-3f18-4095-9f54-6ccfc248b16e","task":"3c658c488fd0868847fab30976c2a079d8fd63df148fb3b53fd1a418015723d7","component":"streamPeerTask"}
``` ```
## Kustomize Support
### Prepare Kubernetes Cluster
If there is no available Kubernetes cluster for testing, [minikube](https://minikube.sigs.k8s.io/docs/start/) is
recommended. Just run `minikube start`.
### Build and Apply Kustomize Configuration
```shell
git clone https://github.com/dragonflyoss/Dragonfly2.git
kustomize build Dragonfly2/deploy/kustomize/single-cluster-native/overlays/sample | kubectl apply -f -
```
### Wait Dragonfly Ready
Wait all pods running
```shell
kubectl -n dragonfly-system wait --for=condition=ready --all --timeout=10m pod
```
### Next Steps
Following [Configure Runtime](#configure-runtime-manually) to configure runtime.
Following [Using Dragonfly](#using-dragonfly) to use Dragonfly.
## Upgrade Guide

View File

@ -0,0 +1,85 @@
# Kustomize Support
## Prepare Kubernetes Cluster
If there is no available Kubernetes cluster for testing, [minikube](https://minikube.sigs.k8s.io/docs/start/) is
recommended. Just run `minikube start`.
## Build and Apply Kustomize Configuration
```shell
git clone https://github.com/dragonflyoss/Dragonfly2.git
kustomize build Dragonfly2/deploy/kustomize/single-cluster-native/overlays/sample | kubectl apply -f -
```
## Wait Dragonfly Ready
Wait all pods running
```shell
kubectl -n dragonfly-system wait --for=condition=ready --all --timeout=10m pod
```
## Manager Console
The console page will be displayed on `dragonfly-manager.dragonfly-system.svc.cluster.local:8080`.
If you need to bind Ingress, you can refer to [configuration options](https://artifacthub.io/packages/helm/dragonfly/dragonfly#values) of Helm Charts, or create it manually.
Console features preview reference document [console preview](../../../design/manager.md).
## Configure Runtime Manually
Use Containerd with CRI as example, more runtimes can be found [here](../../../quick-start.md)
> This example is for single registry, multiple registries configuration is [here](../../../container-runtimes)
For private registry:
```toml
# explicitly use v2 config format, if already v2, skip the "version = 2"
version = 2
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."harbor.example.com"]
endpoint = ["http://127.0.0.1:65001", "https://harbor.example.com"]
```
For docker public registry:
```toml
# explicitly use v2 config format, if already v2, skip the "version = 2"
version = 2
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["http://127.0.0.1:65001", "https://registry-1.docker.io"]
```
Add above config to `/etc/containerd/config.toml` and restart Containerd
```shell
systemctl restart containerd
```
## Using Dragonfly
After all above steps, create a new pod with target registry. Or just pull an image with `crictl`:
```shell
crictl harbor.example.com/library/alpine:latest
```
```shell
crictl pull docker.io/library/alpine:latest
```
After pulled images, find logs in dfdaemon pod:
```shell
# find pods
kubectl -n dragonfly-system get pod -l component=dfdaemon
# find logs
pod_name=dfdaemon-xxxxx
kubectl -n dragonfly-system exec -it ${pod_name} -- grep "peer task done" /var/log/dragonfly/daemon/core.log
```
Example output:
```
{"level":"info","ts":"2021-06-28 06:02:30.924","caller":"peer/peertask_stream_callback.go:77","msg":"stream peer task done, cost: 2838ms","peer":"172.17.0.9-1-ed7a32ae-3f18-4095-9f54-6ccfc248b16e","task":"3c658c488fd0868847fab30976c2a079d8fd63df148fb3b53fd1a418015723d7","component":"streamPeerTask"}
```

View File

@ -0,0 +1 @@
# WIP Upgrade guide

11
docs/en/design/README.md Normal file
View File

@ -0,0 +1,11 @@
# Design
Design is content all about design of Dragonfly. It includes all things taken into consideration at the very beginning, the architecture designed for all components in Dragonfly, the interactive workflow between components, all APIs in Dragonfly and some technical things else.
Table of contents:
* [architecture](architecture.md)
* [manager](manager.md)
* [TODO scheduler](scheduler.md)
* [TODO cdn](cdn.md)
* [TODO dfdaemon](dfdaemon.md)

View File

@ -1,6 +1,7 @@
# Product Thinking and Design # Product Thinking and Design
## Positioning ## Positioning
Provide enterprise-level (efficient, stable, secure, low-cost, product-oriented) file distribution and management services, and become the cloud-native best practice and standard solution in this realm. Provide enterprise-level (efficient, stable, secure, low-cost, product-oriented) file distribution and management services, and become the cloud-native best practice and standard solution in this realm.
## What problems are solved ## What problems are solved
@ -36,17 +37,17 @@ Provide enterprise-level (efficient, stable, secure, low-cost, product-oriented)
### Entity relationship ### Entity relationship
![alt][association] ![alt][TODO association]
### Image file download process ### Image file download process
![alt][download-process] ![alt][TODO download-process]
### Sub-system architecture ### Sub-system architecture
#### CDN system #### CDN system
![cdn][cdn] ![cdn][TODO cdn]
### Sub-system function ### Sub-system function
@ -100,6 +101,3 @@ Provide enterprise-level (efficient, stable, secure, low-cost, product-oriented)
[arch]: ../images/arch.png [arch]: ../images/arch.png
[association]: ../../zh-CN/images/association.png
[download-process]: ../../zh-CN/images/download-process.png
[cdn]: ../../zh-CN/images/cdn.png

1
docs/en/design/cdn.md Normal file
View File

@ -0,0 +1 @@
# WIP CDN

View File

@ -0,0 +1 @@
# WIP Dfdaemon

View File

@ -1,4 +1,4 @@
# Manager Console # Manager
Used to manage the dynamic configuration that each module depends on, and provide keepalive and metrics functions. Used to manage the dynamic configuration that each module depends on, and provide keepalive and metrics functions.
@ -9,12 +9,12 @@ Used to manage the dynamic configuration that each module depends on, and provid
- Scheduler cluster and Scheduler instance have a `1:N` relationship - Scheduler cluster and Scheduler instance have a `1:N` relationship
<div align="center"> <div align="center">
<img src="../../images/manager-console/relationship.jpg" width="500" title="manager-relationship"> <img src="../images/manager-console/relationship.jpg" width="500" title="manager-relationship">
</div> </div>
When the Scheduler instance starts, it reports to the manager the Scheduler Cluster ID. Refer to [document](../../config/scheduler.yaml) to configure `schedulerClusterID`. When the Scheduler instance starts, it reports to the manager the Scheduler Cluster ID. Refer to [document](../deployment/configuration/scheduler.yaml) to configure `schedulerClusterID`.
When the CDN instance starts, it reports to the manager the CDN Cluster ID. Refer to [document](../../config/cdn.yaml) to configure `cdnClusterID`. When the CDN instance starts, it reports to the manager the CDN Cluster ID. Refer to [document](../deployment/configuration/cdn.yaml) to configure `cdnClusterID`.
## User account ## User account
@ -47,13 +47,13 @@ Default root username: `root` password: `dragonfly`.
##### Configure Scheduler Cluster ##### Configure Scheduler Cluster
<p align="center"> <p align="center">
<img width="500" height="500" src="../../images/manager-console/configure-scheduler-cluster.jpg"> <img width="500" height="500" src="../images/manager-console/configure-scheduler-cluster.jpg">
</p> </p>
##### Configure Scheduler Cluster's Client ##### Configure Scheduler Cluster's Client
<p align="center"> <p align="center">
<img width="500" height="500" src="../../images/manager-console/configure-scheduler-cluster-client.jpg"> <img width="500" height="500" src="../images/manager-console/configure-scheduler-cluster-client.jpg">
</p> </p>
- `load_limit`: client host can provide the maximum upload load. - `load_limit`: client host can provide the maximum upload load.
@ -71,18 +71,18 @@ Default root username: `root` password: `dragonfly`.
##### Configure CDN Cluster ##### Configure CDN Cluster
<p align="center"> <p align="center">
<img width="500" height="500" src="../../images/manager-console/configure-cdn-cluster.jpg"> <img width="500" height="500" src="../images/manager-console/configure-cdn-cluster.jpg">
</p> </p>
- `load_limit`: CDN host can provide the maximum upload load. - `load_limit`: CDN host can provide the maximum upload load.
[signin]: ../../images/manager-console/signin.jpg [signin]: ../images/manager-console/signin.jpg
[signup]: ../../images/manager-console/signup.jpg [signup]: ../images/manager-console/signup.jpg
[scheduler-cluster]: ../../images/manager-console/scheduler-cluster.jpg [scheduler-cluster]: ../images/manager-console/scheduler-cluster.jpg
[add-scheduler-cluster]: ../../images/manager-console/add-scheduler-cluster.jpg [add-scheduler-cluster]: ../images/manager-console/add-scheduler-cluster.jpg
[configure-scheduler-cluster]: ../../images/manager-console/configure-scheduler-cluster.jpg [configure-scheduler-cluster]: ../images/manager-console/configure-scheduler-cluster.jpg
[configure-scheduler-cluster-client]: ../../images/manager-console/configure-scheduler-cluster-client.jpg [configure-scheduler-cluster-client]: ../images/manager-console/configure-scheduler-cluster-client.jpg
[cdn-cluster]: ../../images/manager-console/cdn-cluster.jpg [cdn-cluster]: ../images/manager-console/cdn-cluster.jpg
[add-cdn-cluster]: ../../images/manager-console/add-cdn-cluster.jpg [add-cdn-cluster]: ../images/manager-console/add-cdn-cluster.jpg
[configure-cdn-cluster]: ../../images/manager-console/configure-cdn-cluster.jpg [configure-cdn-cluster]: ../images/manager-console/configure-cdn-cluster.jpg

View File

@ -0,0 +1 @@
# WIP Scheduler

View File

@ -1,3 +0,0 @@
# [WIP] Harbor with Dragonfly
This document will help you experience how to use dragonfly with harbor.

View File

@ -0,0 +1,8 @@
# Preheat
P2P provides two types of preheating: `image` and `file`. Users can be preheat in the `console` or directly call `preheat api` for preheating
Table of contents:
* [Console](console.md)
* [Api](api.md)

View File

@ -1,14 +1,6 @@
# Preheat # API
P2P provides two types of preheating: `image` and `file`. Users can be preheat in the `console` or directly call `preheat api` for preheating Use preheat apis for preheating. First create a POST request for preheating, you can refer to [create preheat api document](../api-reference/api-reference.md#create-preheat)
## Console
TODO
## API
Use preheat apis for preheating. First create a POST request for preheating, you can refer to [create preheat api document](../../api/api.md#create-preheat)
If the `scheduler_cluster_id` does not exist, it means to preheat all scheduler clusters. If the `scheduler_cluster_id` does not exist, it means to preheat all scheduler clusters.
@ -28,7 +20,7 @@ If the output of command above has content like
{"id":"group_28439e0b-d4c3-43bf-945e-482b54c49dc5","status":"PENDING","create_at":"2021-10-09T11:54:50.6182794Z"} {"id":"group_28439e0b-d4c3-43bf-945e-482b54c49dc5","status":"PENDING","create_at":"2021-10-09T11:54:50.6182794Z"}
``` ```
Polling the preheating status with id. if status is `SUCCESS`, preheating is successful, you can refer to [get preheat api document](../../api/api.md#get-preheat) Polling the preheating status with id. if status is `SUCCESS`, preheating is successful, you can refer to [get preheat api document](../api-reference/api-reference.md#get-preheat)
```bash ```bash
curl --request GET 'http://dragonfly-manager:8080/api/v1/preheats/group_28439e0b-d4c3-43bf-945e-482b54c49dc5' curl --request GET 'http://dragonfly-manager:8080/api/v1/preheats/group_28439e0b-d4c3-43bf-945e-482b54c49dc5'

View File

@ -0,0 +1 @@
# WIP console

102
docs/en/quick-start.md Normal file
View File

@ -0,0 +1,102 @@
# Dragonfly Quick Start
Dragonfly Quick Start document aims to help you to quick start Dragonfly journey. This experiment is quite easy and
simplified.
You can have a quick start following [Kubernetes-with-Dragonfly](./deployment/installation/kubernetes/README.md). We recommend to use `Containerd with CRI` and `CRI-O` client.
This table describes some container runtimes version and documents.
| Runtime | Version | Document | CRI Support | Pull Command |
| --- | --- | --- | --- | --- |
| Containerd without CRI | All | [Link](runtime-integration/containerd.md) | No | ctr image pull docker.io/library/alpine |
| Containerd with CRI | v1.1.0+ | [Link](runtime-integration/containerd.md) | Yes | crictl pull docker.io/library/alpine:latest |
| CRI-O | All | [Link](runtime-integration/cri-o.md) | Yes | crictl pull docker.io/library/alpine:latest |
## Runtime Configuration Guide for Dragonfly Helm Chart
Dragonfly helm supports config docker automatically.
Config cases:
**Implicit registries support**
Chart customize values.yaml:
```yaml
containerRuntime:
docker:
enable: true
# -- Inject domains into /etc/hosts to force redirect traffic to dfdaemon.
# Caution: This feature need dfdaemon to implement SNI Proxy, confirm image tag is greater than v0.4.0.
# When use certs and inject hosts in docker, no necessary to restart docker daemon.
injectHosts: true
registryDomains:
- "harbor.example.com"
- "harbor.example.net"
```
This config enables docker pulling images from registries `harbor.example.com` and `harbor.example.net` via Dragonfly.
When deploying Dragonfly with above config, it's unnecessary to restart docker daemon.
Limitations:
* Only support implicit registries
## Prepare Kubernetes Cluster
If there is no available Kubernetes cluster for testing, [minikube](https://minikube.sigs.k8s.io/docs/start/) is
recommended. Just run `minikube start`.
## Install Dragonfly
### Install with default configuration
```shell
helm repo add dragonfly https://dragonflyoss.github.io/helm-charts/
helm install --create-namespace --namespace dragonfly-system dragonfly dragonfly/dragonfly
```
## Wait Dragonfly Ready
Wait all pods running
```shell
kubectl -n dragonfly-system wait --for=condition=ready --all --timeout=10m pod
```
## Manager Console
The console page will be displayed on `dragonfly-manager.dragonfly-system.svc.cluster.local:8080`.
If you need to bind Ingress, you can refer to [configuration options](https://artifacthub.io/packages/helm/dragonfly/dragonfly#values) of Helm Charts, or create it manually.
Console features preview reference document [console preview](design/manager.md).
## Using Dragonfly
After all above steps, create a new pod with target registry. Or just pull an image with `crictl`:
```shell
crictl harbor.example.com/library/alpine:latest
```
```shell
crictl pull docker.io/library/alpine:latest
```
After pulled images, find logs in dfdaemon pod:
```shell
# find pods
kubectl -n dragonfly-system get pod -l component=dfdaemon
# find logs
pod_name=dfdaemon-xxxxx
kubectl -n dragonfly-system exec -it ${pod_name} -- grep "peer task done" /var/log/dragonfly/daemon/core.log
```
Example output:
```
{"level":"info","ts":"2021-06-28 06:02:30.924","caller":"peer/peertask_stream_callback.go:77","msg":"stream peer task done, cost: 2838ms","peer":"172.17.0.9-1-ed7a32ae-3f18-4095-9f54-6ccfc248b16e","task":"3c658c488fd0868847fab30976c2a079d8fd63df148fb3b53fd1a418015723d7","component":"streamPeerTask"}
```
## Preheat
To get the best out of Dragonfly, you can pull the image in advance by [preheat](preheat/README.md)

View File

@ -0,0 +1,7 @@
# Runtime Integration
Table of contents:
* [containerd](containerd.md)
* [cri-o](cri-o.md)
* [docker](docker.md)

View File

@ -147,3 +147,130 @@ You can get the certificate of your server with:
``` ```
openssl x509 -in <(openssl s_client -showcerts -servername xxx -connect xxx:443 -prexit 2>/dev/null) openssl x509 -in <(openssl s_client -showcerts -servername xxx -connect xxx:443 -prexit 2>/dev/null)
``` ```
# Use dfget daemon as registry mirror for Containerd with CRI support
From v1.1.0, Containerd supports registry mirrors, we can configure Containerd via this feature for HA.
## Quick Start
### Step 1: Configure dfget daemon
To use dfget daemon as registry mirror, first you need to ensure configuration in `/etc/dragonfly/dfget.yaml`:
```yaml
proxy:
security:
insecure: true
tcpListen:
listen: 0.0.0.0
port: 65001
registryMirror:
# multiple registries support, if only mirror single registry, disable this
dynamic: true
url: https://index.docker.io
proxies:
- regx: blobs/sha256.*
```
Run dfget daemon
```shell
dfget daemon
```
## Step 2: Configure Containerd
### Option 1: Single Registry
Enable mirrors in Containerd registries configuration in
`/etc/containerd/config.toml`:
```toml
# explicitly use v2 config format, if already v2, skip the "version = 2"
version = 2
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["http://127.0.0.1:65001","https://registry-1.docker.io"]
```
In this config, there is two mirror endpoints for "docker.io", Containerd will pull images with `http://127.0.0.1:65001` first.
If `http://127.0.0.1:65001` is not available, the default `https://registry-1.docker.io` will be used for HA.
> More details about Containerd configuration: https://github.com/containerd/containerd/blob/v1.5.2/docs/cri/registry.md#configure-registry-endpoint
> Containerd has deprecated the above config from v1.4.0, new format for reference: https://github.com/containerd/containerd/blob/v1.5.2/docs/cri/config.md#registry-configuration
### Option 2: Multiple Registries
This option only supports Containerd 1.5.0+.
#### 1. Enable Containerd Registries Config Path
Enable mirrors in Containerd registries config path in
`/etc/containerd/config.toml`:
```toml
# explicitly use v2 config format, if already v2, skip the "version = 2"
version = 2
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
```
#### 2. Generate Per Registry hosts.toml
##### Option 1: Generate hosts.toml manually
Path: `/etc/containerd/certs.d/example.com/hosts.toml`
Replace `example.com` according the different registry domains.
Content:
```toml
server = "https://example.com"
[host."http://127.0.0.1:65001"]
capabilities = ["pull", "resolve"]
[host."http://127.0.0.1:65001".header]
X-Dragonfly-Registry = ["https://example.com"]
```
##### Option 2: Generate hosts.toml automatically
You can also generate hosts.toml with https://github.com/dragonflyoss/Dragonfly2/blob/main/hack/gen-containerd-hosts.sh
```shell
bash gen-containerd-hosts.sh example.com
```
> More details about registry configuration: https://github.com/containerd/containerd/blob/main/docs/hosts.md#registry-configuration---examples
## Step 3: Restart Containerd Daemon
```
systemctl restart containerd
```
## Step 4: Pull Image
You can pull image like this:
```
crictl pull docker.io/library/busybox
```
## Step 5: Validate Dragonfly
You can execute the following command to check if the busybox image is distributed via Dragonfly.
```bash
grep 'register peer task result' /var/log/dragonfly/daemon/*.log
```
If the output of command above has content like
```
{"level":"info","ts":"2021-02-23 20:03:20.306","caller":"client/client.go:83","msg":"register peer task result:true[200] for taskId:adf62a86f001e17037eedeaaba3393f3519b80ce,peerIp:10.15.233.91,securityDomain:,idc:,scheduler:127.0.0.1:8002","peerId":"10.15.233.91-65000-43096-1614081800301788000","errMsg":null}
```

View File

@ -1,20 +0,0 @@
# Installation
There are two installation methods, it is recommended to use helm charts to install as a whole, or install separately according to modules
## Install with Helm Charts
> ArtifactHub Link: https://artifacthub.io/packages/helm/dragonfly/dragonfly
It is recommended to use helm charts for installation, which is a simple and quick installation. [Kubernetes-with-Dragonfly](../../ecosystem/Kubernetes-with-Dragonfly.md) is the installation instructions of dragonfly.
## Install separately
* [install-client](./install-dfdaemon.md) is the installation instructions of dfdaemon
* [install-manager](./install-manager.md) is the installation instructions of manager
* [install-scheduler](./install-scheduler.md) is the installation instructions of scheduler
* [install-cdn](./install-cdn.md) is the installation instructions of CDN

View File

@ -1,26 +0,0 @@
# Dragonfly Quick Start
Dragonfly Quick Start document aims to help you to quick start Dragonfly journey. This experiment is quite easy and
simplified.
You can have a quick start following [Kubernetes-with-Dragonfly](../ecosystem/Kubernetes-with-Dragonfly.md). We recommend to use `Containerd with CRI` and `CRI-O` client.
This table describes some container runtimes version and documents.
| Runtime | Version | Document | CRI Support | Pull Command |
| --- | --- | --- | --- | --- |
| Containerd without CRI | All | [Link](./proxy/containerd.md) | No | ctr image pull docker.io/library/alpine |
| Containerd with CRI | v1.1.0+ | [Link](./registry-mirror/cri-containerd.md) | Yes | crictl pull docker.io/library/alpine:latest |
| CRI-O | All | [Link](./registry-mirror/cri-o.md) | Yes | crictl pull docker.io/library/alpine:latest |
## SEE ALSO
- [install manager](../user-guide/install/install-manager.md) - how to install the Dragonfly manager
- [install cdn](../user-guide/install/install-cdn.md) - how to install the Dragonfly cdn
- [install scheduler](../user-guide/install/install-scheduler.md) - how to install the Dragonfly scheduler
- [manager console](../user-guide/console/preview.md) - preview manager console
- [docker proxy](../user-guide/proxy/docker.md) - make Dragonfly as an HTTP proxy for docker daemon
- Container Runtimes
- [cri-o mirror](../user-guide/registry-mirror/cri-o.md) - make Dragonfly as Registry Mirror for CRIO daemon
- [cri-containerd mirror](../user-guide/registry-mirror/cri-containerd.md) - make Dragonfly as Registry Mirror for containerd daemon
- [preheat](../user-guide/preheat/preheat.md) - preheat feature

View File

@ -1,126 +0,0 @@
# Use dfget daemon as registry mirror for Containerd with CRI support
From v1.1.0, Containerd supports registry mirrors, we can configure Containerd via this feature for HA.
## Quick Start
### Step 1: Configure dfget daemon
To use dfget daemon as registry mirror, first you need to ensure configuration in `/etc/dragonfly/dfget.yaml`:
```yaml
proxy:
security:
insecure: true
tcpListen:
listen: 0.0.0.0
port: 65001
registryMirror:
# multiple registries support, if only mirror single registry, disable this
dynamic: true
url: https://index.docker.io
proxies:
- regx: blobs/sha256.*
```
Run dfget daemon
```shell
dfget daemon
```
## Step 2: Configure Containerd
### Option 1: Single Registry
Enable mirrors in Containerd registries configuration in
`/etc/containerd/config.toml`:
```toml
# explicitly use v2 config format, if already v2, skip the "version = 2"
version = 2
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
endpoint = ["http://127.0.0.1:65001","https://registry-1.docker.io"]
```
In this config, there is two mirror endpoints for "docker.io", Containerd will pull images with `http://127.0.0.1:65001` first.
If `http://127.0.0.1:65001` is not available, the default `https://registry-1.docker.io` will be used for HA.
> More details about Containerd configuration: https://github.com/containerd/containerd/blob/v1.5.2/docs/cri/registry.md#configure-registry-endpoint
> Containerd has deprecated the above config from v1.4.0, new format for reference: https://github.com/containerd/containerd/blob/v1.5.2/docs/cri/config.md#registry-configuration
### Option 2: Multiple Registries
This option only supports Containerd 1.5.0+.
#### 1. Enable Containerd Registries Config Path
Enable mirrors in Containerd registries config path in
`/etc/containerd/config.toml`:
```toml
# explicitly use v2 config format, if already v2, skip the "version = 2"
version = 2
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = "/etc/containerd/certs.d"
```
#### 2. Generate Per Registry hosts.toml
##### Option 1: Generate hosts.toml manually
Path: `/etc/containerd/certs.d/example.com/hosts.toml`
Replace `example.com` according the different registry domains.
Content:
```toml
server = "https://example.com"
[host."http://127.0.0.1:65001"]
capabilities = ["pull", "resolve"]
[host."http://127.0.0.1:65001".header]
X-Dragonfly-Registry = ["https://example.com"]
```
##### Option 2: Generate hosts.toml automatically
You can also generate hosts.toml with https://github.com/dragonflyoss/Dragonfly2/blob/main/hack/gen-containerd-hosts.sh
```shell
bash gen-containerd-hosts.sh example.com
```
> More details about registry configuration: https://github.com/containerd/containerd/blob/main/docs/hosts.md#registry-configuration---examples
## Step 3: Restart Containerd Daemon
```
systemctl restart containerd
```
## Step 4: Pull Image
You can pull image like this:
```
crictl pull docker.io/library/busybox
```
## Step 5: Validate Dragonfly
You can execute the following command to check if the busybox image is distributed via Dragonfly.
```bash
grep 'register peer task result' /var/log/dragonfly/daemon/*.log
```
If the output of command above has content like
```
{"level":"info","ts":"2021-02-23 20:03:20.306","caller":"client/client.go:83","msg":"register peer task result:true[200] for taskId:adf62a86f001e17037eedeaaba3393f3519b80ce,peerIp:10.15.233.91,securityDomain:,idc:,scheduler:127.0.0.1:8002","peerId":"10.15.233.91-65000-43096-1614081800301788000","errMsg":null}
```