From c849e87efd9eb2b5ddc265bca8cb7f06ad4eeb54 Mon Sep 17 00:00:00 2001 From: cndoit18 Date: Fri, 22 Oct 2021 11:36:36 +0800 Subject: [PATCH] docs(en): upgrade docs (#673) Signed-off-by: cndoit18 --- README.md | 7 - docs/en/README.md | 106 ++++----------- .../api.md => api-reference/api-reference.md} | 6 +- docs/en/cli-reference/README.md | 10 ++ docs/en/deployment/README.md | 14 ++ .../configuration}/cdn-nginx.conf | 0 .../configuration}/cdn.yaml | 0 .../configuration}/dfget.yaml | 0 .../configuration}/manager.yaml | 0 .../configuration}/scheduler.yaml | 0 docs/en/deployment/installation/README.md | 7 + .../deployment/installation/docker/README.md | 8 ++ .../installation/docker/docker-compose.md | 1 + .../installation/docker/standalone/README.md | 20 +++ .../installation/docker/standalone/cdn.md | 67 +++++++++ .../docker/standalone/dfdaemon.md | 67 +++++++++ .../installation/docker/standalone/manager.md | 72 ++++++++++ .../docker/standalone/scheduler.md | 65 +++++++++ .../installation/executable-files/README.md | 13 ++ .../installation/executable-files/cdn.md} | 69 ---------- .../executable-files/dfdaemon.md} | 70 ---------- .../installation/executable-files/manager.md} | 78 +---------- .../executable-files/scheduler.md} | 67 --------- .../installation/kubernetes/README.md | 10 ++ .../installation/kubernetes/helm.md} | 77 +++-------- .../installation/kubernetes/kustomize.md | 85 ++++++++++++ .../installation/kubernetes/upgrade-guide.md | 1 + docs/en/design/README.md | 11 ++ docs/en/design/architecture.md | 12 +- docs/en/design/cdn.md | 1 + docs/en/design/dfdaemon.md | 1 + .../console/preview.md => design/manager.md} | 32 ++--- docs/en/design/scheduler.md | 1 + .../developer-guide.md} | 0 docs/en/ecosystem/Harbor-with-Dragonfly.md | 3 - docs/en/preheat/README.md | 8 ++ .../preheat/preheat.md => preheat/api.md} | 16 +-- docs/en/preheat/console.md | 1 + docs/en/quick-start.md | 102 ++++++++++++++ docs/en/runtime-integration/README.md | 7 + .../containerd.md | 127 ++++++++++++++++++ .../cri-o.md | 0 .../proxy => runtime-integration}/docker.md | 0 docs/en/user-guide/install/README.md | 20 --- docs/en/user-guide/quick-start.md | 26 ---- .../registry-mirror/cri-containerd.md | 126 ----------------- 46 files changed, 775 insertions(+), 639 deletions(-) rename docs/en/{api/api.md => api-reference/api-reference.md} (99%) create mode 100644 docs/en/cli-reference/README.md create mode 100644 docs/en/deployment/README.md rename docs/en/{config => deployment/configuration}/cdn-nginx.conf (100%) rename docs/en/{config => deployment/configuration}/cdn.yaml (100%) rename docs/en/{config => deployment/configuration}/dfget.yaml (100%) rename docs/en/{config => deployment/configuration}/manager.yaml (100%) rename docs/en/{config => deployment/configuration}/scheduler.yaml (100%) create mode 100644 docs/en/deployment/installation/README.md create mode 100644 docs/en/deployment/installation/docker/README.md create mode 100644 docs/en/deployment/installation/docker/docker-compose.md create mode 100644 docs/en/deployment/installation/docker/standalone/README.md create mode 100644 docs/en/deployment/installation/docker/standalone/cdn.md create mode 100644 docs/en/deployment/installation/docker/standalone/dfdaemon.md create mode 100644 docs/en/deployment/installation/docker/standalone/manager.md create mode 100644 docs/en/deployment/installation/docker/standalone/scheduler.md create mode 100644 docs/en/deployment/installation/executable-files/README.md rename docs/en/{user-guide/install/install-cdn.md => deployment/installation/executable-files/cdn.md} (60%) rename docs/en/{user-guide/install/install-dfdaemon.md => deployment/installation/executable-files/dfdaemon.md} (51%) rename docs/en/{user-guide/install/install-manager.md => deployment/installation/executable-files/manager.md} (50%) rename docs/en/{user-guide/install/install-scheduler.md => deployment/installation/executable-files/scheduler.md} (52%) create mode 100644 docs/en/deployment/installation/kubernetes/README.md rename docs/en/{ecosystem/Kubernetes-with-Dragonfly.md => deployment/installation/kubernetes/helm.md} (84%) create mode 100644 docs/en/deployment/installation/kubernetes/kustomize.md create mode 100644 docs/en/deployment/installation/kubernetes/upgrade-guide.md create mode 100644 docs/en/design/README.md create mode 100644 docs/en/design/cdn.md create mode 100644 docs/en/design/dfdaemon.md rename docs/en/{user-guide/console/preview.md => design/manager.md} (50%) create mode 100644 docs/en/design/scheduler.md rename docs/en/{development/local.md => developer-guide/developer-guide.md} (100%) delete mode 100644 docs/en/ecosystem/Harbor-with-Dragonfly.md create mode 100644 docs/en/preheat/README.md rename docs/en/{user-guide/preheat/preheat.md => preheat/api.md} (76%) create mode 100644 docs/en/preheat/console.md create mode 100644 docs/en/quick-start.md create mode 100644 docs/en/runtime-integration/README.md rename docs/en/{user-guide/proxy => runtime-integration}/containerd.md (50%) rename docs/en/{user-guide/registry-mirror => runtime-integration}/cri-o.md (100%) rename docs/en/{user-guide/proxy => runtime-integration}/docker.md (100%) delete mode 100644 docs/en/user-guide/install/README.md delete mode 100644 docs/en/user-guide/quick-start.md delete mode 100644 docs/en/user-guide/registry-mirror/cri-containerd.md diff --git a/README.md b/README.md index a26af9ce41c..72cbd75fb1d 100644 --- a/README.md +++ b/README.md @@ -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. -## Getting Started - -- [Quick Start][quickstart] -- [Installation][installation] - ## Documentation 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 [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 [discussion]: https://github.com/dragonflyoss/Dragonfly2/discussions [contributing]: CONTRIBUTING.md diff --git a/docs/en/README.md b/docs/en/README.md index 723ef432a1b..07346f06b33 100644 --- a/docs/en/README.md +++ b/docs/en/README.md @@ -1,85 +1,31 @@ # 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: -* [Quick Start](#Quick-Start) -* [User Guide](#User-Guide) -* [CLI Reference](#CLI-Reference) - * [dfget](cli-reference/dfget.md) - * [cdn](cli-reference/cdn.md) - * [scheduler](cli-reference/scheduler.md) - * [manager](cli-reference/manager.md) -* [API Reference](#API-Reference) -* [Ecosystem](#Ecosystem) - * [Kubernetes Integration](ecosystem/Kubernetes-with-Dragonfly.md) - * [WIP Harbor Integration](ecosystem/Harbor-with-Dragonfly.md) -* [Developer Guide](#Developer-Guide) - * [Design Doc](#Design-Doc) - * [Test Guide](#Test-Guide) - -## How to Contribute Document - -Find `WIP` or `TODO` in this page and follow [CONTRIBUTING](../../CONTRIBUTING.md). - -## Quick Start - -[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 -prerequisites, -how to install Dragonfly and how to experience Dragonfly's usage. - -## 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. - - +* [Quick Start](quick-start.md) +* [Design](design/README.md) + * [architecture](design/architecture.md) + * [manager](design/manager.md) + * [TODO scheduler](design/scheduler.md) + * [TODO cdn](design/cdn.md) + * [TODO dfdaemon](desigin/dfdaemon.md) +* [Deployment](deployment/README.md) + * [Installation](deployment/installation) + * [Configuration](deployment/configuration) +* [CLI Reference](cli-reference/README.md) + * [dfget](cli-reference/dfget.md) + * [cdn](cli-reference/cdn.md) + * [scheduler](cli-reference/scheduler.md) + * [manager](cli-reference/manager.md) +* [Runtime Integration](runtime-integration/README.md) + * [containerd](runtime-integration/containerd.md) + * [cri-o](runtime-integration/cri-o.md) + * [docker](runtime-integration/docker.md) +* [Preheat](preheat/README.md) + * [Console](preheat/console.md) + * [Api](preheat/api.md) +* [Developer Guide](developer-guide/developer-guide.md) +* [Test Guide](test-guide/test-guide.md) +* [API Reference](api-reference/api-reference.md) diff --git a/docs/en/api/api.md b/docs/en/api-reference/api-reference.md similarity index 99% rename from docs/en/api/api.md rename to docs/en/api-reference/api-reference.md index 356e4fcc574..adfde7d4a1e 100644 --- a/docs/en/api/api.md +++ b/docs/en/api-reference/api-reference.md @@ -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 diff --git a/docs/en/cli-reference/README.md b/docs/en/cli-reference/README.md new file mode 100644 index 00000000000..06b65f90d5e --- /dev/null +++ b/docs/en/cli-reference/README.md @@ -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) \ No newline at end of file diff --git a/docs/en/deployment/README.md b/docs/en/deployment/README.md new file mode 100644 index 00000000000..156ef101f4c --- /dev/null +++ b/docs/en/deployment/README.md @@ -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. diff --git a/docs/en/config/cdn-nginx.conf b/docs/en/deployment/configuration/cdn-nginx.conf similarity index 100% rename from docs/en/config/cdn-nginx.conf rename to docs/en/deployment/configuration/cdn-nginx.conf diff --git a/docs/en/config/cdn.yaml b/docs/en/deployment/configuration/cdn.yaml similarity index 100% rename from docs/en/config/cdn.yaml rename to docs/en/deployment/configuration/cdn.yaml diff --git a/docs/en/config/dfget.yaml b/docs/en/deployment/configuration/dfget.yaml similarity index 100% rename from docs/en/config/dfget.yaml rename to docs/en/deployment/configuration/dfget.yaml diff --git a/docs/en/config/manager.yaml b/docs/en/deployment/configuration/manager.yaml similarity index 100% rename from docs/en/config/manager.yaml rename to docs/en/deployment/configuration/manager.yaml diff --git a/docs/en/config/scheduler.yaml b/docs/en/deployment/configuration/scheduler.yaml similarity index 100% rename from docs/en/config/scheduler.yaml rename to docs/en/deployment/configuration/scheduler.yaml diff --git a/docs/en/deployment/installation/README.md b/docs/en/deployment/installation/README.md new file mode 100644 index 00000000000..3a987bb888b --- /dev/null +++ b/docs/en/deployment/installation/README.md @@ -0,0 +1,7 @@ +# Installation + +Table of contents: + +* [docker](docker/README.md) +* [executable-files](executable-files/README.md) +* [kubernetes](kubernetes/README.md) diff --git a/docs/en/deployment/installation/docker/README.md b/docs/en/deployment/installation/docker/README.md new file mode 100644 index 00000000000..d9efdfeb2d2 --- /dev/null +++ b/docs/en/deployment/installation/docker/README.md @@ -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) diff --git a/docs/en/deployment/installation/docker/docker-compose.md b/docs/en/deployment/installation/docker/docker-compose.md new file mode 100644 index 00000000000..a9caaf25ce2 --- /dev/null +++ b/docs/en/deployment/installation/docker/docker-compose.md @@ -0,0 +1 @@ +# WIP Docker-Compose Support diff --git a/docs/en/deployment/installation/docker/standalone/README.md b/docs/en/deployment/installation/docker/standalone/README.md new file mode 100644 index 00000000000..55e63410e1c --- /dev/null +++ b/docs/en/deployment/installation/docker/standalone/README.md @@ -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 + diff --git a/docs/en/deployment/installation/docker/standalone/cdn.md b/docs/en/deployment/installation/docker/standalone/cdn.md new file mode 100644 index 00000000000..0c829cc1590 --- /dev/null +++ b/docs/en/deployment/installation/docker/standalone/cdn.md @@ -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 +``` \ No newline at end of file diff --git a/docs/en/deployment/installation/docker/standalone/dfdaemon.md b/docs/en/deployment/installation/docker/standalone/dfdaemon.md new file mode 100644 index 00000000000..539b86a9c34 --- /dev/null +++ b/docs/en/deployment/installation/docker/standalone/dfdaemon.md @@ -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 +``` \ No newline at end of file diff --git a/docs/en/deployment/installation/docker/standalone/manager.md b/docs/en/deployment/installation/docker/standalone/manager.md new file mode 100644 index 00000000000..b3fd6649754 --- /dev/null +++ b/docs/en/deployment/installation/docker/standalone/manager.md @@ -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). diff --git a/docs/en/deployment/installation/docker/standalone/scheduler.md b/docs/en/deployment/installation/docker/standalone/scheduler.md new file mode 100644 index 00000000000..a48b9eb3fe4 --- /dev/null +++ b/docs/en/deployment/installation/docker/standalone/scheduler.md @@ -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 +``` diff --git a/docs/en/deployment/installation/executable-files/README.md b/docs/en/deployment/installation/executable-files/README.md new file mode 100644 index 00000000000..c4b5c11e808 --- /dev/null +++ b/docs/en/deployment/installation/executable-files/README.md @@ -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 diff --git a/docs/en/user-guide/install/install-cdn.md b/docs/en/deployment/installation/executable-files/cdn.md similarity index 60% rename from docs/en/user-guide/install/install-cdn.md rename to docs/en/deployment/installation/executable-files/cdn.md index 4ab11e40aca..1c23c42b93c 100644 --- a/docs/en/user-guide/install/install-cdn.md +++ b/docs/en/deployment/installation/executable-files/cdn.md @@ -2,22 +2,8 @@ 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 -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. Required Software | Version Limit @@ -26,61 +12,6 @@ Git|1.9.1+ Golang|1.12.x 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 ### Get cdn executable file diff --git a/docs/en/user-guide/install/install-dfdaemon.md b/docs/en/deployment/installation/executable-files/dfdaemon.md similarity index 51% rename from docs/en/user-guide/install/install-dfdaemon.md rename to docs/en/deployment/installation/executable-files/dfdaemon.md index d44b9361386..141de22f9bd 100644 --- a/docs/en/user-guide/install/install-dfdaemon.md +++ b/docs/en/deployment/installation/executable-files/dfdaemon.md @@ -2,84 +2,14 @@ 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 -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. Required Software | Version Limit ---|--- Git|1.9.1+ 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 diff --git a/docs/en/user-guide/install/install-manager.md b/docs/en/deployment/installation/executable-files/manager.md similarity index 50% rename from docs/en/user-guide/install/install-manager.md rename to docs/en/deployment/installation/executable-files/manager.md index 46c0e8e264b..a0a6e682647 100644 --- a/docs/en/user-guide/install/install-manager.md +++ b/docs/en/deployment/installation/executable-files/manager.md @@ -2,22 +2,8 @@ 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 -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. Required Software | Version Limit @@ -26,69 +12,9 @@ Git|1.9.1+ Golang|1.12.x 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 -### 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. 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) -Console features preview reference document [console preview](../../user-guide/console/preview.md). +Console features preview reference document [console preview](../../../design/manager.md). diff --git a/docs/en/user-guide/install/install-scheduler.md b/docs/en/deployment/installation/executable-files/scheduler.md similarity index 52% rename from docs/en/user-guide/install/install-scheduler.md rename to docs/en/deployment/installation/executable-files/scheduler.md index ea6bbe7a08a..3fab79a5c03 100644 --- a/docs/en/user-guide/install/install-scheduler.md +++ b/docs/en/deployment/installation/executable-files/scheduler.md @@ -2,22 +2,8 @@ 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 -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. Required Software | Version Limit @@ -26,59 +12,6 @@ Git|1.9.1+ Golang|1.12.x 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 ### Get scheduler executable file diff --git a/docs/en/deployment/installation/kubernetes/README.md b/docs/en/deployment/installation/kubernetes/README.md new file mode 100644 index 00000000000..bcd10d96e19 --- /dev/null +++ b/docs/en/deployment/installation/kubernetes/README.md @@ -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) diff --git a/docs/en/ecosystem/Kubernetes-with-Dragonfly.md b/docs/en/deployment/installation/kubernetes/helm.md similarity index 84% rename from docs/en/ecosystem/Kubernetes-with-Dragonfly.md rename to docs/en/deployment/installation/kubernetes/helm.md index 2cb4cf14f48..bd1478bce5e 100644 --- a/docs/en/ecosystem/Kubernetes-with-Dragonfly.md +++ b/docs/en/deployment/installation/kubernetes/helm.md @@ -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`, -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 +## Runtime Configuration Guide for Dragonfly Helm Chart 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. > Because the original `daemonset` in Kubernetes did not support `Surging Rolling Update` policy. @@ -84,7 +73,7 @@ Limitations: * Need restart docker daemon * 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: @@ -143,7 +132,7 @@ containerRuntime: enable: true ``` -#### 3. [WIP] CRI-O +### 3. [WIP] CRI-O > DON'T USE, Work in progress @@ -163,21 +152,21 @@ containerRuntime: - "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 recommended. Just run `minikube start`. -### Install Dragonfly +## Install Dragonfly -#### Install with default configuration +### 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 ``` -#### 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. @@ -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 ``` -#### 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. @@ -250,7 +239,7 @@ mysql: enable: false ``` -### Wait Dragonfly Ready +## Wait Dragonfly Ready Wait all pods running @@ -258,19 +247,19 @@ Wait all pods running 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`. 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: @@ -296,7 +285,7 @@ Add above config to `/etc/containerd/config.toml` and 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`: @@ -320,34 +309,4 @@ kubectl -n dragonfly-system exec -it ${pod_name} -- grep "peer task done" /var/l 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"} -``` - -## 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 +``` \ No newline at end of file diff --git a/docs/en/deployment/installation/kubernetes/kustomize.md b/docs/en/deployment/installation/kubernetes/kustomize.md new file mode 100644 index 00000000000..30d0002b508 --- /dev/null +++ b/docs/en/deployment/installation/kubernetes/kustomize.md @@ -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"} +``` diff --git a/docs/en/deployment/installation/kubernetes/upgrade-guide.md b/docs/en/deployment/installation/kubernetes/upgrade-guide.md new file mode 100644 index 00000000000..76fc8815243 --- /dev/null +++ b/docs/en/deployment/installation/kubernetes/upgrade-guide.md @@ -0,0 +1 @@ +# WIP Upgrade guide \ No newline at end of file diff --git a/docs/en/design/README.md b/docs/en/design/README.md new file mode 100644 index 00000000000..9c621cea4bb --- /dev/null +++ b/docs/en/design/README.md @@ -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) diff --git a/docs/en/design/architecture.md b/docs/en/design/architecture.md index 468600130f8..9aacaf51464 100644 --- a/docs/en/design/architecture.md +++ b/docs/en/design/architecture.md @@ -1,6 +1,7 @@ # Product Thinking and Design ## 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. ## What problems are solved @@ -36,17 +37,17 @@ Provide enterprise-level (efficient, stable, secure, low-cost, product-oriented) ### Entity relationship -![alt][association] +![alt][TODO association] ### Image file download process -![alt][download-process] +![alt][TODO download-process] ### Sub-system architecture #### CDN system -![cdn][cdn] +![cdn][TODO cdn] ### Sub-system function @@ -99,7 +100,4 @@ Provide enterprise-level (efficient, stable, secure, low-cost, product-oriented) - Client connection management -[arch]: ../images/arch.png -[association]: ../../zh-CN/images/association.png -[download-process]: ../../zh-CN/images/download-process.png -[cdn]: ../../zh-CN/images/cdn.png \ No newline at end of file +[arch]: ../images/arch.png \ No newline at end of file diff --git a/docs/en/design/cdn.md b/docs/en/design/cdn.md new file mode 100644 index 00000000000..00e5a1ff354 --- /dev/null +++ b/docs/en/design/cdn.md @@ -0,0 +1 @@ +# WIP CDN \ No newline at end of file diff --git a/docs/en/design/dfdaemon.md b/docs/en/design/dfdaemon.md new file mode 100644 index 00000000000..62b20ae8bae --- /dev/null +++ b/docs/en/design/dfdaemon.md @@ -0,0 +1 @@ +# WIP Dfdaemon \ No newline at end of file diff --git a/docs/en/user-guide/console/preview.md b/docs/en/design/manager.md similarity index 50% rename from docs/en/user-guide/console/preview.md rename to docs/en/design/manager.md index f7c685ff6fd..48f5a8911dc 100644 --- a/docs/en/user-guide/console/preview.md +++ b/docs/en/design/manager.md @@ -1,4 +1,4 @@ -# Manager Console +# Manager 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
- +
-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 @@ -47,13 +47,13 @@ Default root username: `root` password: `dragonfly`. ##### Configure Scheduler Cluster

- +

##### Configure Scheduler Cluster's Client

- +

- `load_limit`: client host can provide the maximum upload load. @@ -71,18 +71,18 @@ Default root username: `root` password: `dragonfly`. ##### Configure CDN Cluster

- +

- `load_limit`: CDN host can provide the maximum upload load. -[signin]: ../../images/manager-console/signin.jpg -[signup]: ../../images/manager-console/signup.jpg -[scheduler-cluster]: ../../images/manager-console/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-client]: ../../images/manager-console/configure-scheduler-cluster-client.jpg -[cdn-cluster]: ../../images/manager-console/cdn-cluster.jpg -[add-cdn-cluster]: ../../images/manager-console/add-cdn-cluster.jpg -[configure-cdn-cluster]: ../../images/manager-console/configure-cdn-cluster.jpg +[signin]: ../images/manager-console/signin.jpg +[signup]: ../images/manager-console/signup.jpg +[scheduler-cluster]: ../images/manager-console/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-client]: ../images/manager-console/configure-scheduler-cluster-client.jpg +[cdn-cluster]: ../images/manager-console/cdn-cluster.jpg +[add-cdn-cluster]: ../images/manager-console/add-cdn-cluster.jpg +[configure-cdn-cluster]: ../images/manager-console/configure-cdn-cluster.jpg diff --git a/docs/en/design/scheduler.md b/docs/en/design/scheduler.md new file mode 100644 index 00000000000..4633fac3a36 --- /dev/null +++ b/docs/en/design/scheduler.md @@ -0,0 +1 @@ +# WIP Scheduler \ No newline at end of file diff --git a/docs/en/development/local.md b/docs/en/developer-guide/developer-guide.md similarity index 100% rename from docs/en/development/local.md rename to docs/en/developer-guide/developer-guide.md diff --git a/docs/en/ecosystem/Harbor-with-Dragonfly.md b/docs/en/ecosystem/Harbor-with-Dragonfly.md deleted file mode 100644 index ba1ee0f391d..00000000000 --- a/docs/en/ecosystem/Harbor-with-Dragonfly.md +++ /dev/null @@ -1,3 +0,0 @@ -# [WIP] Harbor with Dragonfly - -This document will help you experience how to use dragonfly with harbor. \ No newline at end of file diff --git a/docs/en/preheat/README.md b/docs/en/preheat/README.md new file mode 100644 index 00000000000..e70c1e9b7ed --- /dev/null +++ b/docs/en/preheat/README.md @@ -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) diff --git a/docs/en/user-guide/preheat/preheat.md b/docs/en/preheat/api.md similarity index 76% rename from docs/en/user-guide/preheat/preheat.md rename to docs/en/preheat/api.md index b5da8cb9604..98b5a6cf9c7 100644 --- a/docs/en/user-guide/preheat/preheat.md +++ b/docs/en/preheat/api.md @@ -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 - -## 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) +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) 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"} ``` -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 curl --request GET 'http://dragonfly-manager:8080/api/v1/preheats/group_28439e0b-d4c3-43bf-945e-482b54c49dc5' @@ -38,4 +30,4 @@ If the status is `SUCCESS`, the preheating is successful. ```bash {"id":"group_28439e0b-d4c3-43bf-945e-482b54c49dc5","status":"SUCCESS","create_at":"2021-10-09T11:54:50.5712334Z"} -``` +``` \ No newline at end of file diff --git a/docs/en/preheat/console.md b/docs/en/preheat/console.md new file mode 100644 index 00000000000..4faa41a6e29 --- /dev/null +++ b/docs/en/preheat/console.md @@ -0,0 +1 @@ +# WIP console \ No newline at end of file diff --git a/docs/en/quick-start.md b/docs/en/quick-start.md new file mode 100644 index 00000000000..df52ca5bd9f --- /dev/null +++ b/docs/en/quick-start.md @@ -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) diff --git a/docs/en/runtime-integration/README.md b/docs/en/runtime-integration/README.md new file mode 100644 index 00000000000..00fc328bde0 --- /dev/null +++ b/docs/en/runtime-integration/README.md @@ -0,0 +1,7 @@ +# Runtime Integration + +Table of contents: + +* [containerd](containerd.md) +* [cri-o](cri-o.md) +* [docker](docker.md) diff --git a/docs/en/user-guide/proxy/containerd.md b/docs/en/runtime-integration/containerd.md similarity index 50% rename from docs/en/user-guide/proxy/containerd.md rename to docs/en/runtime-integration/containerd.md index 90ad526320e..30ed56f4a6f 100644 --- a/docs/en/user-guide/proxy/containerd.md +++ b/docs/en/runtime-integration/containerd.md @@ -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) ``` + +# 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} +``` diff --git a/docs/en/user-guide/registry-mirror/cri-o.md b/docs/en/runtime-integration/cri-o.md similarity index 100% rename from docs/en/user-guide/registry-mirror/cri-o.md rename to docs/en/runtime-integration/cri-o.md diff --git a/docs/en/user-guide/proxy/docker.md b/docs/en/runtime-integration/docker.md similarity index 100% rename from docs/en/user-guide/proxy/docker.md rename to docs/en/runtime-integration/docker.md diff --git a/docs/en/user-guide/install/README.md b/docs/en/user-guide/install/README.md deleted file mode 100644 index 05c0f8c2274..00000000000 --- a/docs/en/user-guide/install/README.md +++ /dev/null @@ -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 - diff --git a/docs/en/user-guide/quick-start.md b/docs/en/user-guide/quick-start.md deleted file mode 100644 index 6564ccdd64e..00000000000 --- a/docs/en/user-guide/quick-start.md +++ /dev/null @@ -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 diff --git a/docs/en/user-guide/registry-mirror/cri-containerd.md b/docs/en/user-guide/registry-mirror/cri-containerd.md deleted file mode 100644 index 852cba69f4a..00000000000 --- a/docs/en/user-guide/registry-mirror/cri-containerd.md +++ /dev/null @@ -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} -```