Update 3.2.0 Jenkins System Settings Docs

Signed-off-by: Felixnoo <felixliu@kubesphere.io>
This commit is contained in:
Felixnoo 2021-12-03 14:45:08 +08:00
parent 161d4d4427
commit f2d10b697a
8 changed files with 15 additions and 25 deletions

View File

@ -77,7 +77,7 @@ You need to create two projects, such as `kubesphere-sample-dev` and `kubesphere
If you want to use a private repository from GitLab, refer to the following steps:
- Go to **User Settings > Access Tokens** on GitLab to create an access token with API and read_repository permissions.
- [Log in to the Jenkins dashboard](../jenkins-setting/#log-in-to-jenkins-to-reload-configurations), go to **Manage Jenkins > Manage Credentials** to use your GitLab token to create a Jenkins credential for accessing GitLab, and go to **Manage Jenkins > Configure System** to add the credential in **GitLab Server**.
- [Log in to the Jenkins dashboard](../jenkins-setting/#log-in-to-jenkins-to-view-configurations), go to **Manage Jenkins > Manage Credentials** to use your GitLab token to create a Jenkins credential for accessing GitLab, and go to **Manage Jenkins > Configure System** to add the credential in **GitLab Server**.
- In your DevOps project, select **DevOps Project Settings > Credentials** to use your GitLab token to create a credential. You have to specify the credential for **Credential** on the **GitLab** tab when creating a pipeline so that the pipeline can pull code from your private GitLab repository.
{{</ notice >}}

View File

@ -29,20 +29,15 @@ Besides, you can find the `formula.yaml` file in the repository [ks-jenkins](htt
It is recommended that you configure Jenkins in KubeSphere through Configuration as Code (CasC). The built-in Jenkins CasC file is stored as a [ConfigMap](../../../project-user-guide/configuration/configmaps/).
1. Log in to KubeSphere as `admin`. Click **Platform** in the upper-left corner and select **Cluster Management**.
2. If you have enabled the [multi-cluster feature](../../../multicluster-management/) with member clusters imported, you can select a specific cluster to edit the ConfigMap. If you have not enabled the feature, refer to the next step directly.
3. In the left navigation pane, select **ConfigMaps** under **Configuration**. On the **ConfigMaps** page, select `kubesphere-devops-system` from the drop-down list and click `jenkins-casc-config`.
3. On the left navigation pane, select **ConfigMaps** under **Configuration**. On the **ConfigMaps** page, select `kubesphere-devops-system` from the drop-down list and click `jenkins-casc-config`.
4. On the details page, click **Edit YAML** from the **More** drop-down list.
5. The configuration template for `jenkins-casc-config` is a YAML file under the `data.jenkins_user.yaml:` section. You can modify the container image, label, resource requests and limits, etc. in the broker (Kubernetes Jenkins agent) in the ConfigMap or add a container in the podTemplate. When you finish, click **OK**.
6. Wait for a while until your changes are automatically reloaded.
5. The configuration template for `jenkins-casc-config` is a YAML file as shown below. You can modify the container image, label, resource requests and limits, etc. in the broker (Kubernetes Jenkins agent) in the ConfigMap or add a container in the podTemplate. When you finish, click **OK**.
## Log in to Jenkins to View Configurations
![edit-jenkins](/images/docs/devops-user-guide/using-devops/jenkins-system-settings/edit-jenkins.png)
## Log in to Jenkins to Reload Configurations
After you modified `jenkins-casc-config`, you need to reload your updated system configuration on the **Configuration as Code** page on the Jenkins dashboard. This is because system settings configured directly through the Jenkins dashboard may be overwritten by the CasC configuration after Jenkins is rescheduled.
After you modified `jenkins-casc-config`, you can log in to the Jenkins dashboard to view the updated system configurations on the **Configuration as Code** page.
1. Execute the following command to get the address of Jenkins.
@ -70,7 +65,7 @@ After you modified `jenkins-casc-config`, you need to reload your updated system
5. Scroll down and click **Configuration as Code**.
6. To reload configurations that you have modified in the ConfigMap, click **Apply new configuration**.
6. To view the updated configurations, click **View Configuration**.
7. For more information about how to set up Jenkins via CasC, see the [Jenkins documentation](https://github.com/jenkinsci/configuration-as-code-plugin).

View File

@ -18,7 +18,7 @@ This tutorial demonstrates how to use Jenkins shared libraries in KubeSphere Dev
## Configure a Shared Library on the Jenkins Dashboard
1. [Log in to the Jenkins dashboard](../jenkins-setting/#log-in-to-jenkins-to-reload-configurations) and click **Manage Jenkins** in the left navigation pane.
1. [Log in to the Jenkins dashboard](../jenkins-setting/#log-in-to-jenkins-to-view-configurations) and click **Manage Jenkins** in the left navigation pane.
2. Scroll down and click **Configure System**.

View File

@ -77,7 +77,7 @@ weight: 11291
如需使用 GitLab 私有仓库,请参考以下步骤:
- 在 GitLab 上前往**用户设置 > 访问令牌**,创建拥有 API 和 read_repository 权限的个人访问令牌。
- [登录 Jenkins 面板](../jenkins-setting/#登录-jenkins-重新加载配置),前往**系统管理 > Manage Credentials**,使用您的 GitLab 令牌创建 Jenkins 凭证,用于访问 GitLab。然后前往**系统管理 > 系统配置**,在 **GitLab 服务**中添加该凭证。
- [登录 Jenkins 面板](../jenkins-setting/#登录-jenkins-查看配置),前往**系统管理 > Manage Credentials**,使用您的 GitLab 令牌创建 Jenkins 凭证,用于访问 GitLab。然后前往**系统管理 > 系统配置**,在 **GitLab 服务**中添加该凭证。
- 在您的 DevOps 项目中,选择 **DevOps 项目设置 > 凭证**,使用您的 GitLab 令牌创建一个凭证。然后在创建流水线时,您需要在 **GitLab** 页签上的**凭证**中指定该凭证,以便流水线能够从您的 GitLab 私有仓库中拉取代码。
{{</ notice >}}

View File

@ -29,20 +29,15 @@ KubeSphere 默认安装 Jenkins Configuration as Code 插件,您可以通过 Y
建议您通过 Configuration as Code (CasC) 在 KubeSphere 中配置 Jenkins。内置 Jenkins CasC 文件存储为 [ConfigMap](../../../project-user-guide/configuration/configmaps/)。
1. 以 `admin` 身份登录 KubeSphere点击左上角的**平台管理**,然后选择**集群管理**。
2. 如果您已经启用[多集群功能](../../../multicluster-management/)并已导入成员集群,您可以选择一个特定集群来编辑 ConfigMap。如果您尚未启用多集群功能请直接参考下一步。
3. 在左侧导航栏中选择**配置**下的**配置字典**。在**配置字典**页面上,从下拉列表中选择 `kubesphere-devops-system`,然后点击 `jenkins-casc-config`
4. 在详情页面上,点击**更多操作**,在下拉列表中选择**编辑 YAML**。
5. `jenkins-casc-config` 的配置模板是一个 YAML 文件,位于 `data.jenkins_user.yaml:` 部分。您可以在 ConfigMap 的代理 (Kubernetes Jenkins Agent) 中修改容器镜像、标签、资源请求 (Request) 和限制 (Limit) 等内容,或者在 podTemplate 中添加容器。完成操作后,点击**确定**。
6. 稍等片刻,您的改动会自动重新加载。
5. `jenkins-casc-config` 的配置模板是一个 YAML 文件,如下图所示。您可以在 ConfigMap 的代理 (Kubernetes Jenkins Agent) 中修改容器镜像、标签、资源请求 (Request) 和限制 (Limit) 等内容,或者在 podTemplate 中添加容器。完成操作后,点击**确定**。
## 登录 Jenkins 查看配置
![编辑 Jenkins](/images/docs/zh-cn/devops-user-guide/use-devops/jenkins-system-settings/edit-jenkins.png)
## 登录 Jenkins 重新加载配置
修改 `jenkins-casc-config` 后,您需要在 Jenkins 仪表板的 **Configuration as Code** 页面上重新加载更新后的系统配置。这是因为直接通过 Jenkins 仪表板配置的系统设置可能在 Jenkins 重新调度之后被 CasC 配置覆盖。
修改 `jenkins-casc-config` 后,您可以登录 Jenkins 仪表板,在 **Configuration as Code** 页面上查看更新后的系统配置。
1. 执行以下命令获取 Jenkins 的地址。
@ -70,7 +65,7 @@ KubeSphere 默认安装 Jenkins Configuration as Code 插件,您可以通过 Y
5. 向下翻页并点击 **Configuration as Code**.
6. 要重新加载 ConfigMap 中已修改的配置,请点击**应用新配置**。
6. 要查看更新后的配置,请点击**查看配置**。
7. 有关如何通过 CasC 设置 Jenkins 的更多信息,请参见 [Jenkins 文档](https://github.com/jenkinsci/configuration-as-code-plugin)。

View File

@ -18,7 +18,7 @@ weight: 11292
## 在 Jenkins 仪表盘配置共享库
1. [登录 Jenkins 仪表板](https://kubesphere.io/zh/docs/devops-user-guide/how-to-use/jenkins-setting/#log-in-to-jenkins-to-reload-configurations)并点击左侧导航栏中的**系统管理**。
1. [登录 Jenkins 仪表板](../jenkins-setting/#登录-jenkins-查看配置)并点击左侧导航栏中的**系统管理**。
2. 向下滚动并点击**系统配置**。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 428 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 423 KiB