Skip to content

Commit

Permalink
docs: sealos create support for environment variable based template…
Browse files Browse the repository at this point in the history
… rendering (#4224)

* feature: environment variable based template rendering in sealos create

* add: goimports tools

* update: goimports tools

* update: goimports tools

* fix golangci lint error

* docs: environment variable based template rendering in sealos create
  • Loading branch information
LZiHaN committed Nov 2, 2023
1 parent 183f7c7 commit 77e7e18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Expand Up @@ -26,16 +26,18 @@ The `sealos create` command provides the following options:

- `--short=false`: If true, only print the mount path.

- `-e, --env=[]`: Specify environment variables used during the rendering of template files.

Each option can be followed by an argument.

## Example

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
sealos create -e registryPort=8443 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.
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. The `-e registryPort=8443` option specifies the environment variable used during the rendering of template files, where `registryPort` is set to `8443`. Please note that in this example, the cluster is not actually run.

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.
Expand Up @@ -26,16 +26,18 @@ sealos create docker.io/labring/kubernetes:v1.24.0

- `--short=false`: 如果为真,只打印挂载路径。

- `-e, --env=[]`: 指定渲染模板文件时使用的环境变量。

每个选项后都可以跟随一个参数。

## 示例

例如,你可以使用以下命令创建一个名为 `mycluster` 的集群,但不实际运行它:

```bash
sealos create docker.io/labring/kubernetes:v1.24.0
sealos create -e registryPort=8443 docker.io/labring/kubernetes:v1.24.0
```

此命令将创建一个镜像名称为 `docker.io/labring/kubernetes:v1.24.0` 的集群工作目录,并输出集群镜像的地址,但不会实际运行集群竟
此命令将创建一个镜像名称为 `docker.io/labring/kubernetes:v1.24.0` 的集群工作目录,并输出集群镜像的地址`-e registryPort=8443` 选项指定了在渲染模板文件时使用的环境变量,其中 `registryPort` 被设置为 `8443`。请注意,这个示例中集群并没有被实际运行

以上就是 `sealos create` 命令的使用指南,希望对你有所帮助。如果你在使用过程中遇到任何问题,欢迎向我们提问。

0 comments on commit 77e7e18

Please sign in to comment.