diff --git a/content/zh/docs/application-store/_index.md b/content/zh/docs/application-store/_index.md index a604a5a40..0ab538057 100644 --- a/content/zh/docs/application-store/_index.md +++ b/content/zh/docs/application-store/_index.md @@ -1,23 +1,76 @@ --- -title: "App Store" -description: "Getting started with KubeSphere DevOps project" +title: "应用商店" +description: "Getting started with the App Store of KubeSphere" layout: "single" -linkTitle: "App Store" -weight: 4500 + +linkTitle: "应用商店" +weight: 4600 icon: "/images/docs/docs.svg" --- -## Installing KubeSphere and Kubernetes on Linux +The KubeSphere App Store, powered by [OpenPitrix](https://github.com/openpitrix/openpitrix), an open-source platform that manages apps across clouds, provides users with enterprise-ready containerized solutions. You can upload your own apps through app templates or add app repositories that serve as an application tool for tenants to choose the app they want. -In this chapter, we will demonstrate how to use KubeKey to provision a new Kubernetes and KubeSphere cluster based on different infrastructures. Kubekey can help you to quickly build a production-ready cluster architecture on a set of machines from zero to one. It also helps you to easily scale the cluster and install pluggable components on existing architecture. +The App Store features a highly productive integrated system for application lifecycle management, allowing users to quickly upload, release, deploy, upgrade and remove apps in ways best suit them. This is how KubeSphere empowers developers to spend less time setting up and more time developing. -## Most Popular Pages +## [Application Lifecycle Management](../application-store/app-lifecycle-management/) -Below you will find some of the most common and helpful pages from this chapter. We highly recommend you to review them at first. +Manage your app across the entire lifecycle, including submission, review, test, release, upgrade and removal. -{{< popularPage icon="/images/docs/bitmap.jpg" title="Install KubeSphere on AWS EC2" description="Provisioning a new Kubernetes and KubeSphere cluster based on AWS" link="" >}} +## Built-in Applications -{{< popularPage icon="/images/docs/bitmap.jpg" title="Install KubeSphere on AWS EC2" description="Provisioning a new Kubernetes and KubeSphere cluster based on AWS" link="" >}} +KubeSphere provides 15 featured built-in apps that are commonly used on Kubernetes. With few clicks, you can deploy them to Kubernetes clusters on-premises or in third-party clouds. + +### [Deploy etcd on KubeSphere](../application-store/built-in-apps/etcd-app/) + +Learn how to deploy etcd from the App Store of KubeSphere and access its service. + +### [Deploy Harbor on KubeSphere](../application-store/built-in-apps/harbor-app/) + +Learn how to deploy Harbor from the App Store of KubeSphere and access its service. + +### [Deploy Memcached on KubeSphere](../application-store/built-in-apps/memcached-app/) + +Learn how to deploy Memcached from the App Store of KubeSphere and access its service. + +### [Deploy Minio on KubeSphere](../application-store/built-in-apps/minio-app/) + +Learn how to deploy Minio from the App Store of KubeSphere and access its service. + +### [Deploy MongoDB on KubeSphere](../application-store/built-in-apps/mongodb-app/) + +Learn how to deploy MongoDB from the App Store of KubeSphere and access its service. + +### [Deploy MySQL on KubeSphere](../application-store/built-in-apps/mysql-app/) + +Learn how to deploy MySQL from the App Store of KubeSphere and access its service. + +### [Deploy NGINX on KubeSphere](../application-store/built-in-apps/nginx-app/) + +Learn how to deploy NGINX from the App Store of KubeSphere and access its service. + +### [Deploy PostgreSQL on KubeSphere](../application-store/built-in-apps/postgresql-app/) + +Learn how to deploy PostgreSQL from the App Store of KubeSphere and access its service. + +### [Deploy RabbitMQ on KubeSphere](../application-store/built-in-apps/rabbitmq-app/) + +Learn how to deploy RabbitMQ from the App Store of KubeSphere and access its service. + +### [Deploy Redis on KubeSphere](../application-store/built-in-apps/redis-app/) + +Learn how to deploy Redis from the App Store of KubeSphere and access its service. + +### [Deploy Tomcat on KubeSphere](../application-store/built-in-apps/tomcat-app/) + +Learn how to deploy Tomcat from the App Store of KubeSphere and access its service. + +## External Applications + +You can upload app templates or add app repositories to KubeSphere so that tenants in the same workspace can quickly deploy apps from them. + +### [Deploy GitLab on KubeSphere](../application-store/external-apps/gitlab-app/) + +Learn how to deploy GitLab through an app repository and access its service. \ No newline at end of file diff --git a/content/zh/docs/application-store/app-lifecycle-management.md b/content/zh/docs/application-store/app-lifecycle-management.md new file mode 100644 index 000000000..8a22490a8 --- /dev/null +++ b/content/zh/docs/application-store/app-lifecycle-management.md @@ -0,0 +1,299 @@ +--- +title: "应用程序生命周期管理" +keywords: 'Kubernetes, KubeSphere, app-store' +description: 'App Lifecycle Management' +linkTitle: '应用程序生命周期管理' +weight: 2240 +--- + +KubeSphere integrates [OpenPitrix](https://github.com/openpitrix/openpitrix), an open-source multi-cloud application management platform, to set up the App Store, managing applications throughout their entire lifecycle. The App Store supports two kinds of application deployment: + +- **App template** provides a way for developers and independent software vendors (ISVs) to share applications with users in a workspace. You can also import third-party app repositories within a workspace. +- **Composing app** means users can quickly build a complete application using multiple microservices to compose it. KubeSphere allows users to select existing services or create new services to create a composing app on the one-stop console. + +![app-store](/images/docs/appstore/application-lifecycle-management/app-store.png) + +Using [Redis](https://redis.io/) as an example application, this tutorial demonstrates how to manage the app throughout the entire lifecycle, including submission, review, test, release, upgrade and removal. + +## Prerequisites + +- You need to enable [KubeSphere App Store (OpenPitrix)](../../pluggable-components/app-store). +- You need to create a workspace, a project and an account (`project-regular`). For more information, see [Create Workspace, Project, Account and Role](../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Create Customized Role and Account + +You need to create two accounts first, one for ISVs (`isv`) and the other (`reviewer`) for app technical reviewers. + +1. Log in the KubeSphere console with the account `admin`. Click **Platform** in the top left corner and select **Access Control**. In **Account Roles**, click **Create**. + + ![create-role](/images/docs/appstore/application-lifecycle-management/create-role.jpg) + +2. Set a name for the role, such as `app-review`, and click **Edit Authorization**. + + ![app-review-name](/images/docs/appstore/application-lifecycle-management/app-review-name.jpg) + +3. In **Apps Management**, choose **App Templates Management** and **App Templates View** in the authorization list, then click **OK**. + + ![create-roles](/images/docs/appstore/application-lifecycle-management/create-roles.png) + + {{< notice note >}} + + The account granted the role `app-review` is able to view the App Store on the platform and manage apps, including review and removal. + + {{}} + +4. As the role is ready now, you need to create an account and grant the role of `app-review` to it. In **Accounts**, click **Create**. Provide the required information and click **OK**. + + ![create-review-role](/images/docs/appstore/application-lifecycle-management/create-review-role.jpg) + +5. Similarly, create another account `isv`, and grant the role of `platform-regular` to it. + + ![account-ready](/images/docs/appstore/application-lifecycle-management/account-ready.jpg) + +6. Invite both accounts created above to an existing workspace such as `demo-workspace`, and grant them the role of `workspace-admin`. + +### Step 2: Upload and Submit Application + +1. Log in KubeSphere as `isv` and go to your workspace. You need to upload the example app Redis to this workspace so that it can be used later. First, download the app [Redis 11.3.4](https://github.com/kubesphere/tutorial/raw/master/tutorial%205%20-%20app-store/redis-11.3.4.tgz) and click **Upload Template** in **App Templates**. + + ![upload-app](/images/docs/appstore/application-lifecycle-management/upload-app.jpg) + + {{< notice note >}} + + In this example, a new version of Redis will be uploaded later to demonstrate the upgrade feature. + + {{}} + +2. In the dialogue that appears, click **Upload Helm Chart Package** to upload the chart file. Click **OK** to continue. + + ![upload-template](/images/docs/appstore/application-lifecycle-management/upload-template.jpg) + +3. Basic information of the app displays under **App Info**. To upload an icon for the app, click **Upload icon**. You can also skip it and click **OK** directly. + + {{< notice note >}} + + Maximum accepted resolutions of the app icon: 96 x 96 pixels. + + {{}} + + ![upload-icon](/images/docs/appstore/application-lifecycle-management/upload-icon.jpg) + +4. The app displays in the template list with the status **draft** after successfully uploaded, which means this app is under development. The uploaded app is visible to all members in the same workspace. + + ![app-draft](/images/docs/appstore/application-lifecycle-management/app-draft.jpg) + +5. Go to the detail page of the app template by clicking Redis from the list. You can edit the basic information of this app by clicking **Edit Info**. + + ![edit-app-template](/images/docs/appstore/application-lifecycle-management/edit-app-template.jpg) + +6. You can customize the app's basic information by specifying the fields in the pop-up window. + + ![edit-app-information](/images/docs/appstore/application-lifecycle-management/edit-app-information.jpg) + +7. Click **OK** to save your changes, then you can test this application by deploying it to Kubernetes. Click the draft version to expand the menu and select **Test Deploy**. + + ![test-deployment](/images/docs/appstore/application-lifecycle-management/test-deployment.jpg) + + {{< notice note >}} + + If you don't want to test the app, you can submit it for review directly. However, it is recommended that you test your app deployment and function first before you submit it for review, especially in a production environment. This helps you detect any problems in advance and accelerate the review process. + + {{}} + +8. Select the cluster and project to which you want to deploy the app, set up different configurations for the app, and then click **Deploy**. + + ![deployment-place](/images/docs/appstore/application-lifecycle-management/deployment-place.jpg) + + ![deploying-app](/images/docs/appstore/application-lifecycle-management/deploying-app.jpg) + + {{< notice note >}} + + Some apps can be deployed with all configurations set in a form. You can use the toggle switch to see its YAML file, which contains all parameters you need to specify in the form. + + {{}} + +9. Wait for a few minutes, then switch to the tab **Deployed Instances**. You will find that Redis has been deployed successfully. + + ![deployed-instance-success](/images/docs/appstore/application-lifecycle-management/deployed-instance-success.jpg) + +10. After you test the app with no issues found, you can click **Submit Review** to submit this application for review. + + ![submit-for-review](/images/docs/appstore/application-lifecycle-management/submit-for-review.jpg) + + {{< notice note >}} + + +The version number must start with a number and contain decimal points. + +{{}} + +11. After the app is submitted, the app status will change to **Submitted**. Now app reviewers can review it. + + ![submitted-app](/images/docs/appstore/application-lifecycle-management/submitted-app.jpg) + +### Step 3: Review Application + +1. Log out and log back in KubeSphere as `reviewer`. Click **Platform** in the top left corner and select **App Store Management**. On the **App Review** page, the app submitted in the previous step displays under the tab **Unprocessed**. + + ![app-to-be-reviewed](/images/docs/appstore/application-lifecycle-management/app-to-be-reviewed.jpg) + +2. To review this app, click it to inspect the app information, introduction, chart file and update logs from the pop-up window. + + ![reviewing](/images/docs/appstore/application-lifecycle-management/reviewing.jpg) + +3. It is the responsibility of the reviewer to decide whether the app meets the criteria to be released to the App Store. Click **Pass** to approve it or **Reject** to deny an app submission. + +### Step 4: Release Application to App Store + +After the app is approved, `isv` can release the Redis application to the App Store, allowing all users on the platform to find and deploy this application. + +1. Log out and log back in KubeSphere as `isv`. Go to your workspace and click Redis on the **App Templates** page. On its detail page, expand the version menu, then click **Release to Store**. In the pop-up prompt, click **OK** to confirm. + + ![app-templates-page](/images/docs/appstore/application-lifecycle-management/app-templates-page.jpg) + +2. Under **Audit Records**, you can see the app status. **Active** means it is available in the App Store. + + ![app-active](/images/docs/appstore/application-lifecycle-management/app-active.jpg) + +3. Click **View in Store** to go to its **App Info** page in the App Store. Alternatively, click **App Store** in the top left corner and you can also see the app. + + ![redis](/images/docs/appstore/application-lifecycle-management/redis.jpg) + + {{< notice note >}} + + You may see two Redis apps in the App Store, one of which is a built-in app in KubeSphere. Note that a newly-released app displays at the beginning of the list in the App Store. + + {{}} + +4. Now, users in the workspace can deploy Redis from the App Store. To deploy the app to Kubernetes, click the app to go to its **App Info** page, and click **Deploy**. + + ![deploy-redis](/images/docs/appstore/application-lifecycle-management/deploy-redis.jpg) + +### Step 5: Create App Category + +`reviewer` can create multiple categories for different types of applications based on their function and usage. It is similar to setting tags and categories can be used in the App Store as filters, such as Big Data, Middleware, and IoT. + +1. Log in KubeSphere as `reviewer`. To create a category, go to the **App Store Management** page and click the plus icon in **App Categories**. + + ![app-category](/images/docs/appstore/application-lifecycle-management/app-category.jpg) + +2. Set a name and icon for the category in the dialogue, then click **OK**. For Redis, you can input `Database` for the field **Category Name**. + + ![set-app-type](/images/docs/appstore/application-lifecycle-management/set-app-type.jpg) + + {{< notice note >}} + + Usually, an app reviewer creates necessary categories in advance and ISVs select the category in which an app appears before submitting it for review. A newly-created category has no app in it. + + {{}} + +3. As the category is created, you can assign the category to your app. In **Uncategorized**, select Redis and click **Change Category**. + + ![set-category-for-app](/images/docs/appstore/application-lifecycle-management/set-category-for-app.jpg) + +4. In the dialogue, select the category (**Database**) from the drop-down list and click **OK**. + + ![confirm-category](/images/docs/appstore/application-lifecycle-management/confirm-category.jpg) + +5. The app displays in the category as expected. + + ![app-in-category-list-expected](/images/docs/appstore/application-lifecycle-management/app-in-category-list-expected.jpg) + +### Step 6: Add New Version + +To allow workspace users to upgrade apps, you need to add new app versions to KubeSphere first. Follow the steps below to add a new version for the example app. + +1. Log in KubeSphere as `isv` again and navigate to **App Templates**. Click the app Redis in the list. + + ![redis-new-version](/images/docs/appstore/application-lifecycle-management/redis-new-version.jpg) + +2. Download [Redis 12.0.0](https://github.com/kubesphere/tutorial/raw/master/tutorial%205%20-%20app-store/redis-12.0.0.tgz), which is a new version of Redis for demonstration in this tutorial. In the tab **Versions**, click **New Version** on the right to upload the package you just downloaded. + + ![new-version-redis](/images/docs/appstore/application-lifecycle-management/new-version-redis.jpg) + +3. Click **Upload Helm Chart Package** and click **OK** after it is uploaded. + + ![upload-new-redis-version](/images/docs/appstore/application-lifecycle-management/upload-new-redis-version.jpg) + +4. The new app version displays in the version list. You can click it to expand the menu and test the new version. Besides, you can also submit it for review and release it to the App Store, which is the same as the steps shown above. + + ![uploaded-new-version](/images/docs/appstore/application-lifecycle-management/uploaded-new-version.jpg) + + ![see-new-version](/images/docs/appstore/application-lifecycle-management/see-new-version.jpg) + +### Step 7: Upgrade + +After a new version is released to the App Store, all users can upgrade this application to the new version. + +{{< notice note >}} + +To follow the steps below, you must deploy an app of one of its old versions first. In this example, Redis 11.3.4 was already deployed in the project `demo-project` and its new version 12.0.0 was released to the App Store. + +{{}} + +1. Log in KubeSphere as `project-regular`, navigate to the **Applications** page of the project, and click the app to be upgraded. + + ![app-to-be-upgraded](/images/docs/appstore/application-lifecycle-management/app-to-be-upgraded.jpg) + +2. Under **App Template**, select **Version Info**. You can see all released app versions in the list. The app version you are using currently is marked with **Current Version**. To upgrade your app to a specific version, click **Upgrade** on the right of the version number. + + {{< notice note >}} + + You must move your cursor onto the app version to see the **Upgrade** button. + + {{}} + + ![upgrade-an-app](/images/docs/appstore/application-lifecycle-management/upgrade-an-app.jpg) + +3. On the **Applications** page, you can see that the app is being upgraded. The status will change to **active** when the upgrade finishes. + + ![version-upgraded](/images/docs/appstore/application-lifecycle-management/version-upgraded.jpg) + + ![upgrade-finish](/images/docs/appstore/application-lifecycle-management/upgrade-finish.jpg) + +### Step 8: Suspend App + +You can choose to remove an app entirely from the App Store or suspend a specific app version. + +1. Log in KubeSphere as `reviewer`. Click **Platform** in the top left corner and go to **App Store Management**. On the **App Store** page, click Redis. + + ![remove-app](/images/docs/appstore/application-lifecycle-management/remove-app.jpg) + +2. On the detail page, click **Suspend App** and select **OK** in the dialogue to confirm the operation to remove the app from the App Store. + + ![suspend-app](/images/docs/appstore/application-lifecycle-management/suspend-app.jpg) + + {{< notice note >}} + + Removing an app from the App Store does not affect tenants who are using the app. + + {{}} + +3. To make the app available in the App Store again, click **Activate App**. + + ![activate-app](/images/docs/appstore/application-lifecycle-management/activate-app.jpg) + +4. To suspend a specific app version, expand the version menu and click **Suspend Version**. In the dialogue that appears, click **OK** to confirm. + + ![suspend-version](/images/docs/appstore/application-lifecycle-management/suspend-version.jpg) + + {{< notice note >}} + + After an app version is suspended, this version is not available in the App Store. Suspending an app version does not affect tenants who are using this version. + + {{}} + +5. To make the app version available in the App Store again, click **Activate Version**. + + ![activate-version](/images/docs/appstore/application-lifecycle-management/activate-version.jpg) + + + + + + + + + diff --git a/content/zh/docs/application-store/built-in-apps/_index.md b/content/zh/docs/application-store/built-in-apps/_index.md index 0f2ce8a6d..9b99284ac 100644 --- a/content/zh/docs/application-store/built-in-apps/_index.md +++ b/content/zh/docs/application-store/built-in-apps/_index.md @@ -1,5 +1,5 @@ --- -linkTitle: "Built-in Applications" +linkTitle: "内置应用" weight: 2200 _build: diff --git a/content/zh/docs/application-store/built-in-apps/etcd-app.md b/content/zh/docs/application-store/built-in-apps/etcd-app.md new file mode 100644 index 000000000..22c09e4cd --- /dev/null +++ b/content/zh/docs/application-store/built-in-apps/etcd-app.md @@ -0,0 +1,76 @@ +--- +title: "Deploy etcd on KubeSphere" +keywords: 'Kubernetes, KubeSphere, etcd, app-store' +description: 'How to deploy etcd on KubeSphere.' +linkTitle: "Deploy etcd on KubeSphere" +weight: 2240 +--- + +Written in Go, [etcd](https://etcd.io/) is a distributed key-value store to store data that needs to be accessed by a distributed system or cluster of machines. In Kubernetes, it is the backend for service discovery and stores cluster states and configurations. + +This tutorial walks you through an example of deploying etcd from the App Store of KubeSphere. + +## Prerequisites + +- Please make sure you [enable the OpenPitrix system](https://kubesphere.io/docs/pluggable-components/app-store/). +- You need to create a workspace, a project, and a user account (`project-regular`) for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, you log in as `project-regular` and work in the project `demo-project` in the workspace `demo-workspace`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Deploy etcd from App Store + +1. On the **Overview** page of the project `demo-project`, click **App Store** in the top left corner. + + ![project-overview](/images/docs/appstore/built-in-apps/etcd-app/project-overview.jpg) + +2. Find etcd and click **Deploy** on the **App Info** page. + + ![etcd-app-store](/images/docs/appstore/built-in-apps/etcd-app/etcd-app-store.jpg) + + ![deploy-etcd](/images/docs/appstore/built-in-apps/etcd-app/deploy-etcd.jpg) + +3. Set a name and select an app version. Make sure etcd is deployed in `demo-project` and click **Next**. + + ![deployment-location](/images/docs/appstore/built-in-apps/etcd-app/deployment-location.jpg) + +4. On the **App Config** page, specify the size of the persistent volume for etcd and click **Deploy**. + + ![specify-volume](/images/docs/appstore/built-in-apps/etcd-app/specify-volume.jpg) + + {{< notice note >}} + + To specify more values for etcd, use the toggle switch to see the app's manifest in YAML format and edit its configurations. + + {{}} + +5. In **App Templates** of the **Applications** page, wait until etcd is up and running. + + ![etcd-running](/images/docs/appstore/built-in-apps/etcd-app/etcd-running.jpg) + +### Step 2: Access etcd Service + +After the app is deployed, you can use etcdctl, a command-line tool for interacting with etcd server, to access etcd on the KubeSphere console directly. + +1. Navigate to **StatefulSets** in **Workloads**, click the service name of etcd. + + ![etcd-statefulset](/images/docs/appstore/built-in-apps/etcd-app/etcd-statefulset.jpg) + +2. Under **Pods**, expand the menu to see container details, and then click the **Terminal** icon. + + ![etcd-teminal](/images/docs/appstore/built-in-apps/etcd-app/etcd-teminal.jpg) + +3. In the terminal, you can read and write data directly. For example, execute the following two commands respectively. + + ```bash + etcdctl set /name kubesphere + ``` + + ```bash + etcdctl get /name + ``` + + ![etcd-command](/images/docs/appstore/built-in-apps/etcd-app/etcd-command.jpg) + +4. For clients within the KubeSphere cluster, the etcd service can be accessed through `..svc.:2379` (e.g. `etcd-bqe0g4.demo-project.svc.cluster.local:2379` in this guide). + +5. For more information, see [the official documentation of etcd](https://etcd.io/docs/v3.4.0/). \ No newline at end of file diff --git a/content/zh/docs/application-store/built-in-apps/gitlab-app.md b/content/zh/docs/application-store/built-in-apps/gitlab-app.md deleted file mode 100644 index 2d75bf7df..000000000 --- a/content/zh/docs/application-store/built-in-apps/gitlab-app.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "GitLab App" -keywords: 'kubernetes, kubesphere, gitlab, app-store' -description: 'How to use built-in GitLab' - - -weight: 2240 ---- - -TBD diff --git a/content/zh/docs/application-store/built-in-apps/harbor-app.md b/content/zh/docs/application-store/built-in-apps/harbor-app.md index 75ea5a816..742a58f78 100644 --- a/content/zh/docs/application-store/built-in-apps/harbor-app.md +++ b/content/zh/docs/application-store/built-in-apps/harbor-app.md @@ -6,5 +6,102 @@ description: 'How to use built-in Harbor registry' weight: 2242 --- +From the [Introduction](../../_index) section, you know there was uncounted application could be installed by helm. [kubesphere\'s App Store](https://charts.kubesphere.io/main/) also added some popular application. -TBD +This tutorial walks you through an example of how to deploy [Harbor](https://goharbor.io/) with several click in kubesphere. + +## Prerequisites + +- Please make sure you [enable the OpenPitrix system](https://kubesphere.io/docs/pluggable-components/app-store/). We will deploy Harbor from the App Store. +- You need to create a [workspace, a project, and a user account](https://kubesphere.io/docs/quick-start/create-workspace-and-project/) for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, you log in as `project-operator` and work in the project `demo` in the workspace `demo-wp`. + +## Hands-on Lab + +### Common steps + +1. Choose harbor template `From App Store`. + +![choose_app_from_store](/images/docs/appstore/harbor/choose_app_from_store.png) + +2. Choose harbor **version** and **deployment location**, then click `Next`. + +![deploy_set_of_harbor](/images/docs/appstore/harbor/deploy_set_of_harbor.png) + +3. Config harbor yaml, then click `Deploy`. There was an example yaml in section **FAQ**. + +![config_of_harbor_deploy](/images/docs/appstore/harbor/config_of_harbor_deploy.png) + +> `type` : how to expose the service. It\'s related to kubernetes service. +> `tls` : means whether to enable https. Simply set it as **false** for common scenario. +> `externalURL` : the url exposed to user. + +{{< notice warning >}} +Don't forget to edit **externalURL**, if you have trouble in login after harbor deployed, edit this may helpful. +{{}} + +4. Check the status of deployment, then try to login harbor by use the `expose.type` you defined. + +For this example, we use `http://172.23.5.6:30002` to access to harbor which defined at step 3. + +![active_of_harbor](/images/docs/appstore/harbor/active_of_harbor.png) + +![overview_of_harbor_login](/images/docs/appstore/harbor/overview_of_harbor_login.png) + +### FAQ + +1. How to enable http login ? + +* set `tls.enabled` as false in step 3. `externalURL` \'s protocol should be as same as the `expose.type.ports`. +* if use docker login, set `externalURL` as one of `insecure-registries` in **daemon.json**, then reload docker. +* the keywords showed in the yaml below, you should notice. + +```yaml +## NOTICE 172.23.5.6 is the test host ip, should use your ip +expose: + type: nodePort + tls: + enabled: false + secretName: "" + notarySecretName: "" + # commonName should modify + commonName: "172.23.5.6" + nodePort: + # The name of NodePort service + name: harbor + ports: + http: + # The service port Harbor listens on when serving with HTTP + port: 80 + # The node port Harbor listens on when serving with HTTP + nodePort: 30002 + https: + # The service port Harbor listens on when serving with HTTPS + port: 443 + # The node port Harbor listens on when serving with HTTPS + nodePort: 30003 + # Only needed when notary.enabled is set to true + notary: + # The service port Notary listens on + port: 4443 + # The node port Notary listens on + nodePort: 30004 + +externalURL: http://172.23.5.6:30002 + +# The initial password of Harbor admin. Change it from portal after launching Harbor +harborAdminPassword: "Harbor12345" +# The secret key used for encryption. Must be a string of 16 chars. +secretKey: "not-a-secure-key" +``` + +2. How to enable https login ? + + a. use self signed certificates. + * set `tls.enabled` as true in step 3, and edit **externalURL** properly. + * copy the ca certificates stored in pod `harbor-core` \'s `/etc/core/ca` to your host. + * trust the ca certificates by your host first, then restart docker. + + b. use public ssl. + * add certificates as a secrets. + * set `tls.enabled` as true in step 3, and edit **externalURL** properly. + * edit `tls.secretName`. \ No newline at end of file diff --git a/content/zh/docs/application-store/built-in-apps/memcached-app.md b/content/zh/docs/application-store/built-in-apps/memcached-app.md new file mode 100644 index 000000000..75cc29781 --- /dev/null +++ b/content/zh/docs/application-store/built-in-apps/memcached-app.md @@ -0,0 +1,65 @@ +--- +title: "Deploy Memcached on KubeSphere" +keywords: 'Kubernetes, KubeSphere, Memcached, app-store' +description: 'How to deploy Memcached on KubeSphere through App Store' +linkTitle: "Deploy Memcached on KubeSphere" +weight: 2242 +--- +[Memcached](https://memcached.org/) is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. Its API is available for the majority of popular languages. + +This tutorial walks you through an example of deploying Memcached from the App Store of KubeSphere. + +## Prerequisites + +- Please make sure you [enable the OpenPitrix system](https://kubesphere.io/docs/pluggable-components/app-store/). +- You need to create a workspace, a project, and a user account (`project-regular`) for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, you log in as `project-regular` and work in the project `demo-project` in the workspace `demo-workspace`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Deploy Memcached from App Store + +1. On the **Overview** page of the project `demo-project`, click **App Store** in the top left corner. + + ![in-app-store](/images/docs/appstore/built-in-apps/memcached-app/in-app-store.jpg) + +2. Find Memcached and click **Deploy** on the **App Info** page. + + ![memcached-app-store](/images/docs/appstore/built-in-apps/memcached-app/memcached-app-store.jpg) + + ![deploying-memcached](/images/docs/appstore/built-in-apps/memcached-app/deploying-memcached.jpg) + +3. Set a name and select an app version. Make sure Memcached is deployed in `demo-project` and click **Next**. + + ![deployment-confirm](/images/docs/appstore/built-in-apps/memcached-app/deployment-confirm.jpg) + +4. In **App Config**, you can use the default configuration or customize the configuration by editing the YAML file directly. Click **Deploy** to continue. + + ![edit-config](/images/docs/appstore/built-in-apps/memcached-app/edit-config.jpg) + +5. Wait until Memcached is up and running. + + ![memcached-running](/images/docs/appstore/built-in-apps/memcached-app/memcached-running.jpg) + +### Step 2: Access Memcached + +1. Navigate to **Services**, click the service name of Memcached. + + ![memcached-service](/images/docs/appstore/built-in-apps/memcached-app/memcached-service.jpg) + +2. On the detail page, you can find the port number and Pod IP under **Service Ports** and **Pods** respectively. + + ![memcached-port-pod](/images/docs/appstore/built-in-apps/memcached-app/memcached-port-pod.jpg) + +3. As the Memcached service is headless, access it inside the cluster through the Pod IP and port number. The basic syntax of Memcached `telnet` command is `telnet HOST PORT`. For example: + + ```bash + # telnet 10.10.235.3 11211 + Trying 10.10.235.3... + Connected to 10.10.235.3. + Escape character is '^]'. + set runoob 0 900 9 + memcached + STORED + ``` + +4. For more information, see [Memcached](https://memcached.org/). \ No newline at end of file diff --git a/content/zh/docs/application-store/built-in-apps/minio-app.md b/content/zh/docs/application-store/built-in-apps/minio-app.md new file mode 100644 index 000000000..4b00e505a --- /dev/null +++ b/content/zh/docs/application-store/built-in-apps/minio-app.md @@ -0,0 +1,82 @@ +--- +title: "Deploy MinIO on KubeSphere" +keywords: 'Kubernetes, KubeSphere, Minio, app-store' +description: 'How to deploy Minio on KubeSphere from the App Store of KubeSphere' +linkTitle: "Deploy MinIO on KubeSphere" + +weight: 2242 +--- +[MinIO](https://min.io/) object storage is designed for high performance and the S3 API. It is ideal for large, private cloud environments with stringent security requirements and delivers mission-critical availability across a diverse range of workloads. + +This tutorial walks you through an example of deploying MinIO from the App Store of KubeSphere. + +## Prerequisites + +- Please make sure you [enable the OpenPitrix system](../../../pluggable-components/app-store/). +- You need to create a workspace, a project, and a user account (`project-regular`) for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, you log in as `project-regular` and work in the project `demo-project` in the workspace `demo-workspace`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Deploy MinIO from App Store + +1. On the **Overview** page of the project `demo-project`, click **App Store** in the top left corner. + + ![minio-app](/images/docs/appstore/built-in-apps/minio-app/minio-app.jpg) + +2. Find MinIO and click **Deploy** on the **App Info** page. + + ![minio-in-app-store](/images/docs/appstore/built-in-apps/minio-app/minio-in-app-store.jpg) + + ![deploy-minio](/images/docs/appstore/built-in-apps/minio-app/deploy-minio.jpg) + +3. Set a name and select an app version. Make sure MinIO is deployed in `demo-project` and click **Next**. + + ![minio-deploy](/images/docs/appstore/built-in-apps/minio-app/minio-deploy.jpg) + +4. In **App Config**, you can use the default configuration or customize the configuration by editing the YAML file directly. Click **Deploy** to continue. + + ![deloy-minio-2](/images/docs/appstore/built-in-apps/minio-app/deloy-minio-2.jpg) + +5. Wait until MinIO is up and running. + + ![minio-in-list](/images/docs/appstore/built-in-apps/minio-app/minio-in-list.jpg) + +### Step 2: Access MinIO Browser + +To access MinIO outside the cluster, you need to expose the app through NodePort first. + +1. Go to **Services** and click the service name of MinIO. + + ![minio-detail](/images/docs/appstore/built-in-apps/minio-app/minio-detail.jpg) + +2. Click **More** and select **Edit Internet Access** from the drop-down menu. + + ![edit-internet-access](/images/docs/appstore/built-in-apps/minio-app/edit-internet-access.jpg) + +3. Select **NodePort** for **Access Method** and click **OK**. For more information, see [Project Gateway](../../../project-administration/project-gateway/). + + ![nodeport](/images/docs/appstore/built-in-apps/minio-app/nodeport.jpg) + +4. Under **Service Ports**, you can see the port is exposed. + + ![port-exposed](/images/docs/appstore/built-in-apps/minio-app/port-exposed.jpg) + +5. To access the MinIO browser, you need `accessKey` and `secretKey`, which are specified in the configuration file of MinIO. Go to **App Templates** in **Applications**, click MinIO, and you can find the value of these two fields under the tab **Configuration Files**. + + ![template-list](/images/docs/appstore/built-in-apps/minio-app/template-list.jpg) + + ![config-file](/images/docs/appstore/built-in-apps/minio-app/config-file.jpg) + +6. Access the MinIO browser through `{$NodeIP}:{$Nodeport}` using `accessKey` and `secretKey`. + + ![minio-browser](/images/docs/appstore/built-in-apps/minio-app/minio-browser.jpg) + + ![minio-browser-interface](/images/docs/appstore/built-in-apps/minio-app/minio-browser-interface.jpg) + + {{< notice note >}} + + You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed. + + {{}} + +7. For more information about MinIO, refer to [the official documentation of MinIO](https://docs.min.io/). \ No newline at end of file diff --git a/content/zh/docs/application-store/built-in-apps/mysql-app.md b/content/zh/docs/application-store/built-in-apps/mysql-app.md new file mode 100644 index 000000000..ba1aed783 --- /dev/null +++ b/content/zh/docs/application-store/built-in-apps/mysql-app.md @@ -0,0 +1,91 @@ +--- +title: "Deploy MySQL on KubeSphere" +keywords: 'KubeSphere, Kubernetes, Installation, MySQL' +description: 'How to deploy MySQL on KubeSphere through App Store' + +link title: "Deploy MySQL" +weight: 345 +--- +[MySQL](https://www.mysql.com/) is an open-source relational database management system (RDBMS), which uses the most commonly used database management language - Structured Query Language (SQL) for database management. It provides a fully managed database service to deploy cloud-native applications using the world’s most popular open-source database. + +This tutorial walks you through an example of deploying MySQL from the App Store of KubeSphere. + +## Prerequisites + +- Please make sure you [enable the OpenPitrix system](https://kubesphere.io/docs/pluggable-components/app-store/). +- You need to create a workspace, a project, and a user account for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, you log in as `project-regular` and work in the project `demo-project` in the workspace `demo-workspace`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Deploy MySQL from App Store + +1. On the **Overview** page of the project `demo-project`, click **App Store** in the top left corner. + + ![go-to-app-store](/images/docs/appstore/built-in-apps/mysql-app/go-to-app-store.jpg) + +2. Find MySQL and click **Deploy** on the **App Info** page. + + ![find-mysql](/images/docs/appstore/built-in-apps/mysql-app/find-mysql.jpg) + + ![click-deploy](/images/docs/appstore/built-in-apps/mysql-app/click-deploy.jpg) + +3. Set a name and select an app version. Make sure MySQL is deployed in `demo-project` and click **Next**. + + ![deploy-mysql](/images/docs/appstore/built-in-apps/mysql-app/deploy-mysql.jpg) + +4. In **App Config**, uncomment the `mysqlRootPassword` field or customize the password. Click **Deploy** to continue. + + ![uncomment-password](/images/docs/appstore/built-in-apps/mysql-app/uncomment-password.jpg) + +5. Wait until MySQL is up and running. + + ![mysql-running](/images/docs/appstore/built-in-apps/mysql-app/mysql-running.jpg) + +### Step 2: Access MySQL Terminal + +1. Go to **Workloads** and click the service name of MySQL. + + ![mysql-workload](/images/docs/appstore/built-in-apps/mysql-app/mysql-workload.jpg) + +2. Under **Pods**, expand the menu to see container details, and then click the **Terminal** icon. + + ![mysql-teminal](/images/docs/appstore/built-in-apps/mysql-app/mysql-teminal.jpg) + +3. In the terminal, execute `mysql -uroot -ptesting` to log in MySQL as the root user. + + ![log-in-mysql](/images/docs/appstore/built-in-apps/mysql-app/log-in-mysql.jpg) + +### Step 3: Access MySQL Database outside Cluster + +To access MySQL outside the cluster, you need to expose the app through NodePort first. + +1. Go to **Services** and click the service name of MySQL. + + ![mysql-service](/images/docs/appstore/built-in-apps/mysql-app/mysql-service.jpg) + +2. Click **More** and select **Edit Internet Access** from the drop-down menu. + + ![edit-internet-access](/images/docs/appstore/built-in-apps/mysql-app/edit-internet-access.jpg) + +3. Select **NodePort** for **Access Method** and click **OK**. For more information, see [Project Gateway](../../../project-administration/project-gateway/). + + ![nodeport-mysql](/images/docs/appstore/built-in-apps/mysql-app/nodeport-mysql.jpg) + +4. Under **Service Ports**, you can see the port is exposed. The port and public IP will be used in the next step to access the MySQL database. + + ![mysql-port-number](/images/docs/appstore/built-in-apps/mysql-app/mysql-port-number.jpg) + +5. To access your MySQL database, you need to use the MySQL client or install a third-party application such as SQLPro Studio for the connection. The following example demonstrates how to access the MySQL database through SQLPro Studio. + + ![login](/images/docs/appstore/built-in-apps/mysql-app/login.jpg) + + ![access-mysql-success](/images/docs/appstore/built-in-apps/mysql-app/access-mysql-success.jpg) + + {{< notice note >}} + + You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed. + + {{}} + +6. For more information about MySQL, refer to [the official documentation of MySQL](https://dev.mysql.com/doc/). + diff --git a/content/zh/docs/application-store/built-in-apps/postgresql-app.md b/content/zh/docs/application-store/built-in-apps/postgresql-app.md new file mode 100644 index 000000000..715148fd5 --- /dev/null +++ b/content/zh/docs/application-store/built-in-apps/postgresql-app.md @@ -0,0 +1,82 @@ +--- +title: "Deploy PostgreSQL on KubeSphere" +keywords: 'Kubernetes, KubeSphere, PostgreSQL, app-store' +description: 'How to deploy PostgreSQL from the App Store of KubeSphere' +linkTitle: "Deploy PostgreSQL on KubeSphere" +weight: 2242 +--- + +[PostgreSQL](https://www.postgresql.org/) is a powerful, open-source object-relational database system which is famous for reliability, feature robustness, and performance. + +This tutorial walks you through an example of how to deploy PostgreSQL from the App Store of KubeSphere. + +## Prerequisites + +- Please make sure you [enable the OpenPitrix system](../../../pluggable-components/app-store/). +- You need to create a workspace, a project, and a user account (`project-regular`) for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, you log in as `project-regular` and work in the project `demo-project` in the workspace `demo-workspace`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Deploy PostgreSQL from App Store + +1. On the **Overview** page of the project `demo-project`, click **App Store** in the top left corner. + + ![click-app-store](/images/docs/appstore/built-in-apps/postgresql-app/click-app-store.jpg) + +2. Find PostgreSQL and click **Deploy** on the **App Info** page. + + ![postgresql-in-app-store](/images/docs/appstore/built-in-apps/postgresql-app/postgresql-in-app-store.jpg) + + ![deploy-postgresql](/images/docs/appstore/built-in-apps/postgresql-app/deploy-postgresql.jpg) + +3. Set a name and select an app version. Make sure PostgreSQL is deployed in `demo-project` and click **Next**. + + ![deploy-postgresql-2](/images/docs/appstore/built-in-apps/postgresql-app/deploy-postgresql-2.jpg) + +4. In **App Config**, specify persistent volumes for the app and record the username and the password which will be used later to access the app. When you finish, click **Deploy**. + + ![set-config](/images/docs/appstore/built-in-apps/postgresql-app/set-config.jpg) + + {{< notice note >}} + + To specify more values for PostgreSQL, use the toggle switch to see the app’s manifest in YAML format and edit its configurations. + + {{}} + +5. Wait until PostgreSQL is up and running. + + ![postgresql-ready](/images/docs/appstore/built-in-apps/postgresql-app/postgresql-ready.jpg) + +### Step 2: Access PostgreSQL Database + +To access MySQL outside the cluster, you need to expose the app through NodePort first. + +1. Go to **Services** and click the service name of PostgreSQL. + + ![access-postgresql](/images/docs/appstore/built-in-apps/postgresql-app/access-postgresql.jpg) + +2. Click **More** and select **Edit Internet Access** from the drop-down menu. + + ![edit-internet-access](/images/docs/appstore/built-in-apps/postgresql-app/edit-internet-access.jpg) + +3. Select **NodePort** for **Access Method** and click **OK**. For more information, see [Project Gateway](../../../project-administration/project-gateway/). + + ![nodeport](/images/docs/appstore/built-in-apps/postgresql-app/nodeport.jpg) + +4. Under **Service Ports**, you can see the port is exposed, which will be used in the next step to access the PostgreSQL database. + + ![port-number](/images/docs/appstore/built-in-apps/postgresql-app/port-number.jpg) + +5. Expand the Pod menu under **Pods** and click the Terminal icon. In the pop-up window, enter commands directly to access the database. + + ![container-terminal](/images/docs/appstore/built-in-apps/postgresql-app/container-terminal.jpg) + + ![postgresql-output](/images/docs/appstore/built-in-apps/postgresql-app/postgresql-output.jpg) + + {{< notice note >}} + + You can also use a third-party application such as SQLPro Studio to connect to the database. You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed. + + {{}} + +6. For more information, see [the official documentation of PostgreSQL](https://www.postgresql.org/docs/). \ No newline at end of file diff --git a/content/zh/docs/application-store/built-in-apps/rabbitmq-app.md b/content/zh/docs/application-store/built-in-apps/rabbitmq-app.md new file mode 100644 index 000000000..d133da39b --- /dev/null +++ b/content/zh/docs/application-store/built-in-apps/rabbitmq-app.md @@ -0,0 +1,83 @@ +--- +title: "Deploy RabbitMQ on KubeSphere" +keywords: 'KubeSphere, RabbitMQ, Kubernetes, Installation' +description: 'How to deploy RabbitMQ on KubeSphere through App Store' + +link title: "Deploy RabbitMQ" +weight: 251 +--- +[RabbitMQ](https://www.rabbitmq.com/) is the most widely deployed open-source message broker. It is lightweight and easy to deploy on premises and in the cloud. It supports multiple messaging protocols. RabbitMQ can be deployed in distributed and federated configurations to meet high-scale, high-availability requirements. + +This tutorial walks you through an example of how to deploy RabbitMQ from the App Store of KubeSphere. + +## Prerequisites + +- Please make sure you [enable the OpenPitrix system](https://kubesphere.io/docs/pluggable-components/app-store/). +- You need to create a workspace, a project, and a user account for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, you log in as `project-regular` and work in the project `demo-project` in the workspace `demo-workspace`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Deploy RabbitMQ from App Store + +1. On the **Overview** page of the project `demo-project`, click **App Store** in the top left corner. + + ![rabbitmq01](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq01.jpg) + +2. Find RabbitMQ and click **Deploy** on the **App Info** page. + + ![find-rabbitmq](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq02.jpg) + + ![click-deploy](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq021.jpg) + +3. Set a name and select an app version. Make sure RabbitMQ is deployed in `demo-project` and click **Next**. + + ![rabbitmq03](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq03.jpg) + +4. In **App Config**, you can use the default configuration directly or customize the configuration either by specifying fields in a form or editing the YAML file. Record the value of **Root Username** and the value of **Root Password**, which will be used later for login. Click **Deploy** to continue. + + ![rabbitMQ11](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitMQ11.jpg) + + ![rabbitMQ04](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitMQ04.jpg) + + {{< notice tip >}} + + To see the manifest file, toggle the **YAML** switch. + + {{}} + +5. Wait until RabbitMQ is up and running. + + ![check-if-rabbitmq-is-running](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq05.jpg) + +### Step 2: Access RabbitMQ Dashboard + +To access RabbitMQ outside the cluster, you need to expose the app through NodePort first. + +1. Go to **Services** and click the service name of RabbitMQ. + + ![go-to-services](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq06.jpg) + +2. Click **More** and select **Edit Internet Access** from the drop-down menu. + + ![rabbitmq07](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq07.jpg) + +3. Select **NodePort** for **Access Method** and click **OK**. For more information, see [Project Gateway](../../../project-administration/project-gateway/). + + ![rabbitmq08](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq08.jpg) + +4. Under **Service Ports**, you can see ports are exposed. + + ![rabbitmq09](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq09.jpg) + +5. Access RabbitMQ **management** through `{$NodeIP}:{$Nodeport}`. Note that the username and password are those you set in **Step 1**. + ![rabbitmq-dashboard](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitmq-dashboard.jpg) + + ![rabbitma-dashboard-detail](/images/docs/appstore/built-in-apps/rabbitmq-app/rabbitma-dashboard-detail.jpg) + + {{< notice note >}} + + You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed. + + {{}} + +6. For more information about RabbitMQ, refer to [the official documentation of RabbitMQ](https://www.rabbitmq.com/documentation.html). \ No newline at end of file diff --git a/content/zh/docs/application-store/built-in-apps/redis-app.md b/content/zh/docs/application-store/built-in-apps/redis-app.md deleted file mode 100644 index 71b46bad2..000000000 --- a/content/zh/docs/application-store/built-in-apps/redis-app.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Redis App" -keywords: 'kubernetes, kubesphere, redis, app-store' -description: 'How to use built-in redis' - - -weight: 2245 ---- - -TBD diff --git a/content/zh/docs/application-store/built-in-apps/tomcat-app.md b/content/zh/docs/application-store/built-in-apps/tomcat-app.md new file mode 100644 index 000000000..b62b95ffb --- /dev/null +++ b/content/zh/docs/application-store/built-in-apps/tomcat-app.md @@ -0,0 +1,88 @@ +--- +title: "Deploy Tomcat on KubeSphere" +keywords: 'KubeSphere, Kubernetes, Installation, Tomcat' +description: 'How to deploy Tomcat on KubeSphere through App Store' + +link title: "Deploy Tomcat" +weight: 261 +--- +[Apache Tomcat](https://tomcat.apache.org/index.html) powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Tomcat provides a pure Java HTTP web server environment in which Java code can run. + +This tutorial walks you through an example of deploying Tomcat from the App Store of KubeSphere. + +## Prerequisites + +- Please make sure you [enable the OpenPitrix system](../../../pluggable-components/app-store/). +- You need to create a workspace, a project, and a user account for this tutorial. The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, you log in as `project-regular` and work in the project `demo-project` in the workspace `demo-workspace`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Deploy Tomcat from App Store + +1. On the **Overview** page of the project `demo-project`, click **App Store** in the top left corner. + + ![go-to-app-store](/images/docs/appstore/built-in-apps/tomcat-app/tomcat-app01.jpg) + +2. Find Tomcat and click **Deploy** on the **App Info** page. + + ![find-tomcat](/images/docs/appstore/built-in-apps/tomcat-app/find-tomcat.jpg) + + ![click-deploy](/images/docs/appstore/built-in-apps/tomcat-app/click-deploy.jpg) + +3. Set a name and select an app version. Make sure Tomcat is deployed in `demo-project` and click **Next**. + + ![click-next](/images/docs/appstore/built-in-apps/tomcat-app/click-next.jpg) + +4. In **App Config**, you can use the default configuration or customize the configuration by editing the YAML file directly. Click **Deploy** to continue. + + ![deploy-tomcat](/images/docs/appstore/built-in-apps/tomcat-app/deploy-tomcat.jpg) + +5. Wait until Tomcat is up and running. + + ![tomcat-running](/images/docs/appstore/built-in-apps/tomcat-app/tomcat-running.jpg) + +### Step 2: Access Tomcat Terminal + +1. Go to **Services** and click the service name of Tomcat. + + ![click-tomcat-service](/images/docs/appstore/built-in-apps/tomcat-app/click-tomcat-service.jpg) + +2. Under **Pods**, expand the menu to see container details, and then click the **Terminal** icon. + + ![tomcat-teminal-icon](/images/docs/appstore/built-in-apps/tomcat-app/tomcat-teminal-icon.jpg) + +3. You can view deployed projects in `/usr/local/tomcat/webapps`. + + ![view-project](/images/docs/appstore/built-in-apps/tomcat-app/view-project.jpg) + +### Step 3: Access Tomcat Project from Browser + +To access Tomcat projects outside the cluster, you need to expose the app through NodePort first. + +1. Go to **Services** and click the service name of Tomcat. + + ![click-tomcat-service](/images/docs/appstore/built-in-apps/tomcat-app/click-tomcat-service.jpg) + +2. Click **More** and select **Edit Internet Access** from the drop-down menu. + + ![edit-internet-access](/images/docs/appstore/built-in-apps/tomcat-app/edit-internet-access.jpg) + +3. Select **NodePort** for **Access Method** and click **OK**. For more information, see [Project Gateway](https://deploy-preview-492--kubesphere-v3.netlify.app/docs/project-administration/project-gateway/). + + ![nodeport](/images/docs/appstore/built-in-apps/tomcat-app/nodeport.jpg) + +4. Under **Service Ports**, you can see the port is exposed. + + ![exposed-port](/images/docs/appstore/built-in-apps/tomcat-app/exposed-port.jpg) + +5. Access the sample Tomcat project through `{$NodeIP}:{$Nodeport}` in your browser. + + ![access-tomcat-browser](/images/docs/appstore/built-in-apps/tomcat-app/access-tomcat-browser.jpg) + + {{< notice note >}} + + You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed. + + {{}} + +6. For more information about Tomcat, refer to [the official documentation of Tomcat](https://tomcat.apache.org/index.html). \ No newline at end of file diff --git a/content/zh/docs/application-store/external-apps/_index.md b/content/zh/docs/application-store/external-apps/_index.md new file mode 100644 index 000000000..ef40f932d --- /dev/null +++ b/content/zh/docs/application-store/external-apps/_index.md @@ -0,0 +1,7 @@ +--- +linkTitle: "External Applications" +weight: 2200 + +_build: + render: false +--- diff --git a/content/zh/docs/application-store/external-apps/gitlab-app.md b/content/zh/docs/application-store/external-apps/gitlab-app.md new file mode 100644 index 000000000..b27872b0c --- /dev/null +++ b/content/zh/docs/application-store/external-apps/gitlab-app.md @@ -0,0 +1,112 @@ +--- +title: "GitLab App" +keywords: 'kubernetes, kubesphere, gitlab, app-store' +description: 'How to deploy GitLab' + + +weight: 2240 +--- + +## Objective + +This tutorial shows you how to quickly deploy a [GitLab](https://gitlab.com/gitlab-org/gitlab) application using templates from KubeSphere Helm repo. The demonstration includes importing application repository, sharing and deploying apps within a workspace. + +## Prerequisites + +- You have enabled [OpenPitrix](/docs/pluggable-components/app-store/). +- You have completed the tutorial [Create Workspace, Project, Account and Role](/docs/quick-start/create-workspace-and-project/). The account needs to be a platform regular user and to be invited as the project operator with the `operator` role. In this tutorial, we'll work in the project `apps` of the workspace `apps`. + +## Hands-on Lab + +### Step 1: Add an Application Repository + +1.1. Sign in as workspace admin account (`apps-admin` for this guide), click **View Workspace** and navigate to **Apps Management → App Repos**, then click **Add Repo**. + + ![Add Repo](/images/docs/appstore/gitlab/add-repo.png) + +1.2. Fill in the basic information, name it `main` and input the URL https://charts.kubesphere.io/main. You can validate if this URL is available, and choose OK when you have done. + + {{< notice note >}} + It will automatically import all of the applications from the Helm repository into KubeSphere. You can browse those app templates in each project. + {{}} + + ![Add KS Repo](/images/docs/appstore/gitlab/add-ks-repo.png) + +### Step 2: Browse App Templates + +2.1. Switch to use workspace regular account to log in (`apps-regular` for this guide), then enter into project `apps`. + +2.2. Click **Application Workloads → Applications**, click **Deploy New Application**. + + ![Deploy App](/images/docs/appstore/gitlab/deploy-app.png) + +2.3. Choose **From App Templates** and select `main` from the dropdown list. Click `gitlab`. + + ![Deploy GitLab](/images/docs/appstore/gitlab/deploy-gitlab.png) + +### Step 3: Deploy GitLab Application + +3.1. Click **Deploy** at the top right, customize app name if needed, and then click **Next**. + + ![Deploy GitLab Info](/images/docs/appstore/gitlab/deploy-gitlab-info.png) + +3.2. Customize App Config, and then click **Deploy**. + +Generally we need to customize the domain name, and we'll use `apps.svc.cluster.local` here, which follows K8s internal DNS suffix for in-cluster access (the leading `apps` means the project `apps`, you can use your own project name accordingly). + + ```yaml + global: + hosts: + domain: apps.svc.cluster.local + + gitlab-runner: + install: false + + gitlab: + webservice: + helmTests: + enabled: false + ``` + + ![GitLab configuration](/images/docs/appstore/gitlab/deploy-gitlab-conf.png) + +3.3. Wait for a few minutes, then you will see the application `git` showing `active` in the application list. + + ![GitLab Active](/images/docs/appstore/gitlab/deploy-gitlab-done.png) + +### Step 4: Expose GitLab Service + +Set up a record `gitlab..svc.` in the DNS server, or simply put it in `hosts` file. + +```shell +172.24.2.3 gitlab.apps.svc.cluster.local +``` + +{{< notice note >}} + +- The hosts file is `/etc/hosts` for Linux or `c:\windows\system32\drivers\etc\hosts` for Windows. +- You can use the IP address of any K8s master/worker node. + +{{}} + +### Step 5: Access the GitLab Service + +5.1. Enter kubectl CLI by clicking the button in popup menu at the right bottom of KubeSphere console. + + ![kubectl](/images/docs/appstore/gitlab/kubectl.png) + +5.2. Retrieve and decode the root user's password. + + ```bash + kubectl -n apps get secrets git-gitlab-initial-root-password -o jsonpath="{.data.password}" | base64 -d; echo + ``` + + ![GitLab Password](/images/docs/appstore/gitlab/gitlab-password.png) + +5.3. Find the port of Nginx. + + ![Nginx Port](/images/docs/appstore/gitlab/nginx-port.png) + +5.4. Accessed GitLab `http://gitlab.apps.svc.cluster.local:` with the password. + + ![Sign in GitLab](/images/docs/appstore/gitlab/signin-gitlab.png) diff --git a/content/zh/docs/faq/_index.md b/content/zh/docs/faq/_index.md index 893f09dae..f2c84e2f7 100644 --- a/content/zh/docs/faq/_index.md +++ b/content/zh/docs/faq/_index.md @@ -1,6 +1,6 @@ --- title: "FAQ" -description: "FAQ is designed to answer and summarize the questions our users most frequently ask about KubeSphere." +description: "FAQ is designed to answer and summarize the questions users ask most frequently about KubeSphere." layout: "single" linkTitle: "FAQ" @@ -9,4 +9,4 @@ weight: 7000 icon: "/images/docs/docs.svg" --- -FAQ is designed to answer and summarize the questions our users most frequently ask about KubeSphere. This section is in a long-term maintenance for v3.0.x. +FAQ is designed to answer and summarize the questions users ask most frequently about KubeSphere. This section will be updated regularly for v3.0.x. \ No newline at end of file diff --git a/content/zh/docs/faq/byop.md b/content/zh/docs/faq/byop.md new file mode 100644 index 000000000..ef0251007 --- /dev/null +++ b/content/zh/docs/faq/byop.md @@ -0,0 +1,128 @@ +--- +title: "Bring your own Prometheus" +keywords: "Monitoring, Prometheus, node-exporter, kube-state-metrics, KubeSphere, Kubernetes" +description: "Use your own Prometheus stack for KubeSphere monitoring" + +Weight: 7100 +--- + +KubeSphere comes with several pre-installed customized monitoring components including Prometheus Operator, Prometheus, Alertmanager, Grafana (Optional), various service monitors, node-exporter, kube-state-metrics. These components might already exist before you install KubeSphere, it's possible to use your own Prometheus stack setup in KubeSphere v3.0.0 . + +## Steps to bring your own Prometheus + +To use your own Prometheus stack setup, the steps are as below: + +- Uninstall KubeSphere customized Prometheus stack + +- Install your own Prometheus stack + +- Install KubeSphere customized stuff to your Prometheus stack + +- Change KubeSphere's `monitoring endpoint` + +### 1. Uninstall KubeSphere customized Prometheus stack + +You can uninstall KubeSphere customized Prometheus stack as below: + +```bash +# Enter ks-installer pod +kubectl -n kubesphere-system exec -it `kubectl -n kubesphere-system get pod|grep ks-installer|awk '{print $1}'` -- /bin/sh +# Execute the following commands inside ks-installer pod to uninstall, pls ignore errors like below: +# Error from server (NotFound): error when deleting "/kubesphere/kubesphere/prometheus/xx/xxx.yaml": xxx "xxx" not found +kubectl delete -f /kubesphere/kubesphere/prometheus/alertmanager/ +kubectl delete -f /kubesphere/kubesphere/prometheus/devops/ +kubectl delete -f /kubesphere/kubesphere/prometheus/etcd/ +kubectl delete -f /kubesphere/kubesphere/prometheus/grafana/ +kubectl delete -f /kubesphere/kubesphere/prometheus/kube-state-metrics/ +kubectl delete -f /kubesphere/kubesphere/prometheus/node-exporter/ +kubectl delete -f /kubesphere/kubesphere/prometheus/upgrade/ +kubectl delete -f /kubesphere/kubesphere/prometheus/prometheus-rules-v1.16\+.yaml +kubectl delete -f /kubesphere/kubesphere/prometheus/prometheus-rules.yaml +kubectl delete -f /kubesphere/kubesphere/prometheus/prometheus +kubectl delete -f /kubesphere/kubesphere/prometheus/init/ +# Delete pvc Prometheus used +kubectl -n kubesphere-monitoring-system delete pvc `kubectl -n kubesphere-monitoring-system get pvc | grep -v VOLUME | awk '{print $1}' | tr '\n' ' '` +``` + +### 2. Install your own Prometheus stack + +{{< notice note >}} + +KubeSphere 3.0 was certified to work well with Prometheus Operator **v0.38.3+**, Prometheus **v2.20.1+**, Alertmanager **v0.21.0+**,kube-state-metrics **v1.9.6**, node-exporter **v0.18.1**, so please be aware that your Prometheus stack components' version meets these version requirements especially node-exporter and kube-state-metrics. + +If you've already had a Prometheus stack up and running, you can skip this step. + +{{}} + +Promethes stack can be installed in many ways, the following steps show how to install using `kube-prometheus`. + +```bash +# Get kube-prometheus version v0.6.0 whose node-exporter's version v0.18.1 matches the one KubeSphere v3.0.0 used +cd ~ && git clone https://github.com/prometheus-operator/kube-prometheus.git && cd kube-prometheus && git checkout tags/v0.6.0 -b v0.6.0 +# Setup monitoring namespace, install prometheus operator and corresponding roles +kubectl apply -f manifests/setup/ +# Wait until the prometheus operator is up and running +kubectl -n monitoring get pod --watch +# Remove unnecessary components like prometheus adapter +rm -rf manifests/prometheus-adapter-*.yaml +# Change kube-state-metrics to the same version v1.9.6 as KubeSphere v3.0.0 used +sed -i 's/v1.9.5/v1.9.6/g' manifests/kube-state-metrics-deployment.yaml +# Install Prometheus, Alertmanager, Grafana, kube-state-metrics, node-exporter +kubectl apply -f manifests/ +``` + +### 3. Install KubeSphere customized stuff to your Prometheus stack + +{{< notice note >}} + +KubeSphere 3.0 uses Prometheus Operator to manage Prometheus/Alertmanager config and lifecycle, ServiceMonitor (to manage scrape config), PrometheusRule (to manage Prometheus recording/alert rules). + +There are a few items listed in [KubeSphere kustomization](https://github.com/kubesphere/kube-prometheus/blob/ks-v3.0/kustomize/kustomization.yaml), among which `prometheus-rules.yaml` and `prometheus-rulesEtcd.yaml` are required for KubeSphere v3.0.0 to work properly and the others are optional. You can remove `alertmanager-secret.yaml` if you don't want your existing Alertmanager's config to be overwritten. You can remove `xxx-serviceMonitor.yaml` if you don't want your own `ServiceMonitors` to be overwritten (KubeSphere customized ServiceMonitors discard many irrelevant metrics to make sure Promethues only store the most useful metrics). + +If your Prometheus stack setup isn't managed by Prometheus Operator, you can skip this step. But you have to make sure that: + +- You must copy the recording/alerting rules in [PrometheusRule](https://github.com/kubesphere/kube-prometheus/blob/ks-v3.0/kustomize/prometheus-rules.yaml) and [PrometheusRule for ETCD](https://github.com/kubesphere/kube-prometheus/blob/ks-v3.0/kustomize/prometheus-rulesEtcd.yaml) to your Prometheus config for KubeSphere v3.0.0 to work properly. + +- Configure your Prometheus to scrape metrics from the same targets as the ServiceMonitors listed in [KubeSphere kustomization](https://github.com/kubesphere/kube-prometheus/blob/ks-v3.0/kustomize/kustomization.yaml) + +{{}} + +```bash +# Get KubeSphere v3.0.0 customized kube-prometheus +cd ~ && mkdir kubesphere && cd kubesphere && git clone https://github.com/kubesphere/kube-prometheus.git && cd kube-prometheus/kustomize +# Change to your own namespace in which Prometheus stack is deployed +sed -i 's/my-namespace//g' kustomization.yaml +# Apply KubeSphere customized stuff including Promethues rules, Alertmanager config, various ServiceMonitors. +kubectl apply -k . +# Setup service for kube-scheduler and kube-controller-manager metrics exposure +kubectl apply -f https://raw.githubusercontent.com/kubesphere/kube-prometheus/ks-v3.0/kustomize/prometheus-serviceKubeScheduler.yaml +kubectl apply -f https://raw.githubusercontent.com/kubesphere/kube-prometheus/ks-v3.0/kustomize/prometheus-serviceKubeControllerManager.yaml +# Find Prometheus CR which is usually k8s +kubectl -n monitoring get prometheus +# Set Prometheus rule evaluation interval to 1m to be consistent with KubeSphere v3.0.0 customized ServiceMonitor, rule evaluation interval should be greater or equal to scrape interval. +kubectl -n monitoring patch prometheus k8s --patch '{ + "spec": { + "evaluationInterval": "1m" + } +}' --type=merge +``` + +### 4. Change KubeSphere's `monitoring endpoint` + +Now your own Prometheus stack is up and running, it's time to change KubeSphere's monitoring endpoint to use your own Prometheus. + +Opening kubesphere-config by running `kubectl edit cm -n kubesphere-system kubesphere-config`, then find `monitoring endpoint` section like below: + +```bash + monitoring: + endpoint: http://prometheus-operated.kubesphere-monitoring-system.svc:9090 +``` + +Change monitoring endpoint to your own Prometheus: + +```bash + monitoring: + endpoint: http://prometheus-operated.monitoring.svc:9090 +``` + +Restart KubeSphere APIServer by running `kubectl -n kubesphere-system rollout restart deployment/ks-apiserver` \ No newline at end of file diff --git a/content/zh/docs/faq/console-faq.md b/content/zh/docs/faq/console-faq.md index 4f34ad8bd..66905a0dc 100644 --- a/content/zh/docs/faq/console-faq.md +++ b/content/zh/docs/faq/console-faq.md @@ -3,11 +3,11 @@ title: "Questions about KubeSphere Console" keywords: "FAQ, console, KubeSphere, Kubernetes" description: "FAQ is designed to answer and summarize the questions our users most frequently ask about KubeSphere Console." -Weight: 7100 +Weight: 7200 --- **What kind of browsers does KubeSphere support?** -In general, KubeSphere console supports some popular browsers including **Chrome, Firefox, Safari, Opera, and Edge.** You only need to consider the supported versions of these browsers listed in the green box of the table below: +In general, KubeSphere console supports major web browsers including **Chrome, Firefox, Safari, Opera, and Edge.** You only need to consider the supported versions of these browsers listed in the green box of the table below: ![supported browsers](/images/docs/faq/console-browser.png) diff --git a/content/zh/docs/faq/telemetry.md b/content/zh/docs/faq/telemetry.md index 0f3959df8..c0e69a5c9 100644 --- a/content/zh/docs/faq/telemetry.md +++ b/content/zh/docs/faq/telemetry.md @@ -3,7 +3,7 @@ title: "Telemetry in KubeSphere" keywords: "Installer, Telemetry, KubeSphere, Kubernetes" description: "Telemetry collects aggregate information of KubeSphere installation." -Weight: 7100 +Weight: 7300 --- Telemetry collects aggregate information about the size of KubeSphere clusters installed, KubeSphere and Kubernetes versions, components enabled, cluster running time, error logs, etc. KubeSphere promises that the information is only used by the KubeSphere community to improve products and will not be shared with any third parties. @@ -31,60 +31,60 @@ Telemetry is enabled by default when you install KubeSphere, while you also have When you install KubeSphere on existing Kubernetes clusters, you need to download the file [cluster-configuration.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml) for cluster setting. If you want to disable Telemetry, do not use `kubectl apply -f` directly for this file. -{{< notice note >}} +{{< notice note >}} If you install KubeSphere on Linux, see [Disable Telemetry after Installation](../telemetry/#disable-telemetry-after-installation) directly. -{{}} +{{}} -1. In the tutorial of [Installing KubeSphere on Kubernetes](../../installing-on-kubernetes/introduction/overview/), you execute `kubectl apply -f` first for the file [kubesphere-installer.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml). After that, create a local file `cluster-configuration.yaml` through the following command: +1. Download the file [cluster-configuration.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml) and open it for editing: -```bash -vi cluster-configuration.yaml -``` + ```bash + vi cluster-configuration.yaml + ``` -2. Copy all the content in the file [cluster-configuration.yaml](https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/cluster-configuration.yaml) and paste it to the local file just created. -3. Scroll down to the bottom of the file and add the value `telemetry_enabled: false` as follows: +2. In this local cluster-configuration.yaml file, scroll down to the bottom of the file and add the value `telemetry_enabled: false` as follows: -```yaml - openpitrix: - enabled: false - servicemesh: - enabled: false - telemetry_enabled: false # Add this line here to disable Telemetry. -``` + ```yaml + openpitrix: + enabled: false + servicemesh: + enabled: false + telemetry_enabled: false # Add this line here to disable Telemetry. + ``` -4. Save the file after you finish and execute the following command to start installation. +3. Save the file after you finish and execute the following commands to start installation. -```bash -kubectl apply -f cluster-configuration.yaml -``` + ```bash + kubectl apply -f https://github.com/kubesphere/ks-installer/releases/download/v3.0.0/kubesphere-installer.yaml + + kubectl apply -f cluster-configuration.yaml + ``` ### Disable Telemetry after Installation 1. Log in the console as `admin` and click **Platform** in the top left corner. + 2. Select **Clusters Management** and navigate to **CRDs**. -{{< notice note >}} - + {{< notice note >}} If you have enabled [the multi-cluster feature](../../multicluster-management/), you need to select a cluster first. - -{{}} + {{}} 3. Input `clusterconfiguration` in the search bar and click the result to go to its detail page. -![edit-crd](/images/docs/faq/telemetry-in-kubesphere/edit-crd.jpg) + ![edit-crd](/images/docs/faq/telemetry-in-kubesphere/edit-crd.jpg) 4. Click the three dots on the right of `ks-installer` and select **Edit YAML**. -![edit-ks-installer](/images/docs/faq/telemetry-in-kubesphere/edit-ks-installer.jpg) + ![edit-ks-installer](/images/docs/faq/telemetry-in-kubesphere/edit-ks-installer.jpg) 5. Scroll down to the bottom of the file and add the value `telemetry_enabled: false`. When you finish, click **Update**. -![enable-telemetry](/images/docs/faq/telemetry-in-kubesphere/enable-telemetry.jpg) + ![enable-telemetry](/images/docs/faq/telemetry-in-kubesphere/enable-telemetry.jpg) {{< notice note >}} If you want to enable Telemetry again, you can update `ks-installer` by deleting the value `telemetry_enabled: false` or changing it to `telemetry_enabled: true`. -{{}} \ No newline at end of file +{{}} diff --git a/content/zh/docs/project-user-guide/application/_index.md b/content/zh/docs/project-user-guide/application/_index.md new file mode 100644 index 000000000..e13f131ef --- /dev/null +++ b/content/zh/docs/project-user-guide/application/_index.md @@ -0,0 +1,7 @@ +--- +linkTitle: "Applications" +weight: 2079 + +_build: + render: false +--- diff --git a/content/zh/docs/project-user-guide/application/app-template.md b/content/zh/docs/project-user-guide/application/app-template.md new file mode 100644 index 000000000..865bbd4cb --- /dev/null +++ b/content/zh/docs/project-user-guide/application/app-template.md @@ -0,0 +1,37 @@ +--- +title: "App Templates" +keywords: 'Kubernetes, chart, Helm, KubeSphere, application, repository, template' +description: 'What are app templates.' +linkTitle: "App Templates" +weight: 2200 +--- + +An app template serves as a way for users to upload, deliver and manage apps. Generally, an app is composed of one or more Kubernetes workloads (e.g. [Deployments](../../../project-user-guide/application-workloads/deployments/), [StatefulSets](../../../project-user-guide/application-workloads/statefulsets/) and [DaemonSets](../../../project-user-guide/application-workloads/daemonsets/)) and [Services](../../../project-user-guide/application-workloads/services/) based on how it functions and communicates with the external environment. Apps that are uploaded as app templates are built based on a [Helm](https://helm.sh/) package. + +## How App Templates Work + +You can deliver Helm charts to the public repository of KubeSphere or import a private app repository to offer app templates. + +The public repository is also known as the App Store in KubeSphere, accessible to every tenant in a workspace. After [uploading the Helm chart of an app](../../../workspace-administration/upload-helm-based-application/), you can deploy your app to test its functions and submit it for review. Ultimately, you have the option to release it the App Store after it is approved. For more information, see [Application Lifecycle Management](../../../application-store/app-lifecycle-management/). + +![app-store](/images/docs/project-user-guide/applications/app-templates/app-store.jpg) + +For a private repository, only users with required permissions are allowed to [add private repositories](../../../workspace-administration/app-repository/import-helm-repository/) in a workspace. Generally, the private repository is built based on object storage services, such as MinIO. After imported to KubeSphere, these private repositories serve as application pools to provide app templates. + +![private-app-repository](/images/docs/project-user-guide/applications/app-templates/private-app-repository.jpg) + +{{< notice note >}} + +[For individual apps that are uploaded as Helm charts](../../../workspace-administration/upload-helm-based-application/) to KubeSphere, they display in the App Store together with built-in apps after approved and released. Besides, when you select app templates from private app repositories, you can also see **From workspace** in the list, which stores these individual apps uploaded as Helm charts. + +{{}} + +KubeSphere deploys app repository services based on [OpenPitrix](https://github.com/openpitrix/openpitrix) as a [pluggable component](../../../pluggable-components/app-store/). + +## Why App Templates + +App templates enable users to deploy and manage apps in a visualized way. Internally, they play an important role as shared resources (e.g. databases, middleware and operating systems) created by enterprises for the coordination and cooperation within teams. Externally, app templates set industry standards of building and delivery. Users can take advantage of app templates in different scenarios to meet their own needs through one-click deployment. + +In addition, as OpenPitrix is integrated to KubeSphere to provide application management across the entire lifecycle, the platform allows ISVs, developers and regular users to all participate in the process. Backed by the multi-tenant system of KubeSphere, each tenant is only responsible for their own part, such as app uploading, app review, release, test, and version management. Ultimately, enterprises can build their own App Store and enrich their application pools with their customized standards. As such, apps can also be delivered in a standardized fashion. + +For more information about how to use app templates, see [Deploy Apps from App Templates](../deploy-app-from-template/). \ No newline at end of file diff --git a/content/zh/docs/project-user-guide/application/compose-app.md b/content/zh/docs/project-user-guide/application/compose-app.md new file mode 100644 index 000000000..080c41655 --- /dev/null +++ b/content/zh/docs/project-user-guide/application/compose-app.md @@ -0,0 +1,10 @@ +--- +title: "Compose a Microservice App" +keywords: 'kubesphere, kubernetes, docker, devops, service mesh, openpitrix' +description: 'Compose a microservice-based application' + + +weight: 2230 +--- + +TBD diff --git a/content/zh/docs/project-user-guide/application/deploy-app-from-appstore.md b/content/zh/docs/project-user-guide/application/deploy-app-from-appstore.md new file mode 100644 index 000000000..41b06833e --- /dev/null +++ b/content/zh/docs/project-user-guide/application/deploy-app-from-appstore.md @@ -0,0 +1,86 @@ +--- +title: "Deploy Apps from App Store" +keywords: 'Kubernetes, chart, helm, KubeSphere, application, App Store' +description: 'How to deploy apps from the App Store.' +linkTitle: "Deploy Apps from App Store" +weight: 2220 +--- + +The [App Store](../../../application-store/) is also the public app repository on the platform, which means every tenant on the platform can view the applications in the Store regardless of which workspace they belong to. The App Store contains 15 featured enterprise-ready containerized apps and apps released by tenants from different workspaces on the platform. Any authenticated users can deploy applications from the Store. This is different from private app repositories which are only accessible to tenants in the workspace where private app repositories are imported. + +This tutorial demonstrates how to quickly deploy [NGINX](https://www.nginx.com/) from the KubeSphere App Store powered by [OpenPitrix](https://github.com/openpitrix/openpitrix) and access its service through NodePort. + +## Prerequisites + +- You have enabled [OpenPitirx (App Store)](../../../pluggable-components/app-store). +- You need to create a workspace, a project, and a user account (`project-regular`) for this tutorial. The account needs to be a platform regular user invited to the project with the `operator` role. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). + +## Hands-on Lab + +### Step 1: Deploy NGINX from App Store + +1. On the **Overview** page of the project `demo-project`, click **App Store** in the top left corner. + + ![app-store](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/app-store.jpg) + + {{< notice note >}} + + You can also click **Deploy New Application** and select **From App Store** to go to the App Store. + + {{}} + +2. Find NGINX and click **Deploy** on the **App Info** page. + + ![nginx-in-app-store](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/nginx-in-app-store.jpg) + + ![deploy-nginx](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/deploy-nginx.jpg) + +3. Set a name and select an app version. Make sure NGINX is deployed in `demo-project` and click **Next**. + + ![confirm-deployment](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/confirm-deployment.jpg) + +4. In **App Config**, specify the number of replicas to deploy for the app and enable Ingress based on your needs. When you finish, click **Deploy**. + + ![edit-config-nginx](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/edit-config-nginx.jpg) + + ![manifest-file](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/manifest-file.jpg) + + {{< notice note >}} + + To specify more values for NGINX, use the toggle switch to see the app’s manifest in YAML format and edit its configurations. + + {{}} + +5. Wait until NGINX is up and running. + + ![nginx-running](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/nginx-running.jpg) + +### Step 2: Access NGINX + +To access NGINX outside the cluster, you need to expose the app through NodePort first. + +1. Go to **Services** and click the service name of NGINX. + + ![nginx-service](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/nginx-service.jpg) + +2. On the service detail page, click **More** and select **Edit Internet Access** from the drop-down menu. + + ![edit-internet-access](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/edit-internet-access.jpg) + +3. Select **NodePort** for **Access Method** and click **OK**. For more information, see [Project Gateway](../../../project-administration/project-gateway/). + + ![nodeport](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/nodeport.jpg) + +4. Under **Service Ports**, you can see the port is exposed. + + ![exposed-port](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/exposed-port.jpg) + +5. Access NGINX through `{$NodeIP}:{$Nodeport}`. + + ![access-nginx](/images/docs/project-user-guide/applications/deploy-apps-from-app-store/access-nginx.jpg) + + {{< notice note >}} + + You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed. + + {{}} \ No newline at end of file diff --git a/content/zh/docs/project-user-guide/application/deploy-app-from-template.md b/content/zh/docs/project-user-guide/application/deploy-app-from-template.md new file mode 100644 index 000000000..5571fdef2 --- /dev/null +++ b/content/zh/docs/project-user-guide/application/deploy-app-from-template.md @@ -0,0 +1,131 @@ +--- +title: "Deploy Apps from App Templates" +keywords: 'Kubernetes, chart, helm, KubeSphere, application, app templates' +description: 'How to deploy apps from app templates in a private repository.' +linkTitle: "Deploy Apps from App Templates" + +weight: 2210 +--- + +When you deploy an app, you can select the app from the App Store which contains built-in apps of KubeSphere and [apps uploaded as Helm charts](../../../workspace-administration/upload-helm-based-application/). Alternatively, you can use apps from private app repositories added to KubeSphere to provide app templates. + +This tutorial demonstrates how to quickly deploy [Grafana](https://grafana.com/) using the app template from a private repository, which is based on QingStor object storage. + +## Prerequisites + +- You have enabled [OpenPitirx (App Store)](../../../pluggable-components/app-store). +- You have completed the tutorial of [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project/). Namely, you must have a workspace, a project and two user accounts (`ws-admin` and `project-regular`). `ws-admin` must be granted the role of `workspace-admin` in the workspace and `project-regular` must be granted the role of `operator` in the project. + +## Hands-on Lab + +### Step 1: Add an App Repository + +1. Log in the web console of KubeSphere as `ws-admin`. In your workspace, go to **App Repos** under **Apps Management**, and then click **Add Repo**. + + ![add-app-repo](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/add-app-repo.jpg) + +2. In the dialogue that appears, enter `test-repo` for the app repository name and `https://helm-chart-repo.pek3a.qingstor.com/kubernetes-charts/` for the repository URL. Click **Validate** to verify the URL and click **OK** to continue. + + ![input-repo-info](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/input-repo-info.jpg) + +3. Your repository displays in the list after successfully imported to KubeSphere. + + ![repository-list](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/repository-list.jpg) + + {{< notice note >}} + + For more information about dashboard properties as you add a private repository, see [Import Helm Repository](../../../workspace-administration/app-repository/import-helm-repository/). + + {{}} + +### Step 2: Deploy Grafana from App Templates + +1. Log out of KubeSphere and log back in as `project-regular`. In your project, choose **Applications** under **Application Workloads** and click **Deploy New Application**. + + ![create-new-app](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/create-new-app.jpg) + +2. Select **From App Templates** from the pop-up dialogue. + + ![select-app-templates](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/select-app-templates.jpg) + + **From App Store**: Choose built-in apps and apps uploaded individually as Helm charts. + + **From App Templates**: Choose apps from private app repositories and the workspace app pool. + +3. Select `test-repo` from the drop-down list, which is the private app repository just uploaded. + + ![private-app-template](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/private-app-template.jpg) + + {{< notice note >}} + + The option **From workspace** in the list represents the workspace app pool, which contains apps uploaded as Helm charts. They are also part of app templates. + + {{}} + +4. Input `Grafana` in the search bar to find the app, and then click it to deploy it. + + ![search-grafana](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/search-grafana.jpg) + + {{< notice note >}} + + The app repository used in this tutorial is synchronized from the Google Helm repository. Some apps in it may not be deployed successfully as their Helm charts are maintained by different organizations. + + {{}} + +5. You can view its app information and configuration files. Under **Versions**, select a version number from the list and click **Deploy**. + + ![deploy-grafana](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/deploy-grafana.jpg) + +6. Set an app name and confirm the version and deployment location. Click **Next** to continue. + + ![confirm-info](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/confirm-info.jpg) + +7. In **App Config**, you can manually edit the manifest file or click **Deploy** directly. + + ![app-config](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/app-config.jpg) + +8. Wait for Grafana to be up and running. + +### Step 3: Expose Grafana Service + +To access Grafana outside the cluster, you need to expose the app through NodePort first. + +1. Go to **Services** and click the service name of Grafana. + + ![grafana-services](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/grafana-services.jpg) + +2. Click **More** and select **Edit Internet Access** from the drop-down menu. + + ![edit-access](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/edit-access.jpg) + +3. Select **NodePort** for **Access Method** and click **OK**. For more information, see [Project Gateway](../../../project-administration/project-gateway/). + + ![nodeport](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/nodeport.jpg) + +4. Under **Service Ports**, you can see the port is exposed. + + ![exposed-port](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/exposed-port.jpg) + +### Step 4: Access Grafana + +1. To access the Grafana dashboard, you need the username and password. Navigate to **Secrets** and click the item that has the same name as the app name. + + ![grafana-secret](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/grafana-secret.jpg) + +2. On the detail page, click the eye icon first and you can see the username and password. + + ![secret-page](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/secret-page.jpg) + + ![click-eye-icon](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/click-eye-icon.jpg) + +2. Access Grafana through `${Node IP}:${NODEPORT}`. + + ![grafana-UI](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/grafana-UI.jpg) + + ![home-page](/images/docs/project-user-guide/applications/deploy-apps-from-app-templates/home-page.jpg) + + {{< notice note >}} + + You may need to open the port in your security groups and configure related port forwarding rules depending on your where your Kubernetes cluster is deployed. + + {{}} \ No newline at end of file diff --git a/content/zh/docs/project-user-guide/grayscale-release/blue-green-deployment.md b/content/zh/docs/project-user-guide/grayscale-release/blue-green-deployment.md index 2bc812253..d21bc6ad0 100644 --- a/content/zh/docs/project-user-guide/grayscale-release/blue-green-deployment.md +++ b/content/zh/docs/project-user-guide/grayscale-release/blue-green-deployment.md @@ -1,10 +1,98 @@ --- title: "Blue-green Deployment" -keywords: 'KubeSphere, kubernetes, docker, helm, jenkins, istio, prometheus' -description: 'Blue-green Deployment' +keywords: 'KubeSphere, Kubernetes, service mesh, istio, release, blue-green deployment' +description: 'How to implement blue-green deployment for an app.' linkTitle: "Blue-green Deployment" weight: 2130 --- -TBD \ No newline at end of file + +The blue-green release provides a zero downtime deployment, which means the new version can be deployed with the old one preserved. At any time, only one of the versions is active serving all the traffic, while the other one remains idle. If there is a problem with running, you can quickly roll back to the old version. + +![blue-green-0](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-0.png) + + +## Prerequisites + +- You need to enable [KubeSphere Service Mesh](../../../pluggable-components/service-mesh/). +- You need to create a workspace, a project and an account (`project-regular`). The account must be invited to the project with the role of `operator`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project). +- You need to enable **Application Governance** and have an available app so that you can implement the blue-green deployment for it. The sample app used in this tutorial is Bookinfo. For more information, see [Deploy Bookinfo and Manage Traffic](../../../quick-start/deploy-bookinfo-to-k8s/). + +## Create Blue-green Deployment Job + +1. Log in KubeSphere as `project-regular`. Under **Categories**, click **Create Job** on the right of **Blue-green Deployment**. + + ![blue-green-1](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-1.jpg) + +2. Set a name for it and click **Next**. + + ![blue-green-2](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-2.jpg) + +3. Select your app from the drop-down list and the service for which you want to implement the blue-green deployment. If you also use the sample app Bookinfo, select **reviews** and click **Next**. + + ![blue-green-3](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-3.jpg) + +4. On the **Grayscale Release Version** page, add another version of it (e.g `v2`) as shown in the image below and click **Next**: + + ![blue-green-4](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-4.jpg) + + {{< notice note >}} + + The image version is `v2` in the screenshot. + + {{}} + +5. To allow the app version `v2` to take over all the traffic, select **Take over all traffic** and click **Create**. + + ![blue-green-5](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-5.jpg) + +6. The blue-green deployment job created displays under the tab **Job Status**. Click it to view details. + + ![blue-green-job-list](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-job-list.jpg) + +7. Wait for a while and you can see all the traffic go to the version `v2`: + + ![blue-green-6](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-6.jpg) + +8. The new **Deployment** is created as well. + + ![version2-deployment](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/version2-deployment.jpg) + +9. You can directly get the virtual service to identify the weight by executing the following command: + + ```bash + kubectl -n demo-project get virtualservice -o yaml + ``` + + {{< notice note >}} + + - When you execute the command above, replace `demo-project` with your own project (i.e. namespace) name. + - If you want to execute the command from the web kubectl on the KubeSphere console, you need to use the account `admin`. + + {{}} + +10. Expected output: + + ```yaml + ... + spec: + hosts: + - reviews + http: + - route: + - destination: + host: reviews + port: + number: 9080 + subset: v2 + weight: 100 + ... + ``` + +## Take a Job Offline + +After you implement the blue-green deployment, and the result meets your expectation, you can take the task offline with the version `v1` removed by clicking **Job offline**. + +![blue-green-7](/images/docs/project-user-guide/grayscale-release/blue-green-deployment/blue-green-7.jpg) + diff --git a/content/zh/docs/project-user-guide/grayscale-release/canary-release.md b/content/zh/docs/project-user-guide/grayscale-release/canary-release.md index d9f1aa954..1c3191bd8 100644 --- a/content/zh/docs/project-user-guide/grayscale-release/canary-release.md +++ b/content/zh/docs/project-user-guide/grayscale-release/canary-release.md @@ -1,10 +1,107 @@ --- title: "Canary Release" -keywords: 'KubeSphere, kubernetes, docker, helm, jenkins, istio, prometheus' -description: 'Canary Release' +keywords: 'KubeSphere, Kubernetes, canary release, istio, service mesh' +description: 'How to implement the canary release for an app.' linkTitle: "Canary Release" weight: 2130 --- -TBD \ No newline at end of file +On the back of [Istio](https://istio.io/), KubeSphere provides users with necessary control to deploy canary services. In a canary release, you introduce a new version of a service and test it by sending a small percentage of traffic to it. At the same time, the old version is responsible for handling the rest of the traffic. If everything goes well, you can gradually increase the traffic sent to the new version, while simultaneously phasing out the old version. In the case of any occurring issues, KubeSphere allows you to roll back to the previous version as you change the traffic percentage. + +This method serves as an efficient way to test performance and reliability of a service. It can help detect potential problems in the actual environment while not affecting the overall system stability. + +![canary-release-0](/images/docs/project-user-guide/grayscale-release/canary-release/canary-release-0.png) + +## Prerequisites + +- You need to enable [KubeSphere Service Mesh](../../../pluggable-components/service-mesh/). +- You need to create a workspace, a project and an account (`project-regular`). The account must be invited to the project with the role of `operator`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project). +- You need to enable **Application Governance** and have an available app so that you can implement the canary release for it. The sample app used in this tutorial is Bookinfo. For more information, see [Deploy Bookinfo and Manage Traffic](../../../quick-start/deploy-bookinfo-to-k8s/). + +## Create Canary Release Job + +1. Log in KubeSphere as `project-regular`. Under **Categories**, click **Create Job** on the right of **Canary Release**. + + ![create-canary-release](/images/docs/project-user-guide/grayscale-release/canary-release/create-canary-release.jpg) + +2. Set a name for it and click **Next**. + + ![set-task-name](/images/docs/project-user-guide/grayscale-release/canary-release/set-task-name.jpg) + +3. Select your app from the drop-down list and the service for which you want to implement the canary release. If you also use the sample app Bookinfo, select **reviews** and click **Next**. + + ![cabary-release-3](/images/docs/project-user-guide/grayscale-release/canary-release/cabary-release-3.jpg) + +4. On the **Grayscale Release Version** page, add another version of it (e.g `v2`) as shown in the image below and click **Next**: + + ![canary-release-4](/images/docs/project-user-guide/grayscale-release/canary-release/canary-release-4.jpg) + + {{< notice note >}} + + The image version is `v2` in the screenshot. + + {{}} + +5. You send traffic to these two versions (`v1` and `v2`) either by a specific percentage or by the request content such as `Http Header`, `Cookie` and `URI`. Select **Forward by traffic ratio** and drag the icon in the middle to change the percentage of traffic sent to these two versions respectively (e.g. set 50% for either one). When you finish, click **Create**. + + ![canary-release-5](/images/docs/project-user-guide/grayscale-release/canary-release/canary-release-5.gif) + +6. The canary release job created displays under the tab **Job Status**. Click it to view details. + + ![canary-release-job](/images/docs/project-user-guide/grayscale-release/canary-release/canary-release-job.jpg) + +7. Wait for a while and you can see half of the traffic go to each of them: + + ![canary-release-6](/images/docs/project-user-guide/grayscale-release/canary-release/canary-release-6.jpg) + +8. The new **Deployment** is created as well. + + ![deployment-list-1](/images/docs/project-user-guide/grayscale-release/canary-release/deployment-list-1.jpg) + +9. You can directly get the virtual service to identify the weight by executing the following command: + + ```bash + kubectl -n demo-project get virtualservice -o yaml + ``` + + {{< notice note >}} + + - When you execute the command above, replace `demo-project` with your own project (i.e. namespace) name. + - If you want to execute the command from the web kubectl on the KubeSphere console, you need to use the account `admin`. + + {{}} + +10. Expected output: + + ```bash + ... + spec: + hosts: + - reviews + http: + - route: + - destination: + host: reviews + port: + number: 9080 + subset: v1 + weight: 50 + - destination: + host: reviews + port: + number: 9080 + subset: v2 + weight: 50 + ... + ``` + +## Take a Job Offline + +1. After you implement the canary release, and the result meets your expectation, you can select **Take Over** from the menu, sending all the traffic to the new version. + + ![take-over-traffic](/images/docs/project-user-guide/grayscale-release/canary-release/take-over-traffic.jpg) + +2. To remove the old version with the new version handling all the traffic, click **Job offline**. + + ![job-offline](/images/docs/project-user-guide/grayscale-release/canary-release/job-offline.jpg) diff --git a/content/zh/docs/project-user-guide/grayscale-release/overview.md b/content/zh/docs/project-user-guide/grayscale-release/overview.md index af4aa30e4..6f60ee7a9 100644 --- a/content/zh/docs/project-user-guide/grayscale-release/overview.md +++ b/content/zh/docs/project-user-guide/grayscale-release/overview.md @@ -1,10 +1,34 @@ --- title: "Overview" -keywords: 'kubernetes, docker, helm, jenkins, istio, prometheus' -description: 'Overview' - +keywords: 'Kubernetes, KubeSphere, grayscale release, overview, service mesh' +description: 'An overview of grayscale release.' linkTitle: "Overview" weight: 2110 --- -TBD +Modern, cloud-native applications are often composed of a group of independently deployable components, also known as microservices. In a microservices architecture, developers are able to make adjustments to their apps with great flexibility as they do not affect the network of services each performing a specific function. This kind of network of microservices making up an application is also called **service mesh**. + +A KubeSphere service mesh, built on the open-source project of [Istio](https://istio.io/), controls how different parts of an app interact with one another. Among others, grayscale release strategies represent an important part for users to test and release new app versions without affecting the communication among microservices. + +## Grayscale Release Strategies + +A grayscale release in KubeSphere ensures smooth transition as you upgrade your apps to a new version. The specific strategy adopted may be different but the ultimate goal is the same - identify potential problems in advance without affecting your apps running in the production environment. This not only minimizes risks of a version upgrade but also tests the performance of new app builds. + +KubeSphere provides users with three grayscale release strategies. + +### [Blue-green Deployment](../blue-green-deployment/) + +A blue-green deployment provides an efficient method of releasing new versions with zero downtime and outages as it creates an identical standby environment where the new app version runs. With this approach, KubeSphere routes all the traffic to either version. Namely, only one environment is live at any given time. In the case of any issues with the new build, it allows you to immediately roll back to the previous version. + +### [Canary Release](../canary-release/) + +A canary deployment reduces the risk of version upgrades to a minimum as it slowly rolls out changes to a small subset of users. More specially, you have the option to expose a new app version to a portion of production traffic, which is defined by yourself on the highly responsive dashboard. Besides, KubeSphere gives you a visualized view of real-time traffic as it monitors requests after you implement a canary deployment. During the process, you can analyze the behavior of the new app version and choose to gradually increase the percentage of traffic sent to it. Once you are confident of the build, you can route all the traffic to it. + +### [Traffic Mirroring](../traffic-mirroring/) + +Traffic mirroring copies live production traffic and sends it to a mirrored service. By default, KubeSphere mirrors all the traffic while you can also manually define the percentage of traffic to be mirrored by specifying a value. Common use cases include: + +- Test new app versions. You can compare the real-time output of mirrored traffic and production traffic. +- Test clusters. You can use production traffic of instances for cluster testing. +- Test databases. You can use an empty database to store and load data. + diff --git a/content/zh/docs/project-user-guide/grayscale-release/traffic-mirroring.md b/content/zh/docs/project-user-guide/grayscale-release/traffic-mirroring.md index 083beeb31..bb4663f1a 100644 --- a/content/zh/docs/project-user-guide/grayscale-release/traffic-mirroring.md +++ b/content/zh/docs/project-user-guide/grayscale-release/traffic-mirroring.md @@ -1,10 +1,106 @@ --- title: "Traffic Mirroring" -keywords: 'KubeSphere, kubernetes, docker, helm, jenkins, istio, prometheus' +keywords: 'KubeSphere, Kubernetes, traffic mirroring, istio' description: 'Traffic Mirroring' linkTitle: "Traffic Mirroring" weight: 2130 --- -TBD \ No newline at end of file +Traffic mirroring, also called shadowing, is a powerful, risk-free method of testing your app versions as it sends a copy of live traffic to a service that is being mirrored. Namely, you implement a similar setup for acceptance test so that problems can be detected in advance. As mirrored traffic happens out of band of the critical request path for the primary service, your end users will not be affected during the whole process. + +## Prerequisites + +- You need to enable [KubeSphere Service Mesh](../../../pluggable-components/service-mesh/). +- You need to create a workspace, a project and an account (`project-regular`). The account must be invited to the project with the role of `operator`. For more information, see [Create Workspace, Project, Account and Role](../../../quick-start/create-workspace-and-project). +- You need to enable **Application Governance** and have an available app so that you can mirror the traffic of it. The sample app used in this tutorial is Bookinfo. For more information, see [Deploy Bookinfo and Manage Traffic](../../../quick-start/deploy-bookinfo-to-k8s/). + +## Create Traffic Mirroring Job + +1. Log in KubeSphere as `project-regular`. Under **Categories**, click **Create Job** on the right of **Traffic Mirroring**. + + ![traffic-mirroring-1](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/traffic-mirroring-1.jpg) + +2. Set a name for it and click **Next**. + + ![traffic-mirroring-2](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/traffic-mirroring-2.jpg) + +3. Select your app from the drop-down list and the service of which you want to mirror the traffic. If you also use the sample app Bookinfo, select **reviews** and click **Next**. + + ![traffic-mirroring-3](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/traffic-mirroring-3.jpg) + +4. On the **Grayscale Release Version** page, add another version of it (e.g. `v2`) as shown in the image below and click **Next**: + + ![traffic-mirroring-4](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/traffic-mirroring-4.jpg) + + {{< notice note >}} + + The image version is `v2` in the screenshot. + + {{}} + +5. Click **Create** in the final step. + + ![traffic-mirroring-5](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/traffic-mirroring-5.jpg) + +6. The traffic mirroring job created displays under the tab **Job Status**. Click it to view details. + + ![traffic-mirroing-task](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/traffic-mirroing-task.jpg) + +7. You can see the traffic is being mirrored to `v2` with real-time traffic displaying in the line chart. + + ![traffic-mirroring-6](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/traffic-mirroring-6.jpg) + +8. The new **Deployment** is created as well. + + ![new-deployment](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/new-deployment.jpg) + +9. You can directly get the virtual service to view `mirror` and `weight` by executing the following command: + + ```bash + kubectl -n demo-project get virtualservice -o yaml + ``` + + {{< notice note >}} + + - When you execute the command above, replace `demo-project` with your own project (i.e. namespace) name. + - If you want to execute the command from the web kubectl on the KubeSphere console, you need to use the account `admin`. + + {{}} + +10. Expected output: + + ```bash + ... + spec: + hosts: + - reviews + http: + - route: + - destination: + host: reviews + port: + number: 9080 + subset: v1 + weight: 100 + mirror: + host: reviews + port: + number: 9080 + subset: v2 + ... + ``` + + This route rule sends 100% of the traffic to `v1`. The last stanza specifies that you want to mirror to the service `reviews v2`. When traffic gets mirrored, the requests are sent to the mirrored service with their Host/Authority headers appended with `-shadow`. For example, `cluster-1` becomes `cluster-1-shadow`. + + {{< notice note >}} + +These requests are mirrored as “fire and forget”, which means that the responses are discarded. You can specify the `weight` field to mirror a fraction of the traffic, instead of mirroring all requests. If this field is absent, for compatibility with older versions, all traffic will be mirrored. For more information, see [Mirroring](https://istio.io/v1.5/pt-br/docs/tasks/traffic-management/mirroring/). + +{{}} + +## Take a Job Offline + +You can remove the traffic mirroring job by clicking **Job offline**, which does not affect the current app version. + +![remove-traffic-mirroring](/images/docs/project-user-guide/grayscale-release/traffic-mirroring/remove-traffic-mirroring.jpg) \ No newline at end of file