Merge pull request #1786 from Felixnoo/update-s2i
Update Doc: Source to Image
|
|
@ -25,7 +25,7 @@ This tutorial demonstrates how to use S2I to import source code of a Java sample
|
|||
|
||||
Log in to GitHub and fork the GitHub repository [devops-java-sample](https://github.com/kubesphere/devops-java-sample) to your personal GitHub account.
|
||||
|
||||

|
||||

|
||||
|
||||
### Step 2: Create Secrets
|
||||
|
||||
|
|
@ -41,21 +41,21 @@ You do not need to create the GitHub Secret if your forked repository is open to
|
|||
|
||||
1. In the same project, navigate to **Services** under **Application Workloads** and click **Create**.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Choose **Java** under **Build a New Service from Source Code Repository**, name it `s2i-demo` and click **Next**.
|
||||
|
||||

|
||||

|
||||
|
||||
{{< notice note >}}
|
||||
|
||||
KubeSphere has integrated common S2I templates such as Java, Node.js and Python. If you want to use other languages or customize your S2I templates, see Customize S2I Templates.
|
||||
KubeSphere has integrated common S2I templates such as Java, Node.js and Python. If you want to use other languages or customize your S2I templates, see [Customize S2I Templates](../s2i-templates/).
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
3. On the **Build Settings** page, provide the following information accordingly and click **Next**.
|
||||
|
||||

|
||||

|
||||
|
||||
**Service Type**: Select **Stateless Service** for this example. For more information about different Services, see [Service Type](../../../project-user-guide/application-workloads/services/#service-type).
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ You do not need to create the GitHub Secret if your forked repository is open to
|
|||
|
||||
**Code URL**: The source code repository address (currently support Git). You can specify the code branch and the relative path in the source code terminal. The URL supports HTTP and HTTPS. Paste the forked repository URL (your own repository address) into this field.
|
||||
|
||||

|
||||

|
||||
|
||||
**Branch**: The branch that is used for image building. Enter `master` for this tutorial. You can enter `dependency` for a cache test.
|
||||
|
||||
|
|
@ -79,11 +79,11 @@ You do not need to create the GitHub Secret if your forked repository is open to
|
|||
|
||||
4. On the **Container Settings** page, scroll down to **Service Settings** to set the access policy for the container. Select **HTTP** for **Protocol**, customize the name (for example, `http-1`), and enter `8080` for both **Container Port** and **Service Port**.
|
||||
|
||||

|
||||

|
||||
|
||||
5. Scroll down to **Health Checker** and check it. Set a readiness probe by filling out the following parameters. Click **√** when you finish setting the probe and then click **Next** to continue.
|
||||
5. Scroll down to **Health Checker** and select it. Set a readiness probe by filling out the following parameters. Click **√** when you finish setting the probe and then click **Next** to continue.
|
||||
|
||||

|
||||

|
||||
|
||||
**HTTP Request**: Select **HTTP** as the protocol, enter `/` as the path (root path in this tutorial), and enter `8080` as the port exposed.
|
||||
|
||||
|
|
@ -95,49 +95,49 @@ You do not need to create the GitHub Secret if your forked repository is open to
|
|||
|
||||
6. On the **Mount Volumes** page, you can add a volume for the container. For more information, see [Volumes](../../../project-user-guide/storage/volumes/). Click **Next** to continue.
|
||||
|
||||
7. On the **Advanced Settings** page, check **Internet Access** and select **NodePort** as the access method. Click **Create** to finish the whole process.
|
||||
7. On the **Advanced Settings** page, select **Internet Access** and select **NodePort** as the access method. Click **Create** to finish the whole process.
|
||||
|
||||

|
||||

|
||||
|
||||
8. Click **Image Builder** from the navigation bar and you can see that the example image is being built.
|
||||
|
||||

|
||||

|
||||
|
||||
### Step 4: Check results
|
||||
|
||||
1. Wait for a while and you can see the status of the image has reached **Successful**.
|
||||
|
||||

|
||||

|
||||
|
||||
2. Click this image to go to its detail page. Under **Job Records**, click the arrow icon on the right of a record to see building logs. You can see `Build completed successfully` at the end of the log if everything runs normally.
|
||||
2. Click this image to go to its detail page. Under **Job Records**, click <img src="/images/docs/project-user-guide/image-builder/s2i-publish-app-without-dockerfile/down-arrow.png" width="20px" /> on the right of a record to see building logs. You can see `Build completed successfully` at the end of the log if everything runs normally.
|
||||
|
||||

|
||||

|
||||
|
||||
3. Go back to the previous page, and you can see the corresponding Job, Deployment and Service of the image have been all created successfully.
|
||||
|
||||
#### Service
|
||||
|
||||

|
||||

|
||||
|
||||
#### Deployment
|
||||
|
||||

|
||||

|
||||
|
||||
#### Job
|
||||
|
||||

|
||||

|
||||
|
||||
4. In your Docker Hub repository, you can see that KubeSphere has pushed the image to the repository with the expected tag.
|
||||
|
||||

|
||||

|
||||
|
||||
### Step 5: Access the S2I Service
|
||||
|
||||
1. On the **Services** page, click the S2I Service to go to its detail page.
|
||||
|
||||

|
||||

|
||||
|
||||
2. To access the Service, you can either use the endpoint with the `curl` command or visit `Node IP:Port Number`. For example:
|
||||
2. To access the Service, you can either use the endpoint with the `curl` command or visit `<Node IP>:<Port Number>`. For example:
|
||||
|
||||
```bash
|
||||
$ curl 10.10.131.44:8080
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ Source-to-Image (S2I) 是一个工具箱和工作流,用于从源代码构建
|
|||
|
||||
{{< notice note >}}
|
||||
|
||||
KubeSphere 已集成常用的 S2I 模板,例如 Java、Node.js 和 Python。如果您想使用其他语言或自定义 S2I 模板,请参见自定义 S2I 模板。
|
||||
KubeSphere 已集成常用的 S2I 模板,例如 Java、Node.js 和 Python。如果您想使用其他语言或自定义 S2I 模板,请参见[自定义 S2I 模板](../s2i-templates/)。
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ Source-to-Image (S2I) 是一个工具箱和工作流,用于从源代码构建
|
|||
|
||||

|
||||
|
||||
2. 点击该镜像前往其详情页面。在**任务记录**下,点击记录右侧的箭头图标查看构建日志。如果一切运行正常,您可以在日志末尾看到 `Build completed successfully`。
|
||||
2. 点击该镜像前往其详情页面。在**任务记录**下,点击记录右侧的 <img src="/images/docs/zh-cn/project-user-guide/image-builder/source-to-image/down-arrow.png" width="20px" /> 查看构建日志。如果一切运行正常,您可以在日志末尾看到 `Build completed successfully`。
|
||||
|
||||

|
||||
|
||||
|
|
@ -137,7 +137,7 @@ Source-to-Image (S2I) 是一个工具箱和工作流,用于从源代码构建
|
|||
|
||||

|
||||
|
||||
2. 要访问该服务,您可以执行 `curl` 命令使用 Endpoint 或者访问 `Node IP:Port Number`。例如:
|
||||
2. 要访问该服务,您可以执行 `curl` 命令使用 Endpoint 或者访问 `<Node IP>:<Port Number>`。例如:
|
||||
|
||||
```bash
|
||||
$ curl 10.10.131.44:8080
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 448 KiB |
|
After Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 367 KiB |
|
After Width: | Height: | Size: 461 KiB |
|
Before Width: | Height: | Size: 218 KiB |
|
After Width: | Height: | Size: 240 KiB |
|
Before Width: | Height: | Size: 296 KiB |
|
After Width: | Height: | Size: 903 KiB |
|
Before Width: | Height: | Size: 228 KiB |
|
After Width: | Height: | Size: 384 KiB |
|
Before Width: | Height: | Size: 253 KiB |
|
After Width: | Height: | Size: 634 KiB |
|
Before Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 596 KiB |
|
Before Width: | Height: | Size: 246 KiB |
|
After Width: | Height: | Size: 604 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 290 KiB |
|
After Width: | Height: | Size: 751 KiB |
|
Before Width: | Height: | Size: 327 KiB |
|
After Width: | Height: | Size: 576 KiB |
|
Before Width: | Height: | Size: 238 KiB |
|
After Width: | Height: | Size: 236 KiB |
|
Before Width: | Height: | Size: 237 KiB |
|
After Width: | Height: | Size: 353 KiB |
|
Before Width: | Height: | Size: 230 KiB |
|
After Width: | Height: | Size: 284 KiB |
|
Before Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 280 KiB |
|
After Width: | Height: | Size: 603 KiB |
|
Before Width: | Height: | Size: 202 KiB |
|
After Width: | Height: | Size: 598 KiB |
|
After Width: | Height: | Size: 2.1 KiB |