diff --git a/docs/en/concepts-and-designs/README.md b/docs/en/concepts-and-designs/README.md index d1f40885c..b638bf7a4 100644 --- a/docs/en/concepts-and-designs/README.md +++ b/docs/en/concepts-and-designs/README.md @@ -36,7 +36,7 @@ TODO ### KubeSphere DevOps -TODO(@runzexia) +Read [DevOps Pipeline Overview](devops-pipeline-overview.md). ### KubeSphere S2I/B2I diff --git a/docs/en/concepts-and-designs/devops-pipeline-overview.md b/docs/en/concepts-and-designs/devops-pipeline-overview.md new file mode 100644 index 000000000..ab332df8f --- /dev/null +++ b/docs/en/concepts-and-designs/devops-pipeline-overview.md @@ -0,0 +1,73 @@ +# KubeSphere DevOps Pipeline Overview + +KubeSphere DevOps Pipeline is aimed to meet the complex CI/CD requirements on Kubernetes. + +With the KubeSphere DevOps Pipeline, you can quickly construct a complete CI/CD workflow and architecture by manipulating with the KubeSphere console. + + +## DevOps Pipeline Capabilities + +* Build, Deploy, Launch services in Kubernetes +* Use Kubernetes dynamic agent to release the ability of Kubernetes to dynamically expand +* In SCM Pipeline and Out of SCM Pipeline +* Easy-to-use graphical pipeline editing panel +* Multi-tenant isolation + + +### DevOps Pipeline API + +The KubeSphere DevOps Pipeline API will encapsulate the following APIs to provide a standardized REST API: + +- Jenkins Core API +- Jenkins BlueOcean API +- Sonarqube API +- Other Plugins API + +KubeSphere apiserver will provide multi-tenant API, pipeline API, credential API, code quality analysis API, etc. + +![ks-devops-api](../../images/devops-api.png) + + +### Multi-tenant isolation + +In the current version (v2.1.0), multi-tenancy in the DevOps part is done with the ability of the [role-strategy-plugin](https://github.com/jenkinsci/role-strategy-plugin) plugin. KubeSphere will automatically synchronize permission rules in this plugin. + +In the future, KubeSphere DevOps will authentication based on [OPA](https://www.openpolicyagent.org/). + +### Integration with Jenkins + +KubeSphere integrates with standard Jenkins, customizing plugins and configurations. + +#### Distribution of plugins + +To meet the needs of users in private cloud environments, KubeSphere uses the built-in nginx as a jenkins update center. The jenkins update center is provided as a Docker image + [Helm Chart](https://github.com/kubesphere/ks-installer/tree/master/roles/ks-devops/jenkins-update-center). + +#### Jenkins configuration + +KubeSphere uses Docker Image, Jenkins update Center and Helm Chart to distribute Jenkins。 + +The list of plugins and configuration required by Jenkins will be provided by [Helm Chart](https://github.com/kubesphere/ks-installer/tree/master/roles/ks-devops/jenkins). + +We use [Groovy Script](https://wiki.jenkins.io/display/JENKINS/Groovy+Hook+Script) and [JCasC](https://github.com/jenkinsci/configuration-as-code-plugin) to initialize Jenkins. + + +### Pipeline Builder Image And Jenkins PodTemplate + +Jenkins does not include any agent configuration by default, KubeSphere provides some default agents (including docker image and podTemplate configuration). + +The default agent image will be built based on the [builder base](https://github.com/kubesphere/builder-base), you can search the keyword of repository `builder xxx` in KubeSphere [github](https://github.com/kubesphere/). + +### In SCM Pipeline and Out of SCM Pipeline + +KubeSphere's pipeline syntax will be fully compatible with Jenkins' pipeline syntax. Jenkinsfile found in SCM will be supported with Jenkins plugin. + +We will provide a plug-in SCM API, allowing users to graphically edit Jenkinsfile, Dockerfile and other configurations in SCM on KubeSphere. + +### Sonarqube Integration + +KubeSphere will retrieve Jenkins pipelines that have performed Sonarqube code analysis. And provide API to access analysis report. + + +### More + +If you have more questions, you can create an issue on [github](https://github.com/kubesphere/kubesphere) diff --git a/docs/en/guides/Kubesphere-code-layout.md b/docs/en/guides/Kubesphere-code-layout.md new file mode 100644 index 000000000..46b075d2a --- /dev/null +++ b/docs/en/guides/Kubesphere-code-layout.md @@ -0,0 +1,167 @@ +# KubeSphere File Tree + +This document describes the directory structure of the KubeSphere repository. + + +``` +├── api // Automatically generated API documentation +│   ├── api-rules +│   ├── ks-openapi-spec // REST API documentation provided by kubesphere apiserver +│   └── openapi-spec // REST API documentation provided by kubesphere apiserver +├── build // Dockerfile +│   ├── hypersphere +│   ├── ks-apigateway +│   ├── ks-apiserver +│   ├── ks-controller-manager +│   ├── ks-iam +│   └── ks-network +├── cmd // Main applications for KubeSphere. +│   ├── controller-manager // Kubesphere Controller Manger, used to reconcile KubeSphere CCRD +│   │   └── app +│   ├── hypersphere +│   ├── ks-apigateway // KubeSphere API gateway +│   │   └── app +│   ├── ks-apiserver // KubeSphere REST API server +│   │   └── app +│   ├── ks-iam // KubeSphere iam service +│   │   └── app +│   └── ks-network +├── config // CRD config files +│   ├── crds // CRD yaml files +│   ├── default // kustomization yaml files +│   ├── manager // controller manager yaml files +│   ├── rbac // rbac yaml files +│   ├── samples // CRD sample +│   └── webhook // webhppk yaml files +├── docs +│   ├── en +│   │   ├── concepts-and-designs +│   │   └── guides +│   └── images +├── hack // Script files to help people develop +│   └── lib +├── pkg // Library code. +│   ├── api // Structure definitions for REST APIs +│   │   ├── devops +│   │   ├── logging +│   │   └── monitoring +│   ├── apigateway +│   │   └── caddy-plugin +│   ├── apis // Structure definitions for CRDs +│   │   ├── devops +│   │   ├── network +│   │   ├── servicemesh +│   │   └── tenant +│   ├── apiserver // REST API parameter processing +│   │   ├── components +│   │   ├── devops +│   │   ├── git +│   │   ├── iam +│   │   ├── logging +│   │   ├── monitoring +│   │   ├── openpitrix +│   │   ├── operations +│   │   ├── quotas +│   │   ├── registries +│   │   ├── resources +│   │   ├── revisions +│   │   ├── routers +│   │   ├── runtime +│   │   ├── servicemesh +│   │   ├── tenant +│   │   ├── terminal +│   │   ├── workloadstatuses +│   │   └── workspaces +│   ├── client //Automatically generated CRD client +│   │   ├── clientset +│   │   ├── informers +│   │   └── listers +│   ├── constants // common constants +│   ├── controller // controller manger's reconciliation logic +│   │   ├── application +│   │   ├── clusterrolebinding +│   │   ├── destinationrule +│   │   ├── job +│   │   ├── namespace +│   │   ├── network +│   │   ├── s2ibinary +│   │   ├── s2irun +│   │   ├── storage +│   │   ├── virtualservice +│   │   └── workspace +│   ├── db // Database ORM Framework +│   │   ├── ddl +│   │   ├── schema +│   │   └── scripts +│   ├── gojenkins // Jenkins Go Client +│   │   ├── _tests +│   │   └── utils +│   ├── informers +│   ├── kapis // REST API registration +│   │   ├── devops +│   │   ├── iam +│   │   ├── logging +│   │   ├── monitoring +│   │   ├── openpitrix +│   │   ├── operations +│   │   ├── resources +│   │   ├── servicemesh +│   │   ├── tenant +│   │   └── terminal +│   ├── models // Data processing part of REST API +│   │   ├── components +│   │   ├── devops +│   │   ├── git +│   │   ├── iam +│   │   ├── kubeconfig +│   │   ├── kubectl +│   │   ├── log +│   │   ├── metrics +│   │   ├── nodes +│   │   ├── openpitrix +│   │   ├── quotas +│   │   ├── registries +│   │   ├── resources +│   │   ├── revisions +│   │   ├── routers +│   │   ├── servicemesh +│   │   ├── status +│   │   ├── storage +│   │   ├── tenant +│   │   ├── terminal +│   │   ├── workloads +│   │   └── workspaces +│   ├── server // Data processing part of REST API +│   │   ├── config +│   │   ├── errors +│   │   ├── filter +│   │   ├── options +│   │   └── params +│   ├── simple // common clients +│   │   └── client +│   ├── test +│   ├── utils // common utils +│   │   ├── hashutil +│   │   ├── idutils +│   │   ├── iputil +│   │   ├── jsonutil +│   │   ├── jwtutil +│   │   ├── k8sutil +│   │   ├── net +│   │   ├── readerutils +│   │   ├── reflectutils +│   │   ├── signals +│   │   ├── sliceutil +│   │   ├── stringutils +│   │   └── term +│   ├── version +│   └── webhook +├── test // e2e test code +│   ├── e2e +├── tools // tools to genereate API docs +│   ├── cmd +│   │   ├── crd-doc-gen // gen CRD API docs +│   │   └── doc-gen // gen REST API docs +│   └── lib + +``` diff --git a/docs/en/guides/README.md b/docs/en/guides/README.md index 356835a87..ab4a5e832 100644 --- a/docs/en/guides/README.md +++ b/docs/en/guides/README.md @@ -28,11 +28,14 @@ Compiling Guide teaches developer how to build the project in local and set up t 2. Understand the workflow of kubesphere development. Read [Development Workflow](Development-workflow.md). -3. Understand the best practices for submitting PR and our code of conduct +3. Learn KubeSphere code layout + +Read [KubeSphere Code Layout](Kubesphere-code-layout.md). + +4. Understand the best practices for submitting PR and our code of conduct Read [best practices for submitting PR](pull-requests.md). Read [code of conduct](code-of-conduct.md). -### KubeSphere Core developer ### KubeSphere Installer developer @@ -56,7 +59,9 @@ TODO(@magicsong) ### KubeSphere DevOps developer -TODO(@runzexia) +Users who are interested in DevOps Pipeline, you can read the documentation according to the [guidelines above](README.md#for-code-developer). + +The function of KubeSphere DevOps is mainly provided by KubeSphere apiserver. ### KubeSphere S2I/B2I developer diff --git a/docs/images/devops-api.png b/docs/images/devops-api.png new file mode 100644 index 000000000..e8e36f708 Binary files /dev/null and b/docs/images/devops-api.png differ