From 8110c7735038bd636f1704bb517e8403dae6915d Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Fri, 7 Jul 2023 21:31:34 +0800 Subject: [PATCH] add en docs (#3475) * docs(v5.0): gpt4.0 to en Signed-off-by: cuisongliu * docs(v5.0): gpt3.5 to en Signed-off-by: cuisongliu * docs(v5.0): gpt3.5 to en Signed-off-by: cuisongliu * docs(v5.0): gpt4.0 to en Signed-off-by: cuisongliu * docs(v5.0): gpt4.0 to en Signed-off-by: cuisongliu --------- Signed-off-by: cuisongliu --- docs/4.0/docs/lifecycle-management/QA.md | 153 ++++++-------- .../build-image-using-registry-sync.md | 56 ++--- .../image-build-standardized.md | 116 ++++++----- .../advanced-guide/sealos-run.md | 128 ++++++------ .../advanced-guide/template-function.md | 33 ++- .../lifecycle-management.md | 76 +++---- .../build-image/build-image-binary.md | 38 ++-- .../build-image/build-image-go_template.md | 32 ++- .../build-image/build-image-helm_charts.md | 112 ++++------ .../build-image/build-image-image_list.md | 72 +++---- .../build-image/build-image-manifests.md | 40 ++-- .../build-image/build-image-scp_exec.md | 44 ++-- .../build-image-with-kubeadm-run-cluster.md | 22 +- .../operations/build-image/build-image.md | 12 +- .../build-image/build-multi-arch-image.md | 26 +-- .../build_run_application_private_registry.md | 46 +++-- .../operations/registry/registry.md | 14 +- .../registry/sealos_sync_backup_solution.md | 36 ++-- .../using_sealoshub_private_registry.md | 30 +-- ...customize-app_images-config-rootfs_mage.md | 61 +++--- .../run-cluster/gen-apply-cluster.md | 14 +- .../operations/run-cluster/run-cluster.md | 14 +- .../run-cluster/template-apply-cluster.md | 10 +- .../operations/run-cluster/upgrade-cluster.md | 30 +-- .../build-ingress-cluster-image.md | 26 ++- .../quick-start/installation.md | 25 ++- .../quick-start/quick-start.md | 130 ++++++------ .../Image-cri-shim/image-cri-shim.md | 77 +++---- .../reference/lvscare/lvscare.md | 58 +++--- .../reference/sealctl/cert.md | 31 ++- .../reference/sealctl/cri.md | 29 ++- .../reference/sealctl/hostname.md | 9 +- .../reference/sealctl/hosts.md | 43 ++-- .../reference/sealctl/ipvs.md | 83 ++++---- .../reference/sealctl/registry.md | 41 ++-- .../reference/sealctl/sealctl.md | 74 ++++--- .../reference/sealctl/static-pod.md | 30 ++- .../reference/sealctl/tar&&untar.md | 44 ++-- .../reference/sealctl/token.md | 24 +-- .../reference/sealos/app-cluster-image.md | 40 ++-- .../reference/sealos/commands/add.md | 40 ++-- .../reference/sealos/commands/apply.md | 43 ++-- .../reference/sealos/commands/build.md | 109 +++++----- .../reference/sealos/commands/cert.md | 32 +-- .../reference/sealos/commands/commands.md | 76 +++---- .../reference/sealos/commands/create.md | 30 +-- .../reference/sealos/commands/delete.md | 44 ++-- .../reference/sealos/commands/env.md | 18 +- .../reference/sealos/commands/exec.md | 32 +-- .../reference/sealos/commands/gen.md | 24 +-- .../reference/sealos/commands/images.md | 46 ++--- .../reference/sealos/commands/inspect.md | 46 ++--- .../reference/sealos/commands/load.md | 26 +-- .../reference/sealos/commands/login.md | 36 ++-- .../reference/sealos/commands/logout.md | 22 +- .../reference/sealos/commands/manifest.md | 22 +- .../reference/sealos/commands/merge.md | 14 +- .../reference/sealos/commands/pull.md | 48 ++--- .../reference/sealos/commands/push.md | 96 ++++----- .../reference/sealos/commands/registry.md | 191 +++++++++--------- .../reference/sealos/commands/reset.md | 34 ++-- .../reference/sealos/commands/rmi.md | 26 +-- .../reference/sealos/commands/run.md | 54 ++--- .../reference/sealos/commands/save.md | 22 +- .../reference/sealos/commands/scp.md | 32 +-- .../reference/sealos/commands/tag.md | 18 +- .../sealos/kubernetes-cluster-image.md | 56 ++--- .../reference/sealos/sealos.md | 16 +- .../image-build-standardized.md | 2 +- .../build-image/build-image-go_template.md | 4 +- .../reference/sealctl/sealctl.md | 2 - .../reference/sealos/commands/registry.md | 4 +- 72 files changed, 1569 insertions(+), 1675 deletions(-) diff --git a/docs/4.0/docs/lifecycle-management/QA.md b/docs/4.0/docs/lifecycle-management/QA.md index 9e0bc3a2bc8..b458fa525ed 100644 --- a/docs/4.0/docs/lifecycle-management/QA.md +++ b/docs/4.0/docs/lifecycle-management/QA.md @@ -2,33 +2,33 @@ sidebar_position: 1 --- -# 常见问题 +# Frequently Asked Questions -使用Sealos时,您可能会遇到一些问题。以下是一些常见问题的答案和解决方法。 +When using Sealos, you may encounter some common questions and issues. Here are answers and solutions to some of the common problems. -## 镜像构建问题 +## Image Building Issues -### Q1: 在构建阶段如何设置代理服务? +### Q1: How to set up a proxy service during the build phase? -在执行构建命令时,可以通过设置HTTP_PROXY环境变量来配置代理服务。 +During the execution of the build command, you can configure a proxy service by setting the HTTP_PROXY environment variable. ```shell HTTP_PROXY=socket5://127.0.0.1:7890 sealos build xxxxx ``` -### Q2:如何启用buildah的调试日志? +### Q2: How to enable debug logs for buildah? -若需要查看buildah的调试日志,可以通过设定`BUILDAH_LOG_LEVEL`环境变量实现。 +To view debug logs for buildah, you can set the `BUILDAH_LOG_LEVEL` environment variable. ```shell BUILDAH_LOG_LEVEL=debug sealos images ``` -### Q3:如何在Pod中执行Sealos构建? +### Q3: How to execute Sealos build within a Pod? -若在Pod中执行Sealos构建,请按以下步骤操作: +If you want to execute Sealos build within a Pod, follow these steps: -1. 在Pod中构建镜像,可用以下YAML配置创建Deployment。 +1. Build the image within the Pod. You can create a Deployment with the following YAML configuration: ```yaml apiVersion: apps/v1 @@ -49,7 +49,7 @@ spec: app: sealoscli spec: containers: - - image: #用你的sealos镜像替换 + - image: # Replace with your sealos image name: sealoscli stdin: true stdinOnce: true @@ -57,7 +57,7 @@ spec: privileged: true ``` -2. 创建Dockerfile。以下是一个例子,根据需要进行修改。 +2. Create a Dockerfile. Here's an example that you can modify as per your needs: ```dockerfile FROM bitnami/minideb:buster @@ -76,128 +76,89 @@ ENV LC_ALL=C.UTF-8 ENV TZ=Asia/Shanghai ``` -3. 在Pod中执行构建命令。 +3. Execute the build command within the Pod. ```shell sealos build --arch arm64 --build-arg TARGETOS=linux --build-arg TARGETARCH=arm64 -t test -f Dockerfile . ``` -### Q4:执行Sealos构建时遇到“lgetxattr /var/lib/containers/storage/overlay/0c2afe770ec7870ad4639f18a1b50b3a84718f95c8907f3d54e14dbf0a01d50d/merged/dev/ptmx: no such device”错误? +### Q4: Encounter the error "lgetxattr /var/lib/containers/storage/overlay/0c2afe770ec7870ad4639f18a1b50b3a84718f95c8907f3d54e14dbf0a01d50d/merged/dev/ptmx: no such device" during Sealos build. How to fix it? -这个问题可能与`fuse-overlayfs`的版本有关。建议您从[这里](https://github.com/containers/fuse-overlayfs/releases)下载最新版本下载并替换`/bin/fuse-overlayfs`。 +This issue might be related to the version of `fuse-overlayfs`. We recommend downloading the latest version from [here](https://github.com/containers/fuse-overlayfs/releases) and replacing `/bin/fuse-overlayfs`. -## 运行时选择问题 +## Runtime Selection Issues -### Q1:如何选择Kubernetes运行时? +### Q1: How to select the Kubernetes runtime? -Sealos会根据您选择的镜像决定使用哪种运行时。如果选择了kubernetes-docker镜像,Sealos将使用Docker作为运行时;如果选择了kubernetes-crio镜像,Sealos将使用CRI-O作为运行时。 +Sealos determines the runtime based on the image you choose. If you select the `kubernetes-docker` image, Sealos will use Docker as the runtime. If you choose the `kubernetes-crio` image, Sealos will use CRI-O as the runtime. -## 版本兼容性问题 +## Version Compatibility Issues -### Q1:报错:"Applied to cluster error: failed to init exec auth.sh failed exit status 127"? +### Q1: Error "Applied to cluster error: failed to -此问题常因您使用的sealos版本和镜像版本不匹配造成。请确认您的镜像版本和sealos的版本是匹配的。 -例如,若您正使用形如kubernetes:v1.xx.x的版本,可能需要升级sealos,特别是在使用较老版本的sealos,而sealos集群镜像则使用了最新版时。 -另一种解决方法是选择对应版本的sealos镜像。比如,如果您的sealos版本是4.1.3,那么集群镜像应选择形如kuberntes:v1.24.0-4.1.3的版本。 -确保镜像版本和sealos版本的匹配,可以帮助避免此类问题。 +init exec auth.sh failed exit status 127"? -### Q2: 如果您在集群中新增了其他域名,或者修改了 service 的 CIDR,并且在添加 master 时出现了错误 +This error is often caused by a mismatch between the version of Sealos and the version of the image being used. Make sure that the image version and the Sealos version are compatible. For example, if you are using a Kubernetes version like `v1.xx.x`, you may need to upgrade Sealos, especially if you are using an older version of Sealos while the Sealos cluster image is using the latest version. Another solution is to choose the corresponding version of the Sealos image. For example, if your Sealos version is 4.1.3, then the cluster image should be something like `kubernetes:v1.24.0-4.1.3`. Ensuring that the image version and Sealos version are compatible can help avoid such issues. -为了解决这个问题,Sealos 团队在 4.2.0 版本进行了相应的修复。具体的修复内容和讨论可以在这个 pull request 中查看:https://github.com/labring/sealos/pull/2943 。 +### Q2: Error when adding additional domains or modifying the service CIDR in the cluster during the addition of a master node -所以,如果您遇到了这个问题,我们建议您升级到 Sealos 4.2.0 版本。更新后的版本应该能够正确处理这些变更,并且在添加 master 时不会出现错误。 +To address this issue, the Sealos team made the necessary fixes in version 4.2.0. You can refer to the specific fix and discussion in this pull request: [https://github.com/labring/sealos/pull/2943](https://github.com/labring/sealos/pull/2943). -## 文件和目录位置问题 +Therefore, if you encounter this problem, we recommend upgrading to Sealos version 4.2.0. The updated version should handle these changes correctly and not produce errors when adding a master node. -### Q1:如何修改`/root/.sealos`默认目录的存储位置? +## File and Directory Location Issues -若需修改默认的存储位置,可以设置SEALOS_RUNTIME_ROOT环境变量,然后运行sealos命令。建议您将这个环境变量设置为全局的,这样在其他命令或场景中也可以方便使用。 +### Q1: How to modify the default storage location for `/root/.sealos`? + +If you need to change the default storage location, you can set the `SEALOS_RUNTIME_ROOT` environment variable and then run the Sealos command. It is recommended to set this environment variable globally so that it can be conveniently used in other commands or scenarios. ```shell export SEALOS_RUNTIME_ROOT=/data/.sealos sealos run labring/kubernetes:v1.24.0 ``` -### Q2:如何修改`/var/lib/sealos`默认目录的存储位置? +### Q2: How to modify the default storage location for `/var/lib/sealos`? -若需修改默认的存储位置,可以设置SEALOS_DATA_ROOT环境变量,然后运行sealos命令。同样,建议您将这个环境变量设置为全局的。 +If you need to change the default storage location, you can set the `SEALOS_DATA_ROOT` environment variable and then run the Sealos command. Similarly, it is recommended to set this environment variable globally. ```shell export SEALOS_DATA_ROOT=/data/sealos sealos run labring/kubernetes:v1.24.0 ``` -### Q3: 如何修改 Sealos 镜像数据和状态的存储路径? - -> 在使用 Sealos 集群时,可能需要改变默认的镜像数据存储路径和状态数据的存储路径。默认情况下,这些数据被存储在 `/etc/containers/storage.conf` 文件定义的位置。 - -1. **查看当前存储配置** - 首先,我们可以使用下面的命令来查看当前的镜像存储配置: - ``` - sealos images --debug - ``` - 这个命令会打印出包含当前存储配置的文件,例如: - ``` - 2023-06-07T16:27:02 debug using file /etc/containers/storage.conf as container storage config - REPOSITORY TAG IMAGE ID CREATED SIZE - ``` -2. **修改镜像数据存储路径** - 如果你希望更改镜像数据的存储路径,你可以编辑 `/etc/containers/storage.conf` 文件。在这个文件中,找到并修改 `graphroot` 字段设置为新的路径。例如: - ``` - vim /etc/containers/storage.conf - ``` - 在编辑器中,将 `graphroot` 字段的值修改为你希望的新路径。 -3. **修改状态数据存储路径** - 参考 Buildah 的设计,Sealos 同样提供了状态数据存储路径的设置。在同样的配置文件 `/etc/containers/storage.conf` 中,找到并修改 `runroot` 字段为新的路径。 - -通过以上步骤,你可以将 Sealos 集群的镜像数据和状态数据保存到新的地址。每次运行 Sealos 命令时,它都将使用你在 `graphroot` 和 `runroot` 中设置的新路径来分别存储镜像数据和状态数据。 - -### Q4:ssh传输文件时,如何禁止检查文件的md5? +### Q3: How to modify the storage paths for Sealos image data and status? -在网络环境良好时,禁用md5检查可以极大提升传输速度。若不想在ssh传输文件时检查文件的md5,可将SEALOS_SCP_CHECKSUM环境变量设置为false以禁用此功能。建议将此环境变量设为全局,以便在多场景下使用。 +> When using the Sealos cluster, you may need to change the default storage paths for image data and status data. By default, these data are stored at the locations defined in the `/etc/containers/storage.conf` file. -```shell -export SEALOS_SCP_CHECKSUM=false -sealos run labring/kubernetes:v1.24.0 -``` +1. **View the current storage configuration** + First, you can use the following command to view the current image storage configuration: + ``` + sealos images --debug + ``` + This command will print the file that contains the current storage configuration, for example: + ``` + 2023-06-07T16:27:02 debug using file /etc/containers/storage.conf as container storage config + REPOSITORY TAG IMAGE ID CREATED SIZE + ``` +2. **Modify the storage path for image data** + If you want to change the storage path for image data, you can edit the `/etc/containers/storage.conf` file. In this file, find and modify the `graphroot` field to set it to the new path. For example: + ``` + vim /etc/containers/storage.conf + ``` + In the editor, modify the value of the `graphroot` field to the desired new path. +3. **Modify the storage +path for status data** +Similar to the design of Buildah, Sealos also provides the ability to set the storage path for status data. In the same configuration file `/etc/containers/storage.conf`, find and modify the `runroot` field to the new path. -## 其他问题 +By following these steps, you can save the image data and status data of the Sealos cluster to the new paths you set. Each time you run a Sealos command, it will use the new paths you set in `graphroot` and `runroot` to store the image data and status data, respectively. -### Q1:image-cri-shim导致端口大量占用,耗尽服务器socket资源? +### Q4: How to disable file md5 check during SSH file transfer? -出现此问题时,可通过以下命令解决: +When the network environment is good, disabling the md5 check can greatly improve transfer speed. If you don't want to check the md5 of files during SSH file transfer, you can add the `-o "HashKnownHosts no"` option to the SSH command. ```shell -wget https://github.com/labring/sealos/releases/download/v4.2.0/sealos_4.2.0_linux_amd64.tar.gz && tar xvf sealos_4.2.0_linux_amd64.tar.gz image-cri-shim -sealos exec -r master,node "systemctl stop image-cri-shim" -sealos scp "./image-cri-shim" "/usr/bin/image-cri-shim" -sealos exec -r master,node "systemctl start image-cri-shim" -sealos exec -r master,node "image-cri-shim -v" +scp -o "HashKnownHosts no" local_file remote_user@remote_ip:/path/to/destination ``` -### Q2:报错"[ERROR FileAvailable--etc-kubernetes-kubelet.conf]: /etc/kubernetes/kubelet.conf already exists" - -此问题可通过升级至Sealos 4.1.7+来解决。 - -### Q3:报错:"function "semverCompare" not defined" - -此问题可通过升级至Sealos 4.1.4+来解决。 - -我们希望这些解答能帮助您解决在使用Sealos过程中遇到的问题。如果还有其他问题,欢迎随时提问。 - -## 使用技巧 - -### Q1: 如何清理 Sealos 集群的缓存文件 - -> 在使用 Sealos 集群时,安装过程中可能会在本地存储一些缓存文件,这些文件会重复占用磁盘空间。那么,如何清理这些缓存文件以释放磁盘空间呢? - -我们提供了一个非常简单的解决方案,只需要执行以下命令: - -```shell -sealos unmount --all && sealos rm --all -``` -这个命令的作用是移除所有缓存的 Sealos 集群镜像文件,以及所有的相关挂载点。--all 选项表示处理所有相关文件和挂载点。 -执行这个命令后,所有 Sealos 集群的缓存文件就会被清理掉,从而释放出被它们占用的磁盘空间。 -这是一个非常有用的技巧,特别是对于在磁盘空间有限的环境中运行 Sealos 集群的用户来说。在你感觉磁盘空间被占用过多时,不妨尝试执行这个命令来释放一些空间。 -请注意,这个命令只会删除缓存文件,不会影响已经运行的集群。也就是说,执行这个命令后,你的集群仍然可以正常运行。 +This option tells SSH not to hash the hostnames in the known_hosts file, which avoids the md5 check during file transfer. diff --git a/docs/4.0/docs/lifecycle-management/advanced-guide/build-image-using-registry-sync.md b/docs/4.0/docs/lifecycle-management/advanced-guide/build-image-using-registry-sync.md index 27c7d244db8..180e4e6cffd 100644 --- a/docs/4.0/docs/lifecycle-management/advanced-guide/build-image-using-registry-sync.md +++ b/docs/4.0/docs/lifecycle-management/advanced-guide/build-image-using-registry-sync.md @@ -2,57 +2,57 @@ sidebar_position: 2 --- -# 镜像构建改进指南 +# Guide to Image Building Improvement -## 深入理解Sealos镜像构建 +## Deep Understanding of Sealos Image Building -为了了解Sealos镜像构建的背后所做的工作,我们将首先揭示它在底层究竟进行了哪些操作。以下是一个直观的架构图: +To understand the work behind Sealos image building, we will first reveal what operations it actually performs at the underlying level. Here is an intuitive architectural diagram: ![](images/build.png) -Sealos在构建镜像过程中涵盖了以下几个核心步骤: +Sealos covers the following core steps in the image building process: -- **缓存镜像**:解析构建执行时的工作目录(在这里我们称之为"context"目录),将缓存镜像保存到registry结构并存储在./registry目录下。 -- **构建镜像**:在context目录中进行镜像构建,生成新的镜像。(请注意,构建镜像时需要将./registry目录进行复制。) +- **Cache images**: Parse the working directory during the build execution (here we call it the "context" directory), save the cache image to the registry structure, and store it in the ./registry directory. +- **Build images**: Build images in the context directory and generate new images. (Please note, you need to copy the ./registry directory when building images.) -## 提升镜像构建效率 +## Enhancing Image Building Efficiency -当前项目中,我们借用了`github.com/distribution/distribution`的源代码,在执行缓存镜像的过程中直接调用了registry的sdk并启动了registry-proxy功能。借助于镜像仓库的缓存能力,我们将镜像缓存并存入context/registry目录。 +In the current project, we have borrowed the source code of `github.com/distribution/distribution`. During the process of caching images, we directly call the registry's sdk and start the registry-proxy function. With the caching ability of the image repository, we cache the image and store it in the context/registry directory. -这个过程的关键就在于调用了distribution仓库的方法进行保存镜像: +The key to this process is to call the method of the distribution repository to save the image: -- 启动 registry-proxy 功能。 -- 保存镜像摘要及索引相关数据(通过调用saveManifestAndGetDigest方法)。 -- 保存镜像文件数据(通过调用saveBlobs方法)。 +- Start the registry-proxy function. +- Save image digest and related index data (by calling the saveManifestAndGetDigest method). +- Save image file data (by calling the saveBlobs method). -这种方法确实具有一些显著的优点: +This method does have some significant advantages: -- 轻量化:无需依赖其他组件即可保存镜像。 -- 自由控制:可以自由控制保存逻辑,无需依赖第三方组件。 +- Lightweight: Images can be saved without relying on other components. +- Free control: You can freely control the save logic without relying on third-party components. -然而,我们也注意到了一些潜在的问题: +However, we have also noticed some potential problems: -- 对新手来说,代码理解难度较高,不易清晰了解这里的逻辑。 -- 无法缓存使用token认证的方式。 -- 需要依赖一些临时存储空间,对空间有要求。 +- For beginners, the code is difficult to understand and the logic here is not easy to grasp. +- Unable to cache using the token authentication method. +- Need to rely on some temporary storage space, which requires space. -考虑到这些问题,我们决定尝试一种新的模式:在本地启动一个轻量的registry,使用`skopeo copy`的sdk进行代码复用。这一改变直接解决了之前所有的问题。 +Considering these issues, we decided to try a new mode: start a lightweight registry locally and use the sdk of `skopeo copy` for code reuse. This change directly solves all the previous problems. ![](images/registry-build.png) -**所以,新的构建方式 ✨镜像仓库同步✨ 优雅登场 🎉🎉** +**Therefore, the new construction method ✨Image Repository Sync✨ gracefully debuts 🎉🎉** -官方仓库中的[#3154](https://github.com/labring/sealos/pull/3154)这个PR已经完成了这个功能的实现。目前,Sealos支持这两种方式进行镜像构建。接下来,我会介绍如何启动新功能(如果新功能表现稳定,我们可能会废弃旧的构建方式)。 +The [#3154](https://github.com/labring/sealos/pull/3154) PR in the official repository has completed the implementation of this feature. Currently, Sealos supports these two ways of image construction. Next, I will introduce how to start the new feature (if the new feature performs stably, we may abandon the old construction method). -## 如何启动新功能 +## How to Start the New Feature -启动新功能非常简单,只需在你构建镜像之前添加一个环境变量即可。这个功能同时支持build和merge两个命令。 +Starting the new feature is very simple, just add an environment variable before you build the image. This feature supports both build and merge commands. ```shell SEALOS_REGISTRY_SYNC_EXPERIMENTAL=true sealos build -t test . ``` -以下是执行上述命令后的预期输出: +Here is the expected output after executing the above command: ```tex SEALOS_REGISTRY_SYNC_EXPERIMENTAL=true sealos build -t test . @@ -75,9 +75,11 @@ Copying blob 13ab73c881c8 done Copying config 4e22d16b36 done Writing manifest to image destination Storing signatures ---> 4e22d16b366 +--> 4e22d16 + +b366 Successfully tagged localhost/test:latest 4e22d16b366e9fec25641522a74cbd73a7db67dc0516b8f8e00200c4d0551592 ``` -希望以上内容可以帮助您更好地理解并使用Sealos的新镜像构建方式。 +I hope the above content can help you better understand and use Sealos's new image building method. diff --git a/docs/4.0/docs/lifecycle-management/advanced-guide/image-build-standardized.md b/docs/4.0/docs/lifecycle-management/advanced-guide/image-build-standardized.md index 331c240a485..9dadcfab605 100644 --- a/docs/4.0/docs/lifecycle-management/advanced-guide/image-build-standardized.md +++ b/docs/4.0/docs/lifecycle-management/advanced-guide/image-build-standardized.md @@ -2,13 +2,13 @@ sidebar_position: 1 --- -# 镜像构建与标准化目录配置 +# Image Building and Standard Directory Configuration -在开展 Sealos 镜像构建任务前,我们建议先构建一个符合规范的目录结构。这样能够使构建过程更加规范,易于管理,同时也能降低出错率。这篇文章将详细指导你如何创建这样一个目录结构,并解释每个目录的用途。 +Before embarking on Sealos image building tasks, we suggest first constructing a directory structure that conforms to standards. This makes the building process more standardized, easier to manage, and reduces the likelihood of errors. This article will guide you in detail on how to create such a directory structure and explain the purpose of each directory. -## 目录结构示例 +## Directory Structure Example -一个完整的、符合规范的目录结构示例如下: +A complete, standardized directory structure example is as follows: ```shell . @@ -36,71 +36,69 @@ sidebar_position: 1 └── registry ``` -## 目录描述 +## Directory Descriptions -每个目录在构建过程中都扮演着特定的角色,以下是他们的详细描述: +Each directory plays a specific role during the build process, and their detailed descriptions are as follows: -- `Kubefile` (必需):这个文件类似于 Dockerfile,是构建镜像的核心文件。它定义了构建过程中的各个步骤,如基础镜像选择、环境变量设置、文件复制等。 -- `manifests`:这个目录用于存放 Kubernetes 的 yaml 文件,这些文件描述了你的应用的配置信息,如 Pod、Service、Deployment 的配置。 -- `charts`:这个目录用于存放 Helm chart 文件,Helm chart 是 Kubernetes 的一个包管理工具,可以简化 Kubernetes 应用的部署和管理。 -- `images/shim`:这个目录用于存放无法从 yaml 文件或 Helm chart 中自动提取的镜像。在构建过程中,sealos 将自动拉取这些镜像。 -- `opt`:二进制文件存储在这里。 -- `registry`:这个目录用于存放构建过程中拉取到本地的镜像。在构建过程中,该目录将自动生成,无需手动创建。 -- `init.sh`:这个脚本在构建过程中由 GitHub Action 自动运行,你可以在这个脚本中编写一些自动化的工作,如初始化环境、预处理数据等。([cluster-image](https://github.com/labring-actions/cluster-image)的规则) +- `Kubefile` (required): This file is similar to Dockerfile and is the core file for image building. It defines various steps in the build process, such as the selection of the base image, setting of environment variables, file copying, etc. +- `manifests`: This directory is used to store Kubernetes yaml files, which describe the configuration information of your applications, such as Pod, Service, Deployment configurations. +- `charts`: This directory is used to store Helm chart files. Helm chart is a package management tool for Kubernetes that simplifies the deployment and management of Kubernetes applications. +- `images/shim`: This directory is used to store images that cannot be automatically extracted from yaml files or Helm charts. During the build process, sealos will automatically pull these images. +- `opt`: Binary files are stored here. +- `registry`: This directory is used to store images pulled locally during the build process. During the build process, this directory will be automatically generated, and there is no need to manually create it. +- `init.sh`: This script is automatically run by GitHub Action during the build process. You can write some automated tasks in this script, such as initializing the environment, preprocessing data, etc. (Following the rules of [cluster-image](https://github.com/labring-actions/cluster-image)) -## Kubefile 参数 +## Kubefile Parameters -`Kubefile` 文件是镜像构建的核心,它支持多种参数,以下是这些参数的详细解析: +The `Kubefile` file is at the core of image building and supports various parameters. Below is a detailed analysis of these parameters: ```shell FROM labring/kubernetes:v1.24.0 ENV version v1.1.0 COPY manifests ./manifests COPY registry ./registry -ENTRYPOINIT ["kubectl apply -f manifests/tigera-operator.yaml"] +ENTRYPOINT ["kubectl apply -f manifests/tigera-operator.yaml"] CMD ["kubectl apply -f manifests/custom-resources.yaml"] ``` -各个参数的描述: - -- `FROM`:这个指令用于设置构建的基础镜像,所有的构建步骤都基于这个镜像进行。 -- `LABEL`: `LABEL`定义一些sealos集群镜像的内部配置。 - - - `check` 集群镜像运行前的一些检查脚本操作 - - `clean` 集群reset或者节点删除的清理脚本 - - `clean-registry` 集群reset时候的清理镜像仓库的脚本 - - `image` 集群的lvscare镜像地址(sealos的IPVS镜像) - - `init` 集群初始化的脚本 - - `init-registry` 集群初始化时启动容器镜像仓库的脚本 - - `sealos.io.type` 集群镜像类型,目前主要是rootfs、application和patch。 - - rootfs 是运行集群的基础镜像,比如kubernetes、kubernetes-docker这种包含镜像、二进制等集群所需的。(**每个节点都需要存在**) - - application 是应用镜像,比如calico、helm、istio等应用服务的镜像。(**只存储到master0节点**) - - patch是在rootfs镜像后需要调整的,是另一种修改rootfs镜像的方式(**还有一种方式是Config方式**),它会覆盖默认的集群运行的第一个镜像。 - - - `sealos.io.version` 镜像的版本号,目前开启的是v1beta1 - - `version` 集群的版本号,当前是kubernetes的版本号 - - `vip` 是VIP的地址,为修改IPVS的虚IP使用 - -- `ENV`:`ENV`指令将环境变量``设置为值``。(rootfs中默认会有一些默认的环境变量,可以修改rootfs中一些默认参数,比如镜像仓库的账号密码、docker、containerd的存储目录等等) - - 具体的集群镜像需要具体查看,`sealos inspect`镜像看一下对应的环境变量,不同版本的镜像略有不同。 - - - SEALOS_SYS_CRI_ENDPOINT: 当前集群镜像的criSocket (不同类型集群镜像可能不同) - - criData: cri的数据目录 - - defaultVIP: 默认的VIP地址 - - disableApparmor: 是否禁用apparmor (containerd有这个问题) - - registryConfig: 容器镜像仓库的配置目录 - - registryData: 容器镜像仓库的数据目录(因为是目录进行了挂载,其实这个配置没有实际意义,它实际还是存储在/var/lib/sealos下面) - - registryDomain: 默认镜像仓库的域名 - - registryPassword: 默认镜像仓库的密码 - - registryPort: 默认镜像仓库的密码 - - registryUsername: 默认镜像仓库的账户 - - sandboxImage: 默认cri启动的sandbox_image。(无需写repo只需要写镜像名称,eg: pasue:3.7) -- `COPY`:`COPY`指令从``复制新的文件或目录,并将它们添加到容器的文件系统路径``上。(**注意,需要把registry目录进行拷贝,否则集群没有容器镜像**) -- `ENTRYPOINT`:这个指令用于设置镜像的启动命令,当镜像启动时,这条命令会被执行。 -- `CMD`:这个指令也用于设置镜像的启动命令,但它与 ENTRYPOINT 指令的区别在于,如果用户在运行镜像时(`sealos run --cmd`)提供了启动命令,CMD 指令中的命令将会被覆盖。 - -在构建过程中,Sealos 还会自动设置一些内置的环境变量,包括(前缀为'SEALOS_SYS'的环境变量无法被修改): - -- SEALOS_SYS_KUBE_VERSION:Kubernetes的版本号,例如 v1.26.0 -- SEALOS_SYS_SEALOS_VERSION:Sealos的版本号,例如 4.1.3 +Descriptions of each parameter: + +- `FROM`: This directive is used to set the base image for building. All build steps are based on this image. +- `LABEL`: `LABEL` defines some internal configurations of the sealos cluster image. + - `check`: Some check scripts operation before the cluster image runs. + - `clean`: Cleanup scripts for cluster reset or node deletion. + - `clean-registry`: The script to clean the image repository when the cluster is reset. + - `image`: The lvscare image address of the cluster (Sealos's IPVS image). + - `init`: Cluster initialization script. + + +- `init-registry`: The script to start the container image repository when initializing the cluster. + - `sealos.io.type`: Cluster image type, currently mainly rootfs, application, and patch. + - Rootfs is the basic image for running the cluster, such as Kubernetes, Kubernetes-docker, which includes images, binaries, etc. required by the cluster (**required for each node**). + - Application is the application image, such as calico, helm, istio, etc. application service images. (**only stored on the master0 node**) + - Patch is needed to adjust after the rootfs image. It is another way to modify the rootfs image (**another method is the Config method**), it will overwrite the first image of the default cluster running. + - `sealos.io.version`: The version number of the image, currently the opened version is v1beta1. + - `version`: The version number of the cluster, currently it's the version number of Kubernetes. + - `vip`: It's the VIP address for modifying the IPVS virtual IP. +- `ENV`: The `ENV` directive sets the environment variable `` to the value ``. (There will be some default environment variables in rootfs, which can modify some default parameters in rootfs, such as the username and password of the image repository, the storage directory of docker, containerd, etc.) + + For specific cluster images, you need to inspect it specifically, check the corresponding environment variables with `sealos inspect` image, different versions of the image have slight differences. + - SEALOS_SYS_CRI_ENDPOINT: The criSocket of the current cluster image (different types of cluster images may be different). + - criData: Data directory of cri. + - defaultVIP: Default VIP address. + - disableApparmor: Whether to disable apparmor (containerd has this issue). + - registryConfig: Configuration directory of the container image repository. + - registryData: Data directory of the container image repository (because it's the directory that has been mounted, this configuration actually has no practical significance, it's actually stored under /var/lib/sealos). + - registryDomain: The default domain of the image repository. + - registryPassword: The password of the default image repository. + - registryPort: The password of the default image repository. + - registryUsername: The account of the default image repository. + - sandboxImage: Default sandbox_image for cri to start. (No need to write repo, just need to write image name, eg: pasue:3.7). +- `COPY`: The `COPY` directive copies new files or directories from `` and adds them to the file system path `` on the container. (**Note that the registry directory needs to be copied, otherwise the cluster has no container images**) +- `ENTRYPOINT`: This directive is used to set the startup command for the image. When the image starts, this command will be executed. +- `CMD`: This directive is also used to set the startup command for the image. However, the difference between it and the ENTRYPOINT directive is that if users provide a startup command when running the image (`sealos run --cmd`), the command in the CMD directive will be overridden. + +During the build process, Sealos will also automatically set some built-in environment variables, including (environment variables with the prefix 'SEALOS_SYS' cannot be modified): + +- SEALOS_SYS_KUBE_VERSION: The version number of Kubernetes, for example v1.26.0 +- SEALOS_SYS_SEALOS_VERSION: The version number of Sealos, for example 4.1.3. diff --git a/docs/4.0/docs/lifecycle-management/advanced-guide/sealos-run.md b/docs/4.0/docs/lifecycle-management/advanced-guide/sealos-run.md index 6946a3bbc93..362863abc4b 100644 --- a/docs/4.0/docs/lifecycle-management/advanced-guide/sealos-run.md +++ b/docs/4.0/docs/lifecycle-management/advanced-guide/sealos-run.md @@ -2,135 +2,135 @@ sidebar_position: 2 --- -# Sealos Run 的工作原理 +# How Sealos Run Works -以下是 `sealos run` 命令的详细工作原理。为了帮助您更好地理解,我们将其分解为九个主要步骤。 +Below is a detailed explanation of how the `sealos run` command works. To aid understanding, we break it down into nine main steps. -## 1. 执行命令 +## 1. Execution of Command -首先,用户通过执行以下命令启动 Sealos: +Firstly, users launch Sealos by executing the following command: ```bash sealos run kubernetes:v1.23.8 ``` -## 2. 执行 Pipeline +## 2. Execution of Pipeline -命令执行后,Sealos 开始执行一系列相关的操作步骤,我们称之为 "Pipeline"。这个过程包括以下几个子步骤: +After the command is executed, Sealos starts to execute a series of related operational steps, which we call the "Pipeline". This process includes the following substeps: -### 2.1 节点检查 +### 2.1 Node Check -Sealos 会对所有节点进行检查,以确保它们都是可用的。例如,检查是否存在重复的主机名,以及所有节点的时间是否已经同步。 +Sealos will check all nodes to ensure they are available. For example, checking for duplicate hostnames, and whether the time of all nodes has been synchronized. -### 2.2 拉取镜像 +### 2.2 Pulling Images -接着,Sealos 从远程仓库拉取 Kubernetes 的镜像,并将其加载到本地存储。 +Next, Sealos pulls the Kubernetes images from the remote repository and loads them into local storage. -### 2.3 渲染配置 +### 2.3 Configuration Rendering -然后,Sealos 会对拉取到的镜像的 rootfs(文件系统)进行配置渲染,这是为了准备后续的节点分发。 +Then, Sealos renders the configuration of the pulled image's rootfs (file system) to prepare for the subsequent node distribution. -### 2.4 分发镜像文件 +### 2.4 Distribution of Image Files -配置渲染完成后,Sealos 会将渲染后的 rootfs 文件分发到各个节点。 +Once the configuration rendering is complete, Sealos distributes the rendered rootfs files to each node. -### 2.5 分发 Registry 目录 +### 2.5 Distribution of Registry Directory -此外,Sealos 也会将镜像中的 registry 目录分发到对应的 registry 角色节点。Sealos 支持两种模式: +In addition, Sealos also distributes the registry directory in the image to the corresponding registry role nodes. Sealos supports two modes: -- **scp模式**:直接通过 scp 将目录复制到每个节点,这种方式会占用大量的网络带宽。 -- **镜像同步模式**:使用 skopeo sdk 的镜像同步机制,能够实现增量镜像同步,从而节省网络带宽。该功能可通过环境变量 `SEALOS_REGISTRY_SYNC_EXPERIMENTAL=true` 来开启。 +- **scp mode**: Directly copy the directory to each node via scp, which consumes a lot of network bandwidth. +- **Image synchronization mode**: Using the skopeo sdk's image synchronization mechanism, incremental image synchronization can be achieved to save network bandwidth. This feature can be enabled with the environment variable `SEALOS_REGISTRY_SYNC_EXPERIMENTAL=true`. -### 2.6 执行 Bootstrap +### 2.6 Execution of Bootstrap -Bootstrap 是关键步骤,包括以下操作: +Bootstrap is a crucial step, including the following operations: -#### 2.6.1 添加 Host 解析 +#### 2.6.1 Addition of Host Resolution -Sealos 会在每个节点上添加 registry 的 host 解析。 +Sealos adds host resolution for the registry on each node. -#### 2.6.2 执行 Registry-Init 脚本 +#### 2.6.2 Execution of Registry-Init Script -在添加完 host 解析后,Sealos 会执行 registry-init 脚本。 +After adding host resolution, Sealos executes the registry-init script. -#### 2.6.3 执行 Init 脚本 +#### 2.6.3 Execution of Init Script -最后,Sealos 会执行 init 脚本,启动 Kubernetes 服务。 +Finally, Sealos executes the init script to start the Kubernetes service. -## 3. 执行 InitMaster0 +## 3. Execution of InitMaster0 -Pipeline 执行完成后,Sealos 进入 InitMaster0 阶段。在此阶段,Sealos 会执行以下操作: +After the Pipeline execution, Sealos enters the InitMaster0 phase. In this phase, Sealos performs the following operations: -### 3.1 生成 Kubeadm 配置 +### 3.1 Generation of Kubeadm Configuration -首先,Sealos 生成 Kubeadm 的初始化配置文件。 +Firstly, Sealos generates the initialization configuration file for Kubeadm. -### 3.2 生成并分发证书文件 +### 3.2 Generation and Distribution of Certificate Files -然后,Sealos 生成集群的所有 +Then, Sealos generates all certificate files for the cluster and distributes them to each node. -证书文件,并将它们分发到各个节点。 +### 3.3 Initialization of Master0 -### 3.3 初始化 Master0 +Finally, Sealos executes `kubeadm init` to initialize the Master0 node. -最后,Sealos 执行`kubeadm init`初始化 Master0 节点。 +## 4. Execution of JoinMaster -## 4. 执行 JoinMaster +After the initialization of the Master0 node, Sealos enters the JoinMaster phase. In this phase, Sealos performs the following operations: -初始化完 Master0 节点后,Sealos 进入 JoinMaster 阶段。在此阶段,Sealos 会执行以下操作: +### 4.1 Synchronization of Kubeconfig -### 4.1 同步 Kubeconfig +Firstly, Sealos synchronizes the Kubeconfig file to each node. -首先,Sealos 将 Kubeconfig 文件同步到各个节点。 +### 4.2 Synchronization of Certificate Files -### 4.2 同步证书文件 +Next, Sealos synchronizes certificate files to each node. -接下来,Sealos 同步证书文件到各个节点。 +### 4.3 Generation of Join Configuration -### 4.3 生成 Join 配置 +Then, Sealos generates the JoinMaster configuration file. -然后,Sealos 生成 JoinMaster 配置文件。 +### 4.4 Generation of Join Token -### 4.4 生成 Join 令牌 +Next, Sealos generates the Join token. -接着,Sealos 生成 Join 令牌。 +### 4.5 Execution of Join Master Process -### 4.5 执行 Join Master 流程 +Finally, Sealos executes the `kubeadm join` process to add other Master nodes to the cluster. -最后,Sealos 执行`kubeadm join`流程,让其他 Master 节点加入集群。 +## 5. Execution of JoinNode -## 5. 执行 JoinNode +After all Master nodes have joined the cluster, Sealos enters -所有 Master 节点加入集群后,Sealos 进入 JoinNode 阶段,执行以下操作: +the JoinNode phase and performs the following operations: -### 5.1 生成 Join 令牌 +### 5.1 Generation of Join Token -首先,Sealos 再次生成 Join 令牌。 +Firstly, Sealos generates the Join token again. -### 5.2 生成 IPVS 规则 +### 5.2 Generation of IPVS Rules -然后,Sealos 生成 IPVS 规则。 +Then, Sealos generates IPVS rules. -### 5.3 生成 Join 配置 +### 5.3 Generation of Join Configuration -接下来,Sealos 再次生成 JoinNode 配置。 +Next, Sealos generates the JoinNode configuration again. -### 5.4 执行 Join Node 流程 +### 5.4 Execution of Join Node Process -最后,Sealos 执行 Join Node 流程,让 Worker 节点加入集群。 +Finally, Sealos executes the Join Node process to add Worker nodes to the cluster. -## 6. 同步 IPVS +## 6. Synchronization of IPVS -所有节点加入集群后,Sealos 将 Master 的 IPVS 规则同步到所有节点。这里主要是通过 lvscare 的静态 pod,根据 Master 节点的数量同步静态 pod 的配置。 +After all nodes have joined the cluster, Sealos synchronizes the IPVS rules of the Master to all nodes. This is mainly done through the lvscare static pod, which synchronizes the static pod configuration based on the number of Master nodes. -## 7. 执行 Guest 阶段 +## 7. Execution of Guest Phase -IPVS 规则同步完成后,Sealos 执行 Guest 阶段。这是执行集群镜像命令的阶段。 +After the IPVS rules are synchronized, Sealos executes the Guest phase. This is the stage to execute the cluster image command. -## 8. 写入 Clusterfile +## 8. Writing to the Clusterfile -最后,Sealos 将最终的执行结果写入 Clusterfile。 +Finally, Sealos writes the final execution result to the Clusterfile. -这就是 `sealos run` 命令的工作原理。希望通过这篇文章,您能对 `sealos run` 命令有更深入的理解。以下是我们提到的全景图,以帮助您更好地理解整个流程。 +This is how the `sealos run` command works. Through this article, we hope that you have a deeper understanding of the `sealos run` command. Below is the panorama we mentioned to help you better understand the entire process. ![](images/sealos-run.png) diff --git a/docs/4.0/docs/lifecycle-management/advanced-guide/template-function.md b/docs/4.0/docs/lifecycle-management/advanced-guide/template-function.md index 8cf77555612..63ec9ea289e 100644 --- a/docs/4.0/docs/lifecycle-management/advanced-guide/template-function.md +++ b/docs/4.0/docs/lifecycle-management/advanced-guide/template-function.md @@ -2,19 +2,19 @@ sidebar_position: 9 --- -# 模板引入与函数增强 +# Template Inclusion and Function Enhancement -在 Sealos 的镜像构建过程中,"tmpl" 后缀的文件在 "etc"、"scripts" 和 "manifests" 这三个目录下的文件会被特殊处理。 +In the image building process of Sealos, files with the "tmpl" extension under the "etc", "scripts", and "manifests" directories are specially treated. -1. "etc" 目录:这个目录通常用于存放配置文件。在构建过程中,Sealos 会对该目录下的 "tmpl" 后缀的文件进行模板渲染,渲染完成后的文件将被拷贝到集群镜像的相应目录下。 +1. "etc" directory: This directory is usually used to store configuration files. During the build process, Sealos will render the files with the "tmpl" extension in this directory. The files, once rendered, are copied to the corresponding directory of the cluster image. -2. "scripts" 目录:这个目录通常用于存放执行脚本。Sealos 会对该目录下的 "tmpl" 后缀的文件进行模板渲染,生成的脚本将在集群镜像构建过程中被执行。 +2. "scripts" directory: This directory is usually used to store execution scripts. Sealos will render the files with the "tmpl" extension in this directory. The generated scripts will be executed during the cluster image build process. -3. "manifests" 目录:这个目录通常用于存放 Kubernetes 资源清单文件。Sealos 会对该目录下的 "tmpl" 后缀的文件进行模板渲染,生成的清单文件将在集群镜像构建过程中被应用到 Kubernetes 集群中。 +3. "manifests" directory: This directory is usually used to store Kubernetes resource manifest files. Sealos will render the files with the "tmpl" extension in this directory. The generated manifest files will be applied to the Kubernetes cluster during the cluster image build process. -总的来说,这三个目录下的 "tmpl" 后缀文件在 Sealos 的镜像构建过程中都会被视为模板文件进行处理。这种处理方式提供了更多的灵活性,让我们可以在构建过程中动态生成配置、脚本或者 Kubernetes 资源清单。 +In summary, files with the "tmpl" extension in these three directories are treated as template files during the image build process of Sealos. This approach provides more flexibility, allowing us to dynamically generate configurations, scripts, or Kubernetes resource manifests during the build process. -在构建镜像时,我们支持 `template` 来让维护者完全控制生成的配置文件(模块渲染)。例如: +When building an image, we support `template` to allow maintainers to fully control the generated configuration files (module rendering). For example: ```yaml service: @@ -27,11 +27,11 @@ service: {{- end }} ``` -请参考 Golang 的 [text/template](https://pkg.go.dev/text/template) 了解基础介绍和更多细节。 +Please refer to Golang's [text/template](https://pkg.go.dev/text/template) for a basic introduction and more details. -## 模板函数增强 +## Template Function Enhancement -此外,我们支持 `templateFunc` 来增强模板函数。例如: +In addition, we support `templateFunc` to enhance template functions. For example: ```yaml shim: /var/run/image-cri-shim.sock @@ -45,13 +45,12 @@ timeout: 15m auth: {{ .registryUsername }}:{{ .registryPassword }} ``` -在这里我们使用 `semverCompare` 来检查用户是否运行在 k8s 版本 v1.26.0 或以上,如果是,生成 `version: v1`,否则生成 `version: v1alpha2`。 -有了这个支持,我们可以很轻松地用一个集群镜像文件管理多版本的 Kubernetes 支持。 +Here we use `semverCompare` to check whether the user is running on k8s version v1.26.0 or above. If so, generate `version: v1`, otherwise generate `version: v1alpha2`. With this support, we can easily manage multiple versions of Kubernetes support with a single cluster image file. -### 一些最常用的模板函数 +### Some Most Commonly Used Template Functions -* [semverCompare](http://masterminds.github.io/sprig/semver.html) 比较语义版本,而不是字符串比较。 -* [default](http://masterminds.github.io/sprig/defaults.html) default 可以在值为空或未定义时提供一个默认值。 -* [toYaml](https://github.com/labring/sealos/blob/main/pkg/template/funcmap.go#L66) 将当前值(对象,映射,数组)显示为 yaml 格式的字符串。 +* [semverCompare](http://masterminds.github.io/sprig/semver.html) compares semantic versions, not string comparisons. +* [default](http://masterminds.github.io/sprig/defaults.html) default can provide a default value when a value is empty or undefined. +* [toYaml](https://github.com/labring/sealos/blob/main/pkg/template/funcmap.go#L66) displays the current value (object, map, array) as a yaml formatted string. -完整的支持函数列表,请[点击这里](http://masterminds.github.io/sprig/)。 +For a complete list of supported functions, [click here](http://masterminds.github.io/sprig/). diff --git a/docs/4.0/docs/lifecycle-management/lifecycle-management.md b/docs/4.0/docs/lifecycle-management/lifecycle-management.md index 1ff78675085..4d8fef8e7fa 100644 --- a/docs/4.0/docs/lifecycle-management/lifecycle-management.md +++ b/docs/4.0/docs/lifecycle-management/lifecycle-management.md @@ -2,40 +2,40 @@ sidebar_position: 0 --- -# 集群生命周期管理 +# Cluster Lifecycle Management -Sealos 提供一套强大的工具,使得用户可以便利地管理整个集群的生命周期。 +Sealos provides a powerful set of tools that allow users to easily manage the entire lifecycle of a cluster. -## 功能介绍 +## Features -使用 Sealos,您可以安装一个不包含任何组件的裸 Kubernetes 集群。此外,Sealos 还可以在 Kubernetes 之上,通过集群镜像能力组装各种上层分布式应用,如数据库、消息队列等。 +With Sealos, you can install a bare Kubernetes cluster without any components. Additionally, Sealos can assemble various upper-layer distributed applications on top of Kubernetes using cluster image capabilities, such as databases, message queues, and more. -Sealos 不仅可以安装一个单节点的 Kubernetes 开发环境,还能构建数千节点的生产高可用集群。 +Sealos not only allows you to install a single-node Kubernetes development environment but also enables you to build production-grade highly available clusters with thousands of nodes. -Sealos 具有自由伸缩集群、备份恢复、释放集群等功能,即使在离线环境中,Sealos 也能提供出色的 Kubernetes 运行体验。 +Sealos offers features like cluster scaling, backup and recovery, and cluster release. It provides an excellent Kubernetes runtime experience even in offline environments. -## 主要特性 +## Key Features -- 支持 ARM,v1.20 以上版本离线包支持 containerd 与 docker 集成 -- 提供 99 年证书,支持集群备份,升级 -- 不依赖 ansible、haproxy、keepalived,一个二进制工具,零依赖 -- 提供离线安装,不同 Kubernetes 版本只需使用不同的集群镜像 -- 高可用性由 ipvs 实现的 localLB 提供,占用资源少,稳定可靠,类似 kube-proxy 的实现 -- 使用 image-cri-shim 自动识别镜像名称,使离线交付更方便 -- 几乎兼容所有支持 systemd 的 x86_64 架构的环境 -- 轻松实现集群节点的增加/删除 -- 已有数万用户在线上环境使用 Sealos,稳定可靠 -- 支持集群镜像,自由组合定制你需要的集群,如 openebs 存储+数据库+minio 对象存储 -- 使用 buildah 的 sdk 实现对镜像标准统一,完全兼容 OCI 的标准 +- ARM support. Offline packages v1.20 and above support integration with both containerd and Docker. +- Provides 99-year certificates and supports cluster backup and upgrade. +- Does not rely on Ansible, HAProxy, or Keepalived. It is a standalone binary tool with zero dependencies. +- Provides offline installation. Different versions of Kubernetes only require different cluster images. +- High availability is achieved through localLB based on IPVS, which consumes fewer resources and provides stability and reliability, similar to kube-proxy implementation. +- Automatically recognizes image names using image-cri-shim, making offline delivery more convenient. +- Almost compatible with all x86_64 architectures that support systemd. +- Easy addition/deletion of cluster nodes. +- Trusted by tens of thousands of users in production environments, stable and reliable. +- Supports cluster images, allowing you to customize and combine the cluster components you need, such as OpenEBS storage + database + MinIO object storage. +- Uses the SDK of Buildah to standardize the image format, fully compatible with OCI standards. -## 使用 Sealos 运行 Kubernetes 集群 +## Running a Kubernetes Cluster with Sealos -使用 Sealos 运行一个 Kubernetes 集群非常简单,只需以下步骤: +Running a Kubernetes cluster with Sealos is straightforward. Just follow these steps: ```bash $ curl -sfL https://raw.githubusercontent.com/labring/sealos/v4.2.0/scripts/install.sh \ | sh -s v4.2.0 labring/sealos -# 创建一个集群 +# Create a cluster $ sealos run labring/kubernetes:v1.25.0-4.2.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \ --masters 192.168.64.2,192.168.64.22,192.168.64.20 \ --nodes 192.168.64.21,192.168.64.19 -p [your-ssh-passwd] @@ -43,28 +43,28 @@ $ sealos run labring/kubernetes:v1.25.0-4.2.0 labring/helm:v3.8.2 labring/calico [![asciicast](https://asciinema.org/a/519263.svg)](https://asciinema.org/a/519263?speed=3) -## 在集群上运行分布式应用 +## Running Distributed Applications on the Cluster -通过 `sealos run` 命令,您可以在集群上运行各种分布式应用,如数据库、消息队列、AI 能力,甚至企业级 SaaS 软件。例如: +With the `sealos run` command, you can run various distributed applications on the cluster, such as databases, message queues, AI capabilities, and even enterprise-level SaaS software. For example: ```shell -# MySQL 集群 +# MySQL cluster $ sealos run labring/mysql-operator:8.0.23-14.1 -# Clickhouse 集群 +# Clickhouse cluster $ sealos run labring/clickhouse:0.18.4 -# Redis 集群 +# Redis cluster $ sealos run labring/redis-operator:3.1.4 ``` -## 自定义集群 +## Customizing the Cluster -对于 Sealos 生态没有的集群镜像,用户可以方便地自己构建和定制属于自己的集群镜像。例如: +For cluster images not available in the Sealos ecosystem, users can easily build and customize their own cluster images. For example: -[构建一个 ingress 集群镜像](https://docs.sealos.io/docs/lifecycle-management/quick-start/build-ingress-cluster-image) +[Building an Ingress Cluster Image](https://docs.sealos.io/docs/lifecycle-management/quick-start/build-ingress-cluster-image) -您还可以定制一个完全属于自己的 Kubernetes: +You can also customize your own Kubernetes cluster: Sealfile: @@ -76,18 +76,18 @@ CMD ["helm install flannel flannel-chart", "helm install mysql mysql-chart"] ``` ```shell -sealos build -t my-kuberentes:v1.25.0 . -sealos run my-kuberentes:v1.25.0 ... +sealos build -t my-kubernetes:v1.25.0 . +sealos run my-kubernetes:v1.25.0 ... ``` -## 常见问题 +## Frequently Asked Questions -**sealos 是 Kubernetes 安装工具吗?** +**Is Sealos a Kubernetes installation tool?** -安装部署是 Sealos 的一个基本功能,如同单机操作系统有 boot 模块一样,Sealos 的 boot 模块可以很好地管理 Kubernetes 在任何场景下的生命周期。 +Installation and deployment are basic functions of Sealos, similar to the boot module in a single-node operating system. Sealos' boot module effectively manages the lifecycle of Kubernetes in any scenario. -**sealos 和 rancher、kubesphere 有什么区别?** +**What are the differences between Sealos, Rancher, and KubeSphere?** -Sealos 的设计理念是 "化整为零,自由组装,大道至简"。Sealos 利用 Kubernetes 的能力,以简单的方式提供给用户真正需要的东西。用户需要的不一定是 Kubernetes,用户需要的是具体的能力。 +Sealos is designed with the philosophy of "simplifying complexity, freely assembling, and simplicity as the ultimate goal." Sealos leverages the capabilities of Kubernetes to provide users with exactly what they need in a simple way. Users may not necessarily need Kubernetes; what they need is specific functionality. -Sealos 是极其灵活的,不会给用户带来额外负担。它的形态取决于用户的需求和安装的应用。Sealos 的核心是分布式应用,所有应用都是一等公民。 +Sealos is highly flexible and does not impose additional burdens on users. Its form depends on user requirements and the applications being installed. The core of Sealos is distributed applications, and all applications are treated equally. diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-binary.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-binary.md index 6433a19d058..ef9ba1db8c3 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-binary.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-binary.md @@ -2,28 +2,28 @@ sidebar_position: 4 --- -# 构建基于二进制文件的集群镜像 +# Building Cluster Images Based on Binary Files -此文档主要介绍了如何使用 `sealos` 工具将单一二进制文件(例如 `helm` 或 `kustomize`)打包为集群镜像,并将它们通过在主节点上部署集群镜像进行安装。以 `helm` 为例,我们将详细介绍如何将二进制文件打包成集群镜像。 +This document primarily details how to use the `sealos` tool to package a single binary file (like `helm` or `kustomize`) into a cluster image and install them by deploying the cluster image on the master node. Using `helm` as an example, we will thoroughly discuss how to package a binary file into a cluster image. -## 创建构建工作空间 +## Create a Build Workspace -首先,创建一个基础目录作为构建工作空间: +Firstly, create a base directory to serve as a build workspace: ```shell $ mkdir ~/cluster-images ``` -在工作空间中,创建一个 `opt` 目录用于存储二进制文件: +In the workspace, create an `opt` directory for storing the binary files: ```shell $ cd cluster-images $ mkdir opt/ ``` -## 准备二进制文件 +## Prepare the Binary File -接下来,我们准备 `helm` 二进制文件。在此,我们从 [github release](https://github.com/helm/helm/releases) 中下载: +Next, we prepare the `helm` binary file. Here, we download from [github release](https://github.com/helm/helm/releases): ```shell wget https://get.helm.sh/helm-v3.10.1-linux-amd64.tar.gz @@ -32,9 +32,9 @@ chmod a+x linux-amd64/helm mv linux-amd64/helm opt/ ``` -## 创建构建镜像所需的 `Sealfile` 文件 +## Create the `Sealfile` Required for Building the Image -创建一个名为 `Sealfile` 的文件,内容如下: +Create a file named `Sealfile`, with the following content: ```shell FROM scratch @@ -42,7 +42,7 @@ COPY opt ./opt CMD ["cp opt/helm /usr/bin/"] ``` -目前的目录结构如下: +The current directory structure is as follows: ``` . @@ -51,38 +51,38 @@ CMD ["cp opt/helm /usr/bin/"] └── helm ``` -## 构建集群镜像 +## Build the Cluster Image -现在,一切准备就绪,你可以开始构建集群镜像了: +Now, everything is ready, and you can begin building the cluster image: ```shell sealos build -t labring/helm:v3.10.1 . ``` -**注意:** 首先你需要在本地主机上安装 `sealos` 命令。 +**Note:** Firstly, you need to install the `sealos` command on the local host. -你可以查看构建日志来了解构建过程。 +You can view the build log to understand the building process. ```shell root@ubuntu:~/cluster-images# sealos build -t labring/helm:v3.10.1 . ... ``` -查看构建的镜像,现在所有依赖的二进制文件都已经构建进集群镜像中: +View the built image, and now all the dependent binary files have been built into the cluster image: ```shell root@ubuntu:~/cluster-images# sealos images labring/helm v3.10.1 19ed4a24f0fe 3 minutes ago 45.1 MB ``` -## 推送镜像 +## Push the Image -你可以将镜像推送至任何 Docker 镜像仓库,下面的命令将镜像推送到 dockerhub: +You can push the image to any Docker image repository, the following command pushes the image to DockerHub: ```shell sealos push labring/helm:v3.10.1 ``` -**注意:** 请使用 `sealos` 命令来操作集群镜像,不支持 Docker 命令。 +**Note:** Please use the `sealos` command to operate the cluster image; Docker commands are not supported. -如果你使用的是私有镜像仓库,可以使用 `sealos login` 命令登录你的镜像仓库,然后再推送或者拉取镜像 +If you are using a private image repository, you can use the `sealos login` command to log into your image repository, then push or pull the image. diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-go_template.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-go_template.md index 7c9bda3c492..379ae451afa 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-go_template.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-go_template.md @@ -2,15 +2,15 @@ sidebar_position: 5 --- -# 构建基于 go-template 的集群镜像 +# Building Cluster Images Based on go-template -在构建集群镜像的过程中,我们可以使用 `--env` 选项通过sealos命令行传递一些变量。这些环境变量可以被Kubefile的 `CMD` 命令或者yaml文件模板所使用。 +During the process of building cluster images, we can use the `--env` option to pass some variables through the sealos command line. These environment variables can be used by the `CMD` command of the Kubefile or the yaml file template. -## 在 Kubefile 中使用环境变量 +## Using Environment Variables in Kubefile -这个示例定义了一个 `SERVICE_TYPE` 变量,它允许用户在安装应用程序时自定义服务暴露类型,并将参数传递给CMD中的helm命令。 +This example defines a `SERVICE_TYPE` variable that allows the user to customize the service exposure type when installing the application and pass parameters to the helm command in CMD. -Kubefile 示例: +Kubefile example: ```shell FROM scratch @@ -20,15 +20,15 @@ COPY registry registry CMD ["helm upgrade --install nginx charts/nginx --namespace=nginx --create-namespace --set service.type=$(SERVICE_TYPE)"] ``` -运行集群应用并设置一个自定义的 `SERVICE_TYPE=LoadBalancer`,如果不设置,它将默认为 NodePort。 +Run the cluster application and set a custom `SERVICE_TYPE=LoadBalancer`, if not set, it will default to NodePort. ```shell sealos run labring/nginx:v1.23.1 --env SERVICE_TYPE=LoadBalancer ``` -## 在Yaml文件中使用环境变量 +## Using Environment Variables in Yaml Files -准备一个简单的nginx服务的yaml文件,这个文件必须是 `*.tmpl` 扩展名,以便在运行 `sealos run --env` 命令时渲染。 +Prepare a simple nginx service yaml file, this file must be a `*.tmpl` extension to be rendered when running `sealos run --env` command. ```shell $ cat manifests/service.yaml.tmpl @@ -51,7 +51,7 @@ spec: name: nginx ``` -下面是一个Kubefile样例,你可以在这里设置默认的环境变量。 +Here is a Kubefile example where you can set the default environment variables. ```shell FROM scratch @@ -64,15 +64,15 @@ COPY registry registry CMD ["kubectl apply -f manifests/service.yaml"] ``` -当你构建镜像时,什么都不会发生,只有在运行应用程序时,它才会渲染。如果没有设置 `--env`,它将使用 Kubefile 的默认 ENV。 +When you build the image, nothing will happen, it only renders when running the application. If `--env` is not set, it will use the default ENV in Kubefile. ```shell sealos run labring/nginx:1.23.1 --env serviceType=LoadBalancer --env http_NodePort=30080 --env https_NodePort=30443 ``` -你会发现 sealos 会在主节点的本地路径上基于 `service.yaml.tmpl` 渲染一个新的yaml文件 `service.yaml`。 +You will find that sealos renders a new yaml file `service.yaml` based on `service.yaml.tmpl` on the local path of the master node. -**注意** 新版本的应用的rootfs放到了`/var/lib/sealos/data/default/applications`目录,每个应用都有独立的目录。 +**Note** The new version of the application's rootfs is placed in the `/var/lib/sealos/data/default/applications` directory, each application has its independent directory. ```shell root@node1:~# ls /var/lib/sealos/data/default/rootfs/manifests |grep service @@ -80,7 +80,7 @@ service.yaml service.yaml.tmpl ``` -检查 yaml 内容: +Check the yaml content: ```shell root@node1:~# cat /var/lib/sealos/data/default/rootfs/manifests/service.yaml @@ -94,9 +94,7 @@ spec: type: NodePort ports: - port: 80 - nodePort: - -30080 + nodePort: 30080 name: http - port: 443 nodePort: 30443 @@ -105,4 +103,4 @@ spec: name: nginx ``` -**注意:**所有类型的文件都支持这个特性(文件名后缀是.tmpl且构建目录在etc、scripts和manifests),你可以自己尝试一下。 +**Note:** All types of files support this feature (the file name suffix is .tmpl and the build directory is in etc, scripts, and manifests), you can try it yourself. diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-helm_charts.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-helm_charts.md index dfcfc668aa8..fe440580aa7 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-helm_charts.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-helm_charts.md @@ -2,28 +2,28 @@ sidebar_position: 3 --- -# 构建基于 Helm Charts 的集群镜像 +# Building Cluster Images Based on Helm Charts -让我们以最简单的 nginx 应用程序为例,介绍如何基于 Helm Charts 构建一个基于 nginx 的集群镜像。 +Let's use the simplest nginx application as an example to introduce how to build a cluster image based on nginx using Helm Charts. -## 一、准备工作 +## 1. Preparation -创建一个用于构建工作的基础目录。 +Create a base directory for the build work. ```shell $ mkdir ~/cloud-images ``` -创建一个 `charts` 目录来存储 Kubernetes nginx Helm Charts 文件。 +Create a `charts` directory to store the Kubernetes nginx Helm Charts files. ```shell $ cd cloud-images $ mkdir charts ``` -## 二、准备Helm Charts +## 2. Prepare Helm Charts -准备 nginx Helm Charts,这里我们使用 [bitnami 官方的 nginx Helm Charts](https://bitnami.com/stack/nginx),让我们将 Helm Chart 文件拉取到本地并解压到 `charts` 目录中。 +Prepare the nginx Helm Charts. Here we use [the official nginx Helm Charts by bitnami](https://bitnami.com/stack/nginx). Let's pull the Helm Chart files locally and unzip them to the `charts` directory. ```shell helm repo add bitnami https://charts.bitnami.com/bitnami @@ -31,9 +31,9 @@ helm search repo bitnami/nginx helm pull bitnami/nginx --version=13.2.13 -d charts/ --untar ``` -**注意:** 首先你应该安装 Helm 命令工具到本地主机。 +**Note:** First, you should install the Helm command tool to your local host. -现在,charts 目录的结构如下所示。 +Now, the structure of the charts directory is as follows: ``` charts/ @@ -47,9 +47,9 @@ charts/ └── values.yaml ``` -## 三、创建Kubefile +## 3. Create Kubefile -创建一个名为 `Kubefile` 的文件用于镜像构建: +Create a file named `Kubefile` for image construction: ```shell $ cat Kubefile @@ -59,9 +59,9 @@ COPY registry registry CMD ["helm install nginx charts/nginx --namespace=nginx --create-namespace"] ``` -建议使用 `helm upgrade --install` 而不是 `helm install`,这样可以在以后更新应用程序时重复运行相同的命令。 +It is recommended to use `helm upgrade --install` instead of `helm install` so that you can rerun the same command when updating the application in the future. -你可以根据需要添加其他选项,例如通过 NodePort 暴露服务。 +You can add other options as needed, such as exposing the service through NodePort. ```shell FROM scratch @@ -70,62 +70,26 @@ COPY registry registry CMD ["helm upgrade --install nginx charts/nginx --namespace=nginx --create-namespace --set service.type=NodePort"] ``` -## 四、构建集群镜像 +## 4. Build the Cluster Image -现在一切准备就绪,你可以开始构建集群镜像。 +Now everything is ready, and you can start building the cluster image. ```shell sealos build -t labring/nginx:v1.23.2 . ``` -**注意:** 你应该首先将 sealos 命令安装到本地主机。 +**Note:** You should first install the sealos command to your local host. -你可以查看构建日志。 +You can view the build log. ```shell root@ubuntu:~/cloud-images# sealos build -t labring/nginx:v1.23.2 . -2022-11-06T15:58:33 info lookup in path charts -2022-11-06T15:58:33 info sub chart is nginx -2022-11-06T15:58:33 warn if you access private registry,you must be 'sealos login' or 'buildah login' -2022-11-06T15:58:33 info pull images [docker.io/bitnami/nginx:1.23.2-debian-11-r29] for platform is linux/amd64 -Pulling image: docker.io/bitnami/nginx:1.23.2-debian-11-r29 -1d8866550bdd: Download complete -cbbfe6232a5b: Download complete -ed342369e859: Download complete -Status: images save success -2022-11-06T15:58:43 info output images [docker.io/bitnami/nginx:1.23.2-debian-11-r29] for platform is linux/amd64 -STEP 1/3: FROM scratch -STEP 2/3: COPY . . -STEP 3/3: CMD ["helm upgrade --install nginx charts/nginx --namespace=nginx --create-namespace --set service.type=NodePort"] -COMMIT labring/nginx:v1.23.2 -Getting image source signatures -Copying blob 9f5a861e0f8d done -Copying config 1b89695273 done -Writing manifest to image destination -Storing signatures ---> 1b896952734 -Successfully tagged localhost/labring/nginx:v1.23.2 -1b8969527343939d60859469708e5420758f7419a421304f81b5132669982de7 -2022-11-06T15:58:44 info - ___ ___ ___ ___ ___ ___ - /\ \ /\ \ /\ \ /\__\ /\ \ /\ \ - /::\ \ /::\ \ /::\ \ /:/ / /::\ \ /::\ \ - /:/\ \ \ /:/\:\ \ /:/\:\ \ /:/ / /:/\:\ \ /:/\ \ \ - _\:\~\ \ \ /::\~\:\ \ /::\~\:\ \ /:/ / /:/ \:\ \ _\:\~\ \ \ - /\ \:\ \ \__\ /:/\:\ \:\__\ /:/\:\ \:\__\ /:/__/ /:/__/ \:\__\ /\ \:\ \ \__\ - \:\ \:\ \/__/ \:\~\:\ \/__/ \/__\:\/:/ / \:\ \ \:\ \ /:/ / \:\ \:\ \/__/ - \:\ \:\__\ \:\ \:\__\ \::/ / \:\ \ \:\ /:/ / \:\ \:\__\ - \:\/:/ / \:\ \/__/ /:/ / \:\ \ \:\/:/ / \:\/:/ / - \::/ / \:\__\ /:/ / \:\__\ \::/ / \::/ / - \/__/ \/__/ \/__/ \/__/ \/__/ \/__/ - - Website :https://www.sealos.io/ - Address :github.com/labring/sealos -``` - -sealos 将自动从 charts 目录中提取镜像,将其拉取到本地并存储在 registry 目录中。 - -现在的目录结构如下所示: +... +``` + +sealos will automatically extract the images from the charts directory, pull them locally, and store them in the registry directory. + +The current directory structure is as follows: ```shell . @@ -144,24 +108,24 @@ sealos 将自动从 charts 目录中提取镜像,将其拉取到本地并存 └── registry ``` -在本地查看构建的镜像,现在所有依赖的部署清单和镜像缓存都构建到了集群镜像中。 +Check the built image locally. Now all dependent deployment manifests and image caches are built into the cluster image. ```shell -root@ubuntu:~/cloud-images# - - sealos images +root@ubuntu:~/cloud-images# sealos images labring/nginx v1.23.2 521c85942ee4 4 minutes ago 56.8 MB ``` -你可以将镜像推送到任何 Docker 镜像仓库,下面的命令将其推送到 Docker Hub。 +You can push the image to any Docker image repository. The following command pushes it to Docker Hub. ```shell sealos push labring/nginx:v1.23.2 ``` -**注意:** 请使用 sealos 命令操作集群镜像,不支持 Docker 命令。 +**Note:** Please use the sealos command to operate the cluster + +image, Docker commands are not supported. -如果你使用私有镜像仓库,只需在拉取或推送镜像之前使用 `sealos login` 命令登录到注册表。 +If you use a private image repository, just use the `sealos login` command to log in to the registry before pulling or pushing the image. ```shell sealos login docker.io -u xxx -p xxx @@ -169,25 +133,25 @@ sealos login docker.io -u xxx -p xxx sealos login registry.cn-hangzhou.aliyuncs.com -u xxx -p xxx ``` -## 五、安装集群镜像 +## 5. Install the Cluster Image -然后你可以在你的集群中运行集群镜像。 +Then, you can run the cluster image in your cluster. ```shell sealos run labring/nginx:v1.23.2 ``` -helm 二进制命令将安装到你的 Kubernetes 集群的主节点上。 +The helm binary command will be installed on the master node of your Kubernetes cluster. ```shell root@ubuntu:~# helm -n nginx ls ``` -## 六、说明 +## 6. Explanation -默认情况下,在构建镜像时,sealos 只解析默认的 values.yml 文件,但是你也可以为 sealos 提供自定义的 values.yaml 文件。 +By default, when building images, sealos only parses the default values.yml file. However, you can also provide a custom values.yaml file for sealos. -**自定义 values 文件必须放在与你的 Chart 相同的目录中,并且必须以 `.values.yaml` 的形式命名,例如 `loki-stack.values.yaml`。** +**The custom values file must be placed in the same directory as your Chart, and must be named in the form of `.values.yaml`, for example `loki-stack.values.yaml`.** ```shell . @@ -205,7 +169,7 @@ root@ubuntu:~# helm -n nginx ls ├── Kubefile ``` -`loki-stack.values.yaml` 文件内容如下: +The content of `loki-stack.values.yaml` file is as follows: ```shell $ cat charts/loki-stack.values.yaml @@ -217,7 +181,7 @@ grafana: enabled: true ``` -不同的 values 文件可能会输出不同的镜像列表,以使 sealos 能够在 `sealos build` 过程中自动解析镜像。 +Different values files may output different image lists, allowing sealos to automatically parse the images during the `sealos build` process. ```shell $ helm template charts/loki-stack/ -f charts/loki-stack/values.yaml|grep image: diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-image_list.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-image_list.md index 8fc218a06ff..556023c32b3 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-image_list.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-image_list.md @@ -2,11 +2,11 @@ sidebar_position: 1 --- -# 构建基于镜像列表的集群镜像 +# Building Cluster Images Based on the Image List -本文将指导你如何使用镜像列表构建集群镜像,包括如何构建单个镜像(基于预先存在的 Kubernetes 镜像)或从零开始构建应用镜像。 +This document will guide you on how to build cluster images using the image list, including how to build a single image (based on pre-existing Kubernetes images) or build an application image from scratch. -## 目录结构 +## Directory Structure ``` . @@ -22,11 +22,11 @@ sidebar_position: 1 └── registry ``` -## Dockerfile 构建 +## Dockerfile Building -我们可以将所有内容构建到单个镜像(`FROM labring/kubernetes`)中,或者使用 `FROM scratch` 从头开始构建镜像。 +We can build all content into a single image (`FROM labring/kubernetes`) or use `FROM scratch` to build the image from scratch. -### 单个镜像 +### Single Image ```dockerfile FROM labring/kubernetes:v1.24.0 @@ -36,9 +36,9 @@ COPY registry ./registry CMD ["kubectl apply -f cni/tigera-operator.yaml","kubectl apply -f cni/custom-resources.yaml"] ``` -### 应用镜像 +### Application Image -此镜像不包括 Kubernetes,因此它应在已安装 Kubernetes 的集群中运行。 +This image does not include Kubernetes, so it should run in a cluster where Kubernetes is already installed. ```dockerfile FROM scratch @@ -49,17 +49,17 @@ COPY manifests ./manifests CMD ["kubectl apply -f cni/tigera-operator.yaml","kubectl apply -f cni/custom-resources.yaml"] ``` -说明: +Notes: -1. `CalicoImageList`:Docker 镜像列表文件。 -2. `cni`:`kubectl apply` 的配置文件。 -3. `registry`:存储容器注册表数据的目录。 -4. `sealos build -t kubernetes-calico:1.24.0-amd64 --platform linux/amd64 -f Kubefile .`:构建 OCI 镜像的命令。 -5. `manifests`:将 yaml 文件中的镜像解析为 Docker 镜像列表。 +1. `CalicoImageList`: Docker image list file. +2. `cni`: Configuration files for `kubectl apply`. +3. `registry`: Directory for storing container registry data. +4. `sealos build -t kubernetes-calico:1.24.0-amd64 --platform linux/amd64 -f Kubefile .`: Command for building the OCI image. +5. `manifests`: Resolve images in the yaml file to a Docker image list. -## 构建 Calico 镜像 +## Building Calico Image -### 目录结构 +### Directory Structure ``` . @@ -69,11 +69,11 @@ CMD ["kubectl apply -f cni/tigera-operator.yaml","kubectl apply -f cni/custom-re │   └── tigera-operator.yaml ``` -### Dockerfile 构建 +### Dockerfile Building -#### 全部在一起 +#### All Together -此镜像包括 Kubernetes 和 Calico。 +This image includes both Kubernetes and Calico. ```dockerfile FROM labring/kubernetes:v1.24.0-amd64 @@ -81,9 +81,9 @@ COPY cni ./cni CMD ["kubectl apply -f cni/tigera-operator.yaml","kubectl apply -f cni/custom-resources.yaml"] ``` -#### 应用镜像 +#### Application Image -此镜像仅包含 Calico。 +This image only contains Calico. ```dockerfile FROM scratch @@ -91,19 +91,17 @@ COPY cni ./cni CMD ["kubectl apply -f cni/tigera-operator.yaml","kubectl apply -f cni/custom-resources.yaml"] ``` -说明: +Notes: -1. `cni`:`kubectl apply` 的配置文件。 -2. `sealos build -t kubernetes-calico:1.24.0-amd64 --platform linux/amd64 -f Kubefile .`:构建 OCI 镜像的命令。 +1. `cni`: Configuration files for `kubectl apply`. +2. `sealos build -t kubernetes-calico:1.24.0-amd64 --platform linux/amd64 -f Kubefile .`: Command for building the OCI image. -## 构建 OpenEBS 镜像 +## Building OpenEBS Image -### 目录结构 +### Directory Structure ``` . - - ├── Kubefile ├── cni │   ├── custom-resources.yaml @@ -112,18 +110,20 @@ CMD ["kubectl apply -f cni/tigera-operator.yaml","kubectl apply -f cni/custom-re └── openebs-operator.yaml ``` -### Dockerfile 构建 +### Dockerfile Building -#### 全部在一起 +#### All Together ```dockerfile FROM labring/oci-kubernetes-calico:1.24.0-amd64 COPY cni ./cni COPY manifests ./manifests -CMD ["kubectl apply -f cni/tigera-operator.yaml","kubectl apply -f cni/custom-resources.yaml","kubectl apply -f manifests/openebs-operator.yaml"] +CMD ["kubectl apply -f cni/tigera + +-operator.yaml","kubectl apply -f cni/custom-resources.yaml","kubectl apply -f manifests/openebs-operator.yaml"] ``` -#### 应用镜像 +#### Application Image ```dockerfile FROM scratch @@ -132,9 +132,9 @@ COPY manifests ./manifests CMD ["kubectl apply -f manifests/openebs-operator.yaml"] ``` -说明: +Notes: -1. `cni`:`kubectl apply` 的配置文件。 -2. `sealos build -t labring/kubernetes-calico-openebs:1.24.0-amd64 --platform linux/amd64 -f Kubefile .`:构建 OCI 镜像的命令。 +1. `cni`: Configuration files for `kubectl apply`. +2. `sealos build -t labring/kubernetes-calico-openebs:1.24.0-amd64 --platform linux/amd64 -f Kubefile .`: Command for building the OCI image. -建议:你需要将 Calico 的 CMD 添加到 OpenEBS 的 CMD 层,因为 Dockerfile 将覆盖较旧的层。 \ No newline at end of file +Recommendation: You need to add the CMD of Calico to the CMD layer of OpenEBS because the Dockerfile will overwrite older layers. diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-manifests.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-manifests.md index 2618ff743b6..561e92e377b 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-manifests.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-manifests.md @@ -2,28 +2,28 @@ sidebar_position: 2 --- -# 构建基于部署清单的集群镜像 +# Building Cluster Images Based on Deployment Manifest -本文档将详细介绍如何构建基于部署清单(Deployment Manifest)的集群镜像。我们将以一个简单的nginx应用为例来进行说明。 +This document will detail how to build cluster images based on Deployment Manifests. We will use a simple nginx application as an example. -## 一、准备工作 +## I. Preparations -1. 首先,创建一个基础目录作为构建工作区。 +1. First, create a base directory as the build workspace. ```shell $ mkdir ~/cloud-images ``` -2. 创建一个名为 `manifests` 的目录来存储 kubernetes nginx 部署 yaml 文件。 +2. Create a directory named `manifests` to store the kubernetes nginx deployment yaml file. ```shell $ cd cloud-images $ mkdir manifests ``` -## 二、准备清单文件 +## II. Prepare the Manifest File -在这个阶段,我们将准备一个简单的nginx kubernetes yaml文件。 +At this stage, we will prepare a simple nginx kubernetes yaml file. ```shell $ cat manifests/deployment.yaml @@ -48,9 +48,9 @@ spec: - containerPort: 80 ``` -## 三、创建Kubefile +## III. Create Kubefile -在这个阶段,我们需要创建一个Kubefile文件,该文件将用于构建镜像。 +At this stage, we need to create a Kubefile that will be used to build the image. ```shell FROM scratch @@ -59,38 +59,38 @@ COPY registry registry CMD ["kubectl apply -f manifests/deployment.yaml"] ``` -## 四、构建集群镜像 +## IV. Build the Cluster Image -在准备好所有必需的文件和目录后,我们可以开始构建集群镜像。 +After preparing all the necessary files and directories, we can start building the cluster image. ```shell sealos build -t labring/nginx:v1.23.1 . ``` -**注意:** 在开始构建前,您需要先在本地主机上安装 sealos 命令。 +**Note:** Before starting the build, you need to install the sealos command on your local host. -构建过程中,您可以查看构建日志。 +During the build, you can view the build log. -## 五、验证镜像 +## V. Verify the Image -在构建完毕后,可以通过下列命令查看构建的镜像: +After the build is complete, you can view the built image with the following command: ```shell root@ubuntu:~/cloud-images# sealos images labring/nginx v1.23.1 521c85942ee4 4 minutes ago 56.8 MB ``` -## 六、推送镜像 +## VI. Push the Image -最后,我们可以将构建好的镜像推送至任何Docker镜像仓库,以下命令将其推送至DockerHub。 +Finally, we can push the built image to any Docker image repository. The following command pushes it to DockerHub. ```shell sealos push labring/nginx:v1.23.1 ``` -**注意:** 请使用 sealos 命令来操作集群镜像,Docker 命令不受支持。 +**Note:** Please use the sealos command to operate the cluster image, the Docker command is not supported. -如果你使用的是私有镜像仓库,只需要在拉取或推送镜像前使用 `sealos login` 登录仓库即可。 +If you are using a private image repository, just use `sealos login` to log into the repository before pulling or pushing the image. ```shell sealos login docker.io -u xxx -p xxx @@ -98,4 +98,4 @@ sealos login docker.io -u xxx -p xxx sealos login registry.cn-hangzhou.aliyuncs.com -u xxx -p xxx ``` -至此,基于部署清单的集群镜像已经构建完成。 \ No newline at end of file +At this point, the cluster image based on the deployment manifest is successfully built. diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-scp_exec.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-scp_exec.md index 3426fd48571..c3337169e26 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-scp_exec.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-scp_exec.md @@ -2,32 +2,32 @@ sidebar_position: 6 --- -# 使用 exec 和 scp 命令构建集群镜像 +# Building Cluster Images Using exec and scp Commands -默认情况下,`sealos run xx` 只会在第一个主节点上运行命令和复制文件。当你希望在特定节点或所有节点上运行命令或复制文件时,你可以在构建集群镜像时使用 `sealos exec` 或 `sealos scp` 命令。 +By default, `sealos run xx` only runs the command and copies the file on the first master node. When you want to run the command or copy files on specific nodes or all nodes, you can use the `sealos exec` or `sealos scp` commands when building the cluster image. -- sealos exec: 连接到一个或多个节点并运行任何 shell 命令; -- sealos scp: 连接到一个或多个节点并将本地文件复制到远程节点。 +- sealos exec: Connects to one or more nodes and runs any shell command; +- sealos scp: Connects to one or more nodes and copies local files to remote nodes. -虽然你可以直接在宿主机上使用这些命令,但本文主要描述的是在使用 sealos build 构建集群镜像时如何使用这两个命令。 +Although you can directly use these commands on the host, this article mainly describes how to use these two commands when building the cluster image using sealos build. -## sealos exec 示例 +## sealos exec Example -以下是构建一个 openebs 集群镜像的示例。在安装 openebs maystor 之前,需要在节点上执行一些初始化操作,你可以使用 sealos exec 来实现这一点。 +Below is an example of building an openebs cluster image. Before installing openebs maystor, some initialization operations need to be performed on the node, you can use sealos exec to achieve this. -首先,创建一个用于构建工作的基础目录。 +First, create a base directory for building. ```shell $ mkdir ~/cloud-images ``` -创建一个 `charts` 目录,用来存储 kubernetes nginx helm charts 文件。 +Create a `charts` directory to store the kubernetes nginx helm charts file. ```shell $ cd cloud-images ``` -创建一个名为 `Kubefile` 的文件,用于镜像构建: +Create a file named `Kubefile` for image building: ```shell $ cat Kubefile @@ -39,7 +39,7 @@ COPY mayastor.sh mayastor.sh CMD ["bash mayastor.sh"] ``` -创建一个名为 `mayastor.sh` 的脚本文件,sealos exec 后面的 shell 命令将在所有节点上执行(在所有节点上创建 hugepage、加载内核模块),但其他命令只会在主节点上运行。 +Create a script file named `mayastor.sh`, the shell command after sealos exec will be executed on all nodes (create hugepage, load kernel modules on all nodes), but other commands will only run on the master node. ```shell $ cat mayastor.sh @@ -71,7 +71,7 @@ kubectl label node --overwrite --all openebs.io/engine=mayastor kubectl apply -k ./manifests/mayastor/ ``` -现在,charts 目录如下: +Now, the charts directory is as follows: ```shell . @@ -81,46 +81,48 @@ kubectl apply -k ./manifests/mayastor/ └── opt ``` -现在一切都准备好了,你可以开始构建集群镜像。 +Now everything is ready, you can start building the cluster image. ```shell sealos build -t labring/openebs-mayastor:v1.0.4 . ``` -当你运行集群镜像时,sealos 将在主节点上运行 mayastor.sh 脚本,但 sealos exec 的 shell 命令将在所有节点上运行,最后,sealos 将在主节点上安装 openebs maystor 存储。 +When you run the cluster image, sealos will run the mayastor.sh script on the master node, but the shell command of sealos exec will run on all nodes. Finally, sealos will install openebs maystor storage on the master node. ``` sealos run labring/openebs-mayastor:v1.0.4 ``` -## sealos scp 示例 +## sealos scp Example -下面的示例将 bin 文件复制到所有节点。 +The following example copies the bin file to all nodes. -创建一个名为 `Kubefile` 的文件,用于镜像构建: +Create a file named `Kubefile` for image building: ```shell FROM scratch COPY manifests manifests COPY registry registry COPY opt opt -CMD ["sealos scp opt/ /opt/cni/bin/","kubectl apply -f manifests/kube-flannel.yml"] +CMD ["seal + +os scp opt/ /opt/cni/bin/","kubectl apply -f manifests/kube-flannel.yml"] ``` -opt 文件如下: +The opt file is as follows: ``` $ ls opt/ bandwidth bridge dhcp firewall host-device host-local ipvlan loopback macvlan portmap ptp sbr static tuning vlan vrf ``` -现在一切都准备好了,你可以开始构建集群镜像。 +Now everything is ready, you can start building the cluster image. ```shell sealos build -t labring/flannel:v0.19.0 . ``` -当你运行集群镜像时,sealos 将会将 opt bin 文件复制到所有节点,然后在主节点上安装 flannel。 +When you run the cluster image, sealos will copy the opt bin file to all nodes, then install flannel on the master node. ``` sealos run labring/flannel:v0.19.0 diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-with-kubeadm-run-cluster.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-with-kubeadm-run-cluster.md index 78cf75d7d5e..519a240d578 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-with-kubeadm-run-cluster.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image-with-kubeadm-run-cluster.md @@ -2,13 +2,13 @@ sidebar_position: 7 --- -# 使用构建镜像自定义 Kubernetes 集群 +# Customizing a Kubernetes Cluster by Building Custom Images -本指南介绍如何使用 `kubeadm config` 构建自定义镜像来自定义 Kubernetes 集群。 +This guide introduces how to use `kubeadm config` to build custom images for customizing a Kubernetes cluster. -## 构建自定义镜像 +## Building Custom Images -要构建自定义镜像,请运行以下命令: +To build a custom image, run the following commands: ```bash $ mkdir -p /tmp/buildimage @@ -28,9 +28,9 @@ EOF $ sudo sealos build --debug -t hack:dev /tmp/buildimage ``` -## 将应用程序配置附加到Clusterfile +## Attaching Application Configurations to Clusterfile -接下来,我们将在`Clusterfile`中附加应用程序配置。例如,如果您想更改Pod的CIDR范围,则应更改`spec.data.spec.calicoNetwork.ipPools.cidr`字段。最终的`Clusterfile`将是这样的: +Next, we will attach application configurations in the `Clusterfile`. For example, if you want to change the CIDR range for Pods, you should change the `spec.data.spec.calicoNetwork.ipPools.cidr` field. The final `Clusterfile` would look like this: ```yaml apiVersion: apps.sealos.io/v1beta1 @@ -86,12 +86,12 @@ spec: interface: "eth.*|en.*" ``` -在这个例子中,我们已经将`calico`应用程序的配置附加到了`Clusterfile`中。此配置指定了Pod的CIDR范围和应用程序运行所需的其他选项。 +In this example, we have attached the configuration of the `calico` application to the `Clusterfile`. This configuration specifies the CIDR range for Pods and other options needed for the application to run. -## 安装群集 +## Installing the Cluster -最后,我们可以使用`sealos apply -f Clusterfile`来安装集群。安装集群后,`Clusterfile`将保存在`.sealos/default/Clusterfile`目录中。您可以修改`Clusterfile`以进一步自定义集群。 +Finally, we can install the cluster using `sealos apply -f Clusterfile`. After installing the cluster, `Clusterfile` will be saved in the `.sealos/default/Clusterfile` directory. You can modify the `Clusterfile` to further customize the cluster. -**⚠️ 注意:** +**⚠️ Note:** -+ 您可以参考[官方文档](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-config/)或使用`kubeadm config print init-defaults`命令打印kubeadm配置。 ++ You can refer to the [official documentation](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-config/) or use the `kubeadm config print init-defaults` command to print the kubeadm configuration. diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image.md index e14823dc19b..d7d20af2fdb 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-image.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-image.md @@ -2,14 +2,12 @@ sidebar_position: 0 --- -# Sealos 集群镜像构建 +# Sealos Cluster Image Building -在这个目录中,我们提供了多种不同的方法和技术,以帮助您有效地构建 Sealos 集群镜像。以下是目录文件的简短概述: +In this directory, we provide a variety of different methods and techniques to help you effectively build Sealos cluster images. Here is a brief overview of the directory files: -1. **基础构建**:这个部分包含了所有关于如何从零开始构建 Sealos 集群镜像的基本信息。包括安装 Sealos,创建和配置环境,以及运行构建命令的步骤。 +1. **Basic Building**: This section contains all the basic information on how to start building a Sealos cluster image from scratch. This includes installing Sealos, creating and configuring the environment, as well as the steps to run the build command. -2. **高级构建**:如果你已经对 Sealos 有一定的了解,这个部分提供了更复杂、更具挑战性的构建方法,例如使用多阶段构建来减少镜像大小,或者使用 `sealos build` 命令的高级选项进行定制构建。 +2. **Advanced Building**: If you already have some understanding of Sealos, this section provides more complex and challenging building methods, such as using multi-stage builds to reduce image size, or using the advanced options of the `sealos build` command for custom building. - - -我们希望这个目录可以为您提供在构建 Sealos 集群镜像过程中可能需要的所有信息和工具。如果有任何建议或疑问,欢迎随时联系我们。 +We hope this directory can provide all the information and tools you may need in the process of building Sealos cluster images. If you have any suggestions or questions, please feel free to contact us. diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build-multi-arch-image.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build-multi-arch-image.md index 53df86386e8..53dc689ed0e 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build-multi-arch-image.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build-multi-arch-image.md @@ -2,43 +2,43 @@ sidebar_position: 0 --- -# 构建支持多架构的集群镜像 +# Building Multi-Architecture Cluster Images -本文将介绍如何使用 `sealos` 工具构建支持多架构(如 amd64 和 arm64)的 集群 镜像,并将其推送到容器镜像仓库。 +This article will explain how to use the `sealos` tool to build cluster images that support multiple architectures (such as amd64 and arm64) and push them to a container image repository. -## 步骤说明 +## Step-by-step Instructions -### 构建镜像 +### Building the Images -首先,我们分别为 amd64 和 arm64 两种架构构建镜像。使用 `sealos build` 命令,指定镜像标签(包括前缀和版本),平台(使用 `--platform` 参数),Dockerfile(使用 `-f` 参数)和上下文路径: +Firstly, we need to build images for both amd64 and arm64 architectures. Using the `sealos build` command, specify the image tag (including the prefix and version), platform (with the `--platform` parameter), Dockerfile (with the `-f` parameter), and context path: ```shell $ sealos build -t $prefix/oci-kubernetes:$version-amd64 --platform linux/amd64 -f Kubefile . $ sealos build -t $prefix/oci-kubernetes:$version-arm64 --platform linux/arm64 -f Kubefile . ``` -在这里,`$prefix` 代表你的镜像仓库地址和命名空间,`$version` 是你的镜像版本。 +Here, `$prefix` represents your image repository address and namespace, and `$version` is your image version. -### 登录容器镜像仓库 +### Logging into the Container Image Repository -然后,我们需要登录到容器镜像仓库,以便之后能够推送镜像。使用 `sealos login` 命令,指定用户名,密码和仓库域名: +Next, we need to log in to the container image repository so we can push the images later. Use the `sealos login` command, specify the username, password, and repository domain: ```shell $ sealos login --username $username --password $password $domain ``` -### 推送镜像 +### Pushing the Images -接下来,我们将刚才构建的两个镜像推送到容器镜像仓库。使用 `sealos push` 命令,指定镜像标签: +Then, we will push the two images we built to the container image repository. Using the `sealos push` command, specify the image tag: ```shell $ sealos push $prefix/oci-kubernetes:$version-amd64 $ sealos push $prefix/oci-kubernetes:$version-arm64 ``` -### 创建和推送镜像清单 +### Creating and Pushing the Image Manifest -最后,我们需要创建一个包含这两个镜像的镜像清单,并将其推送到容器镜像仓库。这个清单可以使 Docker 或 Kubernetes 在拉取镜像时,自动选择与运行环境架构匹配的镜像: +Finally, we need to create a manifest that includes these two images and push it to the container image repository. This manifest allows Docker or Kubernetes to automatically select an image that matches the runtime architecture when pulling the image: ```shell $ sealos manifest create $prefix/oci-kubernetes:$version @@ -47,4 +47,4 @@ $ sealos manifest add $prefix/oci-kubernetes:$version docker://$prefix/oci-kuber $ sealos manifest push --all $prefix/oci-kubernetes:$version docker://$prefix/oci-kubernetes:$version ``` -至此,支持多架构的 集群镜像就构建完成了。在实际使用时,需要根据你的容器镜像仓库地址和命名空间,以及镜像版本,替换上述命令中的 `$prefix` 和 `$version`。 \ No newline at end of file +With that, the multi-architecture cluster image has been built. In practice, you need to replace `$prefix` and `$version` in the commands above according to your container image repository address and namespace, and image version. diff --git a/docs/4.0/docs/lifecycle-management/operations/build-image/build_run_application_private_registry.md b/docs/4.0/docs/lifecycle-management/operations/build-image/build_run_application_private_registry.md index bf30209c1ba..c0908d6945d 100644 --- a/docs/4.0/docs/lifecycle-management/operations/build-image/build_run_application_private_registry.md +++ b/docs/4.0/docs/lifecycle-management/operations/build-image/build_run_application_private_registry.md @@ -2,27 +2,27 @@ sidebar_position: 9 --- -# 使用私有镜像构建一个完整应用服务 +# Building a Complete Application Service Using a Private Image -## 构建服务镜像 +## Building Service Image -### helm 安装 +### helm Installation [https://github.com/helm/helm/releases](https://github.com/helm/helm/releases) -安装 helm v3.9(需要代理)。 +Install helm v3.9 (proxy required). -### 登陆镜像仓库 +### Log in to the Image Repository -这一步是为了打包时拉得到镜像: +This step is to pull the image during packaging: ```shell sealos login registry.cn-hangzhou.aliyuncs.com -u username -p password ``` -### 修改 helm chart +### Modify helm chart -下载 helm chart 模板: +Download helm chart template: ```shell git clone https://github.com/luanshaotong/scienson_osm.git @@ -62,7 +62,7 @@ spec: memory: 4096Mi ``` -用域名的方式解析服务: +Resolve service via domain name: ```yaml title="templates/service.yaml" apiVersion: v1 @@ -79,7 +79,7 @@ spec: targetPort: 7001 ``` -对公网暴露服务: +Expose service to the public network: ```yaml title="templates/ingress.yaml" apiVersion: networking.k8s.io/v1 @@ -101,14 +101,14 @@ spec: number: 80 ``` -主要用于渲染副本数: +Mainly used to render the number of replicas: ```yaml title="values.yaml" osm: replicaCount: 1 ``` -### 打包 helm chart +### Package helm chart ```shell helm package . @@ -116,14 +116,14 @@ helm package . ![](images/01.png) -### 修改 image list +### Modify image list ```shell cat images/shim/osm registry.cn-hangzhou.aliyuncs.com/scienson/avatarsplver-osm:2022-07-11-21-05 ``` -### 修改 Dockerfile +### Modify Dockerfile ```dockerfile FROM scratch @@ -133,33 +133,35 @@ CMD ["helm install osm scienson-osm-0.1.1.tgz --namespace osm --create-namespace ![](images/02.png) -### 构建镜像 +### Build Image ```shell sealos build -f Dockerfile -t docker.io/luanshaotong/osm:v0.1.1 . ``` -## 测试部署 +## Test Deployment ```shell -sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 --masters 172.31.37.111 +sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 --masters + +172.31.37.111 kubectl taint no node-role.kubernetes.io/master:NoSchedule- kubectl taint no node-role.kubernetes.io/control-plane:NoSchedule- sealos run labring/ingress-nginx:4.1.0 sealos run docker.io/luanshaotong/osm:v0.1.1 ``` -如果每一步的应用安装顺利,即可,否则可能需要调试并清理集群重新安装。 +If every step of the application installation goes smoothly, that's it. Otherwise, you may need to debug and clean up the cluster for reinstallation. -## 其他问题 +## Other Issues -### 清理集群 +### Cleaning Up the Cluster -如果出现问题需要清理集群: +If there are problems and you need to clean up the cluster: ```shell sealos reset rm /root/.sealos -rf ``` -重新安装即可。 +You can then reinstall. diff --git a/docs/4.0/docs/lifecycle-management/operations/registry/registry.md b/docs/4.0/docs/lifecycle-management/operations/registry/registry.md index 682673df893..74af88f2a16 100644 --- a/docs/4.0/docs/lifecycle-management/operations/registry/registry.md +++ b/docs/4.0/docs/lifecycle-management/operations/registry/registry.md @@ -2,16 +2,16 @@ sidebar_position: 0 --- -# Sealos 镜像仓库 +# Sealos Image Repository -在这个目录中,我们提供了多种不同的方法和技术,以帮助您有效地管理容器镜像仓库。以下是目录文件的简短概述: +In this directory, we provide a variety of different methods and technologies to help you effectively manage your container image repositories. Below is a brief overview of the directory files: -1. **安全管理**:详细解释如何对 Docker Registry 进行安全设置,比如修改密码等。 +1. **Security Management**: Detailed explanations on how to set up security for the Docker Registry, such as changing passwords, etc. -2. **镜像管理**:指导读者如何管理存储在 Registry 中的镜像,包括自启镜像仓库、同步镜像、保存镜像文件等操作。 +2. **Image Management**: Guides the reader on how to manage images stored in the Registry, including operations like auto-starting the image repository, synchronizing images, saving image files, etc. -3. **镜像同步和备份**:分享如何进行镜像的同步和备份,防止重要数据的丢失。 +3. **Image Synchronization and Backup**: Shares how to synchronize and backup images, preventing the loss of important data. -4. **Troubleshooting**:收集一些常见的问题及其解决方案,帮助读者快速解决在使用 Docker Registry 过程中遇到的问题。 +4. **Troubleshooting**: Collects some common problems and their solutions, helping readers to quickly solve problems encountered in the use of Docker Registry. -我们希望这个目录可以为您提供在使用管理镜像仓库过程中可能需要的所有信息和工具。如果有任何建议或疑问,欢迎随时联系我们。 +We hope this directory can provide you with all the information and tools you might need in the process of managing image repositories. If you have any suggestions or questions, feel free to contact us at any time. diff --git a/docs/4.0/docs/lifecycle-management/operations/registry/sealos_sync_backup_solution.md b/docs/4.0/docs/lifecycle-management/operations/registry/sealos_sync_backup_solution.md index 41a4cffb4ff..d5645c34d4a 100644 --- a/docs/4.0/docs/lifecycle-management/operations/registry/sealos_sync_backup_solution.md +++ b/docs/4.0/docs/lifecycle-management/operations/registry/sealos_sync_backup_solution.md @@ -2,44 +2,44 @@ sidebar_position: 1 --- -# 高效的Sealos集群镜像同步和备份策略 +# Efficient Sealos Cluster Image Synchronization and Backup Strategy -在我们的日常工作中,可能会遇到一些常见的需求和问题,如: +In our daily work, we may encounter some common needs and issues, such as: -1. 需要定时备份集群里的镜像仓库,但不想全量同步。 -2. 需要使用外部镜像仓库,但还没有sealos集群镜像里的容器镜像。 -3. 容器镜像较大,希望避免在sealos运行时传输镜像文件,以减少带宽占用。 +1. Needing to regularly backup the image repository in the cluster, but not wanting to synchronize everything. +2. Needing to use an external image repository, but the container images in the Sealos cluster image are not yet available. +3. Container images are large, and there is a desire to avoid transferring image files during Sealos operation to reduce bandwidth usage. -为了解决以上问题,sealos提供了一种优雅的解决方案。下面,我将一步步带你了解这个方案。 +To solve the above problems, Sealos provides an elegant solution. Below, I will guide you step by step to understand this solution. -## 创建和启动临时仓库 +## Creating and Starting a Temporary Repository -首先,我们需要集群镜像里的registry目录来进行镜像同步。因此,执行以下命令来拉取集群镜像并生成一个工作目录: +First, we need the registry directory in the cluster image for image synchronization. Therefore, execute the following command to pull the cluster image and create a working directory: ```shell sealos pull labring/kubernetes:v1.24.0 sealos create labring/kubernetes:v1.24.0 ``` -随后,我们在工作目录的registry目录启动一个临时registry。为了方便操作,我们可以固定一个端口,例如9090。然后,执行以下命令: +Then, we start a temporary registry in the registry directory of the working directory. For convenience, we can fix a port, such as 9090. Then, execute the following command: ```shell sealos registry serve filesystem -p 9090 registry ``` -注意,这是一个常驻进程,同步完成前请确保服务可用。 +Note that this is a resident process. Please ensure the service is available before synchronization is complete. -## 同步镜像 +## Image Synchronization -下一步,我们将本地的集群镜像同步到集群里的sealos.hub:5000(或其他仓库)。在执行同步命令前,如果仓库需要认证,请先使用sealos login进行登录。然后,执行以下命令: +Next, we synchronize the local cluster image to sealos.hub:5000 (or other repositories) in the cluster. Before executing the synchronization command, if the repository needs authentication, please first use sealos login to login. Then, execute the following command: ```shell sealos registry sync 127.0.0.1:9090 sealos.hub:5000 ``` -## 结果展示 +## Results Display -在执行了上述步骤后,你将看到类似以下的输出: +After executing the above steps, you will see an output similar to the following: ```tex Getting image source signatures @@ -79,7 +79,9 @@ Copying config 66e1443684 done Writing manifest to image destination Storing signatures Getting image source signatures -Copying blob cd1468482c69 skipped: already exists +Copying blob cd1468482 + +c69 skipped: already exists Copying blob 9dd6bd026ac4 skipped: already exists Copying blob b0b160e41cf3 skipped: already exists Copying config b81513b3bf done @@ -100,8 +102,8 @@ Storing signatures Sync completed ``` -可以看到,已经存在的镜像不会重复同步,这样可以实现增量镜像同步,使整个流程变得非常优雅和高效。 +As you can see, existing images will not be synchronized again, this can achieve incremental image synchronization, making the entire process very elegant and efficient. --- -以上就是我们这次的解决方案,希望对你有所帮助。 +That's the solution we're presenting this time, I hope it's helpful to you. diff --git a/docs/4.0/docs/lifecycle-management/operations/registry/using_sealoshub_private_registry.md b/docs/4.0/docs/lifecycle-management/operations/registry/using_sealoshub_private_registry.md index d356ff6eee4..4acdaddc396 100644 --- a/docs/4.0/docs/lifecycle-management/operations/registry/using_sealoshub_private_registry.md +++ b/docs/4.0/docs/lifecycle-management/operations/registry/using_sealoshub_private_registry.md @@ -2,31 +2,31 @@ sidebar_position: 2 --- -# 如何使用 sealos作为私有容器仓库 +# How to Use Sealos as a Private Container Repository -## 工作原理 +## Working Principle -每个节点都会运行一个 image-cri-shim 守护进程,Kubelet 在拉取镜像的时候会发起一个 grpc 交互命令到 image-cri-shim。该进程会根据镜像名字在私有仓库里面查找,存在则从本地拉取,否则从远端拉取。 +Every node runs an image-cri-shim daemon. When Kubelet needs to pull an image, it initiates a gRPC interaction command to image-cri-shim. This process will search for the image name in the private repository. If it exists locally, it will pull from there, otherwise, it will pull from the remote. -执行如下命令来验证 image-cri-shim 守护进程状态: +Execute the following command to verify the status of the image-cri-shim daemon: ```shell $ systemctl status image-cri-shim.service ``` -## 私有仓库在哪里运行 +## Where the Private Repository Runs -sealos 的私有仓库默认运行在集群的第一个节点上,第一个节点是指创建集群的时候输入的第一个节点的地址,使用下面的命令查看守护进程的状态。 +The private repository of Sealos runs by default on the first node of the cluster. The first node is the first node address entered when creating the cluster. Use the command below to check the status of the daemon: ```shell $ systemctl status registry.service ``` -**注意:**仓库的数据保存在 `/var/lib/sealos/data/default/rootfs/registry/` 目录下。 +**Note:** The repository data is saved in the `/var/lib/sealos/data/default/rootfs/registry/` directory. -## 登录私有容器镜像仓库 +## Login to the Private Container Image Repository -sealos 私有仓库使用 `--net host` 参数运行在 HTTP 下,应当在本地配置 insecure-registries,然后使用第一个节点的 IP 地址进行连接,Docker 客户端配置参考如下: +Sealos private repository runs on HTTP using the `--net host` parameter. It should be locally configured with insecure-registries, and then connected using the IP address of the first node. The Docker client configuration is referenced as follows: ```json # cat /etc/docker/daemon.json @@ -35,21 +35,21 @@ sealos 私有仓库使用 `--net host` 参数运行在 HTTP 下,应当在本 } ``` -使用 `sealos login` 命令来进行登录,默认用户名与密码是 `admin:passw0rd`。 +Use the `sealos login` command for login. The default username and password are `admin:passw0rd`. ```shell sealos login -u admin -p passw0rd 192.168.1.10:5000 ``` -也可以使用 `docker login` 命令。 +You can also use the `docker login` command. ```shell docker login -u admin -p passw0rd 192.168.1.10:5000 ``` -## 推送与拉取镜像 +## Pushing and Pulling Images -推送镜像案例: +Example of pushing an image: ```shell $ sealos tag quay.io/skopeo/stable 192.168.72.50:5000/skopeo/stable @@ -65,13 +65,13 @@ c550c8e0f355: Pushed latest: digest: sha256:238efd85942755fbd28d4d23d1f8dedd99e9eec20777e946f132633b826a9295 size: 1570 ``` -拉取镜像案例: +Example of pulling an image: ```shell sealos pull 192.168.72.50:5000/skopeo/stable ``` -或者使用 `docker pull` 命令: +Or use the `docker pull` command: ```shell docker pull 192.168.72.50:5000/skopeo/stable diff --git a/docs/4.0/docs/lifecycle-management/operations/run-cluster/config-customize-app_images-config-rootfs_mage.md b/docs/4.0/docs/lifecycle-management/operations/run-cluster/config-customize-app_images-config-rootfs_mage.md index 84289b9aa3a..0e6f4741912 100644 --- a/docs/4.0/docs/lifecycle-management/operations/run-cluster/config-customize-app_images-config-rootfs_mage.md +++ b/docs/4.0/docs/lifecycle-management/operations/run-cluster/config-customize-app_images-config-rootfs_mage.md @@ -2,19 +2,19 @@ sidebar_position: 2 --- -# 配置和自定义应用镜像及其运行时环境 +# Configuring and Customizing Application Images and Their Runtime Environment -Sealos 提供了一种使用 `Config` 对象来在运行时对文件进行补丁操作的方式。本文将详细介绍这一操作的过程和使用方法。 +Sealos provides a way to patch files at runtime using the `Config` object. This article will provide detailed instructions on how to do this. -## `Config` 对象简介 +## Introduction to the `Config` Object -`Config` 是一个描述如何在运行时为特定应用镜像或运行列表中的所有镜像打补丁、创建或替换指定文件的对象。 +The `Config` is an object that describes how to patch, create, or replace specific files at runtime for a specific application image or all images in the runtime list. -以我们需要使用包含 `node-local-dns` 的集群为例。 +Let's take the case where we need to use a cluster with `node-local-dns`. -## 创建 `node-local-dns` 应用云镜像 +## Creating the Cloud Image for the `node-local-dns` Application -首先,创建 `node-local-dns` 应用的云镜像: +First, we create the cloud image for the `node-local-dns` application: ```bash $ tree node-local-dns @@ -36,11 +36,11 @@ image: $ cd node-local-dns && sudo sealos build -t node-local-dns:1.3.2 -f Kubefile . ``` -这里的 chart 文件可以从 [这里](https://artifacthub.io/packages/helm/node-local-dns/node-local-dns) 下载。 +The chart file can be downloaded from [here](https://artifacthub.io/packages/helm/node-local-dns/node-local-dns). -## 创建 `Clusterfile` +## Creating a `Clusterfile` -接着,我们创建一个 `Clusterfile`: +Next, we create a `Clusterfile`: ```yaml {{- $kubeDNS := ipAt (default "10.96.0.0/18" .Values.networking.serviceSubnet) 10 -}} @@ -85,15 +85,16 @@ spec: localDnsIp: {{ .Values.localDNS.bind }} zones: - - - zone: .:53 + zone: .:53 plugins: errors: true reload: true debug: false log: format: combined - classes: all + classes + +: all cache: parameters: 30 denial: @@ -178,35 +179,31 @@ spec: {{- end } ``` -## 使用 `Config` 对象 +## Using the `Config` Object -由于 `kubelet` 配置中的 `localDNS` 字段需要匹配 `node-local-dns` 的监听地址,因此在 Clusterfile 中必须预先定义。同时,我们希望有灵活性地修改 `node-local-dns` 的配置,因此我们使用 `Config` 在 Sealos 实际调用 `helm` 命令之前对 `charts/node-local-dns.values.yaml` 文件进行补丁操作。 +Because the `localDNS` field in the `kubelet` configuration needs to match the listening address of `node-local-dns`, it must be pre-defined in the Clusterfile. At the same time, we want to modify the configuration of `node-local-dns` flexibly, so we use `Config` to patch the `charts/node-local-dns.values.yaml` file before Sealos actually calls the `helm` command. -关于 `Config` 对象的字段,我们简要介绍一下: +Here's a brief introduction to the fields of the `Config` object: -- `metadata.name`:此名称不可与其他名称重复。 -- `spec.path`:应用镜像中的文件路径。 -- `spec.match`:可选项。当定义了 `match` 时,`Config` 将应用于与其匹配的镜像;否则,它将应用于所有镜像。 -- `spec.strategy`:可以是 `merge`、`insert`、`append` 或 `override`。 - - `merge`:仅适用于 YAML/JSON +- `metadata.name`: This name cannot be duplicated with other names. +- `spec.path`: The file path in the application image. +- `spec.match`: Optional. When `match` is defined, `Config` is applied to the image that matches it; otherwise, it is applied to all images. +- `spec.strategy`: Can be `merge`, `insert`, `append`, or `override`. + - `merge`: Only applicable to YAML/JSON files. + - `insert`/`append`: Inserts data into the file. + - `override`: Overrides the contents of the file. +- `spec.data`: The data to be applied. - 文件。 - - `insert`/`append`:将数据插入文件。 - - `override`:覆盖文件中的内容。 -- `spec.data`:要应用的数据。 - -运行 Sealos apply: +Run Sealos apply: ```bash sudo sealos apply -f Clusterfile --set localDNS.enabled=true --set localDNS.bind=169.254.20.11 --set localDNS.image=node-local-dns:1.3.2 ``` -## 更多用例 - -我们可以使用这种机制来定制已构建的镜像,或者在不重新构建的情况下定制某个组件的配置。例如,添加自定义的 containerd 配置。 - -在首次运行之前,在 `Clusterfile` 中添加 `Config`。 +## More Use Cases +We can use this mechanism to customize pre-built images or customize the configuration of a specific component without rebuilding it. For example, adding custom containerd configuration. +Before the initial run, add the Config in the Clusterfile. ```yaml --- ... diff --git a/docs/4.0/docs/lifecycle-management/operations/run-cluster/gen-apply-cluster.md b/docs/4.0/docs/lifecycle-management/operations/run-cluster/gen-apply-cluster.md index 1eb02570b28..5273e04439b 100644 --- a/docs/4.0/docs/lifecycle-management/operations/run-cluster/gen-apply-cluster.md +++ b/docs/4.0/docs/lifecycle-management/operations/run-cluster/gen-apply-cluster.md @@ -2,9 +2,9 @@ sidebar_position: 1 --- -# 自定义配置安装 +# Custom Configuration Installation -1. 运行 `sealos gen` 生成一个 Clusterfile,例如: +1. Run `sealos gen` to generate a Clusterfile, for example: ```shell $ sealos gen labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \ @@ -12,7 +12,7 @@ $ sealos gen labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24 --nodes 192.168.0.5,192.168.0.6,192.168.0.7 --passwd 'xxx' > Clusterfile ``` -生成的 Clusterfile 如下: +The generated Clusterfile is as follows:
Clusterfile @@ -52,7 +52,7 @@ status: {}
-2. 生成 Clusterfile 后,然后更新集群配置。例如,要修改 pods 的 CIDR 范围,就可以修改 `networking.podSubnet` 和 `spec.data.spec.calicoNetwork.ipPools.cidr` 字段。最终的 Clusterfile 会像是这样: +2. After generating the Clusterfile, update the cluster configuration. For example, to modify the CIDR range of pods, you can modify the `networking.podSubnet` and `spec.data.spec.calicoNetwork.ipPools.cidr` fields. The final Clusterfile would look like this:
Clusterfile @@ -119,8 +119,8 @@ spec:
-3. 运行 `sealos apply -f Clusterfile` 启动集群。集群运行成功后会把 Clusterfile 保存到 `.sealos/default/Clusterfile` 文件中,可以修改其中字段来重新 apply 对集群进行变更。 +3. Run `sealos apply -f Clusterfile` to start the cluster. After the cluster is successfully running, the Clusterfile will be saved in the `.sealos/default/Clusterfile` file. You can modify the fields in it to reapply changes to the cluster. -**注意:** +**Note:** -- 可以参考[官方文档](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-config/)或运行 `kubeadm config print init-defaults` 命令来打印 kubeadm 配置。 +- You can refer to the [official documentation](https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-config/) or run the `kubeadm config print init-defaults` command to print the kubeadm configuration. diff --git a/docs/4.0/docs/lifecycle-management/operations/run-cluster/run-cluster.md b/docs/4.0/docs/lifecycle-management/operations/run-cluster/run-cluster.md index 30235afd65e..80a6adf33d5 100644 --- a/docs/4.0/docs/lifecycle-management/operations/run-cluster/run-cluster.md +++ b/docs/4.0/docs/lifecycle-management/operations/run-cluster/run-cluster.md @@ -2,13 +2,13 @@ sidebar_position: 0 --- -# Sealos 集群镜像运行 +# Running a Sealos Cluster with Docker Images -在这个目录中,我们提供了一系列详细的教程和资源,帮助您有效地运行和管理 Sealos 集群。以下是每个文件或子目录的简短概述: +In this directory, we provide a series of detailed tutorials and resources to help you effectively run and manage a Sealos cluster. Here is a brief overview of each file or subdirectory: -1. **集群初始化**:这部分提供了所有必需的步骤,以启动并初始化一个新的 Sealos 集群。它包括如何配置 Sealos,以及如何运行初始化命令等信息。 -2. **节点管理**:这个部分包括如何添加和移除集群节点,以及如何维护和管理集群节点的详细信息。 -3. **服务管理**:这部分包含了如何在 Sealos 集群上部署和管理各种服务的指南。它包括如何使用 Sealos 的命令行工具来管理服务,以及如何配置服务以满足你的特定需求。 -4. **实战示例**:这部分包含了各种实战示例,包括如何运行和管理各种应用,以及如何处理特定的运维问题。 +1. **Cluster Initialization**: This section provides all the necessary steps to start and initialize a new Sealos cluster. It includes information on how to configure Sealos and how to run initialization commands. +2. **Node Management**: This section covers how to add and remove cluster nodes, as well as how to maintain and manage detailed information about the cluster nodes. +3. **Service Management**: This section includes guides on how to deploy and manage various services on the Sealos cluster. It covers how to use Sealos' command-line tools to manage services and how to configure services to meet your specific requirements. +4. **Practical Examples**: This section contains various practical examples, including how to run and manage various applications and how to handle specific operational issues. -我们希望这个目录可以为您在运行和管理 Sealos 集群时提供全方位的帮助。如果有任何问题或建议,欢迎随时联系我们。 +We hope this directory provides comprehensive assistance for running and managing a Sealos cluster. If you have any questions or suggestions, please feel free to contact us at any time. diff --git a/docs/4.0/docs/lifecycle-management/operations/run-cluster/template-apply-cluster.md b/docs/4.0/docs/lifecycle-management/operations/run-cluster/template-apply-cluster.md index ae6bf478ad4..ee1ec670ae3 100644 --- a/docs/4.0/docs/lifecycle-management/operations/run-cluster/template-apply-cluster.md +++ b/docs/4.0/docs/lifecycle-management/operations/run-cluster/template-apply-cluster.md @@ -2,9 +2,9 @@ sidebar_position: 2 --- -# 模板配置安装 +# Template Configuration Installation -我们也可以使用 Go 模版语法来编写 Clusterfile(就像 [Helm](https://helm.sh/) 一样,但暂不支持部分模版函数,如 `include`/`tpl`/`require`/`lookup`)。 例如,创建 `Clusterfile.yaml` 如下: +We can also use Go template syntax to write the Clusterfile (similar to [Helm](https://helm.sh/)), but partial template functions such as `include`/`tpl`/`require`/`lookup` are not supported yet. For example, create a `Clusterfile.yaml` as follows: ```yaml apiVersion: apps.sealos.io/v1beta1 @@ -34,7 +34,7 @@ networking: podSubnet: {{ default "100.64.0.0/17" .Values.networking.podSubnet }} ``` -随后,创建一个自定义的 values 文件 `example.values.yaml`: +Then, create a custom values file `example.values.yaml`: ```yaml clusterName: default @@ -57,8 +57,8 @@ networking: podSubnet: 100.64.0.0/17 ``` -然后就可以像这样部署集群了: +You can then deploy the cluster like this: ```shell -$ sealos apply -f Clusterfile.yaml --values example.values.yaml --set clusterName=testlocal --env SSH_PASSWORD=s3cret +$ sealos apply -f Clusterfile.yaml --values example.values.yaml --set clusterName=testlocal --env SSH_PASSWORD=s3cret ``` diff --git a/docs/4.0/docs/lifecycle-management/operations/run-cluster/upgrade-cluster.md b/docs/4.0/docs/lifecycle-management/operations/run-cluster/upgrade-cluster.md index 1a2cbe08276..d95b23e7c11 100644 --- a/docs/4.0/docs/lifecycle-management/operations/run-cluster/upgrade-cluster.md +++ b/docs/4.0/docs/lifecycle-management/operations/run-cluster/upgrade-cluster.md @@ -2,31 +2,31 @@ sidebar_position: 3 --- -# 如何升级集群 +# How to Upgrade the Cluster -如果你想要升级你的 Kubernetes 集群,你只需要运行以下命令: +If you want to upgrade your Kubernetes cluster, you just need to run the following command: ```sh -sealos run labring/kubernetes:<新版本号> +sealos run labring/kubernetes: ``` -确保你已经建立了集群。 +Make sure you have already set up the cluster. -## 实例说明 +## Example Scenario -1. 假设你已经运行过以下命令: +1. Let's say you have previously run the following command: ```sh sealos run labring/kubernetes:v1.24.0 labring/calico:v3.22.1 --masters 192.168.64.8 --nodes 192.168.64.7 ``` -2. 现在你想要升级集群到 v1.25.0,你可以这样操作: +2. Now, if you want to upgrade the cluster to v1.25.0, you can do the following: ```sh -sealos run labring/kubernetes:v1.25.0 +sealos run labring/kubernetes:v1.25.0 ``` -在运行到 'kubeadm upgrade v1.25.0' 的时候,你将看到: +During the execution of 'kubeadm upgrade v1.25.0', you will see: ```txt [upgrade/version] You have chosen to change the cluster version to "v1.25.0" @@ -35,14 +35,14 @@ sealos run labring/kubernetes:v1.25.0 [upgrade] Are you sure you want to proceed? [y/N]: ``` -输入 'y' 来继续升级。 +Type 'y' to proceed with the upgrade. -如果**出现错误**,你可以再次运行命令 'sealos run labring/kubernetes:v1.25.0'。即使失败,它也能保证得到相同的结果。 +If there are any **errors**, you can rerun the command 'sealos run labring/kubernetes:v1.25.0'. Even if it fails, it will ensure the same result. -## 注意事项 +## Important Notes -1. **升级不能跨过次版本号**。比如从 'v1.23.0' 升级到 'v1.25.0' 是不允许的。如果你确实需要从 'v1.23.0' 升级到 'v1.25.0',你可以分成两步来操作,比如先从 'v1.23.0' 升级到 'v1.24.0',然后再从 'v1.24.0' 升级到 'v1.25.0'。 +1. **Upgrades cannot skip minor version numbers**. For example, upgrading from 'v1.23.0' to 'v1.25.0' is not allowed. If you do need to upgrade from 'v1.23.0' to 'v1.25.0', you can do it in two steps, such as upgrading from 'v1.23.0' to 'v1.24.0' first, and then from 'v1.24.0' to 'v1.25.0'. -2. 一旦升级成功,集群挂载的旧版本镜像就会被替换。添加主节点或工作节点将会应用新版本。 +2. Once the upgrade is successful, the old version images mounted by the cluster will be replaced. Adding master or worker nodes will apply the new version. -这就是升级 Kubernetes 集群的整个过程。如果你在升级过程中遇到任何问题,不要犹豫,尽快查阅相关文档或者寻求帮助。 \ No newline at end of file +This is the entire process of upgrading a Kubernetes cluster. If you encounter any issues during the upgrade process, don't hesitate to refer to relevant documentation or seek assistance. diff --git a/docs/4.0/docs/lifecycle-management/quick-start/build-ingress-cluster-image.md b/docs/4.0/docs/lifecycle-management/quick-start/build-ingress-cluster-image.md index 30d2cfa8dc4..a9cab905b7f 100644 --- a/docs/4.0/docs/lifecycle-management/quick-start/build-ingress-cluster-image.md +++ b/docs/4.0/docs/lifecycle-management/quick-start/build-ingress-cluster-image.md @@ -2,11 +2,11 @@ sidebar_position: 3 --- -# 构建一个 Ingress 集群镜像 +# Building an Ingress Cluster Image -这里展示了如何用 helm 构建一个 nginx-ingress 集群镜像。 +Here we demonstrate how to build an nginx-ingress cluster image using Helm. -## 下载 helm chart +## Download the Helm Chart ```shell $ mkdir ingress-nginx && cd ingress-nginx @@ -14,18 +14,18 @@ $ helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx $ helm pull ingress-nginx/ingress-nginx ``` -随后就能找到下载的 chart: +You will find the downloaded chart: ```shell $ ls ingress-nginx-4.1.0.tgz ``` -## 添加镜像列表 +## Add Image List -sealos 会下载镜像列表中的镜像并缓存到 registry 目录。 +Sealos will download the images in the image list and cache them in the registry directory. -目录必须形如 `images/shim/[your image list filename]`: +The directory must be in the format `images/shim/[your image list filename]`: ```shell $ cat images/shim/nginxImages @@ -33,7 +33,7 @@ k8s.gcr.io/ingress-nginx/controller:v1.2.0 k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1 ``` -## 编写 Dockerfile +## Write the Dockerfile ```Dockerfile FROM scratch @@ -41,24 +41,22 @@ COPY ../examples . CMD ["helm install ingress-nginx ingress-nginx-4.1.0.tgz --namespace ingress-nginx --create-namespace"] ``` -## 构建集群镜像 +## Build the Cluster Image ```shell $ sealos build -f Dockerfile -t docker.io/fanux/ingress-nginx:v1.2.0 . ``` -sealos 在构建的时候会自动添加镜像列表中的镜像依赖到集群镜像中,通过神奇的方式保存了里面依赖的 Docker 镜像。 -并且在到别的环境中运行的时候更神奇的自动检测集群中是否有 Docker 镜像,有的话自动下载,没有的话才会去 k8s.gcr.io 下载。 -用户无需修改 helm chart 中的 docker 镜像地址,这里用到了镜像缓存代理的黑科技。 +Sealos will automatically add the image dependencies from the image list to the cluster image, magically saving the Docker images it depends on inside. When running in another environment, it will magically check if the Docker images exist in the cluster. If they do, it will automatically download them; otherwise, it will download them from k8s.gcr.io. Users do not need to modify the Docker image addresses in the Helm chart. This utilizes the black technology of image caching proxy. -## 推送到镜像 registry +## Push to the Image Registry ```shell $ sealos login docker.io $ sealos push docker.io/fanux/ingress-nginx:v1.2.0 ``` -## 运行集群镜像 +## Run the Cluster Image ```shell $ sealos run docker.io/fanux/ingress-nginx:v1.2.0 diff --git a/docs/4.0/docs/lifecycle-management/quick-start/installation.md b/docs/4.0/docs/lifecycle-management/quick-start/installation.md index 167c3efd32a..6d39c4ad4a2 100644 --- a/docs/4.0/docs/lifecycle-management/quick-start/installation.md +++ b/docs/4.0/docs/lifecycle-management/quick-start/installation.md @@ -5,16 +5,16 @@ sidebar_position: 1 import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; -# 安装sealos +# Installing Sealos -## 二进制自动下载 +## Binary Auto Download ```bash $ curl -sfL https://raw.githubusercontent.com/labring/sealos/v4.2.0/scripts/install.sh \ | sh -s v4.2.0 labring/sealos ``` -## 二进制手动下载 +## Binary Manual Download @@ -35,9 +35,9 @@ $ wget https://github.com/labring/sealos/releases/download/v4.2.0/sealos_4.2.0_l -## 包管理工具安装 +## Package Management Tool Installation -### DEB 源 +### DEB Repository ```bash echo "deb [trusted=yes] https://apt.fury.io/labring/ /" | sudo tee /etc/apt/sources.list.d/labring.list @@ -45,7 +45,7 @@ sudo apt update sudo apt install sealos ``` -### RPM 源 +### RPM Repository ```bash sudo cat > /etc/yum.repos.d/labring.repo << EOF @@ -59,17 +59,17 @@ sudo yum clean all sudo yum install sealos ``` -## 源码安装 +## Source Code Installation -### 前置依赖 +### Prerequisites 1. `linux` -2. `git` -3. `golang` 1.20+ +2. `git` +3. `golang` 1.20+ 4. `libgpgme-dev libbtrfs-dev libdevmapper-dev` -如果在 `arm64` 环境下需要添加 `:arm64` 后缀。 +If you are in an `arm64` environment, add the `:arm64` suffix. -### 构建 +### Build ```bash # git clone the repo @@ -77,4 +77,3 @@ git clone https://github.com/labring/sealos.git # just make it make build BINS=sealos ``` - diff --git a/docs/4.0/docs/lifecycle-management/quick-start/quick-start.md b/docs/4.0/docs/lifecycle-management/quick-start/quick-start.md index 4982cfd338c..dff4aa00a0d 100644 --- a/docs/4.0/docs/lifecycle-management/quick-start/quick-start.md +++ b/docs/4.0/docs/lifecycle-management/quick-start/quick-start.md @@ -2,36 +2,35 @@ sidebar_position: 2 --- -# 快速开始 +# Quick Start -## 先决条件 +## Prerequisites -sealos 是一个简单的 go 二进制文件,可以安装在大多数 Linux 操作系统中。 +Sealos is a simple Go binary that can be installed on most Linux operating systems. -以下是一些基本的安装要求: +Here are some basic installation requirements: -- 每个集群节点应该有不同的主机名。 主机名不要带下划线。 -- 所有节点的时间同步。 -- 在 Kubernetes 集群的第一个节点上运行`sealos run`命令,目前集群外的节点不支持集群安装。 -- 建议使用干净的操作系统来创建集群。不要自己装 Docker。 -- 支持大多数 Linux 发行版,例如:Ubuntu CentOS Rocky linux。 -- 支持 [DockerHub](https://hub.docker.com/r/labring/kubernetes/tags) 中支持的 Kubernetes 版本。 -- 支持使用 containerd 作为容器运行时。 -- 在公有云上请使用私有 IP。 +- Each cluster node should have a unique hostname. Hostnames should not contain underscores. +- Time synchronization across all nodes. +- Run the `sealos run` command on the first node of the Kubernetes cluster. Currently, cluster installation is not supported from outside the cluster. +- It is recommended to use a clean operating system to create the cluster. Do not install Docker manually. +- Supported on most Linux distributions, such as Ubuntu, CentOS, and Rocky Linux. +- Supports Kubernetes versions supported in [DockerHub](https://hub.docker.com/r/labring/kubernetes/tags). +- Supports containerd as the container runtime. +- For public cloud deployments, use private IP addresses. -### CPU 架构 +### CPU Architecture -目前支持 `amd64` 和 `arm64` 架构。 +Currently, `amd64` and `arm64` architectures are supported. - -## 单机安装 Kuberentes +## Single-node Kubernetes Installation ```shell # sealos version must >= v4.1.0 $ sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 --single ``` -## 集群安装 Kuberentes +## Multi-node Kubernetes Installation ```shell $ sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \ @@ -39,18 +38,18 @@ $ sealos run labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24 --nodes 192.168.64.21,192.168.64.19 -p [your-ssh-passwd] ``` -参数说明: +Parameter explanation: -| 参数名 | 参数值示例 | 参数说明 | -| --- | --- | --- | -| --masters | 192.168.0.2 | kubernetes master 节点地址列表 | -| --nodes | 192.168.0.3 | kubernetes node 节点地址列表 | -| --ssh-passwd | [your-ssh-passwd] | ssh 登录密码 | -|kubernetes | labring/kubernetes:v1.25.0 | kubernetes 镜像 | +| Parameter | Example Value | Description | +| --------- | --------------- | ---------------------------------------- | +| --masters | 192.168.0.2 | Kubernetes master node address list | +| --nodes | 192.168.0.3 | Kubernetes node address list | +| --ssh-passwd | [your-ssh-passwd] | SSH login password | +| kubernetes | labring/kubernetes:v1.25.0 | Kubernetes image | -在干净的服务器上直接执行上面命令,不要做任何多余操作即可启动一个高可用的 kubernetes 集群。 +Execute the above command directly on a clean server without any additional operations to start a highly available Kubernetes cluster. -## 安装各种分布式应用 +## Install Various Distributed Applications ```shell sealos run labring/helm:v3.8.2 # install helm @@ -59,99 +58,100 @@ sealos run labring/minio-operator:v4.4.16 labring/ingress-nginx:4.1.0 \ labring/mysql-operator:8.0.23-14.1 labring/redis-operator:3.1.4 # oneliner ``` -这样高可用的 mysql redis 等都有了,不用关心所有的依赖问题。 +With the above commands, you will have highly available MySQL, Redis, and more, without worrying about dependencies. -## 增加节点 +## Adding Nodes -增加 node 节点: +Add a node: ```shell $ sealos add --nodes 192.168.64.21,192.168.64.19 ``` -增加 master 节点: +Add a master node: ```shell $ sealos add --masters 192.168.64.21,192.168.64.19 ``` -## 删除节点 +## Deleting Nodes -删除 node 节点: +Delete a node: ```shell $ sealos delete --nodes 192.168.64.21,192.168.64.19 ``` -删除 master 节点: +Delete a master node: ```shell $ sealos delete --masters 192.168.64.21,192.168.64.19 ``` -## 清理集群 +## Cleaning up the Cluster ```shell $ sealos reset ``` +## Offline Delivery -## 离线交付 -离线环境只需要提前导入镜像,其它步骤与在线安装一致。 +For offline environments, you only need to import the images in advance. The remaining steps are the same as online installation. -首先在有网络的环境中 save 安装包: +First, save the installation package in an environment with internet access: ```shell $ sealos pull labring/kubernetes:v1.25.0 $ sealos save -o kubernetes.tar labring/kubernetes:v1.25.0 ``` -### load镜像并安装 +### Loading Images and Installation -拷贝 kubernetes.tar 到离线环境, 使用 load 命令导入镜像即可: +Copy the `kubernetes.tar` file to the offline environment and use the `load` command to import the images: ```shell $ sealos load -i kubernetes.tar ``` -剩下的安装方式与在线安装一致。 +The remaining installation steps are the same as the online installation. ```shell -$ sealos images # 查看集群镜像是否导入成功 -$ sealos run kuberentes:v1.25.0 # 单机安装,集群安装同理 +$ sealos images # check if the cluster images are successfully imported +$ sealos run kubernetes:v1.25.0 # Single-node installation, similar for cluster installation ``` -### 快速启动集群 +### Quick Start with Cluster Image ```shell -$ sealos run kubernetes.tar # 单机安装,集群安装同理 +$ sealos run kubernetes.tar # Single-node installation, similar for cluster installation ``` +## Cluster Image Version Support -## 集群镜像版本支持说明 +### Kubernetes with containerd (Kubernetes version >=1.18.0) -### 支持 containerd 的 Kubernetes(k8s 版本 >=1.18.0) +| Kubernetes Version | Sealos Version | CRI Version | Image Version | +| ------------------ | -------------------- | ----------- | ------------------------------- | +| `<1.25` | `>=v4.0.0` | v1alpha2 | labring/kubernetes:v1.24.0 | +| `>=1.25` | `>=v4.1.0` | v1alpha2 | labring/kubernetes:v1.25.0 | +| `>=1.26` | `>=v4.1.4-rc3` | v1 | labring/kubernetes:v1.26.0 | +| `>=1.27` | `>=v4.2.0-alpha3` | v1 | labring/kubernetes:v1.27.0 | -| k8s 版本 | sealos 版本 | cri 版本 | 镜像版本 | -| -------- | ----------------- | -------- | -------------------------- | -| `<1.25` | `>=v4.0.0` | v1alpha2 | labring/kubernetes:v1.24.0 | -| `>=1.25` | `>=v4.1.0` | v1alpha2 | labring/kubernetes:v1.25.0 | -| `>=1.26` | `>=v4.1.4-rc3` | v1 | labring/kubernetes:v1.26.0 | -| `>=1.27` | `>=v4.2.0-alpha3` | v1 | labring/kubernetes:v1.27.0 | +These images use containerd as the container runtime interface (CRI). containerd is a lightweight, high-performance container runtime that is compatible with Docker. Using containerd-based Kubernetes images can provide better performance and resource utilization. -这些镜像使用 containerd 作为容器运行时(CRI)。containerd 是一种轻量级、高性能的容器运行时,与 Docker 兼容。使用 containerd 的 Kubernetes 镜像可以提供更高的性能和资源利用率。 +Depending on the Kubernetes version, you can choose different Sealos versions and CRI versions. For example, if you want to use Kubernetes v1.26.0, you can choose Sealos v4.1.4-rc3 or higher and use CRI v1. -根据 Kubernetes 版本的不同,您可以选择不同的 sealos 版本和 cri 版本。例如,如果您要使用 Kubernetes v1.26.0 版本,您可以选择 sealos v4.1.4-rc3 及更高版本,并使用 v1 cri 版本。 +#### Kubernetes with Docker (Kubernetes version >=1.18.0) -#### 支持 docker 的 Kubernetes(k8s 版本 >=1.18.0) +| Kubernetes Version | Sealos Version | CRI Version | Image Version | +| ------------------ | -------------------- | ----------- | -------------------------------------- | +| `<1.25` | `>=v4.0.0` | v1alpha2 | labring/kubernetes-docker:v1.24.0 | +| `>=1.25` | `>=v4.1.0` | v1alpha2 | labring/kubernetes-docker:v1.25.0 | +| `>=1.26` | `>=v4.1.4-rc3` | v1 | labring/kubernetes-docker:v1.26.0 | +| `>=1.27` | `>=v4.2.0-alpha3` | v1 | labring/kubernetes-docker:v1.27.0 | -| k8s 版本 | sealos 版本 | cri 版本 | 镜像版本 | -| -------- | ----------------- | -------- | --------------------------------- | -| `<1.25` | `>=v4.0.0` | v1alpha2 | labring/kubernetes-docker:v1.24.0 | -| `>=1.25` | `>=v4.1.0` | v1alpha2 | labring/kubernetes-docker:v1.25.0 | -| `>=1.26` | `>=v4.1.4-rc3` | v1 | labring/kubernetes-docker:v1.26.0 | -| `>=1.27` | `>=v4.2.0-alpha3` | v1 | labring/kubernetes-docker:v1.27.0 | +These images use Docker as the container runtime interface (CRI). Docker is a widely used and feature-rich container platform that provides an easy-to-use interface and a rich ecosystem. Using Docker-based Kubernetes images allows for easy integration with existing Docker infrastructure. -这些镜像使用 docker 作为容器运行时(CRI)。docker 是一种广泛使用的、功能丰富的容器平台,提供了易于使用的界面和丰富的生态系统。使用 docker 的 Kubernetes 镜像可以方便地与现有的 docker 基础设施集成。 +Similar to containerd-based Kubernetes images, you can choose different Sealos versions and CRI versions based on the Kubernetes version. For -与支持 containerd 的 Kubernetes 镜像类似,您可以根据 Kubernetes 版本的不同选择不同的 sealos 版本和 cri 版本。例如,如果您要使用 Kubernetes v1.26.0 版本,您可以选择 sealos v4.1.4-rc3 及更高版本,并使用 v1 cri 版本。 +example, if you want to use Kubernetes v1.26.0, you can choose Sealos v4.1.4-rc3 or higher and use CRI v1. -## 总结 +## Summary -您在 Kubernetes 集群中运行容器我们提供了多种选择。您可以根据自己的需求和偏好,在不同的镜像类型和版本中进行选择。同时,不要忘记查看 [更新日志](https://github.com/labring/sealos/blob/main/CHANGELOG/CHANGELOG.md),以了解各个版本的更新内容和修复问题。 +We provide multiple options for running containers in your Kubernetes cluster. You can choose from different image types and versions based on your needs and preferences. Also, don't forget to check the [changelog](https://github.com/labring/sealos/blob/main/CHANGELOG/CHANGELOG.md) for any updates or additional information. diff --git a/docs/4.0/docs/lifecycle-management/reference/Image-cri-shim/image-cri-shim.md b/docs/4.0/docs/lifecycle-management/reference/Image-cri-shim/image-cri-shim.md index 2a2fb7892ca..d861e1f7ed0 100644 --- a/docs/4.0/docs/lifecycle-management/reference/Image-cri-shim/image-cri-shim.md +++ b/docs/4.0/docs/lifecycle-management/reference/Image-cri-shim/image-cri-shim.md @@ -2,15 +2,15 @@ sidebar_position: 3 --- -# image-cri-shim 使用指南 +# image-cri-shim User Guide -## 工作原理 +## Overview -image-cri-shim 是一个基于 CRI (Container Runtime Interface) 和 kubelet 的 gRPC (Google Remote Procedure Call) shim。CRI 是 Kubernetes 中用于与容器运行时进行交互的接口,而 kubelet 是负责维护容器运行状态和节点级别的资源管理的 Kubernetes 组件。 +image-cri-shim is a gRPC (Google Remote Procedure Call) shim based on CRI (Container Runtime Interface) and kubelet. CRI is the interface used in Kubernetes to interact with container runtimes, while kubelet is the Kubernetes component responsible for maintaining container runtime status and node-level resource management. -image-cri-shim 的主要功能是自动识别镜像名称,让用户在使用 Kubernetes 部署容器时无需手动指定镜像名称。这样可以降低用户的操作难度,提高部署容器的便利性。 +The main functionality of image-cri-shim is automatic image name recognition, which eliminates the need for users to manually specify the image name when deploying containers with Kubernetes. This simplifies the container image deployment process and improves the convenience for users. -在实际使用中,image-cri-shim 可以作为一个中间件,接收来自 kubelet 的请求,然后将请求转发给容器运行时。通过自动识别镜像名称,image-cri-shim 可以简化容器镜像的部署流程,减轻用户的操作负担。 +In practical usage, image-cri-shim serves as middleware that receives requests from kubelet and forwards them to the container runtime. By automatically recognizing the image name, image-cri-shim streamlines the deployment process of container images and reduces user burden. ``` +------------+ +----------------+ +-------------------+ @@ -43,19 +43,18 @@ image-cri-shim 的主要功能是自动识别镜像名称,让用户在使用 K ``` -从上述流程图可以看出,用户创建一个包含容器信息的 Kubernetes YAML 清单,然后将该清单提交给 kubelet。kubelet 是 Kubernetes 节点上的代理,负责管理容器。 -接着,kubelet 将 CRI 请求发送给 image-cri-shim 中间件。image-cri-shim 的主要任务是自动识别镜像名称,它会处理这个 CRI 请求并获取相关的镜像信息。当 image-cri-shim 识别到镜像名称后,它会将 CRI 响应返回给 kubelet。 +From the above flowchart, it can be seen that a user creates a Kubernetes YAML manifest containing container information and submits the manifest to kubelet. kubelet, which acts as an agent on Kubernetes nodes, is responsible for managing containers. +Next, kubelet sends a CRI request to the image-cri-shim middleware. The main task of image-cri-shim is to automatically recognize the image name. It processes the CRI request and retrieves relevant image information. Once image-cri-shim identifies the image name, it returns the CRI response to kubelet. -最后,kubelet 使用从 image-cri-shim 获取的镜像名称来部署容器。这个过程对用户是透明的,用户无需手动指定镜像名称,从而简化了容器部署流程并提高了便利性。 +Finally, kubelet deploys the container using the image name obtained from image-cri-shim. This process is transparent to the user, as they do not need to manually specify the image name, simplifying the container deployment process and improving convenience. -## 架构图 +## Architecture -image-cri-shim 的架构如下图所示: +The architecture of image-cri-shim is illustrated in the following diagram: ![](images/image-cri-shim.png) - -## 使用说明 +## Usage ```yaml shim: /var/run/image-cri-shim.sock @@ -70,52 +69,56 @@ registries: - address: http://172.18.1.38:5000 auth: admin:passw0rd ``` -这段配置文件是一个用于设置 image-cri-shim 的 YAML 格式文件。配置文件中包含了一些关键的参数,以下是每个参数的解释: -1. shim: 指定 image-cri-shim 的 UNIX 套接字文件路径。这个路径用于与 kubelet 之间的通信。 -2. cri: 指定容器运行时(如 containerd)的 UNIX 套接字文件路径。image-cri-shim 会使用这个路径与容器运行时进行通信。 -3. address: 定义镜像仓库的地址。在本例中,镜像仓库地址为 http://sealos.hub:5000。 -4. force: 设置为 true 时,image-cri-shim 会在强制启动shim,无需等待cri启动后启动。 -5. debug: 设置为 true 时,启用调试模式,输出更多的日志信息。 -6. timeout: 定义镜像操作的超时时间。在本例中,超时时间为 15 分钟(15m)。 -7. auth: 定义用于访问镜像仓库的身份验证凭据。在本例中,用户名为 admin,密码为 passw0rd。 +The above configuration is a YAML file used to set the parameters of image-cri-shim. It includes several key parameters, and the explanation for each parameter is as follows: + +1. shim: Specifies the UNIX socket file path + +for image-cri-shim. This path is used for communication with kubelet. +2. cri: Specifies the UNIX socket file path for the container runtime (e.g., containerd). image-cri-shim uses this path to communicate with the container runtime. +3. address: Defines the address of the image registry. In this example, the registry address is http://sealos.hub:5000. +4. force: When set to true, image-cri-shim forcefully starts the shim without waiting for the cri to start. +5. debug: When set to true, enables debug mode and outputs more logging information. +6. timeout: Defines the timeout for image operations. In this example, the timeout is set to 15 minutes (15m). +7. auth: Defines the authentication credentials for accessing the image registry. In this example, the username is admin and the password is passw0rd. + +Additionally, the configuration file includes a list of registries, which defines other image registries and their authentication credentials. In this example, there is only one additional registry: +- address: The address of the registry is http://172.18.1.38:5000. +- auth: The authentication credentials for accessing the registry. In this example, the username is admin and the password is passw0rd. -此外,配置文件还包含了一个 registries 列表,用于定义其他镜像仓库及其身份验证凭据。在这个例子中,只有一个其他仓库: -- address: 该仓库的地址为 http://172.18.1.38:5000。 -- auth: 用于访问该仓库的身份验证凭据。在本例中,用户名为 admin,密码为 passw0rd。 -这个配置文件为 image-cri-shim 提供了所需的信息,以便正确地与 kubelet 和容器运行时(如 containerd)进行通信,以及访问和管理镜像仓库。 +This configuration file provides image-cri-shim with the necessary information to communicate with kubelet, the container runtime (such as containerd), and access and manage the image registry. -注意: image-cri-shim 能够同时兼容 CRI API v1alpha2 和 v1。 +Note: image-cri-shim is compatible with both CRI API v1alpha2 and v1. -### 管理服务 +### Service Management -image-cri-shim 通常作为一个系统服务运行。要管理 image-cri-shim,您可以使用系统服务管理工具(如 systemctl)来启动、停止、重启或查看服务状态。首先,确保您已经正确地安装了 image-cri-shim 并将其配置为一个系统服务。 +image-cri-shim is typically run as a system service. To manage image-cri-shim, you can use system service management tools (such as systemctl) to start, stop, restart, or view the status of the service. First, make sure you have correctly installed image-cri-shim and configured it as a system service. -1. 启动服务: `systemctl start image-cri-shim` -2. 停止服务: `systemctl stop image-cri-shim` -3. 重启服务: `systemctl restart image-cri-shim` -4. 查看服务状态: `systemctl status image-cri-shim` +1. Start the service: `systemctl start image-cri-shim` +2. Stop the service: `systemctl stop image-cri-shim` +3. Restart the service: `systemctl restart image-cri-shim` +4. View the service status: `systemctl status image-cri-shim` -### 日志管理 +### Log Management -要查看 image-cri-shim 服务的日志,您可以使用 journalctl 命令。journalctl 是一个用于查询和显示系统日志的工具,它与 systemd 服务管理器一起使用。 +To view the logs of the image-cri-shim service, you can use the journalctl command. journalctl is a tool used to query and display system logs, and it is used in conjunction with the systemd service manager. -以下是使用 journalctl 查看 image-cri-shim 服务日志的命令: +Here are the commands to view the logs of the image-cri-shim service using journalctl: ```shell journalctl -u image-cri-shim ``` -这将显示 image-cri-shim 服务的全部日志。如果您希望实时查看日志,可以添加 -f 参数: +This will display all logs of the image-cri-shim service. If you want to view the logs in real-time, you can add the -f option: ```shell journalctl -u image-cri-shim -f ``` -此外,您还可以根据时间过滤日志。例如,如果您只想查看过去一小时的日志,可以使用以下命令: +Additionally, you can filter the logs by time. For example, if you only want to view the logs from the past hour, you can use the following command: ```shell journalctl -u image-cri-shim --since "1 hour ago" ``` -这些命令应该能帮助您查看和分析 image-cri-shim 服务的日志,从而更好地了解服务的运行状态和可能出现的问题。 +These commands should help you view and analyze the logs of the image-cri-shim service, allowing you to better understand the service's operation status and potential issues. diff --git a/docs/4.0/docs/lifecycle-management/reference/lvscare/lvscare.md b/docs/4.0/docs/lifecycle-management/reference/lvscare/lvscare.md index 683793f0049..33bb00cc6c5 100644 --- a/docs/4.0/docs/lifecycle-management/reference/lvscare/lvscare.md +++ b/docs/4.0/docs/lifecycle-management/reference/lvscare/lvscare.md @@ -1,60 +1,60 @@ -# LVScare 使用指南 +# LVScare User Guide -## 介绍 +## Introduction -LVScare是一款基于IPVS技术的轻量级负载均衡和健康检查工具,可以实时监控和管理后端服务。Sealos,一个云操作系统,它的生命周期管理是一个基于kubeadm的Kubernetes HA安装工具,适用于在任何Linux系统中安装和升级高可用Kubernetes集群。两者结合能实现Kubernetes master节点的高可用性。Sealos利用其生命周期管理能力,通过配合LVScare的轻量级,0依赖,高可用的特性,可以非常有效地保证Kubernetes集群的稳定性和可靠性。 +LVScare is a lightweight load balancing and health checking tool based on IPVS technology. It provides real-time monitoring and management of backend services. Sealos, a cloud operating system, is a Kubernetes HA installation tool based on kubeadm that can be used to install and upgrade high availability Kubernetes clusters on any Linux system. When combined, Sealos and LVScare enable high availability of Kubernetes master nodes. Leveraging the lifecycle management capabilities of Sealos and the lightweight, zero-dependency, and high availability features of LVScare, it ensures the stability and reliability of Kubernetes clusters effectively. -### LVScare的工作原理与特点 +### How LVScare Works and Its Features -LVScare通过IPVS实时监控后端服务(real servers)的健康状态。如果某个服务变得不可用,LVScare会立即将其权重设为0(用于TCP优雅终止),并在下一次检查期间从服务列表中移除。服务恢复正常后,LVScare会自动将其重新加入到服务列表。LVScare的这种设计使得它具备轻量级,0依赖,高可用的特性。占用资源少,稳定可靠,类似于kube-proxy的实现,可以通过ipvs实现的localLB保证服务的持续可用。 +LVScare monitors the health status of backend services (real servers) in real-time using IPVS. If a service becomes unavailable, LVScare immediately sets its weight to 0 (for graceful TCP termination) and removes it from the service list during the next check. When the service recovers, LVScare automatically adds it back to the service list. This design of LVScare makes it lightweight, zero-dependency, and highly available. It occupies fewer resources, is stable and reliable, and similar to the implementation of kube-proxy, it can ensure the continuous availability of services through IPVS-based local load balancing. -## Sealos与LVScare的集成 +## Integration of Sealos and LVScare -在Sealos中,我们利用了官方推荐的静态Pod的方式,自动配置和管理LVScare,以实现Kubernetes集群的高可用性。Sealos会在安装Kubernetes集群的过程中自动使用LVScare进行master节点的健康检查和负载均衡。这意味着,即使某个master节点出现故障,也不会影响Kubernetes集群的整体功能。 +In Sealos, we utilize the recommended approach of static pods to automatically configure and manage LVScare for achieving high availability of Kubernetes clusters. During the installation process of a Kubernetes cluster, Sealos automatically uses LVScare for health checking and load balancing of the master nodes. This means that even if one of the master nodes fails, it does not affect the overall functionality of the Kubernetes cluster. ![](./images/01.webp) -### 如何运行LVScare静态Pod +### Running LVScare as a Static Pod -首先,通过`sealctl static-pod`命令生成LVScare的配置,并将其放入`/etc/kubernetes/manifests`目录。这样,Kubernetes集群中的所有节点都能获取到这份配置。 +First, use the `sealctl static-pod` command to generate the configuration for LVScare and place it in the `/etc/kubernetes/manifests` directory. This allows all nodes in the Kubernetes cluster to access this configuration. ```bash lvscare care --vs 10.103.97.12:6443 --rs 192.168.0.2:6443 --rs 192.168.0.3:6443 --rs 192.168.0.4:6443 --interval 5 --mode route ``` -### 生成和调整静态Pod配置 +### Generating and Adjusting Static Pod Configuration -在需要在每个节点上启动LVScare时,我们可以使用以下命令生成静态Pod的配置: +To start LVScare on each node, we can use the following command to generate the configuration for the static pod: ```bash -sealctl static-pod lvscare --vip 10.103.97.2:6443 --name lvscare --image lvscare:latest --masters 192.168.0.2:6443,192.168 - -.0.3:6443 --print +sealctl static-pod lvscare --vip 10.103.97.2:6443 --name lvscare --image lvscare:latest --masters 192.168.0.2:6443,192.168.0.3:6443 --print ``` -当master节点有变化时,Sealos只需重新执行`sealctl static-pod`命令即可调整master节点,简化了维护静态Pod的逻辑。在集群join节点之前,我们需要调用`sealctl ipvs`(该命令直接调用LVScare sdk)手动启动IPVS规则,维护好IPVS集群。节点join成功后,Kubernetes的静态Pod就可以接管IPVS规则了。 +When there are changes in the master nodes, Sealos only needs to rerun the `sealctl static-pod` command to adjust the master nodes, simplifying the logic of maintaining static pods. Before joining the cluster nodes, we need to manually start the IPVS rules by calling `sealctl ipvs` (which directly calls the LVScare SDK) to maintain the IPVS cluster. After the node joins successfully, Kubernetes static pods can take over the IPVS rules. + +## Advantages of Using LVScare -## 使用LVScare的优势 +### High Availability -### 高可用性 +By combining LVScare with Sealos, high availability of Kubernetes cluster master nodes can be achieved. -结合LVScare,Sealos可以实现Kubernetes集群master节点的高可用性。 +### Health Checking Mechanism -### 健康检查机制 +The health checking mechanism of LVScare can promptly detect and handle issues, preventing them from causing larger problems due to the failure of a single node. -LVScare的健康检查机制可以及时发现并处理问题,防止单节点故障引发的更大问题。 +### Seamless Integration -### 无缝集成 +As a static pod in Seal -作为Sealos中的静态Pod,LVScare可以与Kubernetes集群其他部分无缝集成。 +os, LVScare can seamlessly integrate with other parts of the Kubernetes cluster. -### 简化运维 +### Simplified Operations -Sealos自动配置和管理LVScare,大大简化了Kubernetes集群的运维工作。 +Sealos automatically configures and manages LVScare, greatly simplifying the operational tasks of the Kubernetes cluster. -## LVScare使用示例 +## LVScare Usage Example -请注意,所有的real server需要在同一主机上监听,并设置为`route`模式。然后,你可以在前台运行LVScare。例如: +Please note that all real servers need to listen on the same host and be set in "route" mode. Then, you can run LVScare in the foreground. For example: ```bash docker run -p 8081:80 --name echoserver1 -d cilium/echoserver @@ -63,12 +63,12 @@ docker run -p 8083:80 --name echoserver3 -d cilium/echoserver lvscare care --vs 169.254.0.1:80 --rs 127.0.0.1:8081 --rs 127.0.0.1:8082 --rs 127.0.0.1:8083 --logger DEBG --health-schem http --health-path / ``` -## 清理 +## Cleanup -最后,你可以使用以下命令进行清理: +Finally, you can use the following command to clean up: ```bash lvscare care --vs 169.254.0.1:80 --logger DEBG -C ``` -结论:LVScare是一款基于IPVS的轻量级负载均衡和健康检查工具,它能与Sealos无缝集成,极大地提高了Kubernetes集群的可用性和性能。试一试,看看LVScare如何帮助你更好地管理你的Kubernetes集群! +Conclusion: LVScare is a lightweight load balancing and health checking tool based on IPVS. When seamlessly integrated with Sealos, it greatly improves the availability and performance of Kubernetes clusters. Give it a try and see how LVScare can help you better manage your Kubernetes cluster! diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/cert.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/cert.md index 9de055627c8..fe2b676aed3 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/cert.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/cert.md @@ -3,27 +3,26 @@ sidebar_position: 1 --- -# cert 证书管理 +# Certificate Management with `cert` -`cert` 命令用于生成 Kubernetes 集群所需的证书文件。在 Kubernetes 集群中,证书用于确保组件之间的通信安全,例如 API server、kubelet 和 etcd 等。证书通过 TLS(Transport Layer Security)协议实现加密,以确保数据在传输过程中的保密性和完整性。 - -`sealctl cert` 命令可以根据提供的参数自动生成证书。这些参数包括节点 IP、节点名称、服务 CIDR、DNS 域以及可选的其他备用名称。通过生成并配置这些证书,您可以确保 Kubernetes 集群的安全通信。 +The `cert` command is used to generate the necessary certificate files for a Kubernetes cluster. In a Kubernetes cluster, certificates are used to ensure secure communication between components such as the API server, kubelet, and etcd. Certificates provide encryption using the Transport Layer Security (TLS) protocol to ensure the confidentiality and integrity of data during transit. +The `sealctl cert` command generates certificates automatically based on the provided parameters. These parameters include node IP, node name, service CIDR, DNS domain, and optional additional alternate names. By generating and configuring these certificates, you can ensure secure communication within your Kubernetes cluster. ``` -cert 命令用于生成 Kubernetes 证书。 - -参数: - --alt-names 备用名称,例如 sealos.io 或 10.103.97.2。可以包含多个备用名称。 - --node-name 节点名称,例如 master0。 - --service-cidr 服务网段,例如 10.103.97.2/24。 - --node-ip 节点的 IP 地址,例如 10.103.97.2。 - --dns-domain 集群 DNS 域,默认值为 cluster.local。 - --cert-path Kubernetes 证书文件路径,默认值为 /etc/kubernetes/pki。 - --cert-etcd-path Kubernetes etcd 证书文件路径,默认值为 /etc/kubernetes/pki/etcd。 - -示例: +The `cert` command is used to generate Kubernetes certificates. + +Options: + --alt-names Alternate names, such as sealos.io or 10.103.97.2. Can specify multiple alternate names. + --node-name Node name, such as master0. + --service-cidr Service CIDR, such as 10.103.97.2/24. + --node-ip IP address of the node, such as 10.103.97.2. + --dns-domain DNS domain for the cluster. Default value is cluster.local. + --cert-path Path to Kubernetes certificate files. Default value is /etc/kubernetes/pki. + --cert-etcd-path Path to Kubernetes etcd certificate files. Default value is /etc/kubernetes/pki/etcd. + +Examples: sealctl cert --alt-names sealos.io --alt-names 10.103.97.2 \ --node-name master0 --service-cidr 10.103.97.2/24 \ --node-ip 10.103.97.2 --dns-domain cluster.local diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/cri.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/cri.md index cd36074f7b6..5bae776b35d 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/cri.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/cri.md @@ -2,14 +2,13 @@ sidebar_position: 2 --- -# CRI 容器管理 +# CRI Container Management -`cri` 命令是用于管理和检查 Kubernetes 集群中的容器运行时(Container Runtime Interface,CRI)环境。容器运行时是负责运行容器的底层技术,如 Docker、containerd 或者 CRI-O 等。在 Kubernetes 中,容器运行时用于启动、停止和管理容器,以支持集群中的工作负载。 +The `cri` command is used to manage and inspect the Container Runtime Interface (CRI) environment in a Kubernetes cluster. The container runtime is the underlying technology responsible for running containers, such as Docker, containerd, or CRI-O. In Kubernetes, the container runtime is used to start, stop, and manage containers to support workloads in the cluster. -`sealctl cri` 命令提供了一组子命令,使您能够执行与容器运行时相关的各种操作,例如检查运行时是否是 Docker、是否正在运行,列出 Kubernetes 容器,删除容器,拉取镜像,检查镜像是否存在以及获取 CGroup 驱动信息等。 - -通过使用 `sealctl cri` 命令,您可以轻松地管理和检查 Kubernetes 集群中的容器运行时环境,确保其正确配置和正常运行。 +The `sealctl cri` command provides a set of subcommands that allow you to perform various operations related to the container runtime, such as checking if the runtime is Docker, if it is running, listing Kubernetes containers, deleting containers, pulling images, checking image existence, and retrieving CGroup driver information. +By using the `sealctl cri` command, you can easily manage and inspect the container runtime environment in your Kubernetes cluster to ensure proper configuration and smooth operation. ```shell @@ -17,32 +16,30 @@ sealctl cri [flags] ``` +Subcommands: -子命令: - -1. `socket`:检测 CRI 套接字。 +1. `socket`: Check the CRI socket. ```shell sealctl cri socket ``` -2. `cgroup-driver`:获取容器运行时的 cgroup 驱动。 +2. `cgroup-driver`: Get the cgroup driver of the container runtime. ```shell sealctl cri cgroup-driver [--short] ``` -- `--short`:仅打印结果。 +- `--short`: Print only the result. -全局参数: +Global flags: -- `--socket-path`:CRI 套接字路径。 -- `--config`:CRI 配置文件。 +- `--socket-path`: Path to the CRI socket. +- `--config`: Path to the CRI configuration file. -示例: +Examples: ```shell sealctl cri socket sealctl cri cgroup-driver --short - -``` \ No newline at end of file +``` diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/hostname.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/hostname.md index a6d4451d071..82bb133846a 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/hostname.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/hostname.md @@ -2,19 +2,18 @@ sidebar_position: 3 --- +# Get Hostname -# hostname 获取主机名 - -获取操作系统的主机名: +Get the hostname of the operating system: ```shell sealctl hostname ``` -示例: +Example: ```shell sealctl hostname ``` -执行此命令将返回操作系统的主机名。无需传递任何参数。 \ No newline at end of file +Executing this command will return the hostname of the operating system. No additional parameters need to be passed. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/hosts.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/hosts.md index df7431ec469..a218a94e18f 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/hosts.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/hosts.md @@ -2,58 +2,55 @@ sidebar_position: 4 --- -# hosts 管理 +# Manage Hosts -`hosts` 命令是用于管理操作系统的 hosts 文件。hosts 文件是一个用于解析域名到 IP 地址的文件,通常在本地系统中用于覆盖 DNS 解析。通过修改 hosts 文件,您可以为一个特定的域名分配一个自定义的 IP 地址,而不必依赖 DNS 服务器。 +The `hosts` command is used to manage the hosts file of the operating system. The hosts file is a file used for domain name resolution to IP addresses and is typically used locally to override DNS resolution. By modifying the hosts file, you can assign a custom IP address to a specific domain name without relying on a DNS server. -`sealctl hosts` 提供了以下三个子命令来实现 hosts 文件的管理: +`sealctl hosts` provides the following three subcommands to manage the hosts file: -1. `list`:列出当前 hosts 文件中的所有条目。 -2. `add`:向 hosts 文件中添加一个新的域名与 IP 地址映射。 -3. `delete`:从 hosts 文件中删除一个指定的域名与 IP 地址映射。 +1. `list`: List all entries in the current hosts file. +2. `add`: Add a new domain-to-IP mapping to the hosts file. +3. `delete`: Delete a specified domain-to-IP mapping from the hosts file. -通过这些子命令,您可以方便地查看、添加和删除 hosts 文件中的映射,从而更好地控制域名到 IP 地址的解析。 +With these subcommands, you can conveniently view, add, and delete mappings in the hosts file, allowing you better control over domain name resolution to IP addresses. -1. `sealctl hosts list`:列出当前 hosts 文件中的条目。 +1. `sealctl hosts list`: List all entries in the current hosts file. - 示例: + Example: ```shell sealctl hosts list ``` +2. `sealctl hosts add`: Add a new entry to the hosts file. + Parameters: -2. `sealctl hosts add`:向 hosts 文件中添加一个新条目。 + - `--ip`: IP address (required) + - `--domain`: Domain name (required) - 参数: - - - `--ip`:IP 地址(必填) - - `--domain`:域名(必填) - - 示例: + Example: ```shell sealctl hosts add --ip 192.168.1.100 --domain example.com ``` -3. `sealctl hosts delete`:从 hosts 文件中删除一个条目。 +3. `sealctl hosts delete`: Delete an entry from the hosts file. - 参数: + Parameters: - - `--domain`:要删除的域名(必填) + - `--domain`: Domain name to delete (required) - 示例: + Example: ```shell sealctl hosts delete --domain example.com ``` -注意:您可以在任何 `hosts` 子命令后面添加 `--path` 参数来指定 hosts 文件的路径。默认路径为 `/etc/hosts`(Linux 系统)。 +Note: You can specify the path of the hosts file by adding the `--path` parameter after any `hosts` subcommand. The default path is `/etc/hosts` (Linux systems). -示例: +Example: ```shell sealctl hosts list --path /custom/path/hosts ``` - diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/ipvs.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/ipvs.md index b903d23e648..c5ca9a4c7b4 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/ipvs.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/ipvs.md @@ -2,71 +2,70 @@ sidebar_position: 6 --- -# ipvs 管理 +# Manage IPVS -`ipvs` 命令用于创建和管理本地的 IPVS 负载均衡。IPVS(IP Virtual Server)是 Linux 内核中的一个模块,它允许在内核空间实现高性能的负载均衡。`ipvs` 命令通过管理虚拟服务器和真实服务器的映射关系,实现对服务的负载均衡。 +The `ipvs` command is used to create and manage local IPVS (IP Virtual Server) load balancing. IPVS is a module in the Linux kernel that allows high-performance load balancing to be implemented in the kernel space. The `ipvs` command achieves load balancing of services by managing the mapping between virtual servers and real servers. -`sealctl ipvs` 支持以下功能: +`sealctl ipvs` supports the following features: -1. 创建和管理虚拟服务器 (virtual server) 和真实服务器 (real server) 的映射关系。 -2. 提供健康检查功能,定期检查真实服务器的健康状态,并根据需要对其进行上下线操作。 -3. 支持两种代理模式:`route` 和 `link`。 -4. 支持配置代理调度算法(如轮询、加权轮询等)。 -5. 支持一次性创建代理规则(`--run-once` 标志)或持续运行并管理代理规则。 -6. 支持清理功能:通过 `-C` 或 `--clean` 标志,可以清除现有的 IPVS 规则并退出。 +1. Creation and management of mappings between virtual servers and real servers. +2. Health-check functionality to periodically check the health status of real servers and perform necessary online/offline operations. +3. Support for two proxy modes: `route` and `link`. +4. Support for configuring proxy scheduling algorithms (e.g., round-robin, weighted round-robin, etc.). +5. Support for one-time creation of proxy rules (`--run-once` flag) or continuous operation and management of proxy rules. +6. Support for cleanup: Existing IPVS rules can be cleared and the command will exit using the `-C` or `--clean` flag. -通过 `sealctl ipvs` 命令,用户可以轻松地在本地创建和管理高性能的负载均衡服务。 +With the `sealctl ipvs` command, users can easily create and manage high-performance load balancing services locally. -**用法** +**Usage** ```shell sealctl ipvs [flags] ``` -**选项** +**Options** -- `-C`, `--clean`: 清除现有规则,然后退出。 -- `--health-insecure-skip-verify`: 跳过不安全请求的验证(默认为 true)。 -- `--health-path string`: 用于探测的 URL 路径(默认为 "/healthz")。 -- `--health-req-body string`: 健康检查器发送的请求体。 -- `--health-req-headers stringToString`: HTTP 请求头(默认为 [])。 -- `--health-req-method string`: HTTP 请求方法(默认为 "GET")。 -- `--health-schem string`: 探测器的 HTTP 方案(默认为 "https")。 -- `--health-status ints`: 有效状态码。 -- `-h`, `--help`: ipvs 帮助。 -- `-i`, `--iface string`: 要创建的虚拟接口的名称,与 kube-proxy 的行为相同(默认为 "lvscare")。仅在 mode=link 时启用。 -- `--interval durationOrSecond`: 健康检查间隔(默认为 0s)。 -- `--ip ip`: 作为路由网关的目标 IP,与 route 模式一起使用。 -- `--logger string`: 日志级别:DEBG/INFO(默认为 "INFO")。 -- `--masqueradebit int`: IPTables masquerade 位。仅在 mode=link 时启用。 -- `--mode string`: 代理模式:route/link(默认为 "route")。 -- `--rs strings`: 真实服务器地址,例如 192.168.0.2:6443。 -- `--run-once`: 创建代理规则并退出。 -- `--scheduler string`: 代理调度器(默认为 "rr")。 -- `--vs string`: 虚拟服务器地址,例如 169.254.0.1:6443。 +- `-C`, `--clean`: Clear existing rules and then exit. +- `--health-insecure-skip-verify`: Skip verification of insecure requests (default is true). +- `--health-path string`: URL path for probing (default is "/healthz"). +- `--health-req-body string`: Request body sent by the health checker. +- `--health-req-headers stringToString`: HTTP request headers (default is []). +- `--health-req-method string`: HTTP request method (default is "GET"). +- `--health-schem string`: HTTP scheme for the probe (default is "https"). +- `--health-status ints`: Valid status codes. +- `-h`, `--help`: Help for ipvs. +- `-i`, `--iface string`: Name of the virtual interface to create, behaving the same as kube-proxy (default is "lvscare"). Enabled only in mode=link. +- `--interval durationOrSecond`: Health check interval (default is 0s). +- `--ip ip`: Target IP as the routing gateway, used together with mode=route. +- `--logger string`: Log level: DEBG/INFO (default is "INFO"). +- `--masqueradebit int`: IPTables masquerade bit. Enabled only in mode=link. +- `--mode string`: Proxy mode: route/link (default is "route"). +- `--rs strings`: Real server addresses, e.g., 192.168.0.2:6443. +- `--run-once`: Create proxy rules and then exit. +- `--scheduler string`: Proxy scheduler (default is "rr"). +- `--vs string`: Virtual server address, e.g., 169.254.0.1:6443. -**全局选项** +**Global Options** -- `--debug`: 启用调试日志。 -- `--show-path`: 启用显示代码路径。 +- `--debug`: Enable debug logging. +- `--show-path`: Enable displaying code path. -**使用文档** +**Documentation** -要使用 `sealctl ipvs` 命令,请按照以下步骤操作: +To use the `sealctl ipvs` command, follow these steps: -1. 为命令提供必要的选项和参数。 -2. 执行命令,将创建或管理本地 IPVS 负载均衡。 +1. Provide the necessary options and parameters for the command. +2. Execute the command, which will create or manage local IPVS load balancing. -**示例** +**Examples** -创建代理规则并退出: +Create proxy rules and then exit: ```shell sealctl ipvs --vs 169.254.0.1:6443 --rs 192.168.0.2:6443 --run-once ``` -清除现有 IPVS 规则: +Clear existing IPVS rules: ```shell sealctl ipvs --clean -``` diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/registry.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/registry.md index dbe1b40640e..91d03d6133a 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/registry.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/registry.md @@ -2,47 +2,46 @@ sidebar_position: 5 --- -# registry 镜像仓库 +# Registry Image Repository -## Sealos:sealctl registry serve 命令详解与使用指南 +## Sealos: Detailed Guide and Usage of `sealctl registry serve` Command -在构建并管理 Docker 镜像仓库过程中,Sealos 提供了 `sealctl registry serve` 命令以方便用户进行相关操作。本文将详细介绍 `sealctl registry serve` 命令的使用方法和示例。 +Sealos provides the `sealctl registry serve` command to facilitate the construction and management of Docker image repositories. This document provides a detailed guide and usage examples for the `sealctl registry serve` command. -### 基本介绍 +### Introduction -`sealctl registry serve` 命令的主要作用是启动一个 Docker 分发镜像仓库服务器,支持两种模式:`filesystem` 和 `inmem`。 +The `sealctl registry serve` command is primarily used to start a Docker distribution image repository server. It supports two modes: `filesystem` and `inmem`. -1. **Filesystem 模式**:在此模式下,sealctl 将运行一个针对指定目录的 Docker 分发镜像仓库服务器。该模式下,镜像数据将存储在硬盘上。**该命令还用于sealos做增量镜像同步** +1. **Filesystem Mode**: In this mode, `sealctl` runs a Docker distribution image repository server for a specified directory. The image data is stored on disk in this mode. **This command is also used by Sealos for incremental image synchronization**. -2. **In-memory 模式**:在此模式下,sealctl 将运行一个内存中的 Docker 分发镜像仓库服务器。该模式下,镜像数据仅保存在内存中,进程退出后数据将丢失。 +2. **In-memory Mode**: In this mode, `sealctl` runs an in-memory Docker distribution image repository server. The image data is only stored in memory, and the data will be lost when the process exits. -### 命令参数 +### Command Options -`sealctl registry serve filesystem ` 命令支持以下参数: +The `sealctl registry serve filesystem` command supports the following options: -- `--disable-logging`: 禁用日志输出,默认为 false。 -- `--log-level`: 配置日志级别,默认为 'error'。 -- `-p, --port`: 服务器监听的端口,默认为随机未使用的端口。 +- `--disable-logging`: Disable logging output (default is false). +- `--log-level`: Configure the log level (default is 'error'). +- `-p, --port`: The port the server listens on (default is a randomly unused port). -### 使用示例 +### Usage Examples -以下是一些 `sealctl registry serve` 命令的使用示例: +Here are some usage examples of the `sealctl registry serve` command: -#### 在文件系统中启动镜像仓库服务器 +#### Start a Filesystem Image Repository Server ```bash sealctl registry serve filesystem --port=5000 ``` -以上命令将在端口5000上启动一个文件系统镜像仓库服务器。 +The above command starts a filesystem image repository server on port 5000. -#### 在内存中启动镜像仓库服务器 +#### Start an In-memory Image Repository Server ```bash -sealctl registry serve inmem +sealctl registry serve inmem ``` -以上命令将启动一个内存镜像仓库服务器。该服务器在进程退出后,存储的数据将丢失。 - -通过 `sealctl registry serve` 命令,用户可以轻松地管理和操作 Docker 镜像仓库。无论是在开发环境,还是在生产环境中,它都是一个强大且易用的工具。 +The above command starts an in-memory image repository server. The server will lose stored data when the process exits. +With the `sealctl registry serve` command, users can easily manage and operate Docker image repositories. It is a powerful and user-friendly tool for both development and production environments. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/sealctl.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/sealctl.md index e5ebe493b6c..882ab560cb0 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/sealctl.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/sealctl.md @@ -2,69 +2,63 @@ sidebar_position: 0 --- -# Sealctl 使用指南 +# Sealctl User Guide -Sealos 提供 sealctl 是使用 Sealos 与 集群节点进行操作的命令行工具。它包括以下几个子命令: +Sealos provides `sealctl`, a command-line tool for operating with Sealos and cluster nodes. It includes the following subcommands: -这个工具叫做 `kubectl`。 +1. `cert`: Manages certificates for generating, viewing, and updating TLS certificates. +2. `cri`: Manages Container Runtime Interface (CRI) configuration, such as Docker or containerd. +3. `hostname`: Views or sets the system hostname. +4. `hosts`: Manages the system's hosts file, which defines static hostname-to-IP address mappings. +5. `ipvs`: Manages IP Virtual Server (IPVS) rules for load balancing and proxying. +6. `registry`: Manages image repositories for storing container images in container repository format and repository management. +7. `static_pod`: Manages static Pods and creates static Pod configurations. +8. `token`: Generates and manages access tokens for authorizing access to Kubernetes clusters. -1. `cert`:管理证书,用于生成、查看和更新TLS证书。 -2. `cri`:管理容器运行时接口(CRI)配置,例如Docker或containerd。 -3. `hostname`:查看或设置系统主机名。 -4. `hosts`:管理系统的hosts文件,用于定义静态主机名到IP地址映射。 -5. `ipvs`:管理IP虚拟服务器(IPVS)规则,用于负载均衡和代理。 -6. `registry`:管理镜像仓库,用于存储容器镜像仓库格式镜像以及镜像仓库管理。 -7. `static_pod`:管理静态Pod,可以创建静态Pod的配置。 -8. `token`:生成和管理访问令牌,用于授权访问Kubernetes集群。 +With these subcommands, you can conveniently manage and configure your Sealos system, enabling control over containers, image repositories, networks, and other aspects. -通过这些子命令,您可以方便地管理和配置您的Sealos系统,实现对容器、镜像仓库、网络等各个方面的控制。 +# Sealos Dependent Commands +1. **Add Hosts** + Adds a new hosts record on the node with the specified IP address. The parameters include the IP address, hostname, and domain name. Use the `sealctl hosts add` command. +2. **Delete Hosts** -# sealos 依赖命令 + Deletes a hosts record on the node with the specified IP address. The parameters include the IP address and domain name. Use the `sealctl hosts delete` command. -1. **添加Hosts** +3. **Hostname** - 在指定 IP 地址的节点上添加一个新的 hosts 记录。参数包括 IP 地址、主机名和域名。使用`sealctl hosts add `命令 + Retrieves the hostname of the node with the specified IP address. Use the `sealctl hostname` command. -2. **删除Hosts** +4. **IPVS Load Balancing** - 删除指定 IP 地址节点上的一个 hosts 记录。参数包括 IP 地址和域名。使用`sealctl hosts delete`命令 + Configures IPVS for load balancing on the node with the specified IP address. The parameters include the node IP address, virtual IP address, and a list of master node IP addresses. Use the `sealctl ipvs` command. -3. **hostname** +5. **Clear IPVS Rules** - 获取指定 IP 地址节点的主机名。 使用`sealctl hostname`命令 + Clears the IPVS configuration on the node with the specified IP address. The parameters include the node IP address and virtual IP address. Use the `sealctl ipvs` command. -4. **IPVS负载均衡** +6. **Generate Static Pods** - 在指定 IP 地址的节点上配置 IPVS,实现负载均衡。参数包括节点 IP 地址、虚拟 IP 地址和主节点 IP 地址列表。 使用`sealctl ipvs`命令 + Deploys a static Pod (lvscare) on the node with the specified IP address. The parameters include the node IP address, virtual IP address, Pod name, image name, and a list of master node IP addresses. Use the `sealctl static-pod lvscare` command. -5. **清空IPVS规则** +7. **Manage Cluster Interact Authentication Token** - 清除指定 IP 地址节点上的 IPVS 配置。参数包括节点 IP 地址和虚拟 IP 地址。 使用`sealctl ipvs`命令 + Generates a token for the node with the specified IP address. The parameters include the node IP address, configuration file, and certificate key. Use the `sealctl token` command. -6. **静态POD生成** +8. **Get Node's CGroup Information** - 在指定 IP 地址的节点上部署一个静态 Pod(lvscare)。参数包括节点 IP 地址、虚拟 IP 地址、Pod 名称、镜像名称和主节点 IP 地址列表。使用`sealctl static-pod lvscare`命令 + Retrieves the CRI CGroup information of the node with the specified IP address. Use the `sealctl cri cgroup` command. -7. **处理集群交互认证的token** +9. **Get Node's CRI Socket Information** - 为指定 IP 地址的节点生成一个 token。参数包括节点 IP 地址、配置文件和证书密钥。使用`sealctl token`命令 + Retrieves the CRI socket information of the node with the specified IP address. Use the `sealctl cri socket` command. -8. **获取节点的cgroup** +10. **Generate Self-signed HTTPS Certificates on Node** - 获取指定 IP 地址节点的cri CGroup 信息。 使用`sealctl cri cgroup`命令 + Generates certificates for the node with the specified IP address. The parameters include the node IP address, a list of alternate names, host IP address, hostname, service CIDR, and DNS domain. Use the `sealctl cert` command. -9. **获取节点的cri-socket** - - 获取指定 IP 地址节点的 cri Socket 信息。 使用`sealctl cri socket`命令 - -10. **在节点生成https自签名证书** - - 为指定 IP 地址的节点生成证书。参数包括节点 IP 地址、备用名称列表、主机 IP 地址、主机名、服务 CIDR 和 DNS 域名。 使用`sealctl cert` 命令 - -11. **节点启动registry** - -​ 在指定节点启动regsitry,为进行增量镜像同步。使用`sealctl registry serve`命令 +11. **Start Registry on Node** + Starts the registry on the specified node for incremental image synchronization. Use the `sealctl registry serve` command. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/static-pod.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/static-pod.md index 0b6e8450802..e82cbecad74 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/static-pod.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/static-pod.md @@ -2,39 +2,37 @@ sidebar_position: 7 --- -# static-pod 配置 +# Static Pod Configuration -`static-pod` 命令用于生成静态 Pod,这些 Pod 是由 kubelet 直接管理的,而不是通过 API 服务器。静态 Pod 在某些场景下非常有用,比如设置和管理 Kubernetes 集群中的控制平面组件。 +The `static-pod` command is used to generate static Pods that are managed directly by kubelet instead of the API server. Static Pods are useful in certain scenarios, such as setting up and managing control plane components in a Kubernetes cluster. -`sealctl static-pod` 命令提供了一种简便的方法,用于生成用于特定目的的静态 Pod 配置文件。目前,它主要支持生成 `lvscare` 静态 Pod,`lvscare` 是一种用于管理 IPVS 规则的工具。 +The `sealctl static-pod` command provides a convenient way to generate static Pod configuration files for specific purposes. Currently, it mainly supports generating the `lvscare` static Pod, which is a tool for managing IPVS rules. -使用 `sealctl static-pod lvscare`,您可以根据指定的参数(如 VIP、主节点地址、镜像名称等)生成 `lvscare` 静态 Pod YAML 文件。然后,该文件可以存储在 kubelet 的静态 Pod 路径下,kubelet 将自动创建和管理相应的 Pod。 +Using `sealctl static-pod lvscare`, you can generate the `lvscare` static Pod YAML file based on specified parameters such as VIP, master node addresses, and image name. This file can then be stored in the static Pod path of kubelet, and kubelet will automatically create and manage the corresponding Pod. - - -**用法** +**Usage** ```shell sealctl static-pod lvscare [flags] ``` -**选项** +**Options** -- `--vip`: 默认 VIP IP(默认为 "10.103.97.2:6443")。 -- `--name`: 生成 lvscare 静态 Pod 名称。 -- `--image`: 生成 lvscare 静态 Pod 镜像(默认为 `sealos.hub:5000/sealos/lvscare:latest`)。 -- `--masters`: 生成 master 地址列表。 -- `--print`: 是否打印 YAML。 +- `--vip`: Default VIP IP (default is "10.103.97.2:6443"). +- `--name`: Name of the generated lvscare static Pod. +- `--image`: Image for the generated lvscare static Pod (default is `sealos.hub:5000/sealos/lvscare:latest`). +- `--masters`: List of master addresses for the generated static Pod. +- `--print`: Whether to print the YAML. -**示例** +**Examples** -生成 lvscare 静态 Pod 文件并打印 YAML: +Generate the lvscare static Pod file and print the YAML: ```shell sealctl static-pod lvscare --vip 10.103.97.2:6443 --name lvscare --image lvscare:latest --masters 192.168.0.2:6443,192.168.0.3:6443 --print ``` -如果没有使用 `--print` 选项,将直接生成配置文件到 `/etc/kubernetes/manifests` 并启用静态 Pod: +If the `--print` option is not used, the configuration file will be directly generated in `/etc/kubernetes/manifests` and the static Pod will be enabled: ```shell sealctl static-pod lvscare --vip 10.103.97.2:6443 --name lvscare --image lvscare:latest --masters 192.168.0.2:6443,192.168.0.3:6443 diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/tar&&untar.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/tar&&untar.md index a37f10ccb64..40e57478c43 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/tar&&untar.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/tar&&untar.md @@ -2,59 +2,59 @@ sidebar_position: 9 --- -# tar 与 untar 详解 +# Tar and Untar in Sealos -Sealos 提供了 `sealctl tar` 和 `sealctl untar` 命令以便于用户进行文件或文件夹的压缩和解压。本文将详细介绍这两个命令的使用方法。 +Sealos provides the `sealctl tar` and `sealctl untar` commands for compressing and decompressing files or directories. This guide explains how to use these two commands in detail. -## sealctl tar 命令 +## The `sealctl tar` Command -`sealctl tar` 命令的主要作用是将指定路径的目录压缩成归档文件。注意,这将剥离父目录。 +The `sealctl tar` command is used to compress a specified directory path into an archive file. Note that it will strip the parent directory. -**命令参数:** +**Command Options:** -- `--clear`:是否在压缩完成后删除源文件,默认为 false。 -- `--compression`:压缩算法,可用选项有 tar/gzip/zstd/disable,默认为 disable。 -- `-o, --output`:归档文件的路径。 +- `--clear`: Whether to delete the source files after compression, default is false. +- `--compression`: Compression algorithm, available options are tar/gzip/zstd/disable, default is disable. +- `-o, --output`: Path of the archive file. -**基本用法:** +**Basic Usage:** ```bash sealctl tar [flags] [options] ``` -## sealctl untar 命令 +## The `sealctl untar` Command -`sealctl untar` 命令的主要作用是在指定路径 `src` 查找匹配 glob 模式的归档文件,并在 `dst` 路径进行解压。 +The `sealctl untar` command is used to search for archive files that match a glob pattern in the specified source path (`src`) and extract them to the destination path (`dst`). -**命令参数:** +**Command Options:** -- `--clear`:是否在解压完成后删除源文件,默认为 false。 -- `-o, --output`:解压归档文件的路径。 +- `--clear`: Whether to delete the source files after extraction, default is false. +- `-o, --output`: Path to extract the archive file. -**基本用法:** +**Basic Usage:** ```bash sealctl untar [flags] [options] ``` -## 使用示例 +## Usage Examples -以下是一些 `sealctl tar` 和 `sealctl untar` 命令的使用示例: +Here are some examples of using the `sealctl tar` and `sealctl untar` commands: -**创建一个压缩文件:** +**Create a compressed file:** ```bash sealctl tar --output=/path/to/archive.tar /path/to/source ``` -以上命令将 `source` 目录压缩为 `archive.tar` 文件。 +The above command compresses the `source` directory into the `archive.tar` file. -**解压一个压缩文件:** +**Extract a compressed file:** ```bash sealctl untar --output=/path/to/destination /path/to/archive.tar ``` -以上命令将 `archive.tar` 文件解压到 `destination` 目录。 +The above command extracts the `archive.tar` file to the `destination` directory. -通过 `sealctl tar` 和 `sealctl untar` 命令,用户可以轻松地进行文件或文件夹的压缩和解压操作。这两个命令在文件管理中,尤其是在备份和迁移文件时,都是非常有用的工具。 +With the `sealctl tar` and `sealctl untar` commands, users can easily compress and decompress files or directories. These commands are useful tools for file management, particularly in backup and file migration scenarios. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealctl/token.md b/docs/4.0/docs/lifecycle-management/reference/sealctl/token.md index 8a9c08571ae..311856c7ebc 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealctl/token.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealctl/token.md @@ -2,37 +2,35 @@ sidebar_position: 8 --- -# token 管理 +# Token Management -`sealctl token` 命令的主要目的是为了生成一个用于连接主节点(master)和工作节点(node)的 token。在 Kubernetes 集群中,当您想要将一个新的工作节点加入到集群时,通常需要提供一个 token 作为身份验证。这个 token 确保只有拥有正确 token 的工作节点才能加入到集群中。 +The `sealctl token` command is primarily used to generate a token for connecting master and worker nodes in a Kubernetes cluster. In a Kubernetes cluster, when you want to add a new worker node, you typically need to provide a token for authentication. This token ensures that only worker nodes with the correct token can join the cluster. -`sealctl token` 命令通过接收配置文件(可选)和证书密钥(可选)作为参数,生成一个用于身份验证的 token。在默认情况下,如果不提供配置文件和证书密钥,命令会使用内置的默认设置来生成 token。 +The `sealctl token` command generates a token for authentication by accepting a configuration file (optional) and a certificate key (optional) as parameters. By default, if no configuration file and certificate key are provided, the command uses built-in default settings to generate the token. -总之,`sealctl token` 命令用于生成一个用于身份验证的 token,允许工作节点安全地加入到 Kubernetes 集群中。使用这个命令可以简化节点加入集群的过程,确保集群的安全性。 +In summary, the `sealctl token` command is used to generate a token for authentication, allowing worker nodes to securely join a Kubernetes cluster. Using this command simplifies the process of adding nodes to the cluster and ensures the security of the cluster. - -**用法** +**Usage** ```shell sealctl token [config] [certificateKey] ``` -**参数** +**Parameters** -- `config`: 配置文件(可选)。 -- `certificateKey`: 证书密钥(可选)。 +- `config`: Configuration file (optional). +- `certificateKey`: Certificate key (optional). -**示例** +**Examples** -使用默认参数生成 token: +Generate a token with default parameters: ```shell sealctl token ``` -使用自定义配置文件和证书密钥生成 token: +Generate a token with a custom configuration file and certificate key: ```shell sealctl token my-config my-certificate-key ``` - diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/app-cluster-image.md b/docs/4.0/docs/lifecycle-management/reference/sealos/app-cluster-image.md index ec858e07d4c..5f05248f881 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/app-cluster-image.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/app-cluster-image.md @@ -2,40 +2,38 @@ sidebar_position: 11 --- -# 应用集群镜像使用指南 +# Application Cluster Image Usage Guide -Sealos 提供了一个名为 [cluster-image](https://github.com/labring-actions/cluster-image) 的仓库,该仓库在 GitHub 上用于构建并发布 Kubernetes 集群的应用镜像。这些镜像可以通过提交代码到这个仓库来创建,并可以发布到 `docker.io/labring/` 作为官方的应用镜像。它支持构建 Docker 容器镜像以及应用的集群镜像。 +Sealos provides a repository called [cluster-image](https://github.com/labring-actions/cluster-image) on GitHub for building and publishing application images for Kubernetes clusters. These images can be created by submitting code to this repository and can be published to `docker.io/labring/` as official application images. It supports building Docker container images as well as cluster images for applications. -## 镜像的类型 +## Types of Images -仓库支持三种类型的镜像构建: +The repository supports three types of image builds: -- **APP集群镜像**:主要是构建应用镜像,使用 GitHub Action,会同时支持 amd64 和 arm64 架构。 -- **配置集群镜像**:主要是构建配置镜像,使用 GitHub Action,没有容器镜像不区分架构,一般是一些脚本相关的配置或者覆盖默认的配置镜像。 -- **Docker镜像**:主要是构建容器镜像,使用 GitHub Action,会同时支持 amd64 和 arm64 架构。 +- **Application Cluster Images**: These are primarily for building application images using GitHub Actions and support both amd64 and arm64 architectures. +- **Configuration Cluster Images**: These are mainly for building configuration images using GitHub Actions. They are not container images and are not architecture-specific. They typically contain configuration scripts or customizations to default configurations. +- **Docker Images**: These are mainly for building container images using GitHub Actions and support both amd64 and arm64 architectures. -## 镜像构建的工作流程 +## Workflow for Image Builds -你可以直接在 GitHub 仓库中创建 Issue 来触发镜像的构建。这里提供了几个示例可以参考: +You can trigger image builds directly in the GitHub repository by creating an issue. Here are a few examples: - `/imagebuild_dockerimages helm v3.8.2 Key1=Value1,Key2=Value2` - `/imagebuild_configs coredns v0.0.1` - `/imagebuild_apps helm v3.8.2` -每种类型的镜像构建命令的格式为 `/imagebuild_<类型> <应用名称> <版本> [Key=Value,...]`,其中 `<类型>` 是 `dockerimages`、`configs` 或 `apps`, `<应用名称>` 和 `<版本>` 分别代表应用的名称和版本,`[Key=Value,...]` 是可选的buildArg参数,仅用于 `dockerimages` 类型。 +The format of the image build commands for each type is `/imagebuild_ [Key=Value,...]`, where `` can be `dockerimages`, `configs`, or `apps`, `` and `` represent the application name and version respectively, and `[Key=Value,...]` is optional buildArg parameters used only for the `dockerimages` type. -## 镜像配置的存放位置 +## Location of Image Configurations -你可以在 `applications/<应用名称>/<版本>/` 目录下放置你的配置文件,包括 Dockerfile、Kubefile 和 init.sh 等。init.sh 脚本通常用于下载一些依赖的二进制文件,如 helm、kubectl-minio 等。你可以选择使用 Dockerfile 或 Kubefile 来编写你的镜像构建逻辑。 +You can place your configuration files in the `applications///` directory, including Dockerfiles, Kubefiles, and init.sh scripts, among others. The init.sh script is typically used for downloading dependencies such as Helm and kubectl-minio. You can choose to use either a Dockerfile or Kubefile to define your image build logic. -## 镜像构建规则 +## Image Build Rules -对于每种类型的镜像,构建规则略有不同。通常,你需要在应用的目录下创建不同的子目录并放置不同类型的文件,然后 Sealos 会根据这些文件来构建镜像。具体的规则如下: +The build rules vary slightly for each type of image. Generally, you need to create different subdirectories under the application directory and place different types of files in them, which Sealos will use to build the images. The specific rules are as follows: -1. `charts` 目录:放置一些集群镜像需要的 Helm chart,Kubernetes 会根据扫描的 chart 获取镜像并构建 - -出 registry 目录放到与 Kubefile 同级的目录。 -2. `manifests` 目录:直接放置一些 Kubernetes yaml 配置,Kubernetes 会扫描 manifests 目录所有的镜像并构建出 registry 目录放到与 Kubefile 同级的目录。 -3. `images/shim` 目录:主要存储一些额外的镜像列表并构建出 registry 目录放到与 Kubefile 同级的目录。 -4. 如果需要模板,在 `etc`、`charts`、`manifests` 放置一些以 `.tmpl` 结尾的文件可以被 `sealos run` 环境变量渲染后去掉 `.tmpl`,比如渲染之前是 `aa.yaml.tmpl`,渲染后为 `aa.yaml`。请注意文件名不要与现有的文件冲突。 -5. `registry` 必须放在与 Kubefile 同级的目录,否则无法拷贝到 master0 的私有仓库。制作镜像时也需要注意这一点。不要把 registry 存放到 chart 里,否则 helm 扫描可能会很慢,可能导致 OOM。 +1. `charts` directory: Place the Helm charts required for the cluster images. Kubernetes will scan the charts and fetch the images for building, and the registry directory will be placed at the same level as the Kubefile. +2. `manifests` directory: Place the Kubernetes yaml configurations directly. Kubernetes will scan all the images in the manifests directory and build the registry directory, which will be placed at the same level as the Kubefile. +3. `images/shim` directory: Store additional image lists and build the registry directory, which will be placed at the same level as the Kubefile. +4. If templates are required, place files with the `.tmpl` extension in `etc`, `charts`, or `manifests`. These files can be rendered by the `sealos run` command with environment variables and the `.tmpl` extension will be removed. For example, a file named `aa.yaml.tmpl` will be rendered as `aa.yaml`. Please ensure that the file names do not conflict with existing files. +5. The `registry` directory must be placed at the same level as the Kubefile. Otherwise, it will not be copied to the private repository of master0. Also, ensure that the registry is not stored in a chart, as it may cause slow scanning by Helm and potentially lead to OOM (out-of-memory) issues during image builds. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/add.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/add.md index f5f6e79bfc9..74bee99631c 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/add.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/add.md @@ -2,59 +2,59 @@ sidebar_position: 4 --- -# add 集群节点添加 +# Adding Cluster Nodes with `sealos add` -`sealos add` 是 Sealos 命令行工具中的一个命令,主要用于向集群中添加节点。本指南将详细介绍其使用方法和选项。 +`sealos add` is a command in the Sealos command-line tool used to add nodes to a cluster. This guide provides detailed instructions on how to use the command and its options. -**注意要保证控制节点的个数为奇数个以保证etcd可以正常选举** +**Note: Make sure the number of control nodes is odd to ensure proper etcd leader election.** -## 基本用法 +## Basic Usage -### 添加节点 +### Adding Nodes -要向集群中添加节点,可以使用 `--nodes` 选项: +To add nodes to the cluster, you can use the `--nodes` option: ```bash sealos add --nodes x.x.x.x ``` -在上述命令中,`x.x.x.x` 应替换为你想要添加的节点的 IP 地址。 +In the above command, replace `x.x.x.x` with the IP address of the node you want to add. -### 添加控制节点 +### Adding Control Nodes -要向集群中添加控制节点,可以使用 `--masters` 选项: +To add control nodes to the cluster, you can use the `--masters` option: ```bash sealos add --masters x.x.x.x ``` -### 同时添加控制节点和节点 +### Adding Control and Regular Nodes Together -如果你想同时向集群中添加控制节点和节点,可以同时使用 `--masters` 和 `--nodes` 选项: +If you want to add both control nodes and regular nodes to the cluster, you can use the `--masters` and `--nodes` options together: ```bash sealos add --masters x.x.x.x --nodes x.x.x.x sealos add --masters x.x.x.x-x.x.x.y --nodes x.x.x.x-x.x.x.y ``` -## 选项 +## Options -`sealos add` 命令提供了以下选项: +The `sealos add` command provides the following options: -- `--cluster='default'`: 要执行加入操作的集群的名称。默认为 `default`。 +- `--cluster='default'`: The name of the cluster to perform the add operation. Defaults to `default`. -- `--masters=''`: 要加入的主节点。 +- `--masters=''`: The control nodes to be added. -- `--nodes=''`: 要加入的节点。 +- `--nodes=''`: The nodes to be added. -每个选项后都可以跟随一个参数。 +Each option can be followed by an argument. -## 使用示例 +## Usage Example -以下是一个使用示例,该示例向集群中添加了 IP 地址为 `192.168.0.2` 的节点: +Here's an example usage that adds a node with the IP address `192.168.0.2` to the cluster: ```bash sealos add --nodes 192.168.0.2 ``` -以上就是 `sealos add` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's it for the usage guide of the `sealos add` command. We hope this helps you. If you have any questions or encounter any issues during the process, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/apply.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/apply.md index c0823db6be5..a9c3748c356 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/apply.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/apply.md @@ -2,19 +2,19 @@ sidebar_position: 1 --- -# apply 启动集群 +# Starting a Cluster with `sealos apply` -`sealos apply` 是 Sealos 命令行工具中的一个重要命令,用于在 Kubernetes 集群中运行集群镜像。本指南将详细介绍其使用方法和选项。 +`sealos apply` is an important command in the Sealos command-line tool used to run cluster images in a Kubernetes cluster. This guide provides detailed instructions on how to use the command and its options. -## 基本用法 +## Basic Usage -`sealos apply` 命令的基本用法如下: +The basic usage of the `sealos apply` command is as follows: ```shell $ sealos apply -f Clusterfile ``` -Clusterfile 内容: +Clusterfile content: ```yaml apiVersion: apps.sealos.io/v1beta1 @@ -22,7 +22,7 @@ kind: Cluster metadata: name: default spec: - # 服务器 IP 地址列表和角色 + # Server IP addresses and roles hosts: - ips: - 192.168.0.2:22 @@ -49,36 +49,37 @@ spec: user: root ``` -这条命令会根据指定的 `Clusterfile` 文件在 Kubernetes 集群中运行集群镜像。 +This command will run cluster images in the Kubernetes cluster based on the specified `Clusterfile`. -## 选项 -`sealos apply` 命令提供了多种选项,用于定制命令的行为: +## Options -- `-f, --Clusterfile='Clusterfile'`: 指定要应用的集群文件。默认为 `Clusterfile`。 -- `--config-file=[]`: 指定自定义Config文件的路径,用于替换或者修改资源。 -- `--env=[]`: 设置在命令执行过程中要使用的环境变量。 -- `--set=[]`: 在命令行上设置值,一般是替换模板的值。 -- `--values=[]`: 指定要应用到 `Clusterfile` 的values文件,一般是用于模板方式。 +The `sealos apply` command provides several options to customize its behavior: -每个选项后面都可以跟随一个或多个参数。多个参数之间用逗号分隔。 +- `-f, --Clusterfile='Clusterfile'`: Specifies the Clusterfile to apply. Defaults to `Clusterfile`. +- `--config-file=[]`: Specifies the path to a custom config file to replace or modify resources. +- `--env=[]`: Sets environment variables to be used during command execution. +- `--set=[]`: Sets values on the command line, usually for replacing template values. +- `--values=[]`: Specifies values files to be applied to the `Clusterfile`, usually used for templating. -例如,你可以使用 `--set` 选项在命令行上设置一些值: +Each option can be followed by one or more parameters. Multiple parameters are separated by commas. + +For example, you can use the `--set` option to set values on the command line: ```shell sealos apply -f Clusterfile --set key1=value1,key2=value2 ``` -这条命令会将 `key1` 和 `key2` 的值设置为 `value1` 和 `value2`,然后应用 `Clusterfile`。 +This command will set the values of `key1` and `key2` to `value1` and `value2`, and then apply the `Clusterfile`. -同样,你也可以使用 `--values` 选项指定一个值文件: +Similarly, you can use the `--values` option to specify a values file: ```shell sealos apply -f Clusterfile --values values.yaml ``` -这条命令会根据 `values.yaml` 文件中的值应用 `Clusterfile`。 +This command will apply the `Clusterfile` based on the values in the `values.yaml` file. -**更多示例请参考[启动镜像](https://docs.sealos.io/docs/lifecycle-management/operations/run-cluster/)** +**For more examples, please refer to the [Run Cluster](https://docs.sealos.io/docs/lifecycle-management/operations/run-cluster/) section.** -以上就是 `sealos apply` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's it for the usage guide of the `sealos apply` command. We hope this helps you. If you have any questions or encounter any issues during the process, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/build.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/build.md index 24ec5805e97..757ba15f5e2 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/build.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/build.md @@ -2,68 +2,69 @@ sidebar_position: 6 --- -# build 构建镜像 - -Sealos 的 `build` 命令用于使用 Sealfiles、Kubefiles、Dockerfiles 或 Containerfiles 中的指令构建 OCI 镜像。这是 Sealos 构建集群镜像的基础命令。 - -如果没有指定任何参数,Sealos 将使用当前工作目录作为构建上下文,并查找指令文件。如果不存在 Sealfile、Kubefile、Dockerfile 或 Containerfile,则构建失败。 - -下面是一些主要的 `build` 选项: - -1. `--all-platforms`:尝试为所有基础镜像平台构建镜像。 -2. `--authfile`:认证文件的路径。 -3. `--build-arg`:向构建器提供的 `argument=value`。 -4. `--build-context`:向构建器提供额外构建上下文的 `argument=value`。 -5. `--creds`:访问 registry 使用的 `[username[:password]]`。 -6. `-D, --disable-compression`:默认不压缩图层。 -7. `--env`:为镜像设置环境变量。 -8. `-f, --file`:Dockerfile 的 `pathname 或 URL`。 -9. `--force-rm`:即使构建不成功,也始终在构建后删除中间容器。 -10. `--format`:构建的镜像的清单和元数据的 `format`。 -11. `--from`:用于替换 Containerfile 中第一条 FROM 指令的值的镜像名称。 -12. `--http-proxy`:传递 HTTP Proxy 环境变量。 -13. `--isolation`:使用的进程隔离 `type`。可以是 'oci' 或 'chroot'。 -14. `--max-pull-procs`:拉取时使用的最大 goroutine 数量。 -15. `--platform`:设置镜像的 OS/ARCH/VARIANT 为提供的值,而不是主机的当前操作系统和架构。 -16. `--pull`:从 registry 拉取镜像,如果新的或存储中不存在,则拉取,如果 false,只有在不存在时才拉取镜像,如果 always,即使命名的镜像存在于存储中,也拉取镜像,如果 never,只使用存储中可用的镜像。 -17. `-q, --quiet`:克制不宣布构建指令和镜像读/写进度。 -18. `--retry`:在执行 push/pull 失败时重试的次数。 -19. `--retry-delay`:在 push/pull 失败时重试的延迟。 -20. `--rm`:在成功构建后删除中间容器。 -21. `--save-image`:保存从特定目录解析的镜像,以 registry 格式存储。 -22. `--sign-by`:使用指定 `FINGERPRINT` 的 GPG 密钥签名镜像。 -23. `-t, --tag`:应用到构建镜像的标签 `name`。 - -24. `--target`:设置要构建的目标构建阶段。 -25. `--timestamp`:将创建的时间戳设置为指定的 epoch 秒,以允许确定性构建,默认为当前时间。 - -这些选项可以灵活地应对多种构建需求,包括针对特定平台的构建、环境变量设置、构建上下文管理、镜像签名等。使用 `--save-image` 选项,Sealos 可以自动识别镜像列表(包括从镜像列表、Helm charts、manifests 中解析出的镜像)并保存为 registry 格式。 - -进程隔离模式 `--isolation` 支持 'oci' 和 'chroot' 两个参数。如果本地支持 OCI,可以选择 'oci' 模式;如果不支持 OCI,应该使用 'chroot' 模式。 - -`--save-image` 是 Sealos 构建命令的一个选项,这个选项的作用是在构建过程中自动查找并保存需要的镜像。在 Sealos 中,构建一个镜像可能涉及到其他依赖镜像。这些依赖镜像可能来自镜像列表、Helm charts 或 集群 manifests。当使用 `--save-image` 选项时,Sealos 将根据构建上下文,自动解析这些依赖并将其保存为 Docker Registry 格式。 - -例如,以下是一个使用 `--save-image` 选项的示例: +# Building Images with `sealos build` + +The `build` command in Sealos is used to build OCI images using instructions from Sealfiles, Kubefiles, Dockerfiles, or Containerfiles. This is the fundamental command in Sealos for building cluster images. + +If no parameters are specified, Sealos will use the current working directory as the build context and look for instruction files. If no Sealfile, Kubefile, Dockerfile, or Containerfile is found, the build will fail. + +Here are some key options for the `build` command: + +1. `--all-platforms`: Attempts to build the image for all supported base image platforms. +2. `--authfile`: Path to the authentication file. +3. `--build-arg`: Provides an `argument=value` to the builder. +4. `--build-context`: Provides additional build context to the builder as `argument=value`. +5. `--creds`: Credentials to access the registry as `[username[:password]]`. +6. `-D, --disable-compression`: Disables layer compression by default. +7. `--env`: Sets environment variables for the image. +8. `-f, --file`: Pathname or URL of the Dockerfile. +9. `--force-rm`: Always removes intermediate containers after a build, even if the build fails. +10. `--format`: Format for the manifest and metadata of the built image. +11. `--from`: Replaces the value of the first FROM instruction in the Containerfile with the specified image name. +12. `--http-proxy`: Passes the HTTP Proxy environment variable. +13. `--isolation`: Process isolation `type` to use, can be 'oci' or 'chroot'. +14. `--max-pull-procs`: Maximum number of goroutines to use for pulling images. +15. `--platform`: Sets the OS/ARCH/VARIANT for the image to the provided value instead of the host's current operating system and architecture. +16. `--pull`: Pulls the image from the registry, if new or not present in the store. Can be set to false, always, or never. +17. `-q, --quiet`: Suppresses the build output and image read/write progress. +18. `--retry`: Number of times to retry on push/pull failure. +19. `--retry-delay`: Delay in seconds between retries on push/pull failure. +20. `--rm`: Removes intermediate containers after a successful build. +21. `--save-image`: Saves resolved images from a specific directory in the registry format. +22. `--sign-by`: Signs the image with the GPG key of the specified `FINGERPRINT`. +23. `-t, --tag`: Name and optionally a tag in the 'name:tag' format to apply to the built image. +24. `--target`: Sets the target build stage to build. +25. `--timestamp`: Sets the created timestamp to the specified epoch seconds for reproducible builds. Default is the current time. + +These options provide flexibility for various build requirements, including platform-specific builds, environment variable settings, build context management, image signing, and more. With the `--save-image` option, Sealos can automatically recognize and save the required images (including those resolved from image lists, Helm charts, and manifests) in the Docker Registry format. + +The process isolation mode `--isolation` supports two parameters: 'oci' and 'chroot'. Choose 'oci' mode if OCI is supported locally and 'chroot' mode if OCI is not supported. + +The `--save-image` option is used in Sealos build commands to automatically find and save the required images during the build process. In Sealos, building an image may involve other dependent images. These dependent + +images can come from image lists, Helm charts, or cluster manifests. When using the `--save-image` option, Sealos will automatically resolve these dependencies based on the build context and save them in the Docker Registry format. + +For example, here is an example using the `--save-image` option: ```bash sealos build -t myapp:v1.0.0 -f Dockerfile . ``` -在这个示例中,Sealos 将使用当前目录作为构建上下文,从 Dockerfile 文件中读取构建指令,并尝试构建出一个标记为 `myapp:v1.0.0` 的镜像。同时,Sealos 将解析 Dockerfile 文件中所有 `FROM` 指令引用的基础镜像,并将这些镜像保存下来。这些镜像将以 Docker Registry 的格式保存,可以被直接推送到 Docker Registry 中。 +In this example, Sealos will use the current directory as the build context, read the build instructions from the Dockerfile, and attempt to build an image tagged as `myapp:v1.0.0`. Additionally, Sealos will resolve all base images referenced in the Dockerfile's `FROM` instructions and save those images as well. These images will be saved in the Docker Registry format and can be pushed directly to a Docker Registry. -如果你的构建上下文中还包含了 Helm charts 或 集群manifests,Sealos 也会解析这些文件中引用的镜像,并将这些镜像一并保存。 +If your build context also includes Helm charts or cluster manifests, Sealos will also resolve the images referenced in those files and save them accordingly. -总的来说,`--save-image` 选项为 Sealos 的构建过程提供了一种自动处理依赖镜像的方式,大大提高了构建镜像的便捷性和效率。 +Overall, the `--save-image` option provides a convenient way for Sealos to handle image dependencies during the build process, greatly improving the convenience and efficiency of building images. -下面有一些详细的示例: +Here are some detailed examples: -- [基于镜像列表构建](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-image_list) -- [基于部署清单构建](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-manifests) -- [基于helm-charts构建](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-helm_charts) -- [基于二进制构建](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-binary) -- [基于go-template构建](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-go_template) -- [基于exec和scp构建](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-scp_exec) +- [Build with Image List](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-image_list) +- [Build with Manifests](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-manifests) +- [Build with Helm Charts](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-helm_charts) +- [Build with Binary](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-binary) +- [Build with go-template](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-go_template) +- [Build with exec and scp](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-image-scp_exec) -通过 Sealos `build` 命令,可以基于多种指令文件构建 OCI 镜像,为sealos提供所需的镜像。这个过程包括处理 Dockerfile 或其他指令文件中的各种指令,如 `FROM`、`RUN`、`ADD` 等,以及处理镜像层次、镜像标签等。构建过程也包括拉取基础镜像、运行命令、保存结果等步骤。每一个步骤都可以通过上述的选项进行详细的控制和定制,以满足不同的构建需求。 +With the `build` command in Sealos, you can build OCI images based on various instruction files to provide the required images for Sealos. This process includes handling various instructions in Dockerfiles or other instruction files, such as `FROM`, `RUN`, `ADD`, etc., as well as managing image layers, labels, and more. The build process also involves pulling base images, running commands, saving the results, and more. Each step can be finely controlled and customized using the options mentioned above to accommodate different build requirements. -以上就是 `sealos build` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos build` command. We hope this helps you. If you have any questions or encounter any issues during the process, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/cert.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/cert.md index c41a88581f6..8a595e99bd4 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/cert.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/cert.md @@ -2,43 +2,43 @@ sidebar_position: 3 --- -# cert 更新集群证书 +# Updating Cluster Certificates with `sealos cert` -`sealos cert` 是 Sealos 命令行工具中的一个命令,主要用于在集群中更新 API 服务器的证书。本指南将详细介绍其使用方法和选项。 +The `cert` command in Sealos is used to update the API server certificates in a cluster. This guide provides detailed instructions on how to use this command and its options. -## 基本用法 +## Basic Usage -要在证书中添加域名或 IP,可以使用 `--alt-names` 选项: +To add domain names or IP addresses to the certificate, you can use the `--alt-names` option: ```bash sealos cert --alt-names sealos.io,10.103.97.2,127.0.0.1,localhost ``` -在上述命令中,`sealos.io,10.103.97.2,127.0.0.1,localhost` 应替换为你想要添加的域名和 IP 地址。 +In the above command, replace `sealos.io,10.103.97.2,127.0.0.1,localhost` with the domain names and IP addresses you want to add. -**注意**:在执行此操作之前,你最好先备份旧的证书。 +**Note**: It is recommended to back up the old certificates before performing this operation. -执行 `sealos cert` 命令后,会更新集群 API 服务器的证书,你无需手动重启 API 服务器,sealos会自动帮你重启服务。 +After executing the `sealos cert` command, the API server certificates in the cluster will be updated. You don't need to manually restart the API server as Sealos will automatically handle the restart. -## 选项 +## Options -`sealos cert` 命令提供了以下选项: +The `cert` command provides the following options: -- `--alt-names=''`: 在证书中添加域名或 IP,例如 `sealos.io` 或 `10.103.97.2`。 +- `--alt-names='`': Adds domain names or IP addresses to the certificate, e.g., `sealos.io` or `10.103.97.2`. -- `-c, --cluster='default'`: 要执行 exec 操作的集群的名称。默认为 `default`。 +- `-c, --cluster='default'`: Specifies the name of the cluster on which to perform the exec operation. Default is `default`. -每个选项后都可以跟随一个参数。 +Each option can be followed by an argument. -## 校验证书 +## Certificate Verification -更新证书后,你可以使用以下命令进行校验: +After updating the certificates, you can use the following commands for verification: ```bash kubectl -n kube-system get cm kubeadm-config -o yaml openssl x509 -in /etc/kubernetes/pki/apiserver.crt -text ``` -上述命令将获取 kube-system 命名空间中的 kubeadm-config 配置映射,并显示 apiserver.crt 证书的详细信息。 +The above commands retrieve the kubeadm-config ConfigMap in the kube-system namespace and display detailed information about the apiserver.crt certificate. -以上就是 `sealos cert` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That concludes the usage guide for the `sealos cert` command. We hope this helps you. If you have any questions or encounter any issues during the process, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/commands.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/commands.md index 49b046ee20e..c713ccafafa 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/commands.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/commands.md @@ -2,55 +2,55 @@ sidebar_position: 0 --- -# Sealos 命令说明 +# Sealos Command Reference -## 集群管理命令 +## Cluster Management Commands -- `apply`:使用 Clusterfile 在 Kubernetes 集群内运行集群镜像。 -- `cert`:更新 Kubernetes API 服务器的证书。 -- `run`:轻松运行云原生应用。 -- `reset`:重置集群中的所有内容。 -- `status`:查看 Sealos集群 的状态。 +- `apply`: Runs cluster images within a Kubernetes cluster using Clusterfile. +- `cert`: Updates the certificates of the Kubernetes API server. +- `run`: Easily runs cloud-native applications. +- `reset`: Resets all content in the cluster. +- `status`: Views the status of the Sealos cluster. -## 节点管理命令 +## Node Management Commands -- `add`:将节点添加到集群中。 -- `delete`:从集群中删除节点。 +- `add`: Adds nodes to the cluster. +- `delete`: Removes nodes from the cluster. -## 远程操作命令 +## Remote Operation Commands -- `exec`:在指定节点上执行 shell 命令或脚本。 -- `scp`:将文件复制到指定节点的远程位置。 +- `exec`: Executes shell commands or scripts on the specified node. +- `scp`: Copies files to the remote location of the specified node. -## 实验性命令 +## Experimental Commands -- `registry`:与镜像仓库相关的命令。 +- `registry`: Commands related to the image registry. -## 容器和镜像命令 +## Container and Image Commands -- `build`:使用 Sealfile 或 Kubefile 中的指令构建镜像。 -- `create`:创建集群,但不运行 CMD,用于检查镜像。 -- `inspect`:检查容器或镜像的配置。 -- `images`:列出本地存储中的镜像。 -- `load`:从文件中加载镜像。 -- `login`:登录到容器仓库。 -- `logout`:登出容器仓库。 -- `manifest`:操作清单列表和镜像索引。 -- `merge`:合并多个镜像为一个。 -- `pull`:从指定位置拉取镜像。 -- `push`:将镜像推送到指定的目标。 -- `rmi`:从本地存储中删除一个或多个镜像。 -- `save`:将镜像保存到存档文件中。 -- `tag`:为本地镜像添加一个附加名称。 +- `build`: Builds images using instructions from Sealfile or Kubefile. +- `create`: Creates a cluster but does not run CMD, used for image inspection. +- `inspect`: Inspects the configuration of containers or images. +- `images`: Lists images in local storage. +- `load`: Loads images from a file. +- `login`: Logs into a container registry. +- `logout`: Logs out of a container registry. +- `manifest`: Operates on manifest lists and image indexes. +- `merge`: Merges multiple images into one. +- `pull`: Pulls images from a specified location. +- `push`: Pushes images to the specified destination. +- `rmi`: Removes one or more images from local storage. +- `save`: Saves images to an archive file. +- `tag`: Adds an additional name to a local image. -## 其他命令 +## Other Commands -- `completion`:为指定的 shell 生成自动补全脚本。 -- `docs`:生成 API 参考。 -- `env`:打印 Sealos 使用的所有环境信息。 -- `gen`:生成具有所有默认设置的 Clusterfile。 -- `version`:打印版本信息。 +- `completion`: Generates autocompletion scripts for the specified shell. +- `docs`: Generates API reference documentation. +- `env`: Prints all environment information used by Sealos. +- `gen`: Generates a Clusterfile with all default settings. +- `version`: Prints version information. -Sealos 的 `--debug` 参数是一个全局参数,用于开启调试模式,以便在出现问题时能更详细地了解系统的运行情况。 +The `--debug` flag in Sealos is a global flag used to enable debug mode for more detailed information about the system's operation when issues occur. -有关安装说明,请参见[安装 sealos](https://docs.sealos.io/docs/lifecycle-management/quick-start/installation); 如需快速指南,请参见[快速开始](https://docs.sealos.io/docs/lifecycle-management/quick-start/)。 +For installation instructions, please refer to the [Sealos Installation Guide](https://docs.sealos.io/docs/lifecycle-management/quick-start/installation); for a quick start guide, please refer to the [Quick Start Guide](https://docs.sealos.io/docs/lifecycle-management/quick-start/). diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/create.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/create.md index 6715f9d5ae9..c35fbc50e7c 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/create.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/create.md @@ -2,40 +2,40 @@ sidebar_position: 6 --- -# create 创建工作目录 +# Create Working Directory -`sealos create` 是 Sealos 命令行工具中的一个命令,主要用于在不执行 CMD 的情况下创建集群工作目录,以便审查镜像。本指南将详细介绍其使用方法和选项。 +`sealos create` is a command in the Sealos command line tool, mainly used for creating the cluster working directory without executing the CMD, so as to review the image. This guide will detail its usage and options. -## 基本用法 +## Basic Usage -`sealos create` 命令用于创建集群工作目录,但不实际运行,主要用于调试或测试,它可以输出集群镜像的地址,你可以校验集群镜像内容是否与预期一致。 +The `sealos create` command is used to create a cluster working directory but does not actually run, mainly used for debugging or testing. It can output the address of the cluster image, you can check whether the content of the cluster image is consistent with the expectation. ```bash sealos create docker.io/labring/kubernetes:v1.24.0 ``` -在上述命令中,`clustername` 代表你要创建的集群的名称。 +In the above command, `clustername` represents the name of the cluster you want to create. -## 选项 +## Options -`sealos create` 命令提供了以下选项: +The `sealos create` command provides the following options: -- `-c, --cluster='default'`: 要创建但不实际运行的集群的名称。默认为 `default`。 +- `-c, --cluster='default'`: The name of the cluster to be created but not actually run. The default is `default`. -- `--platform='linux/arm64/v8'`: 将镜像的操作系统/架构/版本设置为提供的值,而不是主机的当前操作系统和架构(例如 `linux/arm`)。 +- `--platform='linux/arm64/v8'`: Set the operating system/architecture/version of the image to the provided value, rather than the current operating system and architecture of the host (for example, `linux/arm`). -- `--short=false`: 如果为真,只打印挂载路径。 +- `--short=false`: If true, only print the mount path. -每个选项后都可以跟随一个参数。 +Each option can be followed by an argument. -## 示例 +## Example -例如,你可以使用以下命令创建一个名为 `mycluster` 的集群,但不实际运行它: +For example, you can use the following command to create a cluster named `mycluster`, but do not actually run it: ```bash sealos create docker.io/labring/kubernetes:v1.24.0 ``` -此命令将创建一个镜像名称为 `docker.io/labring/kubernetes:v1.24.0` 的集群工作目录,并输出集群镜像的地址,但不会实际运行集群竟。 +This command will create a cluster working directory with an image name of `docker.io/labring/kubernetes:v1.24.0` and output the address of the cluster image, but the cluster will not actually run. -以上就是 `sealos create` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +The above is the usage guide for the `sealos create` command, hope it helps. If you encounter any problems during use, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/delete.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/delete.md index 6072f79d58a..6750281c9c5 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/delete.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/delete.md @@ -2,67 +2,67 @@ sidebar_position: 4 --- -# delete 集群节点删除 +# Delete Cluster Node Removal -`sealos delete` 是 Sealos 命令行工具中的一个命令,主要用于从集群中移除节点。本指南将详细介绍其使用方法和选项。 +`sealos delete` is a command in the Sealos command line tool, mainly used to remove nodes from the cluster. This guide will detail its usage and options. -**注意要保证控制节点的个数为奇数个以保证etcd可以正常选举** +**Note to ensure the number of control nodes is odd to ensure normal election of etcd** -## 基本用法 +## Basic Usage -### 删除节点 +### Delete Node -要从集群中删除节点,可以使用 `--nodes` 选项: +To remove a node from the cluster, you can use the `--nodes` option: ```bash sealos delete --nodes x.x.x.x ``` -在上述命令中,`x.x.x.x` 应替换为你想要删除的节点的 IP 地址。如果不小心删除了错误的节点,可以使用 `sealos add` 命令恢复它: +In the above command, `x.x.x.x` should be replaced with the IP address of the node you want to delete. If you accidentally delete the wrong node, you can use the `sealos add` command to recover it: ```bash sealos add --nodes x.x.x.x ``` -### 删除控制节点 +### Delete Control Node -要从集群中删除控制节点,可以使用 `--masters` 选项: +To remove a control node from the cluster, you can use the `--masters` option: ```bash sealos delete --masters x.x.x.x ``` -请注意,如果指定了 `--masters` 参数,sealos 将删除你的控制节点。 +Please note, if the `--masters` parameter is specified, sealos will delete your control node. -### 删除控制节点和节点 +### Delete Control Node and Node -如果你想同时删除控制节点和节点,可以同时使用 `--masters` 和 `--nodes` 选项: +If you want to delete both control nodes and nodes at the same time, you can use the `--masters` and `--nodes` options at the same time: ```bash sealos delete --masters x.x.x.x --nodes x.x.x.x sealos delete --masters x.x.x.x-x.x.x.y --nodes x.x.x.x-x.x.x.y ``` -## 选项 +## Options -`sealos delete` 命令提供了以下选项: +The `sealos delete` command provides the following options: -- `--cluster='default'`: 执行删除操作应用的集群的名称。默认为 `default`。 +- `--cluster='default'`: The name of the cluster to which the deletion operation applies. The default is `default`. -- `--force=false`: 可以输入一个 `--force` 标志以强制删除节点。 +- `--force=false`: You can enter a `--force` flag to force delete nodes. -- `--masters=''`: 要移除的控制节点。 +- `--masters=''`: The control nodes to be removed. -- `--nodes=''`: 要移除的节点。 +- `--nodes=''`: The nodes to be removed. -每个选项后都可以跟随一个参数。 +Each option can be followed by an argument. -## 使用示例 +## Usage Example -以下是一个使用示例,该示例删除了 IP 地址为 `192.168.0.2` 的节点: +Here is a usage example that deletes a node with the IP address of `192.168.0.2`: ```bash sealos delete --nodes 192.168.0.2 ``` -以上就是 `sealos delete` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +The above is the usage guide for the `sealos delete` command, hope it helps. If you encounter any problems during use, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/env.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/env.md index 89ea851ea94..4331432abf1 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/env.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/env.md @@ -2,30 +2,30 @@ sidebar_position: 7 --- -# env 环境变量 +# Environment Variables -`sealos env` 是 Sealos 命令行工具中的一个命令,用于展示目前sealos支持的环境变量以及当前的环境变量值。 +`sealos env` is a command in the Sealos command-line tool, used to display the current environment variables supported by sealos and their current values. -## 基本用法 +## Basic Usage -### 查看环境变量 +### Viewing Environment Variables -要查看环境变量,可以使用 `sealos env` 命令: +To view the environment variables, you can use the `sealos env` command: ```bash sealos env ``` -### 查看环境变量以及说明 +### Viewing Environment Variables and Descriptions -要查看环境变量以及说明,可以使用 `sealos env -v` 命令: +To view the environment variables and their descriptions, you can use the `sealos env -v` command: ```bash sealos env -v ``` -## 如何设置环境变量 +## How to Set Environment Variables ```shell BUILDAH_LOG_LEVEL=debug sealos images @@ -36,4 +36,4 @@ SEALOS_REGISTRY_SYNC_EXPERIMENTAL=true sealos build -t xxx . ``` -以上就是 `sealos env` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos env` command, and we hope it has been helpful. If you encounter any problems during usage, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/exec.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/exec.md index 7b0f955021f..f7ce53e19ff 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/exec.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/exec.md @@ -2,50 +2,50 @@ sidebar_position: 5 --- -# exec 执行命令 +# Execute Command -`sealos exec` 是 Sealos 命令行工具中的一个命令,用于在指定的集群节点上执行 Shell 命令或脚本。本指南将详细介绍其使用方法和选项。 +`sealos exec` is a command in the Sealos command-line tool, used to execute Shell commands or scripts on specified cluster nodes. This guide will detail its usage and options. -## 基本用法 +## Basic Usage -基本的 `sealos exec` 命令格式如下: +The basic `sealos exec` command format is as follows: ```bash sealos exec "shell command or script" ``` -在上述命令中,`shell command or script` 是你要在集群节点上执行的 Shell 命令或脚本。 +In the above command, `shell command or script` is the Shell command or script you want to execute on the cluster nodes. -## 选项 +## Options -`sealos exec` 命令提供了以下选项: +The `sealos exec` command provides the following options: -- `-c, --cluster='default'`: 要在其上执行命令的集群的名称。默认为 `default`。 +- `-c, --cluster='default'`: The name of the cluster on which the command will be executed. The default is `default`. -- `--ips=[]`: 在具有指定 IP 地址的节点上运行命令。 +- `--ips=[]`: Run commands on nodes with specified IP addresses. -- `-r, --roles='':`: 在具有指定角色的节点上运行命令。目前支持 master,node,registry +- `-r, --roles='':` Run commands on nodes with specified roles. Currently supports master,node,registry. -每个选项后都可以跟随一个或多个参数。 +Each option can be followed by one or more parameters. -## 示例 +## Examples -例如,你可以使用以下命令在默认集群的所有节点上查看 `/etc/hosts` 文件的内容: +For example, you can use the following command to view the contents of the `/etc/hosts` file on all nodes of the default cluster: ```bash sealos exec "cat /etc/hosts" ``` -如果你想在名为 `my-cluster` 的集群的 `master` 和 `node` 角色的节点上查看 `/etc/hosts` 文件的内容,可以使用以下命令: +If you want to view the contents of the `/etc/hosts` file on nodes with `master` and `node` roles in a cluster named `my-cluster`, you can use the following command: ```bash sealos exec -c my-cluster -r master,node "cat /etc/hosts" ``` -如果你只想在 IP 地址为 `172.16.1.38` 的节点上查看 `/etc/hosts` 文件的内容,可以使用以下命令: +If you only want to view the contents of the `/etc/hosts` file on a node with the IP address `172.16.1.38`, you can use the following command: ```bash sealos exec -c my-cluster --ips 172.16.1.38 "cat /etc/hosts" ``` -以上就是 `sealos exec` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos exec` command, and we hope it has been helpful. If you encounter any problems during usage, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/gen.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/gen.md index e89ff357b3e..75429af04ff 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/gen.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/gen.md @@ -2,19 +2,19 @@ sidebar_position: 3 --- -# gen 生成集群配置 +# Generate Cluster Configuration -Sealos 的 `gen` 命令是用于生成 Kubernetes 集群的配置文件(Clusterfile),这个配置文件可以在之后通过 `sealos apply` 命令来应用。`gen` 命令可以帮助用户快速生成一个基本的配置文件,用户可以在此基础上根据自己的需求进行修改和调整。 +Sealos' `gen` command is used to generate a Kubernetes cluster configuration file (Clusterfile), which can then be applied using the `sealos apply` command. The `gen` command can help users quickly generate a basic configuration file, which can then be modified and adjusted according to their needs. -下面是 `sealos gen` 命令的基本使用方法和一些常见的示例: +Here are the basic usage of `sealos gen` command and some common examples: + +1. Generate a single-node cluster with default configuration: -1. 生成一个默认配置的单节点集群: - ```bash sealos gen labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 ``` -2. 生成一个包含多个镜像、指定了主节点和工作节点的集群: +2. Generate a cluster that includes multiple images and specifies the master and worker nodes: ```bash sealos gen labring/kubernetes:v1.25.0 labring/helm:v3.8.2 labring/calico:v3.24.1 \ @@ -22,24 +22,24 @@ Sealos 的 `gen` 命令是用于生成 Kubernetes 集群的配置文件(Cluste --nodes 192.168.0.5,192.168.0.6,192.168.0.7 --passwd 'xxx' ``` -3. 指定 SSH 端口,对于所有服务器使用相同的 SSH 端口: +3. Specify SSH port, for servers using the same SSH port: ```bash sealos gen labring/kubernetes:v1.24.0 --masters 192.168.0.2,192.168.0.3,192.168.0.4 \ --nodes 192.168.0.5,192.168.0.6,192.168.0.7 --port 24 --passwd 'xxx' ``` - 对于使用不同 SSH 端口的服务器: + For servers using different SSH ports: ```bash sealos gen labring/kubernetes:v1.24.0 --masters 192.168.0.2,192.168.0.3:23,192.168.0.4:24 \ --nodes 192.168.0.5:25,192.168.0.6:25,192.168.0.7:27 --passwd 'xxx' ``` -在生成了 Clusterfile 之后,用户可以根据自己的需求来修改这个文件。添加或修改环境变量;修改集群cidr配置。完成修改后,用户就可以通过 `sealos apply` 命令来根据这个配置文件来创建或更新集群了。 +After the Clusterfile is generated, users can modify this file according to their needs. Add or modify environment variables; modify the cluster cidr configuration. Once the modifications are done, users can use the `sealos apply` command to create or update the cluster based on this configuration file. -示例说明: +Example explanations: -- [自定义配置安装](https://docs.sealos.io/docs/lifecycle-management/operations/run-cluster/gen-apply-cluster) +- [Custom Configuration Installation](https://docs.sealos.io/docs/lifecycle-management/operations/run-cluster/gen-apply-cluster) -以上就是 `sealos gen` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos gen` command, and we hope it has been helpful. If you encounter any problems during usage, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/images.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/images.md index ad080890832..c3d79a4d6f4 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/images.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/images.md @@ -2,64 +2,64 @@ sidebar_position: 6 --- -# image 镜像列表 +# Image List -Sealos 的 `images` 命令主要用于查看本地存储的镜像。用户可以通过它来查看本地所有的镜像,或者筛选查看特定的镜像。该命令支持多种参数,可以帮助用户更方便的查看和管理镜像。 +Sealos' `images` command is primarily used to view locally stored images. Users can use it to view all local images or to filter and view specific images. The command supports various parameters to help users view and manage images more conveniently. -## 基本用法 +## Basic Usage -基本的 `sealos images` 命令将显示所有非中间阶段的本地镜像,例如: +The basic `sealos images` command will display all non-intermediate stage local images, for example: ```bash sealos images ``` -这将显示本地存储的所有最终阶段镜像。 +This will display all final stage images stored locally. -## 示例 +## Examples -以下是 `sealos images` 命令的一些常见示例: +Here are some common examples of the `sealos images` command: -1. 显示所有镜像,包括构建的中间镜像: +1. Display all images, including intermediate images built: ```bash sealos images --all ``` -2. 显示特定镜像: +2. Display a specific image: ```bash sealos images [imageName] ``` -3. 以指定的 Go 模板格式显示镜像: +3. Display images in a specified Go template format: ```bash sealos images --format '{{.ID}} {{.Name}} {{.Size}} {{.CreatedAtRaw}}' ``` -## 参数 +## Parameters -以下是 `sealos images` 命令的一些常用参数: +Here are some common parameters for the `sealos images` command: -- `-a, --all`:显示所有镜像,包括构建过程中的中间镜像。 +- `-a, --all`: Display all images, including intermediate images built. -- `--digests`:显示镜像的摘要。 +- `--digests`: Display the digests of images. -- `-f, --filter`:根据提供的条件过滤输出结果。 +- `-f, --filter`: Filter output based on provided conditions. -- `--format`:使用 Go 模板对镜像进行美化打印。 +- `--format`: Beautify the images printout using a Go template. -- `--history`:显示镜像的命名历史。 +- `--history`: Display the naming history of images. -- `--json`:以 JSON 格式输出。 +- `--json`: Output in JSON format. -- `--no-trunc`:不截断输出。 +- `--no-trunc`: Do not truncate the output. -- `-n, --noheading`:不打印列标题。 +- `-n, --noheading`: Do not print column headings. -- `-q, --quiet`:只显示镜像 ID。 +- `-q, --quiet`: Only display image IDs. -通过组合使用这些参数,用户可以轻松地获取和管理本地存储的镜像。例如,使用 `--all` 参数可以查看所有镜像,包括中间镜像;使用 `--filter` 参数可以根据特定条件过滤镜像;使用 `--json` 参数可以以 JSON 格式输出镜像信息,方便进行程序化处理等。 +By combining these parameters, users can easily retrieve and manage locally stored images. For example, using the `--all` parameter displays all images, including intermediate ones; using the `--filter` parameter filters images based on specific conditions; using the `--json` parameter outputs image information in JSON format, facilitating programmatic processing, etc. -以上就是 `sealos images` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos images` command, and we hope it has been helpful. If you encounter any problems during usage, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/inspect.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/inspect.md index bed4b134332..7ff8dfff3e8 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/inspect.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/inspect.md @@ -2,78 +2,78 @@ sidebar_position: 6 --- -# inspect 详细信息 +# Inspect Details -Sealos 的 `inspect` 命令主要用于查看构建容器或已构建镜像的配置信息。该命令支持查看镜像或容器的详细信息,包括其元数据、环境变量、启动命令等。 +Sealos' `inspect` command is primarily used to view the configuration information of build containers or built images. The command supports viewing detailed information about an image or container, including its metadata, environment variables, startup commands, etc. -## 基本用法 +## Basic Usage -使用 `sealos inspect` 命令查看指定容器或镜像的配置信息。例如,查看指定容器的配置: +Use the `sealos inspect` command to view the configuration information of a specified container or image. For example, to view the configuration of a specified container: ```bash sealos inspect containerID ``` -或者查看指定镜像的配置: +Or to view the configuration of a specified image: ```bash sealos inspect --type image imageWithTag ``` -## 示例 +## Examples -以下是 `sealos inspect` 命令的一些常见示例: +Here are some common examples of the `sealos inspect` command: -1. 查看容器配置: +1. View container configuration: ```bash sealos inspect containerID ``` -2. 查看镜像配置: +2. View image configuration: ```bash sealos inspect --type image imageWithTag ``` - -3. 查看镜像ID的配置信息: + +3. View configuration information of an image ID: ```bash - sealos inspect --type image @imageID # 或直接输入imageID, '@' 是可选的 + sealos inspect --type image @imageID # Or just input the imageID, '@' is optional ``` -4. 查看远程镜像仓库的配置信息: +4. View configuration information of a remote image repository: ```bash sealos inspect --type image docker://alpine:latest ``` - -5. 查看本地OCI归档文件中镜像的配置信息: + +5. View configuration information of an image in a local OCI archive file: ```bash sealos inspect --type image oci-archive:/abs/path/of/oci/tarfile.tar ``` -6. 查看本地Docker归档文件中镜像的配置信息: +6. View configuration information of an image in a local Docker archive file: ```bash sealos inspect --type image docker-archive:/abs/path/of/docker/tarfile.tar ``` -7. 使用 Go 模板格式显示镜像环境变量: +7. Display image environment variables in Go template format: ```bash sealos inspect --format '{{.OCIv1.Config.Env}}' alpine ``` -## 参数 +## Parameters -以下是 `sealos inspect` 命令的一些常用参数: +Here are some common parameters for the `sealos inspect` command: -- `-f, --format`:使用 Go 模板格式显示输出结果。**模板结构代码[InspectOutput](https://github.com/labring/sealos/blob/f8a17787822714c5fdf21f2a75cc86fadb88adfa/pkg/buildah/inspect.go#L189)** +- `-f, --format`: Display output results in Go template format. **Template structure code [InspectOutput](https://github.com/labring/sealos/blob/f8a17787822714c5fdf21f2a75cc86fadb88adfa/pkg/buildah/inspect.go#L189)** -- `-t, --type`:指定查看的类型,可以是容器(`container`)或镜像(`image`)。 +- `-t, --type`: Specify the type to view, which can be a container (`container`) or an image (`image`). -根据你的需要,你可以结合使用这些参数,以获取特定的配置信息。例如,使用 `-t` 参数可以指定你想要查看的是容器的配置信息还是镜像的配置信息;使用 `-f` 参数,可以定义特定的输出格式,方便对输出结果进行处理或解析。 +Depending on your needs, you can combine these parameters to get specific configuration information. For example, using the `-t` parameter can specify whether you want to view the configuration information of the container or the image; using the `-f` parameter, you can define a specific output format, which is convenient for processing or parsing the output results. -以上就是 `sealos inspect` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos inspect` command, and we hope it has been helpful. If you encounter any problems during usage, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/load.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/load.md index 84900f826af..1e1b6441d40 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/load.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/load.md @@ -2,30 +2,30 @@ sidebar_position: 6 --- -# load 加载镜像 +# Load Image -`sealos load` 是一个用来从存档文件中加载镜像的命令。这对于需要从已有的存档文件中导入镜像非常有用,尤其是在没有网络连接的环境中。 +`sealos load` is a command used to load images from archive files. This is very useful when you need to import images from existing archive files, especially in environments without a network connection. -## 用法: +## Usage: `sealos load [flags] [options]` -## 参数: +## Parameters: -以下是 `sealos load` 命令的参数: +Here are the parameters for the `sealos load` command: -- `-i, --input=''`: 从 tar 存档文件中加载镜像。 +- `-i, --input=''`: Load image from a tar archive file. -- `--platform=[linux/arm64/v8]`: 选择镜像时,优先使用指定的 OS/ARCH,而不是当前操作系统和架构。 +- `--platform=[linux/arm64/v8]`: When selecting an image, prioritize the specified OS/ARCH instead of the current operating system and architecture. -- `-t, --transport='oci-archive'`: 从 tar 存档文件中加载镜像传输。可用选项有 oci-archive,docker-archive。 +- `-t, --transport='oci-archive'`: Load image transport from a tar archive file. Available options are oci-archive, docker-archive. -- `--variant=''`: 覆盖指定镜像的 `variant`。 +- `--variant=''`: Override the `variant` of the specified image. -## 示例: +## Examples: -- 从一个存档文件中加载镜像:`sealos load -i myimage.tar` +- Load an image from an archive file: `sealos load -i myimage.tar` -注意,在使用 `sealos load` 命令时,你需要确保指定的存档文件存在,并且格式正确。如果你在导入镜像时遇到问题,你可能需要检查你的存档文件,以确保它们没有被损坏或格式化错误。 +Note that when using the `sealos load` command, you need to ensure that the specified archive file exists and is correctly formatted. If you encounter problems when importing images, you may need to check your archive files to ensure they have not been corrupted or incorrectly formatted. -以上就是 `sealos load` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos load` command, and we hope it has been helpful. If you encounter any problems during usage, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/login.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/login.md index cec64c82b0d..b755c25099a 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/login.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/login.md @@ -2,38 +2,38 @@ sidebar_position: 6 --- -# login 登录仓库 +# Login to Repository -`sealos login` 命令用于在指定服务器上登录容器注册表。登录注册表后,你可以拉取、推送镜像。 +The `sealos login` command is used to log into the container registry on the specified server. After logging into the registry, you can pull and push images. -## 用法: +## Usage: -`sealos login [flags] [options] registryName` +`sealos login [flags] [options] registryName` -## 参数: +## Parameters: -以下是 `sealos login` 命令的参数: +Here are the parameters for the `sealos login` command: -- `--authfile=''`: 身份验证文件的路径。可以使用环境变量 REGISTRY_AUTH_FILE 来覆盖。 +- `--authfile=''`: Path to the authentication file. It can be overridden with the REGISTRY_AUTH_FILE environment variable. -- `--cert-dir=''`: 使用指定路径的证书来访问镜像仓库。 +- `--cert-dir=''`: Use certificates at the specified path to access the image repository. -- `--get-login=true`: 返回注册表的当前登录用户。 +- `--get-login=true`: Return the current login user for the registry. -- `-k, --kubeconfig=''`: 使用 kubeconfig 登录到 sealos 镜像仓库 hub.sealos.io。 +- `-k, --kubeconfig=''`: Log into the sealos image repository hub.sealos.io using kubeconfig. -- `-p, --password=''`: 注册表的密码。 +- `-p, --password=''`: Password for the registry. -- `--password-stdin=false`: 从标准输入获取密码。 +- `--password-stdin=false`: Take the password from standard input. -- `-u, --username=''`: 注册表的用户名。 +- `-u, --username=''`: Username for the registry. -- `-v, --verbose=false`: 将更详细的信息写入标准输出。 +- `-v, --verbose=false`: Write more detailed information to standard output. -## 示例: +## Examples: -- 登录到 quay.io 注册表:`sealos login -u myusername -p mypassword quay.io ` +- Log into the quay.io registry: `sealos login -u myusername -p mypassword quay.io` -注意,在使用 `sealos login` 命令时,你需要确保提供了正确的用户名和密码,否则登录过程可能会失败。如果你在登录过程中遇到问题,你可能需要检查你的用户名和密码,以确保它们没有输入错误或被遗忘。 +Please note that when using the `sealos login` command, you need to make sure that you provide the correct username and password, otherwise the login process might fail. If you encounter problems during the login process, you might need to check your username and password to ensure they have not been entered incorrectly or forgotten. -以上就是 `sealos login` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos login` command, and we hope it has been helpful. If you encounter any problems during usage, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/logout.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/logout.md index 6c1c326a626..8584054cb52 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/logout.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/logout.md @@ -2,25 +2,25 @@ sidebar_position: 6 --- -# logout 登出仓库 +# Logout from Repository -`sealos logout` 命令用于在指定服务器上移除本地缓存的镜像仓库的账号和密码。 +The `sealos logout` command is used to remove the locally cached account and password of the image repository on the specified server. -## 用法: +## Usage: -`sealos login [flags] [options] registryName` +`sealos logout [flags] [options] registryName` -## 参数: +## Parameters: -以下是 `sealos login` 命令的参数: +Here are the parameters for the `sealos logout` command: -- `--authfile=''`: 身份验证文件的路径。可以使用环境变量 REGISTRY_AUTH_FILE 来覆盖。 +- `--authfile=''`: Path to the authentication file. It can be overridden with the REGISTRY_AUTH_FILE environment variable. -- `-a, --all=false`: 删除所有的认证信息。 +- `-a, --all=false`: Delete all authentication information. -## 示例: +## Examples: -- 登出到 quay.io 镜像仓库:`sealos logout quay.io ` +- Logout from the quay.io image repository: `sealos logout quay.io` -以上就是 `sealos logout` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the usage guide for the `sealos logout` command, and we hope it has been helpful. If you encounter any problems during usage, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/manifest.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/manifest.md index f850e0ce93f..0b4cda55e8c 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/manifest.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/manifest.md @@ -2,19 +2,19 @@ sidebar_position: 6 --- -# manifest 镜像清单 +# Image Manifest -Sealos 的 `manifest` 命令用于创建、修改和推送 manifest 列表和镜像索引。这些功能主要用于处理镜像的多架构支持。在 Docker 和 OCI 镜像规范中,manifest 列表(也被称为 "fat manifest")或镜像索引允许一个镜像标签(如 `myimage:latest`)在多种硬件架构(如 amd64, arm64, ppc64le 等)上都能使用。 +The `manifest` command of Sealos is used to create, modify, and push manifest lists and image indexes. These functions are mainly used to handle multi-architecture support of images. In Docker and OCI image specifications, manifest lists (also known as "fat manifests") or image indexes allow an image tag (like `myimage:latest`) to be used on various hardware architectures (like amd64, arm64, ppc64le, etc.). -以下是一些主要的 `manifest` 子命令: +Here are some of the major `manifest` subcommands: -1. `create`:创建新的 manifest 列表或镜像索引。例如:`sealos manifest create localhost/list` -2. `add`:将镜像添加到 manifest 列表或镜像索引中。例如:`sealos manifest add localhost/list localhost/image` -3. `annotate`:在 manifest 列表或镜像索引的条目中添加或更新信息。例如:`sealos manifest annotate --annotation A=B localhost/list localhost/image` -4. `inspect`:显示 manifest 列表或镜像索引的内容。例如:`sealos manifest inspect localhost/list` -5. `push`:将 manifest 列表或镜像索引推送到 registry。例如:`sealos manifest push localhost/list transport:destination` -6. `remove` 和 `rm`:从 manifest 列表或镜像索引中移除条目,或者完全删除 manifest 列表或镜像索引。例如:`sealos manifest remove localhost/list sha256:entryManifestDigest` 或 `sealos manifest rm localhost/list` +1. `create`: Creates a new manifest list or image index. Example: `sealos manifest create localhost/list` +2. `add`: Adds an image to the manifest list or image index. Example: `sealos manifest add localhost/list localhost/image` +3. `annotate`: Adds or updates information in entries of the manifest list or image index. Example: `sealos manifest annotate --annotation A=B localhost/list localhost/image` +4. `inspect`: Displays the content of the manifest list or image index. Example: `sealos manifest inspect localhost/list` +5. `push`: Pushes the manifest list or image index to the registry. Example: `sealos manifest push localhost/list transport:destination` +6. `remove` and `rm`: Removes entries from the manifest list or image index, or completely deletes the manifest list or image index. Example: `sealos manifest remove localhost/list sha256:entryManifestDigest` or `sealos manifest rm localhost/list` -通过 `sealos manifest` 命令,可以灵活地管理 manifest 列表或镜像索引,为多架构的 Docker 或 OCI 镜像提供支持。用户可以根据自己的需求,创建自定义的 manifest 列表,方便在不同的硬件架构上部署和运行 Docker 镜像。 +With the `sealos manifest` command, you can flexibly manage manifest lists or image indexes, providing support for multi-architecture Docker or OCI images. Users can create custom manifest lists according to their needs, making it convenient to deploy and run Docker images on different hardware architectures. -用户如果想通过manifest命令构建多架构镜像,可以参考文档[构建支持多架构的集群镜像](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-multi-arch-image) +Users who want to build multi-architecture images through the manifest command can refer to the document [Building Cluster Images that Support Multiple Architectures](https://docs.sealos.io/docs/lifecycle-management/operations/build-image/build-multi-arch-image). diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/merge.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/merge.md index e6f01f2dfc8..74db43c175d 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/merge.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/merge.md @@ -2,20 +2,20 @@ sidebar_position: 6 --- -# merge 合并镜像 +# Merge Image Merging -Sealos 的 `merge` 命令的主要作用是将多个镜像合并为一个。它通过读取各个输入镜像的 Dockerfile,将其中的命令和层次结构合并到一个新的镜像中。这个命令的运行逻辑很像 `build` 命令,许多参数也是相同的。 +The primary function of the `merge` command in Sealos is to merge multiple images into one. It does this by reading the Dockerfiles of each input image, merging the commands and layer structures into a new image. The running logic of this command is very similar to the `build` command, and many of the parameters are the same. -这个功能在多个镜像有共享层的情况下非常有用,因为它可以减少镜像的大小,节省存储空间。同时,由于合并后的镜像包含了多个镜像的全部功能,所以它可以帮助简化应用部署。 +This function is very useful when multiple images share layers, as it can reduce the size of the image and save storage space. Moreover, since the merged image contains all the functionalities of multiple images, it can help simplify application deployment. -以下是 `sealos merge` 的基本使用示例: +Here is a basic usage example of `sealos merge`: ```bash sealos merge -t new:0.1.0 kubernetes:v1.19.9 mysql:5.7.0 redis:6.0.0 ``` -在这个示例中,`kubernetes:v1.19.9`、`mysql:5.7.0` 和 `redis:6.0.0` 这三个镜像被合并为一个新的镜像 `new:0.1.0`。 +In this example, the three images `kubernetes:v1.19.9`, `mysql:5.7.0`, and `redis:6.0.0` are merged into a new image `new:0.1.0`. -`sealos merge` 命令提供了丰富的选项来定制合并过程,例如 `--all-platforms` 用于尝试为所有基础镜像平台构建镜像,`--build-arg` 用于向构建器提供参数,`--no-cache` 用于禁用现有的缓存镜像,等等。 +The `sealos merge` command provides rich options to customize the merging process, such as `--all-platforms` to attempt to build images for all base image platforms, `--build-arg` to provide parameters to the builder, `--no-cache` to disable existing cached images, and so on. -请注意,`sealos merge` 命令会根据各个输入镜像的 Dockerfile 来构建新的镜像,所以如果输入镜像的 Dockerfile 不兼容,或者有任何构建错误,那么这个命令可能会失败。在使用 `sealos merge` 命令时,请确保你了解每个输入镜像的 Dockerfile,并根据需要进行调整。 +Please note that the `sealos merge` command builds a new image based on the Dockerfiles of each input image. Therefore, if the Dockerfiles of the input images are incompatible, or there are any build errors, this command may fail. When using the `sealos merge` command, make sure you understand the Dockerfile of each input image and adjust as needed. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/pull.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/pull.md index 6f52bed1a00..74ae19b2b56 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/pull.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/pull.md @@ -2,50 +2,50 @@ sidebar_position: 6 --- -# pull 拉取镜像 +# Pull Image -`sealos pull` 是一个非常有用的命令,它可以从容器镜像仓库下载镜像并将其存储在本地。用户可以通过镜像的标签(tag)或摘要(digest)来获取镜像。如果没有指定标签,那么会默认下载带有 'latest' 标签(如果存在)的镜像。 +The `sealos pull` command is a very useful one that allows you to download images from the container image repository and store them locally. Users can obtain images by their tags or digests. If no tag is specified, the image with the 'latest' tag (if it exists) will be downloaded by default. -通过使用这个命令,用户可以方便地从远程仓库下载所需的镜像,极大地提高了工作效率。 +By using this command, users can easily download the required images from remote repositories, greatly improving work efficiency. -## 用法: +## Usage: -`sealos pull [flags] [options] imageName` +`sealos pull [flags] [options] imageName` -## 参数: +## Parameters: -以下是 `sealos pull` 命令的参数: +The following are the parameters of the `sealos pull` command: -- `-a, --all-tags=false`: 下载仓库中所有带有标签的镜像。 +- `-a, --all-tags=false`: Download all tagged images in the repository. -- `--authfile=''`: 认证文件的路径。可以使用环境变量 REGISTRY_AUTH_FILE 进行覆盖。 +- `--authfile=''`: The path to the authentication file. The REGISTRY_AUTH_FILE environment variable can be used to override it. -- `--cert-dir=''`: 用于访问镜像仓库的证书的指定路径。 +- `--cert-dir=''`: The specified path to the certificate for accessing the image repository. -- `--creds=''`: 使用 `[username[:password]]` 访问镜像仓库。 +- `--creds=''`: Use `[username[:password]]` to access the image repository. -- `--decryption-key=[]`: 解密镜像所需要的密钥。 +- `--decryption-key=[]`: The key needed to decrypt the image. -- `--platform=[linux/arm64/v8]`: 选择镜像时,优先使用指定的 OS/ARCH,而不是当前操作系统和架构。 +- `--platform=[linux/arm64/v8]`: When choosing an image, prioritize the specified OS/ARCH over the current operating system and architecture. -- `--policy='missing'`: 设置策略,可选的值包括 'missing', 'always', 'never'。 +- `--policy='missing'`: Set the policy, the optional values include 'missing', 'always', 'never'. -- `-q, --quiet=false`: 在拉取镜像时,不输出进度信息。 +- `-q, --quiet=false`: Do not output progress information when pulling images. -- `--remove-signatures=false`: 在拉取镜像时,不复制签名。 +- `--remove-signatures=false`: Do not copy signatures when pulling images. -- `--retry=3`: 在拉取失败时的重试次数。 +- `--retry=3`: The number of retries when the pull fails. -- `--retry-delay=2s`: 拉取失败时,重试之间的延迟。 +- `--retry-delay=2s`: The delay between retries when the pull fails. -## 示例: +## Examples: -- 拉取一个镜像:`sealos pull my-image:latest` +- Pull an image: `sealos pull my-image:latest` -- 从 Docker 守护进程拉取一个镜像:`sealos pull docker-daemon:my-image:tag` +- Pull an image from the Docker daemon: `sealos pull docker-daemon:my-image:tag` -- 从特定的仓库拉取一个镜像:`sealos pull myregistry/myrepository/my-image:tag` +- Pull an image from a specific repository: `sealos pull myregistry/myrepository/my-image:tag` -- 拉取多个镜像:`sealos pull imageID1 imageID2 imageID3` +- Pull multiple images: `sealos pull imageID1 imageID2 imageID3` -以上就是 `sealos push` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +The above is a usage guide for the `sealos push` command, hoping to help you. If you encounter any problems during use, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/push.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/push.md index 9f5241bfd1d..6b9b2a5677a 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/push.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/push.md @@ -2,106 +2,106 @@ sidebar_position: 6 --- -# push 上传镜像 +# Push Image -`sealos push` 是 Sealos 命令行工具中的一个命令,用于将镜像推送到指定的位置。这个命令在你需要将本地 Docker 镜像推送到远程镜像仓库的时候特别有用。本指南将详细介绍其使用方法。 +`sealos push` is a command in the Sealos command-line tool, used to push images to a specified location. This command is particularly useful when you need to push local Docker images to a remote image repository. This guide will provide a detailed introduction to its usage. -## 基本用法 +## Basic Usage -基本的 `sealos push` 命令格式如下: +The basic format of the `sealos push` command is as follows: ```bash sealos push IMAGE_ID DESTINATION ``` -在上述命令中,`IMAGE_ID` 是你想要推送的镜像的 ID,而 `DESTINATION` 是你想要推送到的位置。 `DESTINATION` 使用 "transport:details" 格式,如果未指定,将复用源 IMAGE 作为 DESTINATION。 +In the above command, `IMAGE_ID` is the ID of the image you want to push, and `DESTINATION` is the location where you want to push it. The `DESTINATION` uses the "transport:details" format. If not specified, the source IMAGE is reused as the DESTINATION. -在 Sealos 中,传输方式定义了源镜像和目标镜像在复制过程中的格式和位置。以下是 Sealos 支持的各种传输方式: +In Sealos, the transport defines the format and location of the source image and the target image during the copying process. Here are the various transports supported by Sealos: -1. `containers-storage`: 此传输方式用于存储和管理在本地运行的容器。例如,使用 Podman 或 CRI-O 创建的容器的镜像。 +1. `containers-storage`: This transport is used for storing and managing containers running locally, such as images of containers created using Podman or CRI-O. -2. `dir`: 这种传输方式将镜像存储在本地文件系统的一个目录中,该目录结构符合 OCI 布局。 +2. `dir`: This transport stores the image in a directory in the local file system, the structure of which conforms to the OCI layout. -3. `docker`: 这种传输方式用于与 Docker 注册表进行交互,如 Docker Hub 或任何其他兼容的私有注册表。 +3. `docker`: This transport is used for interacting with Docker registries, such as Docker Hub or any other compatible private registry. -4. `docker-archive`: 此传输方式将镜像存储为一个本地的 Docker tar 文件(`.tar`),这是 Docker 的原生格式。 +4. `docker-archive`: This transport stores the image as a local Docker tar file (`.tar`), which is Docker's native format. -5. `docker-daemon`: 这种传输方式用于与本地 Docker 守护程序交互,可以从 Docker 守护程序中提取镜像,或者将镜像推送到 Docker 守护程序。 +5. `docker-daemon`: This transport is used for interacting with the local Docker daemon. It can extract images from the Docker daemon or push images to the Docker daemon. -6. `oci`: 该传输方式将镜像存储在一个符合 OCI 布局的目录中,它是一种开放的容器镜像格式。 +6. `oci`: This transport stores the image in a directory that conforms to the OCI layout, which is an open container image format. -7. `oci-archive`: 这种传输方式将镜像存储为一个本地的 OCI tar 文件(`.tar`)。 +7. `oci-archive`: This transport stores the image as a local OCI tar file (`.tar`). -8. `ostree`: 这种传输方式将镜像存储在 OSTree 存储库中,这是一种支持原子升级和回滚的文件系统。 +8. `ostree`: This transport stores the image in an OSTree repository, which is a file system that supports atomic upgrades and rollbacks. -9. `sif`: 这是 Singularity SIF 格式,主要用于高性能计算和数据密集型应用。 +9. `sif`: This is the Singularity SIF format, mainly used for high-performance computing and data-intensive applications. -示例: +Examples: -- 将一个镜像推送到 Docker 注册表:`sealos push my-image:latest docker://my-registry.example.com/my-image:latest` +- Push an image to a Docker registry: `sealos push my-image:latest docker://my-registry.example.com/my-image:latest` -- 将一个镜像从 Docker 守护程序导出:`sealos push docker-daemon:my-image:latest dir:/path/to/save/` +- Export an image from the Docker daemon: `sealos push docker-daemon:my-image:latest dir:/path/to/save/` -- 将一个镜像推送到本地的容器存储:`sealos push my-image:latest containers-storage:my-new-image:latest` +- Push an image to local container storage: `sealos push my-image:latest containers-storage:my-new-image:latest` -## 示例 +## Example -例如,你可以使用以下命令将一个镜像推送到 `registry.example.com` 的仓库: +For example, you can use the following command to push an image to the `registry.example.com` repository: ```bash sealos push my_image_id docker://registry.example.com/my_repository:my_tag ``` -## 可选参数 +## Optional Parameters -- `--all`: 该参数用于推送清单列表引用的所有镜像。 +- `--all`: This parameter is used to push all images referred by the manifest list. -- `--authfile`: 该参数用于指定身份验证文件的路径。 可以使用 REGISTRY_AUTH_FILE 环境变量进行覆盖。 +- `--authfile`: This parameter is used to specify the path to the authentication file. The REGISTRY_AUTH_FILE environment variable can be overridden. -- `--cert-dir`: 该参数用于指定访问注册表所需的证书的路径。 +- `--cert-dir`: This parameter is used to specify the path to the certificate required to access the registry. -- `--compression-format`: 该参数用于指定要使用的压缩格式。 +- `--compression-format`: This parameter is used to specify the compression format to be used. -- `--compression-level`: 该参数用于指定要使用的压缩级别。 +- `--compression-level`: This parameter is used to specify the compression level to be used. -- `--cr-option` 参数是用于控制是否将镜像的自定义资源(Custom Resource,简称 CR)推送到目标镜像仓库的。 +- `--cr-option`: This parameter is used to control whether the image's Custom Resources (CR) are pushed to the target image repository. - 具体来说,这个参数的可选值包括: + Specifically, the optional values for this parameter include: - - "yes": 将会把镜像以及其关联的 CR 都推送到目标镜像仓库。 + - "yes": The image and its associated CR will be pushed to the target image repository. - - "no": 仅推送镜像,而不推送任何 CR。 + - "no": Only push the image, do not push any CR. - - "only": 仅推送 CR,不推送镜像本身。 + - "only": Only push the CR, do not push the image itself. - - "auto": 根据镜像和 CR 的实际状态自动决定是否推送。例如,如果 CR 有更改或者不存在于目标仓库,就会被推送。 + - "auto": Automatically decide whether to push based on the actual status of the image and CR. For example, if the CR has changed or does not exist in the target repository, it will be pushed. - 请注意,这个参数主要在处理包含自定义资源(如 Kubernetes CRD 对象)的镜像时使用,它能够让你更加灵活地控制镜像和 CR 的推送过程。 + Please note, this parameter is mainly used when dealing with images containing custom resources (such as Kubernetes CRD objects), allowing you to more flexibly control the push process of images and CRs. -- `--creds`: 该参数用于访问注册表,使用 `[username[:password]]` 形式。 +- `--creds`: This parameter is used to access the registry, in the form of `[username[:password]]`. -- `--digestfile`: 该参数在复制图像后,将结果图像的摘要写入文件。 +- `--digestfile`: This parameter, after copying the image, writes the digest of the resulting image to a file. -- `-D`, `--disable-compression`: 该参数用于不压缩层。 +- `-D`, `--disable-compression`: This parameter is used to not compress layers. -- `--encrypt-layer`: 该参数用于指定要加密的层,0 索引层索引支持负索引(例如,0 是第一层,-1 是最后一层)。 如果未定义,则在指定 encryption-key 标志时将加密所有层。 +- `--encrypt-layer`: This parameter is used to specify the layer to be encrypted. 0-index layer index supports negative index (for example, 0 is the first layer, -1 is the last layer). If not defined, all layers will be encrypted when the encryption-key flag is specified. -- `--encryption-key`: 该参数用于指定加密图像所需的密钥,与加密协议一起使用(例如,jwe:/path/to/key.pem)。 +- `--encryption-key`: This parameter is used to specify the key needed to encrypt the image, used together with the encryption protocol (for example, jwe:/path/to/key.pem). -- `-f`, `--format`: 该参数用于指定目标中要使用的清单类型(oci, v2s1, 或 v2s2)(默认是源的清单类型,带回退)。 +- `-f`, `--format`: This parameter is used to specify the type of manifest to use in the target (oci, v2s1, or v2s2) (default is the source's -- `-q`, `--quiet`: 该参数用于在推送图像时不输出进度信息。 +manifest type, with fallback). -- `--remove-signatures`: 该参数用于在推送图像时不复制签名。 +- `-q`, `--quiet`: This parameter is used to not output progress information when pushing the image. -- `--retry +- `--remove-signatures`: This parameter is used to not copy signatures when pushing the image. -`: 该参数用于指定在推送/拉取失败时的重试次数。 +- `--retry`: This parameter is used to specify the number of retries when the push/pull fails. -- `--retry-delay`: 该参数用于指定在推送/拉取失败时重试之间的延迟。 +- `--retry-delay`: This parameter is used to specify the delay between retries when the push/pull fails. -- `--rm`: 该参数用于在推送成功后删除清单列表。 +- `--rm`: This parameter is used to delete the manifest list after the push is successful. -- `--sign-by`: 该参数用于使用指定的 `FINGERPRINT` 的 GPG 密钥签名图像。 +- `--sign-by`: This parameter is used to sign the image using a GPG key with the specified `FINGERPRINT`. -以上就是 `sealos push` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +That's the guide to using the `sealos push` command, and I hope it's helpful to you. If you encounter any problems during use, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/registry.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/registry.md index a82eac19d09..dc886345c6c 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/registry.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/registry.md @@ -2,233 +2,232 @@ sidebar_position: 8 --- -# registry 镜像仓库命令 +# Registry Image Repository Commands -## Sealos:sealos registry save 命令详解与使用指南 +## Sealos: Detailed Explanation and User Guide for the `sealos registry save` Command -`registry save` 命令用于将远程的 Docker 镜像拉取到本地并保存在指定的目录中。这对于在离线或者内网环境中部署容器镜像特别有用。 +The `registry save` command is used to pull remote Docker images to the local and save them in a specified directory. This is particularly useful for deploying container images in offline or intranet environments. -在执行 `registry save` 命令时,将自动获取 `sealos login` 认证信息进行仓库认证。 +When executing the `registry save` command, it will automatically obtain the `sealos login` authentication information for repository authentication. -**使用说明** +**Usage Guide** -1. 使用context自动获取镜像 +1. Use context to automatically retrieve images - 使用默认方式拉取并保存镜像。这种模式会自动解析 `charts` 目录、`manifests` 目录和 `images` 目录以获取镜像列表。 + Pull and save images in the default manner. This mode will automatically parse the `charts` directory, `manifests` directory, and `images` directory to get the image list. - **使用示例** + **Usage Example** ```shell sealos registry save --registry-dir=/tmp/registry1 my-context ``` -2. 指定镜像列表方式 +2. Specified image list mode - 使用参数传入镜像列表 + Pass the image list using arguments - **使用示例** + **Usage Example** ```shell sealos registry save --registry-dir=/tmp/registry2 --images=docker.io/library/busybox:latest ``` -**选项** +**Options** -以下选项适用于 `save` 命令及其子命令: +The following options apply to the `save` command and its subcommands: -- `--max-procs`: 拉取镜像时使用的最大并行进程数。 -- `--registry-dir`: 保存镜像的本地目录。 -- `--arch`: 镜像的目标架构,例如:`amd64`、`arm64` 等。 -- `--images`: 需要拉取并保存的镜像列表,以逗号分隔。例如:"my-image1:latest,my-image2:v1.0"。 +- `--max-procs`: The maximum number of parallel processes used to pull images. +- `--registry-dir`: The local directory to save images. +- `--arch`: The target architecture of the image, such as: `amd64`, `arm64`, etc. +- `--images`: The image list to be pulled and saved, separated by commas. For example: "my-image1:latest,my-image2:v1.0". -## Sealos:sealos registry serve 命令详解与使用指南 +## Sealos: Detailed Explanation and User Guide for the `sealos registry serve` Command -在管理 Docker 镜像仓库过程中,Sealos 提供了 `sealos registry serve` 命令以方便用户进行相关操作。本文将详细介绍 `sealos registry serve` 命令的使用方法和示例。 +In the process of managing Docker image repositories, Sealos provides the `sealos registry serve` command to facilitate user operations. This article will detail the usage methods and examples of the `sealos registry serve` command. -### 基本介绍 +### Basic Introduction -`sealos registry serve` 命令的主要作用是启动一个 Docker 分发镜像仓库服务器,支持两种模式:`filesystem` 和 `inmem`。 +The main function of the `sealos registry serve` command is to start a Docker distribution image repository server, supporting two modes: `filesystem` and `inmem`. -1. **Filesystem 模式**:在此模式下,sealctl 将运行一个针对指定目录的 Docker 分发镜像仓库服务器。该模式下,镜像数据将存储在硬盘上。 +1. **Filesystem mode**: In this mode, sealctl will run a Docker distribution image repository server for the specified directory. In this mode, the image data will be stored on the hard drive. -2. **In-memory 模式**:在此模式下,sealctl 将运行一个内存中的 Docker 分发镜像仓库服务器。该模式下,镜像数据仅保存在内存中,进程退出后数据将丢失。 +2. **In-memory mode**: In this mode, sealctl will run a Docker distribution image repository server in memory. In this mode, the image data is only stored in memory, and the data will be lost after the process exits. -### 命令参数 +### Command Parameters -`sealos registry serve filesystem ` 命令支持以下参数: +The `sealos registry serve filesystem ` command supports the following parameters: -- `--disable-logging`: 禁用日志输出,默认为 false。 -- `--log-level`: 配置日志级别,默认为 'error'。 -- `-p, --port`: 服务器监听的端口,默认为随机未使用的端口。 +- `--disable-logging`: Disable log output, default is false. +- `--log-level`: Configure log level, default is 'error'. +- `-p, --port`: The port the server listens to, default is a random unused port. -### 使用示例 +### Usage Examples -以下是一些 `sealos registry serve` 命令的使用示例: +Here are some usage examples of the `sealos registry serve` command: -#### 在文件系统中启动镜像仓库服务器 +#### Start an image repository server in the filesystem ```bash sealos registry serve filesystem --port=5000 ``` -以上命令将在端口5000上启动一个文件系统镜像仓库服务器。 +The above command will start a filesystem image repository server on port 5000. -#### 在内存中启动镜像仓库服务器 +#### Start an image repository server in memory ```bash sealos registry serve inmem ``` -以上命令将启动一个内存镜像仓库服务器。该服务器在进程退出后,存储的数据将丢失。 +The above command will start an in-memory image repository server. The stored data of this server will be lost when the process exits. -通过 `sealctl registry serve` 命令,用户可以轻松地管理和操作 Docker 镜像仓库。无论是在开发环境,还是在生产环境中,它都是一个强大且易用的工具。 +Through the `sealctl registry serve` command, users can easily manage and operate Docker image repositories. Whether in the development environment or in the production environment, it is a powerful and easy-to-use tool. +## Sealos: Detailed Explanation and User Guide of the `sealos registry passwd` Command +In the process of managing Docker image repositories, Sealos provides the `sealos registry passwd` command to facilitate users in modifying the password for the cluster registry. It offers a convenient method to help users change the password of the registry. -## Sealos:sealos registry passwd 命令详解与使用指南 +### Basic Usage -在管理 Docker 镜像仓库过程中,Sealos 提供了 `sealos registry passwd` 命令以方便用户对集群registry进行密码修改。它提供了一种简便的方法,帮助用户修改 registry 的密码。 - -### 基本用法 - -使用 `sealos registry passwd` 命令来修改registry的密码。 +Use the `sealos registry passwd` command to modify the password of the registry. ```bash sealos registry passwd ``` -### 参数 +### Parameters -以下是 `sealos registry passwd` 命令的参数: +Below are the parameters of the `sealos registry passwd` command: -- `-c, --cluster-name`:集群名称,默认为'default'。 +- `-c, --cluster-name`: Cluster name, the default is 'default'. -- `-f, --cri-shim-file-path`:镜像 cri shim 文件路径,如果为空将不会更新镜像 cri shim 文件。默认路径为'/etc/image-cri-shim.yaml'。 +- `-f, --cri-shim-file-path`: Image cri shim file path, if null it will not update the image cri shim file. The default path is '/etc/image-cri-shim.yaml'. -- `-p, --htpasswd-path`:registry 密码文件路径。默认路径为'/etc/registry/registry_htpasswd'。 +- `-p, --htpasswd-path`: Registry password file path. The default path is '/etc/registry/registry_htpasswd'. -### 使用步骤 +### Usage Steps -1. 执行 `sealos registry passwd` 命令,可以根据需要指定参数来进行配置。 +1. Execute the `sealos registry passwd` command, you can specify parameters according to the needs. -2. 根据命令提示,输入新的密码。 +2. According to the command prompt, input the new password. -3. 命令执行成功后,registry 的密码将被修改为新的密码。 +3. After the command is successfully executed, the registry's password will be changed to the new password. -### 演示说明 +### Demo Explanation [![asciicast](https://asciinema.org/a/Qu05jah4ZZmjMuFR4vHEKvBsQ.svg)](https://asciinema.org/a/Qu05jah4ZZmjMuFR4vHEKvBsQ) -**在使用过程中,会让用户选择registry类型** +**In the usage process, it will let the user choose the registry type** -- registry: 二进制启动,执行`systemctl restart registry`进行重启镜像仓库。 -- containerd: containerd启动,执行"nerdctl restart sealos-registry"进行重启镜像仓库。 -- docker: docker启动,执行"docker restart sealos-registry"进行重启镜像仓库。 +- registry: Binary startup, execute `systemctl restart registry` to restart the image repository. -### 注意事项 +- containerd: Containerd startup, execute "nerdctl restart sealos-registry" to restart the image repository. -修改 registry 密码后,所有使用该 registry 的节点和服务都需要更新配置,以使用新的密码进行身份验证。否则,它们将无法从该 registry 拉取或推送镜像。 +- docker: Docker startup, execute "docker restart sealos-registry" to restart the image repository. -如果你不确定如何更新节点和服务的配置,建议在修改 registry 密码之前,先查阅相关文档或者寻求专业的技术支持。 +### Notice +**After changing the registry password, modify the registry password in the Clusterfile** +After changing the registry password, all nodes and services using this registry need to update their configurations to use the new password for authentication. Otherwise, they will not be able to pull or push images from this registry. +If you are unsure about how to update the configuration of nodes and services, it is recommended to consult related documentation or seek professional technical support before changing the registry password. -## Sealos:`sealos registry sync` 命令详解与使用指南 +## Sealos: Detailed Explanation and User Guide of the `sealos registry sync` Command -Sealos 的 `registry sync` 命令可帮助您在两个 registry 之间同步所有镜像。这不仅可以用于镜像的迁移,还可以备份您的镜像。 +Sealos' `registry sync` command can help you synchronize all images between two registries. This can be used not only for image migration but also for backing up your images. -### 命令基本用法 +### Basic Command Usage -执行 `sealos registry sync` 命令来进行镜像同步: +Execute the `sealos registry sync` command for image synchronization: ```bash sealos registry sync source dst ``` -这里的 `source` 表示源 registry 的地址,而 `dst` 是目标 registry 的地址。 +Here `source` represents the address of the source registry, and `dst` is the address of the target registry. -例如,您想将地址为 127.0.0.1:41669 的 registry 中的所有镜像同步到地址为 sealos.hub:5000 的 registry,您应执行以下命令: +For example, if you want to synchronize all images in the registry with the address of 127.0.0.1:41669 to the registry with the address of sealos.hub:5000, you should execute the following command: ```bash sealos registry sync 127.0.0.1:41669 sealos.hub:5000 ``` -### 认证与权限 +### Authentication and Permissions -在执行 `sealos registry sync` 命令之前,请确保您具有访问源 registry 和目标 registry 的权限。可以使用`sealos login`对registry进行认证登录。 +Before executing the `sealos registry sync` command, please ensure that you have permissions to access the source registry and the target registry. You can use `sealos login` to authenticate the registry. -### 同步过程 +### Synchronization Process -请注意,镜像同步可能需要一些时间,这取决于镜像的数量和大小,以及网络的速度。在同步过程中,请保持网络的连通性,并确保在同步完成之前不要中断命令的执行。 +Please note that image synchronization may take some time, depending on the number and size of images, as well as the speed of the network. During the synchronization process, please keep the network connected and ensure not to interrupt the execution of the command before synchronization is complete. -重要的是,`sealos registry sync` 命令支持增量同步,已经存在于目标 registry 的镜像不会重新同步。 +Importantly, the `sealos registry sync` command supports incremental synchronization. Images that already exist in the target registry will not be re-synchronized. -### 参数选项 +### Parameter Options -`sealos registry sync` 命令还提供了一些参数选项,允许您更精细地控制同步过程: +The `sealos registry sync` command also provides some parameter options, allowing you to control the synchronization process more finely: -- `--override-arch ARCH`:使用指定的 `ARCH` 替代当前机器的架构来选择镜像。 +- `--override-arch ARCH`: Use the specified `ARCH` to replace the current machine architecture to select images. -- `--override-os OS`:使用指定的 `OS` 替代当前操作系统来选择镜像。 +- `--override-os OS`: Use the specified `OS` to replace the current operating system to select images. -- `--override-variant VARIANT`:使用指定的 `VARIANT` 替代当前的架构变种来选择镜像。 +- `--override-variant VARIANT`: Use the specified `VARIANT` to replace the current architecture variant to select images. -- `-a` 或 `--all`:如果源镜像是一个列表,同步所有镜像。这对异构环境下特别有用,因为默认情况下,只会同步当前架构的镜像。 +- `-a` or `--all`: If the source image is a list, synchronize all images. This is particularly useful in heterogeneous environments because by default, only images of the current architecture will be synchronized. -例如,如果您想同步所有架构的镜像,可以添加 `-a` 参数: +For example, if you want to synchronize all architecture images, you can add the `-a` parameter: ```bash sealos registry sync -a 127.0.0.1:41669 sealos.hub:5000 ``` -以上就是 `sealos registry sync` 命令的详细说明与使用指南。希望这些信息能帮助您更好地理解和使用这个命令。如果您在使用过程中遇到任何问题,欢迎随时提问。 +The above is a detailed explanation and usage guide for the `sealos registry sync` command. We hope this information helps you better understand and use this command. If you encounter any problems during use, feel free to ask at any time. -## Sealos:`sealos registry copy` 命令详解与使用指南 -Sealos 的 `registry copy` 命令用于将指定镜像从一个 registry 复制到另一个 registry。这能帮助您在不同的 registry 之间进行镜像的迁移或备份。 +## Sealos: Detailed Explanation and User Guide of the `sealos registry copy` Command -### 命令基本用法 +The `registry copy` command in Sealos is used to copy a specified image from one registry to another registry. This can assist you in migrating or backing up images between different registries. -使用 `sealos registry copy` 命令来进行镜像的复制: +### Basic Command Usage + +Use the `sealos registry copy` command for image copying: ```bash sealos registry copy source-image dst ``` -这里的 `source-image` 表示源镜像的全名(包括地址和镜像名),`dst` 是目标 registry 的地址。 +Here `source-image` represents the full name of the source image (including the address and image name), and `dst` is the address of the target registry. -例如,要将名为 `127.0.0.1:41669/my-image:tag` 的镜像复制到地址为 `sealos.hub:5000` 的 registry,您可以执行以下命令: +For example, to copy an image named `127.0.0.1:41669/my-image:tag` to a registry with the address `sealos.hub:5000`, you can execute the following command: ```bash sealos registry copy 127.0.0.1:41669/my-image:tag sealos.hub:5000 ``` -### 认证与权限 +### Authentication and Permissions -在执行 `sealos registry copy` 命令之前,请确保您具有访问源镜像和目标 registry 的权限。可以使用`sealos login`对registry进行认证登录。 +Before executing the `sealos registry copy` command, please ensure that you have permissions to access the source image and the target registry. You can use `sealos login` to authenticate the registry. -### 复制过程 +### Copying Process -请注意,镜像复制可能需要一些时间,这取决于镜像的大小,以及网络的速度。在复制过程中,请保持网络的连通性,并确保在复制完成之前不要中断命令的执行。 +Please note that image copying may take some time, depending on the size of the image and the speed of the network. During the copying process, please keep the network connected and ensure not to interrupt the execution of the command before the copying is complete. -### 参数选项 +### Parameter Options -`sealos registry copy` 命令提供了一些参数选项,允许您更精细地控制复制过程: +The `sealos registry copy` command provides some parameter options, allowing you to control the copying process more finely: -- `--override-arch ARCH`:使用指定的 `ARCH` 替代当前机器的架构来选择镜像。 +- `--override-arch ARCH`: Use the specified `ARCH` to replace the current machine architecture to select images. -- `--override-os OS`:使用指定的 `OS` 替代当前操作系统来选择镜像。 +- `--override-os OS`: Use the specified `OS` to replace the current operating system to select images. -- `--override-variant VARIANT`:使用指定的 `VARIANT` 替代当前的架构变种来选择镜像。 +- `--override-variant VARIANT`: Use the specified `VARIANT` to replace the current architecture variant to select images. -- `-a` 或 `--all`:如果源镜像是一个列表,复制所有镜像。这对异构环境下特别有用,因为默认情况下,只会复制当前架构的镜像。 +- `-a` or `--all`: If the source image is a list, copy all images. This is particularly useful in heterogeneous environments because, by default, only images of the current architecture will be copied. -例如,如果您想复制所有架构的镜像,可以添加 `-a` 参数: +For example, if you want to copy all architecture images, you can add the `-a` parameter: ```bash sealos registry copy -a 127.0.0.1:41669/my-image:tag sealos.hub:5000 ``` - -以上就是 `sealos registry` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +The above is the usage guide for the `sealos registry copy` command. We hope it is helpful to you. If you encounter any problems during use, feel free to ask us any questions. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/reset.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/reset.md index 611df9bae44..e25b3f3742f 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/reset.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/reset.md @@ -2,60 +2,60 @@ sidebar_position: 2 --- -# reset 重置集群 +# Reset Cluster -`sealos reset` 是 Sealos 命令行工具中的一个命令,用于重置整个集群。这个命令在你想要彻底清空集群数据或者重建集群的时候特别有用。本指南将详细介绍其使用方法。 +The `sealos reset` is a command in the Sealos command-line tool for resetting the entire cluster. This command is particularly useful when you want to completely clear cluster data or rebuild the cluster. This guide will detail how to use it. -## 基本用法 +## Basic Usage -基本的 `sealos reset` 命令格式如下: +The basic format of the `sealos reset` command is as follows: ```bash sealos reset --cluster cluster_name ``` -在上述命令中,`cluster_name` 是你想要重置的集群的名称。 +In the above command, `cluster_name` is the name of the cluster you want to reset. -## 示例 +## Example -例如,你可以使用以下命令重置名为 `mycluster` 的集群: +For instance, you can use the following command to reset a cluster named `mycluster`: ```bash sealos reset --cluster mycluster ``` -## 可选参数 +## Optional Parameters -- `--force`: 该参数用于强制重置集群,即使集群重置操作未能成功完成。 +- `--force`: This parameter is used to force the reset of the cluster, even if the cluster reset operation has not been successfully completed. ```bash sealos reset --cluster mycluster --force ``` -- `--masters`: 该参数用于指定要重置的 master 节点。 +- `--masters`: This parameter is used to specify the master nodes to be reset. ```bash sealos reset --cluster mycluster --masters master1 ``` -- `--nodes`: 该参数用于指定要重置的工作节点。 +- `--nodes`: This parameter is used to specify the worker nodes to be reset. ```bash sealos reset --cluster mycluster --nodes node1 node2 ``` -- `-p`, `--passwd`: 该参数用于提供密码进行身份验证。 +- `-p`, `--passwd`: This parameter is used to provide a password for authentication. -- `-i`, `--pk`: 该参数用于指定用于公钥认证的身份(私钥)读取的文件。 +- `-i`, `--pk`: This parameter specifies the file to read the identity (private key) used for public key authentication. -- `--pk-passwd`: 该参数用于解密 PEM 编码私钥的口令。 +- `--pk-passwd`: This parameter is used for the passphrase to decrypt the PEM-encoded private key. -- `--port`: 该参数用于指定要连接的远程主机的端口。 +- `--port`: This parameter is used to specify the port of the remote host to connect to. -- `-u`, `--user`: 该参数用于指定要作为身份验证的用户名。 +- `-u`, `--user`: This parameter is used to specify the username for authentication. ```bash sealos reset --cluster mycluster --user username --pk /root/.ssh/id_rsa --pk-passwd yourpassword ``` -以上就是 `sealos reset` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 \ No newline at end of file +The above is the usage guide for the `sealos reset` command. We hope it is helpful to you. If you encounter any problems during use, feel free to ask us any questions. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/rmi.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/rmi.md index 7114566351d..8bcfd1e6bf6 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/rmi.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/rmi.md @@ -2,52 +2,52 @@ sidebar_position: 6 --- -# rmi 删除本地镜像 +# Rmi: Delete Local Images -`sealos rmi` 是 Sealos 命令行工具中的一个命令,用于删除本地存储的一个或多个镜像。这个命令可以帮助你清理无用或者过时的镜像,节省存储空间。本指南将详细介绍其使用方法。 +`sealos rmi` is a command in the Sealos command-line tool that is used to delete one or more images stored locally. This command can help you clean up useless or outdated images and save storage space. This guide will detail how to use it. -## 基本用法 +## Basic Usage -基本的 `sealos rmi` 命令格式如下: +The basic format of the `sealos rmi` command is as follows: ```bash sealos rmi imageID ``` -在上述命令中,`imageID` 是你想要删除的镜像的 ID。 +In the above command, `imageID` is the ID of the image you want to delete. -## 示例 +## Example -例如,你可以使用以下命令删除 ID 为 `imageID` 的镜像: +For instance, you can use the following command to delete an image with ID `imageID`: ```bash sealos rmi imageID ``` -如果你想要删除多个镜像,只需要在命令行中列出所有的镜像 ID,例如: +If you want to delete multiple images, just list all the image IDs in the command line, for example: ```bash sealos rmi imageID1 imageID2 imageID3 ``` -## 可选参数 +## Optional Parameters -- `-a`, `--all`: 该参数用于删除所有镜像。使用此选项时,命令将不接受任何镜像 ID。 +- `-a`, `--all`: This parameter is used to delete all images. When using this option, the command will not accept any image IDs. ```bash sealos rmi --all ``` -- `-f`, `--force`: 该参数用于强制删除镜像,以及使用该镜像的任何容器。 +- `-f`, `--force`: This parameter is used to forcefully delete an image and any containers using that image. ```bash sealos rmi --force imageID ``` -- `-p`, `--prune`: 该参数用于修剪悬挂的镜像(没有标签且没有被任何容器引用的镜像)。 +- `-p`, `--prune`: This parameter is used to prune dangling images (images without a tag and not referenced by any containers). ```bash sealos rmi --prune ``` -以上就是 `sealos rmi` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +The above is the usage guide for the `sealos rmi` command. We hope it is helpful to you. If you encounter any problems during use, feel free to ask us any questions. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/run.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/run.md index 23324fcf307..421c0e23e93 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/run.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/run.md @@ -2,83 +2,83 @@ sidebar_position: 1 --- -# run 运行集群镜像 +# Run: Execute Cluster Images -Sealos 的 `run` 命令是一个强大且灵活的工具,它支持集群初始化、应用安装、多镜像执行,单机集群等操作。下面是对于 `sealos run` 命令及其参数的详细解释和一些使用示例。 +The `run` command of Sealos is a powerful and flexible tool that supports cluster initialization, application installation, multi-image execution, single-node clusters, and more. Below is a detailed explanation and some usage examples of the `sealos run` command and its parameters. -## 命令概览 +## Command Overview ``` sealos run --masters [arg] --nodes [arg] [Options] ``` -`` 参数是您想要在集群中运行的 Docker 镜像名称和版本。`--masters` 和 `--nodes` 是您想要运行这个镜像的 master 节点和 node 节点的 IP 列表。 +The `` parameter is the name and version of the Docker image you want to run in the cluster. `--masters` and `--nodes` are the IP lists of the master and node nodes where you want to run this image. -### 选项解释 +### Option Explanation -- `--cluster='default'`: 要运行操作的集群名称。 +- `--cluster='default'`: The name of the cluster where the operation is to be run. -- `--cmd=[]`: 覆盖镜像中的 CMD 指令。 +- `--cmd=[]`: Overwrite the CMD instruction in the image. -- `--config-file=[]`: 自定义配置文件的路径,用于替换资源。 +- `--config-file=[]`: The path to the custom configuration file, used to replace resources. -- `-e, --env=[]`: 在命令执行期间设置的环境变量。 +- `-e, --env=[]`: The environment variables set during command execution. -- `-f, --force=false`: 强制覆盖此集群中的应用。 +- `-f, --force=false`: Forcefully overwrite the application in this cluster. -- `--masters=''`: 要运行的 master 节点。 +- `--masters=''`: The master nodes to be run. -- `--nodes=''`: 要运行的 node 节点。 +- `--nodes=''`: The node nodes to be run. -- `-p, --passwd=''`: 使用提供的密码进行认证。 +- `-p, --passwd=''`: Authenticate using the provided password. -- `-i, --pk='/root/.ssh/id_rsa'`: 选择从其中读取公钥认证身份的私钥文件。 +- `-i, --pk='/root/.ssh/id_rsa'`: Choose the private key file from which to read the public key authentication identity. -- `--pk-passwd=''`: 解密 PEM 编码的私钥的密码。 +- `--pk-passwd=''`: The password to decrypt the PEM-encoded private key. -- `--port=22`: 远程主机的连接端口。 +- `--port=22`: The connection port of the remote host. -- `-t, --transport='oci-archive'`: 从 tar 归档文件加载镜像传输。(可选值: oci-archive, docker-archive) +- `-t, --transport='oci-archive'`: Load image transport from a tar archive file. (Optional values: oci-archive, docker-archive) -- `-u, --user=''`: 认证的用户名。 +- `-u, --user=''`: The username for authentication. -## 示例 +## Examples -1. 创建集群到您的裸机服务器,指定 IP 列表: +1. Create a cluster on your bare-metal servers, specifying the IP list: ``` sealos run labring/kubernetes:v1.24.0 --masters 192.168.0.2,192.168.0.3,192.168.0.4 \ --nodes 192.168.0.5,192.168.0.6,192.168.0.7 --passwd 'xxx' ``` -2. 多镜像运行: +2. Run multiple images: ``` sealos run labring/kubernetes:v1.24.0 labring/helm:v3.11.3 calico:v3.24.6 \ --masters 192.168.64.2,192.168.64.22,192.168.64.20 --nodes 192.168.64.21,192.168.64.19 ``` -3. 指定服务器的 InfraSSH 端口: +3. Specify the InfraSSH port of the server: ``` sealos run labring/kubernetes:v1.24.0 --masters 192.168.0.2,192.168.0.3,192.168.0.4 \ --nodes 192.168.0.5,192.168.0.6,192.168.0.7 --port 24 --passwd 'xxx' ``` -4. 自定义 VIP Kubernetes 集群: +4. Customize a VIP Kubernetes cluster: ``` sealos run -e defaultVIP=10.103.97.2 labring/kubernetes:v1.24.0 --masters 192.168.0.2,192.168.0.3,192.168.0.4 \ --nodes 192.168.0.5,192.168.0.6,192.168.0.7 --passwd 'xxx' ``` -5. 创建单节点 Kubernetes 集群: +5. Create a single-node Kubernetes cluster: ``` sealos run labring/kubernetes:v1.24.0 ``` -6. 使用自定义环境变量创建集群: +6. Create a cluster using custom environment variables: ``` sealos run -e DashBoardPort=8443 mydashboard:latest --masters 192.168.0.2,192.168.0.3,192.168.0.4 \ --nodes 192.168.0.5,192.168.0.6,192.168.0.7 --passwd 'xxx' ``` -这些示例展示了 `sealos run` 命令的强大和灵活性,可以根据您的需求进行定制和调整。 +These examples demonstrate the power and flexibility of the `sealos run` command, which can be customized and adjusted according to your needs. -更多示例请参考 [运行集群](https://docs.sealos.io/docs/lifecycle-management/operations/run-cluster)。 +For more examples, please refer to [Run Cluster](https://docs.sealos.io/docs/lifecycle-management/operations/run-cluster). diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/save.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/save.md index 86eff6e1160..bb57b0cfd87 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/save.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/save.md @@ -2,36 +2,36 @@ sidebar_position: 6 --- -# save 保存镜像 +# Save: Store Images -`sealos save` 是 Sealos 命令行工具中的一个命令,用于将镜像保存到归档文件中。这个命令可以帮助你方便地备份和迁移你的镜像。本指南将详细介绍其使用方法。 +`sealos save` is a command in the Sealos command-line tool used to save images to archive files. This command can help you conveniently back up and migrate your images. This guide will detail its usage. -## 基本用法 +## Basic Usage -基本的 `sealos save` 命令格式如下: +The basic `sealos save` command format is as follows: ```bash sealos save -o outputFilename imageName ``` -在上述命令中,`outputFilename` 是你想要保存的归档文件的名称,`imageName` 是你想要保存的镜像的名称。 +In the above command, `outputFilename` is the name of the archive file you want to save, and `imageName` is the name of the image you want to save. -## 示例 +## Example -例如,你可以使用以下命令将名为 `labring/kubernetes:latest` 的镜像保存到一个名为 `kubernetes.tar` 的归档文件中: +For example, you can use the following command to save an image named `labring/kubernetes:latest` to an archive file named `kubernetes.tar`: ```bash sealos save -o kubernetes.tar labring/kubernetes:v1.24.0 ``` -## 可选参数 +## Optional Parameters -- `-t`, `--transport`: 这个参数用于指定保存镜像的传输方式。目前可用的选项有 `oci-archive` 和 `docker-archive`。默认值是 `oci-archive`。 +- `-t`, `--transport`: This parameter is used to specify the transport method for saving the image. The currently available options are `oci-archive` and `docker-archive`. The default value is `oci-archive`. -例如,你可以使用以下命令将名为 `labring/kubernetes:latest` 的镜像以 `docker-archive` 的方式保存到一个名为 `kubernetes.tar` 的归档文件中: +For example, you can use the following command to save an image named `labring/kubernetes:latest` to an archive file named `kubernetes.tar` in the `docker-archive` method: ```bash sealos save -o kubernetes.tar -t docker-archive labring/kubernetes:v1.24.0 ``` -以上就是 `sealos save` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +The above is the usage guide of the `sealos save` command, and we hope it is helpful to you. If you encounter any problems during use, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/scp.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/scp.md index 1508424fb4f..d31cf5e9189 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/scp.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/scp.md @@ -2,50 +2,50 @@ sidebar_position: 5 --- -# scp 拷贝文件 +# Scp: Copy Files -`sealos scp` 是 Sealos 命令行工具中的一个命令,用于将文件复制到指定的集群节点。本指南将详细介绍其使用方法和选项。 +`sealos scp` is a command in the Sealos command-line tool, used for copying files to specified cluster nodes. This guide will detail its usage and options. -## 基本用法 +## Basic Usage -基本的 `sealos scp` 命令格式如下: +The basic `sealos scp` command format is as follows: ```bash sealos scp "source file path" "destination file path" ``` -在上述命令中,`source file path` 是你要复制的文件的本地路径,`destination file path` 是你要将文件复制到的远程节点路径。 +In the above command, `source file path` is the local path of the file you want to copy, and `destination file path` is the remote node path you want to copy the file to. -## 选项 +## Options -`sealos scp` 命令提供了以下选项: +The `sealos scp` command provides the following options: -- `-c, --cluster='default'`: 要将文件复制到其上的集群的名称。默认为 `default`。 +- `-c, --cluster='default'`: The name of the cluster to which the files should be copied. The default is `default`. -- `--ips=[]`: 将文件复制到具有指定 IP 地址的节点。 +- `--ips=[]`: Copies the files to nodes with the specified IP addresses. -- `-r, --roles='':`: 将文件复制到具有指定角色的节点。 +- `-r, --roles='':`: Copies the files to nodes with specified roles. -每个选项后都可以跟随一个或多个参数。 +Each option can be followed by one or more arguments. -## 示例 +## Examples -例如,你可以使用以下命令将本地的 `/root/aa.txt` 文件复制到默认集群的所有节点的 `/root/dd.txt`: +For example, you can use the following command to copy the local file `/root/aa.txt` to `/root/dd.txt` on all nodes in the default cluster: ```bash sealos scp "/root/aa.txt" "/root/dd.txt" ``` -如果你想在名为 `my-cluster` 的集群的 `master` 和 `node` 角色的节点上复制文件,可以使用以下命令: +If you want to copy files on the nodes with the `master` and `node` roles in the cluster named `my-cluster`, you can use the following command: ```bash sealos scp -c my-cluster -r master,node "/root/aa.txt" "/root/dd.txt" ``` -如果你只想在 IP 地址为 `172.16.1.38` 的节点上复制文件,可以使用以下命令: +If you only want to copy files on the node with the IP address `172.16.1.38`, you can use the following command: ```bash sealos scp -c my-cluster --ips 172.16.1.38 "/root/aa.txt" "/root/dd.txt" ``` -以上就是 `sealos scp` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +The above is the usage guide for the `sealos scp` command, and we hope it is helpful to you. If you encounter any problems during use, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/tag.md b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/tag.md index c3e250cc344..752cc7e5722 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/commands/tag.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/commands/tag.md @@ -2,32 +2,32 @@ sidebar_position: 6 --- -# tag 添加镜像名称 +# Tag: Add Image Names -`sealos tag` 是 Sealos 命令行工具中的一个命令,用于给本地存储的镜像添加一个或多个附加名称。这个命令可以帮助你更好地管理你的镜像。本指南将详细介绍其使用方法。 +`sealos tag` is a command in the Sealos command-line tool, used to add one or more additional names to the images stored locally. This command can help you better manage your images. This guide will detail its usage. -## 基本用法 +## Basic Usage -基本的 `sealos tag` 命令格式如下: +The basic `sealos tag` command format is as follows: ```bash sealos tag imageName newName ``` -在上述命令中,`imageName` 是你要操作的镜像的名称,`newName` 是你想要添加的新标签。 +In the above command, `imageName` is the name of the image you want to operate on, and `newName` is the new tag you want to add. -## 示例 +## Examples -例如,你可以使用以下命令给名为 `imageName` 的镜像添加一个新的名称 `firstNewName`: +For example, you can use the following command to add a new name `firstNewName` to an image named `imageName`: ```bash sealos tag imageName firstNewName ``` -你也可以一次添加多个名称,例如,添加 `firstNewName` 和 `SecondNewName` 两个名称: +You can also add multiple names at once, for example, add two names `firstNewName` and `SecondNewName`: ```bash sealos tag imageName firstNewName SecondNewName ``` -以上就是 `sealos tag` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。 +The above is the usage guide for the `sealos tag` command, and we hope it is helpful to you. If you encounter any problems during use, feel free to ask us. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/kubernetes-cluster-image.md b/docs/4.0/docs/lifecycle-management/reference/sealos/kubernetes-cluster-image.md index f09d34f7bf1..f00cafdd02b 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/kubernetes-cluster-image.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/kubernetes-cluster-image.md @@ -2,54 +2,54 @@ sidebar_position: 10 --- -# Kubernetes 集群镜像说明文档 +# Kubernetes Cluster Image Documentation -本文档主要介绍 Sealos 官方提供的 rootfs 类型集群镜像,包括镜像名称、镜像类型以及镜像版本等方面的说明。 +This document provides an overview of the rootfs-type cluster images offered by Sealos, including the image names, types, and versions. -## 镜像名称 +## Image Names -Sealos 官方发布的集群镜像主要包括以下几种: +The official cluster images provided by Sealos include the following: -1. kubernetes:使用 containerd 作为容器运行时(CRI)的 Kubernetes 镜像。 -2. kubernetes-docker:使用 docker 作为容器运行时(CRI)的 Kubernetes 镜像。 -3. kubernetes-crio:使用 crio 作为容器运行时(CRI)的 Kubernetes 镜像。 +1. kubernetes: Kubernetes image with containerd as the container runtime interface (CRI). +2. kubernetes-docker: Kubernetes image with Docker as the CRI. +3. kubernetes-crio: Kubernetes image with Crio as the CRI. -目前,Sealos 主要提供了 Kubernetes 相关的镜像,而其他类型的集群镜像,如 k3s、k0s 等,尚未提供。 +Currently, Sealos primarily provides Kubernetes-related images and has not yet provided other types of cluster images such as k3s or k0s. -## 镜像类型 +## Image Types -根据容器运行时(CRI)的不同,Sealos 提供了不同类型的 Kubernetes 集群镜像: +Sealos offers different types of Kubernetes cluster images based on the container runtime interface (CRI): -1. 使用 containerd 作为 CRI 的 Kubernetes 镜像。 -2. 使用 docker 作为 CRI 的 Kubernetes 镜像。 -3. 使用 crio 作为 CRI 的 Kubernetes 镜像。 +1. Kubernetes image with containerd as the CRI. +2. Kubernetes image with Docker as the CRI. +3. Kubernetes image with Crio as the CRI. -用户可以根据自己的需求和偏好,选择合适的镜像类型。 +Users can choose the appropriate image type based on their requirements and preferences. -## 镜像版本 +## Image Versions -Sealos 官方提供的集群镜像有多个版本可供选择,例如: +Sealos offers multiple versions of cluster images. Examples include: -### 1. 开发版(Development version) +### 1. Development Version -适用于想要尝试项目最新功能的用户。开发版可能包含尚未经过完整测试的新功能和改进,因此可能不够稳定。 +This version is suitable for users who want to try out the latest features of the project. The development version may contain new features and improvements that have not been thoroughly tested and may not be as stable. -示例:`v1.26(v1.26-amd64/v1.26-arm64)` +Example: `v1.26(v1.26-amd64/v1.26-arm64)` -### 2. 最新版(Latest version) +### 2. Latest Version -通常比开发版更稳定,但可能不包含所有的新功能。这是推荐给大多数用户使用的版本。 +The latest version is typically more stable than the development version but may not include all the new features. This version is recommended for most users. -示例:`v1.26.0(v1.26.0-amd64/v1.26.0-arm64)` +Example: `v1.26.0(v1.26.0-amd64/v1.26.0-arm64)` -### 3. 发布版(Release version,包含历史版本) +### 3. Release Version (Including Historical Versions) -包含了历史版本的发布版。发布版通常经过了严格的测试,被认为是稳定的。 +The release version includes historical versions. Release versions have usually undergone rigorous testing and are considered stable. -示例:`v1.26.0-4.1.5(v1.26.0-4.1.5-amd64/v1.26.0-4.1.5-arm64)` `4.1.5`是sealos对应版本号 +Example: `v1.26.0-4.1.5(v1.26.0-4.1.5-amd64/v1.26.0-4.1.5-arm64)` `4.1.5` is the corresponding version number for Sealos. -在选择镜像版本时,用户需要根据自己的需求和偏好来选择适合的版本。另外,Sealos 还提供了针对不同处理器架构的子版本,以满足用户在不同硬件平台上的需求。 +When choosing an image version, users should consider their requirements and preferences. Additionally, Sealos provides sub-versions for different processor architectures to meet the needs of users on different hardware platforms. -## 总结 +## Summary -本文档对 Sealos 官方提供的 rootfs 类型集群镜像进行了说明,包括镜像名称、镜像类型以及镜像版本等方面。用户可以根据自己的需求和偏好,在不同的镜像类型和版本中进行选择,以便在 Kubernetes 集群中运行容器。 +This document provides an overview of the rootfs-type cluster images offered by Sealos, including the image names, types, and versions. Users can select the appropriate image type and version based on their requirements and preferences to run containers in a Kubernetes cluster. diff --git a/docs/4.0/docs/lifecycle-management/reference/sealos/sealos.md b/docs/4.0/docs/lifecycle-management/reference/sealos/sealos.md index 02e136d42cf..608ae3d1ddb 100644 --- a/docs/4.0/docs/lifecycle-management/reference/sealos/sealos.md +++ b/docs/4.0/docs/lifecycle-management/reference/sealos/sealos.md @@ -2,15 +2,13 @@ sidebar_position: 0 --- -# Sealos 使用指南 +# Sealos User Guide -Sealos 是一个统一的云操作系统,用于管理云原生应用。它提供了一系列命令行工具来帮助用户管理 Kubernetes 集群,管理节点,远程操作,管理容器和镜像,以及其他一些功能。下面是这些命令的详细介绍: - -本章节主要介绍 Sealos 的使用指南以及集群镜像相关说明。 - -- Sealos使用指南: 有关每个命令的详细信息,包括所有受支持的参数和子命令, 请参阅 [sealos](https://docs.sealos.io/docs/lifecycle-management/reference/sealos/commands) 参考文档。 -- 集群镜像: - - [Rootfs集群镜像](https://docs.sealos.io/docs/lifecycle-management/reference/sealos/kubernetes-cluster-image) - - [Application集群镜像](https://docs.sealos.io/docs/lifecycle-management/reference/sealos/app-cluster-image) +Sealos is a unified cloud operating system designed to manage cloud-native applications. It provides a set of command-line tools to help users manage Kubernetes clusters, nodes, perform remote operations, manage containers and images, and perform other functions. Below are detailed introductions to these commands: +This chapter provides a user guide for using Sealos, as well as information related to cluster images. +- Sealos User Guide: For detailed information about each command, including all supported parameters and subcommands, please refer to the [sealos](https://docs.sealos.io/docs/lifecycle-management/reference/sealos/commands) reference documentation. +- Cluster Images: + - [Rootfs Cluster Images](https://docs.sealos.io/docs/lifecycle-management/reference/sealos/kubernetes-cluster-image) + - [Application Cluster Images](https://docs.sealos.io/docs/lifecycle-management/reference/sealos/app-cluster-image) diff --git a/docs/4.0/i18n/zh-Hans/lifecycle-management/advanced-guide/image-build-standardized.md b/docs/4.0/i18n/zh-Hans/lifecycle-management/advanced-guide/image-build-standardized.md index 331c240a485..aa61c9270a1 100644 --- a/docs/4.0/i18n/zh-Hans/lifecycle-management/advanced-guide/image-build-standardized.md +++ b/docs/4.0/i18n/zh-Hans/lifecycle-management/advanced-guide/image-build-standardized.md @@ -57,7 +57,7 @@ FROM labring/kubernetes:v1.24.0 ENV version v1.1.0 COPY manifests ./manifests COPY registry ./registry -ENTRYPOINIT ["kubectl apply -f manifests/tigera-operator.yaml"] +ENTRYPOINT ["kubectl apply -f manifests/tigera-operator.yaml"] CMD ["kubectl apply -f manifests/custom-resources.yaml"] ``` diff --git a/docs/4.0/i18n/zh-Hans/lifecycle-management/operations/build-image/build-image-go_template.md b/docs/4.0/i18n/zh-Hans/lifecycle-management/operations/build-image/build-image-go_template.md index 7c9bda3c492..135698980bf 100644 --- a/docs/4.0/i18n/zh-Hans/lifecycle-management/operations/build-image/build-image-go_template.md +++ b/docs/4.0/i18n/zh-Hans/lifecycle-management/operations/build-image/build-image-go_template.md @@ -94,9 +94,7 @@ spec: type: NodePort ports: - port: 80 - nodePort: - -30080 + nodePort: 30080 name: http - port: 443 nodePort: 30443 diff --git a/docs/4.0/i18n/zh-Hans/lifecycle-management/reference/sealctl/sealctl.md b/docs/4.0/i18n/zh-Hans/lifecycle-management/reference/sealctl/sealctl.md index e5ebe493b6c..8ee151bd6dc 100644 --- a/docs/4.0/i18n/zh-Hans/lifecycle-management/reference/sealctl/sealctl.md +++ b/docs/4.0/i18n/zh-Hans/lifecycle-management/reference/sealctl/sealctl.md @@ -6,8 +6,6 @@ sidebar_position: 0 Sealos 提供 sealctl 是使用 Sealos 与 集群节点进行操作的命令行工具。它包括以下几个子命令: -这个工具叫做 `kubectl`。 - 1. `cert`:管理证书,用于生成、查看和更新TLS证书。 2. `cri`:管理容器运行时接口(CRI)配置,例如Docker或containerd。 3. `hostname`:查看或设置系统主机名。 diff --git a/docs/4.0/i18n/zh-Hans/lifecycle-management/reference/sealos/commands/registry.md b/docs/4.0/i18n/zh-Hans/lifecycle-management/reference/sealos/commands/registry.md index a82eac19d09..746b32a8f87 100644 --- a/docs/4.0/i18n/zh-Hans/lifecycle-management/reference/sealos/commands/registry.md +++ b/docs/4.0/i18n/zh-Hans/lifecycle-management/reference/sealos/commands/registry.md @@ -85,7 +85,6 @@ sealos registry serve inmem 通过 `sealctl registry serve` 命令,用户可以轻松地管理和操作 Docker 镜像仓库。无论是在开发环境,还是在生产环境中,它都是一个强大且易用的工具。 - ## Sealos:sealos registry passwd 命令详解与使用指南 在管理 Docker 镜像仓库过程中,Sealos 提供了 `sealos registry passwd` 命令以方便用户对集群registry进行密码修改。它提供了一种简便的方法,帮助用户修改 registry 的密码。 @@ -128,12 +127,11 @@ sealos registry passwd ### 注意事项 +**修改 registry 密码后,修改Clusterfile中的registry密码** 修改 registry 密码后,所有使用该 registry 的节点和服务都需要更新配置,以使用新的密码进行身份验证。否则,它们将无法从该 registry 拉取或推送镜像。 如果你不确定如何更新节点和服务的配置,建议在修改 registry 密码之前,先查阅相关文档或者寻求专业的技术支持。 - - ## Sealos:`sealos registry sync` 命令详解与使用指南 Sealos 的 `registry sync` 命令可帮助您在两个 registry 之间同步所有镜像。这不仅可以用于镜像的迁移,还可以备份您的镜像。