Skip to content

Commit

Permalink
Docs: add docs for app launchpad (#4411)
Browse files Browse the repository at this point in the history
Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>
  • Loading branch information
yangchuansheng committed Dec 13, 2023
1 parent 7a31277 commit c3f5bf6
Show file tree
Hide file tree
Showing 233 changed files with 258 additions and 181 deletions.
File renamed without changes.
Expand Up @@ -30,33 +30,33 @@ Complete the deployment and access in just 6 steps:

1. Enter the **App Launchpad** app from the Sealos Desktop.

![](./imgs/app-launchpad.jpg)
![](./images/app-launchpad.jpg)

2. Click to create a new application.

![](./imgs/app-list.png)
![](./images/app-list.png)

3. Turn on the **External Access** switch. The Nginx image is already filled in by default, no need for modification. Then Click Deploy Aplication.

![](./imgs/app-launchpad3.png)
![](./images/app-launchpad3.png)

4. Enter the App details.

![](./imgs/app-launchpad4.png)
![](./images/app-launchpad4.png)

5. Click the "External Address" to access Nginx.

![](./imgs/app-launchpad6.png)
![](./images/app-launchpad6.png)

## Detailed Features

### Auto Scaling

You can freely switch between fixed instances or elastic scaling mode during application creation/change.

![img](./imgs/app-launchpad7.png)
![img](./images/app-launchpad7.png)

![img](./imgs/app-launchpad8.png)
![img](./images/app-launchpad8.png)

- Fixed Instance: Permanently create a fixed number of Pods, unaffected by actual traffic.
- Elastic Scaling: You can choose to dynamically adjust the number of Pods based on the percentage of CPU or Memory. Setting up elastic scaling requires a certain understanding of your own business traffic. Of course, you can also directly select 1~20 instance numbers, as the billing system will only calculate the actual running instances, inactive ones will not be charged.
Expand All @@ -69,13 +69,13 @@ You can freely switch between fixed instances or elastic scaling mode during app
2. Follow the prompt to modify the DNS at the domain service provider, CNAME resolve to the prompted domain.
3. Confirm the creation/update of the application.

![](./imgs/app-launchpad9.png)
![](./images/app-launchpad9.png)

### Environment

**App Launchpad** uses batch input to enter environment variables, split by line, **=** sign, and **:** sign, and invalid characters in the key will be removed.

![img](./imgs/app-launchpad10.png)
![img](./images/app-launchpad10.png)

**Examples of valid environment variable formats:**

Expand Down Expand Up @@ -105,14 +105,14 @@ You can think of ConfigMap as volumes in Docker. Mount a custom file into the co
- File Value: Corresponds to the content of the file. If the content is too complex, you can edit it locally before pasting it here.
- Note: ConfigMap mounts individual files, not directories.

![](./imgs/app-launchpad11.png)
![](./images/app-launchpad11.png)

### Persistent Storage

Any content saved in the Pod is temporary, so be sure not to save content that needs to be persisted directly in the Pod!!! If you want to allocate a space for persistent storage to the Pod, you can add a **Storage Volume**.

Suppose you need to deploy a PostgreSQL database, you must create a storage volume to persistently store the content in the database.

![](./imgs/app-launchpad12.png)
![](./images/app-launchpad12.png)

Of course, we recommend you use [Database Management](./dbprovider/dbprovider.md) for deploying and managing databases.
24 changes: 24 additions & 0 deletions docs/4.0/docs/guides/applaunchpad/autoscale.md
@@ -0,0 +1,24 @@
---
sidebar_position: 6
---

# Autoscaling

In [Sealos](https://cloud.sealos.io), the "[App Launchpad](/guides/applaunchpad/applaunchpad.md)" feature enables the automatic adjustment of application instance numbers to effectively respond to varying load conditions. This functionality is known as "**Autoscaling**," or more technically, the Horizontal Pod Autoscaler (HPA).

Autoscaling operates by dynamically altering the count of application instances based on specific metrics like CPU and memory usage. This ensures that the applications run efficiently and resources are optimally utilized.

> Key Point: In Autoscaling, "usage" typically refers to the average use across all instances of an application. For example, if an app runs on two instances, its average CPU usage is calculated as the mean of the usage of these two instances.
The workings of Autoscaling are as follows:

1. **Monitoring**: It continuously monitors crucial performance indicators like CPU and memory usage.
2. **Decision Making**: Based on predefined thresholds (e.g., maintaining CPU usage below 50%), it calculates the required adjustments in the instance count.
3. **Adjustment**: Following this, Autoscaling automatically instructs the Sealos controller to modify the number of instances, ensuring the usage stays within the desired range.

For instance, if we set up an application with specific Autoscaling rules such as a maximum CPU usage of 50% and the ability for instance numbers to vary between 1 and 5, Autoscaling will:

- Increase the number of instances when the average CPU usage exceeds 50%, up to a maximum of 5.
- Decrease the number of instances when the average CPU usage drops below 50%, but always maintain at least one instance in operation.

![](./images/autoscale.png)
17 changes: 17 additions & 0 deletions docs/4.0/docs/guides/applaunchpad/configmap.md
@@ -0,0 +1,17 @@
---
sidebar_position: 5
---

# ConfgMap

In [Sealos](https://cloud.sealos.io), the implementation of configuration files plays a vital role, particularly when the application deals with numerous or complex configurations. Differing from environment variables, configuration files are a more versatile and dependable means for managing settings. Environment variables are more apt for simple, small-scale configuration tasks.

The primary strength of configuration files is their capability to hold and control elaborate configuration data, including aspects like configuration files, command-line arguments, and environment variables. These pieces of data can be incorporated into the container upon the launch of the application container, facilitating adjustments to the application's functionalities without the necessity of recompiling the image.

Take, for example, the Nginx container. The utilization of configuration files in this context can be described as follows:

- **Filename**: This pertains to a file within the Nginx container, for which references can be drawn from the instructions provided by the image supplier.
- **File Value**: This is the content corresponding to the file. In cases where the content is elaborate, it's recommended to complete editing it offline and then paste it into the specified location.
- **Key Points**: The approach involves mounting an individual file, not an entire directory. It is imperative to precisely identify the file to be mounted, rather than just a directory path.

![](./images/applaunchpad13.png)
28 changes: 28 additions & 0 deletions docs/4.0/docs/guides/applaunchpad/environment.md
@@ -0,0 +1,28 @@
---
sidebar_position: 4
---

# Environment

In [Sealos](https://cloud.sealos.io), environment variables are pivotal in managing the configuration data for container applications. These variables enable the provision of essential configuration information to applications without necessitating changes to the application's code or image, thus bolstering their maintainability and scalability.

The process of defining environment variables in the "[App Launchpad](/guides/applaunchpad/applaunchpad.md)" interface is streamlined through a bulk input method. Users can define multiple variables by entering them line by line. Each variable comprises a key and a value, separated by either an equal sign (=) or a colon (:). The interface is designed to automatically eliminate any invalid characters from the key, ensuring the accuracy and validity of the environment variables.

![](./images/applaunchpad12.png)

**Environment Variable Formats That Are Correctly Interpreted:**

```shell
host=127.0.0.1
port:3000
name: sealos
- username=123
- password:123
# Comments like this line are ignored, as they don't include an equal sign (=) or a colon (:), which are the key markers.
```

**Environment Variable Formats That Cannot Be Interpreted:**

```shell
host=127.0.0.1 # This line is interpreted because it contains an equal sign (=) or a colon (:). The comment here is also considered part of the variable due to the preceding equal sign (=).
```
Expand Up @@ -13,7 +13,7 @@ In complex application environments, it's common for services to expose multiple
+ **Prometheus Monitoring and App Service**: If your application has a business port and another port for Prometheus monitoring via `/metrics`, you might need to expose both.
+ **Coexistence of GRPC and RESTful services**: If your application offers both GRPC and RESTful services, you might need to expose separate ports for each type of service.

When deploying applications using "[App Launchpad](/platform-components/applaunchpad.md)" on [Sealos](https://cloud.sealos.io), you can easily choose to expose multiple ports. During the deployment process, users simply click on the "Network" option and then select "Add Port" to configure multiple ports.
When deploying applications using "[App Launchpad](/guides/applaunchpad/applaunchpad.md)" on [Sealos](https://cloud.sealos.io), you can easily choose to expose multiple ports. During the deployment process, users simply click on the "Network" option and then select "Add Port" to configure multiple ports.

![](./images/multi-ports1.png)

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions docs/4.0/docs/guides/applaunchpad/persistent-volume.md
@@ -0,0 +1,13 @@
---
sidebar_position: 7
---

# Persistent Volume

[Sealos](https://cloud.sealos.io) offers a flexible environment where containers can be effortlessly created and destroyed. This flexibility is advantageous for application deployment and management, but it also raises the issue of maintaining data persistence. In scenarios where data is stored within an application container, its destruction leads to the loss of all stored data.

To counter this problem, the use of persistent storage is essential. Persistent storage ensures that data is stored externally, thereby preserving it even through container restarts or redeployments. This is particularly vital for applications requiring data retention, like databases, file storage systems, or any services involving user data.

For instance, in deploying Nextcloud, all data associated with its container is located in the `/var/www/html` directory. To maintain data continuity, it's necessary to use external storage solutions for persisting data in this directory.

![](./images/persistent-volume.png)
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 0 additions & 12 deletions docs/4.0/docs/quick-start/app-deployments/next-steps.md

This file was deleted.

File renamed without changes
7 changes: 7 additions & 0 deletions docs/4.0/docs/quick-start/next-steps.md
@@ -0,0 +1,7 @@
---
sidebar_position: 5
---

# Next Steps

Congratulations on getting started with Sealos! Now, you can continue learning more about Sealos's many features:
Expand Up @@ -16,7 +16,7 @@ select the template you’d like to deploy

![Viewing the templates marketplace](./images/templates-2.png)

Not sure which one to use? How about [exploring FastGPT](../../examples/ai-applications/install-fastgpt-on-desktop.md)
Not sure which one to use? How about [exploring FastGPT](/examples/ai-applications/install-fastgpt-on-desktop.md)

## 2. Deploy the template to Sealos

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/4.0/i18n/zh-Hans/current.json
Expand Up @@ -19,9 +19,9 @@
"message": "部署应用",
"description": "The label for category App Deployments in sidebar docSidebar"
},
"sidebar.docSidebar.category.Platform Components": {
"message": "平台组件",
"description": "The label for category Platform Components in sidebar docSidebar"
"sidebar.docSidebar.category.How-to Guides": {
"message": "使用指南",
"description": "The label for category How-to Guides in sidebar docSidebar"
},
"sidebar.docSidebar.category.Self Hosting": {
"message": "私有化部署",
Expand Down
55 changes: 55 additions & 0 deletions docs/4.0/i18n/zh-Hans/guides/applaunchpad/applaunchpad.md
@@ -0,0 +1,55 @@
---
sidebar_position: 0
---

# 应用管理

**应用管理** 是 Sealos 内置的单镜像部署工具,主要用于简化和加速应用程序的部署过程,可以帮助您在 5 分钟内完成应用的部署和上线。

目前「应用管理」具备以下功能:

- 支持使用私有镜像部署应用;
- 支持根据应用需求,自定义所需的 CPU 和内存资源;
- 支持多副本;
- 弹性伸缩 (HPA);
- 提供外网访问地址,便于公网访问;
- 允许用户为应用配置自定义域名,提高品牌识别度和用户体验;
- ConfigMap 配置文件;
- 应用数据的持久化存储,保障数据的安全性和持续性;
- 提供应用和 Pod 的实时监控,帮助用户及时发现并解决问题;
- 记录和管理应用日志,便于问题追踪和性能分析;
- 分析系统事件(Events),提供关键信息帮助优化应用性能;
- 一键进入容器终端,方便管理和调试;
- 支持将应用的多个端口暴露到外网。

## [快速开始](/quick-start/app-deployments/use-app-launchpad.md)

快速安装一些比较常见的应用。

## [更新应用](/guides/applaunchpad/update-app.md)

应用部署完成后修改应用配置。

## [自定义域名](/guides/applaunchpad/add-domain.md)

为应用接入自定义域名。

## [暴露多端口](/guides/applaunchpad/expose-multi-ports.md)

将应用的多个端口暴露到外网中。

## [环境变量](/guides/applaunchpad/environment.md)

通过环境变量为应用提供配置信息。

## [配置文件](/guides/applaunchpad/configmap.md)

通过配置文件为应用提供配置信息。

## [弹性伸缩](/guides/applaunchpad/autoscale.md)

通过弹性伸缩来根据负载自动调整应用的实例数量。

## [持久化存储](/guides/applaunchpad/persistent-volume.md)

使用持久化存储来保障数据的持久化。
24 changes: 24 additions & 0 deletions docs/4.0/i18n/zh-Hans/guides/applaunchpad/autoscale.md
@@ -0,0 +1,24 @@
---
sidebar_position: 6
---

# 弹性伸缩

[应用管理](/guides/applaunchpad/applaunchpad.md)」可以在 Sealos 集群中自动调整应用的实例数量,以适应不同的负载条件。这个功能叫「**弹性伸缩**(Horizontal Pod Autoscaler,简称 HPA)」。

「弹性伸缩」通过监测特定的度量指标(如 CPU 使用率或内存使用率)来动态增加或减少应用的实例数量,以确保应用程序运行效率和资源利用的最优化。

> 注意:在弹性伸缩的上下文中,提到的“使用率”通常是指应用实例的平均使用率。例如,如果一个应用有两个实例,那么其 CPU 平均使用率将是这两个实例的 CPU 使用率的平均值。
弹性伸缩的工作原理:

1. **监控**:持续监控应用的关键性能指标,如 CPU 使用率或内存使用量。
2. **决策**:根据设定的目标(例如 CPU 使用率不超过 50%),系统会计算出为了达到这一目标所需增加或减少的应用实例数量。
3. **调整**:基于计算结果,弹性伸缩会自动指示 Sealos 的控制器增加或减少应用实例的数量,以保持资源使用率在预定目标范围内。

假设我们为一个应用设置了如下规则:CPU 使用率不得超过 50%,实例数量可在 1 至 5 之间变动。在这种设定下,弹性伸缩将会:

- 当应用的平均 CPU 使用率超过 50% 时,系统会增加实例数量,最多增至 5 个。
- 当应用的平均 CPU 使用率低于 50% 时,系统会减少实例数量,但至少保持 1 个实例运行。

![](./images/autoscale.png)
17 changes: 17 additions & 0 deletions docs/4.0/i18n/zh-Hans/guides/applaunchpad/configmap.md
@@ -0,0 +1,17 @@
---
sidebar_position: 5
---

# 配置文件

[Sealos](https://cloud.sealos.io) 应用程序中,配置文件的使用非常重要,尤其是当应用程序需要处理大量或复杂的配置信息时。与环境变量相比,配置文件可以提供一种更灵活、更可靠的配置管理方式。环境变量更适合用于传递少量、简单的配置数据。

配置文件的主要优势在于其能够存储和管理复杂的配置数据,这些配置数据可以包含配置文件、命令行参数、环境变量等信息。这些数据可以在应用容器启动时注入到容器中,从而允许你对应用程序的行为进行调整,而无需重新构建镜像。

下面以 Nginx 容器为例,说明如何使用配置文件来调整应用的行为:

- **文件名**: 对应 Nginx 容器里的文件,可以参考镜像提供者给出的说明。
- **文件值**: 文件对应的内容。如果内容过于复杂,建议在本地编辑完成后,再复制粘贴到相应位置。
- **注意事项**:配置文件是挂载单个文件,而不是挂载目录。你需要明确指定要挂载的具体文件,而非仅仅指定一个目录路径。

![](./images/applaunchpad13.png)
28 changes: 28 additions & 0 deletions docs/4.0/i18n/zh-Hans/guides/applaunchpad/environment.md
@@ -0,0 +1,28 @@
---
sidebar_position: 4
---

# 环境变量

[Sealos](https://cloud.sealos.io) 中,环境变量扮演着至关重要的角色,它们是管理容器应用配置数据的关键工具。通过使用环境变量,可以为应用提供必要的配置信息,而无需直接修改应用的代码或其镜像,从而提高应用的可维护性和可扩展性。

在「[应用管理](/guides/applaunchpad/applaunchpad.md)」界面,环境变量是通过批量输入的方式来定义的。用户可以通过按行输入的方式来定义多个环境变量,其中每个环境变量由键(key)和值(value)组成,两者之间可以使用等号(=)或冒号(:)作为分隔符,「[应用管理](/guides/applaunchpad/applaunchpad.md)」会自动清除键(key)中的无效字符,以确保环境变量的正确性和有效性。

![](./images/applaunchpad12.png)

**可正常解析的环境变量格式:**

```bash
host=127.0.0.1
port:3000
name: sealos
- username=123
- password:123
# 这一行的注释会被忽略。因为不包含等号(=)或冒号(:)这两种标记字符。
```

**不可解析的环境变量格式:**

```bash
host=127.0.0.1 # 这一行会被解析,因为包含了等号(=)或冒号(:)这两种标记字符。这里的注释也会被解析,因为前面已经有等号(=)了。
```
Expand Up @@ -12,7 +12,7 @@ sidebar_position: 3
+ **Prometheus 监控和应用服务**:如果你的应用既有业务端口,又有一个用于 Prometheus 监控的 `/metrics` 端口,你可能需要同时暴露两者。
+ **GRPC 和 RESTful 服务并存**:如果你的应用同时提供 GRPC 和 RESTful 服务,你可能需要为每种服务类型暴露不同的端口。

[Sealos](https://cloud.sealos.io) 在使用「[应用管理](/platform-components/applaunchpad.md)」部署应用时,可以轻松地选择暴露多个端口。在部署应用的过程中,用户只需要点击「网络配置」选项,然后选择「添加端口」,即可实现多端口的配置。
[Sealos](https://cloud.sealos.io) 在使用「[应用管理](/guides/applaunchpad/applaunchpad.md)」部署应用时,可以轻松地选择暴露多个端口。在部署应用的过程中,用户只需要点击「网络配置」选项,然后选择「添加端口」,即可实现多端口的配置。

![](./images/multi-ports1.png)

Expand Down
13 changes: 13 additions & 0 deletions docs/4.0/i18n/zh-Hans/guides/applaunchpad/persistent-volume.md
@@ -0,0 +1,13 @@
---
sidebar_position: 7
---

# 持久化存储

[Sealos](https://cloud.sealos.io) 中,容器可以轻松地被创建和销毁。虽然这为部署和管理应用带来了灵活性,但它也带来了数据持久性的挑战。如果应用在容器内部存储数据,那么当容器被销毁时,所有存储在容器内的数据也会丢失。

持久化存储可以确保数据存储在容器外部,即使在容器重启或重新部署的情况下也能保证数据不会丢失。**如果你的应用需要保留数据(例如数据库、文件存储系统或任何存储用户数据的服务),一定要使用持久化存储!**

假设你要部署一个 Nextcloud,Nextcloud 容器的所有数据都存储在 `/var/www/html` 这个目录下,因此我们需要将该目录下的数据通过外挂存储进行持久化。

![](./images/persistent-volume.png)
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 1
---

# 修改应用配置
# 更新应用

[Sealos](https://cloud.sealos.io) 部署完应用后,可以随时修改应用配置。

Expand Down

0 comments on commit c3f5bf6

Please sign in to comment.