diff --git a/content/en/docs/devops-user-guide/how-to-use/gitlab-multibranch-pipeline.md b/content/en/docs/devops-user-guide/how-to-use/gitlab-multibranch-pipeline.md index 2293c6fcf..11160cd0c 100644 --- a/content/en/docs/devops-user-guide/how-to-use/gitlab-multibranch-pipeline.md +++ b/content/en/docs/devops-user-guide/how-to-use/gitlab-multibranch-pipeline.md @@ -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](../../how-to-integrate/sonarqube/#step-5-add-the-sonarqube-server-to-jenkins), 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. {{}} diff --git a/content/en/docs/devops-user-guide/how-to-use/jenkins-setting.md b/content/en/docs/devops-user-guide/how-to-use/jenkins-setting.md index 4fcac73a4..bddfc1e5d 100644 --- a/content/en/docs/devops-user-guide/how-to-use/jenkins-setting.md +++ b/content/en/docs/devops-user-guide/how-to-use/jenkins-setting.md @@ -32,45 +32,13 @@ It is recommended that you configure Jenkins in KubeSphere through Configuration 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 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**. +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**. - ![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. - -1. Execute the following command to get the address of Jenkins. - - ```bash - export NODE_PORT=$(kubectl get --namespace kubesphere-devops-system -o jsonpath="{.spec.ports[0].nodePort}" services devops-jenkins) - export NODE_IP=$(kubectl get nodes --namespace kubesphere-devops-system -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT - ``` - -2. You can see the expected output as below, which tells you the IP address and port number of Jenkins. - - ```bash - http://192.168.0.4:30180 - ``` - -3. Access Jenkins at `http://Node IP:Port Number`. When KubeSphere is installed, the Jenkins dashboard is also installed by default. Besides, Jenkins is configured with KubeSphere LDAP, which means you can log in to Jenkins with KubeSphere accounts (for example, `admin/P@88w0rd`) directly. - - {{< notice note >}} - - You may need to set up necessary port forwarding rules and open port `30180` to access Jenkins in your security groups depending on where your instances are deployed. - - {{}} - -4. After you log in to the Jenkins dashboard, click **Manage Jenkins** from the navigation pane. - -5. Scroll down and click **Configuration as Code**. - -6. To reload configurations that you have modified in the ConfigMap, click **Apply new configuration**. +6. Wait for at least 70 seconds until your changes are automatically reloaded. 7. For more information about how to set up Jenkins via CasC, see the [Jenkins documentation](https://github.com/jenkinsci/configuration-as-code-plugin). @@ -78,4 +46,5 @@ After you modified `jenkins-casc-config`, you need to reload your updated system In the current version, not all plugins support CasC settings. CasC will only overwrite plugin configurations that are set up through CasC. - {{}} \ No newline at end of file + {{}} + diff --git a/content/en/docs/devops-user-guide/how-to-use/jenkins-shared-library.md b/content/en/docs/devops-user-guide/how-to-use/jenkins-shared-library.md index e5ca40d01..69b39491a 100644 --- a/content/en/docs/devops-user-guide/how-to-use/jenkins-shared-library.md +++ b/content/en/docs/devops-user-guide/how-to-use/jenkins-shared-library.md @@ -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](../../how-to-integrate/sonarqube/#step-5-add-the-sonarqube-server-to-jenkins) and click **Manage Jenkins** in the left navigation pane. 2. Scroll down and click **Configure System**. diff --git a/content/zh/docs/devops-user-guide/how-to-use/gitlab-multibranch-pipeline.md b/content/zh/docs/devops-user-guide/how-to-use/gitlab-multibranch-pipeline.md index 22f3101dd..10da18c7c 100644 --- a/content/zh/docs/devops-user-guide/how-to-use/gitlab-multibranch-pipeline.md +++ b/content/zh/docs/devops-user-guide/how-to-use/gitlab-multibranch-pipeline.md @@ -77,7 +77,7 @@ weight: 11291 如需使用 GitLab 私有仓库,请参考以下步骤: - 在 GitLab 上前往**用户设置 > 访问令牌**,创建拥有 API 和 read_repository 权限的个人访问令牌。 - - [登录 Jenkins 面板](../jenkins-setting/#登录-jenkins-重新加载配置),前往**系统管理 > Manage Credentials**,使用您的 GitLab 令牌创建 Jenkins 凭证,用于访问 GitLab。然后前往**系统管理 > 系统配置**,在 **GitLab 服务**中添加该凭证。 + - [登录 Jenkins 面板](../../how-to-integrate/sonarqube/#步骤-5将-sonarqube-服务器添加至-jenkins),前往**系统管理 > Manage Credentials**,使用您的 GitLab 令牌创建 Jenkins 凭证,用于访问 GitLab。然后前往**系统管理 > 系统配置**,在 **GitLab 服务**中添加该凭证。 - 在您的 DevOps 项目中,选择 **DevOps 项目设置 > 凭证**,使用您的 GitLab 令牌创建一个凭证。然后在创建流水线时,您需要在 **GitLab** 页签上的**凭证**中指定该凭证,以便流水线能够从您的 GitLab 私有仓库中拉取代码。 {{}} diff --git a/content/zh/docs/devops-user-guide/how-to-use/jenkins-setting.md b/content/zh/docs/devops-user-guide/how-to-use/jenkins-setting.md index fccf076a7..19cf0675c 100644 --- a/content/zh/docs/devops-user-guide/how-to-use/jenkins-setting.md +++ b/content/zh/docs/devops-user-guide/how-to-use/jenkins-setting.md @@ -36,41 +36,9 @@ KubeSphere 默认安装 Jenkins Configuration as Code 插件,您可以通过 Y 4. 在详情页面上,点击**更多操作**,在下拉列表中选择**编辑 YAML**。 -5. `jenkins-casc-config` 的配置模板是一个 YAML 文件,如下图所示。您可以在 ConfigMap 的代理 (Kubernetes Jenkins Agent) 中修改容器镜像、标签、资源请求 (Request) 和限制 (Limit) 等内容,或者在 podTemplate 中添加容器。完成操作后,点击**确定**。 +5. `jenkins-casc-config` 的配置模板是一个 YAML 文件,位于 `data.jenkins_user.yaml:` 部分。您可以在 ConfigMap 的代理 (Kubernetes Jenkins Agent) 中修改容器镜像、标签、资源请求 (Request) 和限制 (Limit) 等内容,或者在 podTemplate 中添加容器。完成操作后,点击**确定**。 - ![编辑 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 配置覆盖。 - -1. 执行以下命令获取 Jenkins 的地址。 - - ```bash - export NODE_PORT=$(kubectl get --namespace kubesphere-devops-system -o jsonpath="{.spec.ports[0].nodePort}" services devops-jenkins) - export NODE_IP=$(kubectl get nodes --namespace kubesphere-devops-system -o jsonpath="{.items[0].status.addresses[0].address}") - echo http://$NODE_IP:$NODE_PORT - ``` - -2. 您可以看到如下所示的预期输出,获取 Jenkins 的 IP 地址和端口号。 - - ```bash - http://10.77.1.201:30180 - ``` - -3. 使用地址 `http://Node IP:Port Number` 访问 Jenkins。安装 KubeSphere 时,默认情况下也会安装 Jenkins 仪表板。Jenkins 还配置有 KubeSphere LDAP,这意味着您可以直接使用 KubeSphere 帐户(例如 `admin/P@88w0rd`)登录 Jenkins。 - - {{< notice note >}} - - 取决于您的实例的部署位置,您可能需要设置必要的端口转发规则并在您的安全组中放行端口 `30180`,以便访问 Jenkins。 - - {{}} - -4. 登录 Jenkins 仪表板后,点击导航栏中的**系统管理**。 - -5. 向下翻页并点击 **Configuration as Code**. - -6. 要重新加载 ConfigMap 中已修改的配置,请点击**应用新配置**。 +6. 请至少等待 70 秒,您的改动会自动重新加载。 7. 有关如何通过 CasC 设置 Jenkins 的更多信息,请参见 [Jenkins 文档](https://github.com/jenkinsci/configuration-as-code-plugin)。 @@ -78,4 +46,5 @@ KubeSphere 默认安装 Jenkins Configuration as Code 插件,您可以通过 Y 在当前版本中,并非所有插件都支持 CasC 设置。CasC 仅会覆盖通过 CasC 设置的插件配置。 - {{}} \ No newline at end of file + {{}} + diff --git a/content/zh/docs/devops-user-guide/how-to-use/jenkins-shared-library.md b/content/zh/docs/devops-user-guide/how-to-use/jenkins-shared-library.md index 12a21b4c1..d4b324e1d 100644 --- a/content/zh/docs/devops-user-guide/how-to-use/jenkins-shared-library.md +++ b/content/zh/docs/devops-user-guide/how-to-use/jenkins-shared-library.md @@ -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 仪表板](../../how-to-integrate/sonarqube/#步骤-5将-sonarqube-服务器添加至-jenkins)并点击左侧导航栏中的**系统管理**。 2. 向下滚动并点击**系统配置**。 diff --git a/static/images/docs/devops-user-guide/using-devops/jenkins-system-settings/edit-jenkins.png b/static/images/docs/devops-user-guide/using-devops/jenkins-system-settings/edit-jenkins.png deleted file mode 100644 index 343f5910a..000000000 Binary files a/static/images/docs/devops-user-guide/using-devops/jenkins-system-settings/edit-jenkins.png and /dev/null differ diff --git a/static/images/docs/zh-cn/devops-user-guide/use-devops/jenkins-system-settings/edit-jenkins.png b/static/images/docs/zh-cn/devops-user-guide/use-devops/jenkins-system-settings/edit-jenkins.png deleted file mode 100644 index 6dc432445..000000000 Binary files a/static/images/docs/zh-cn/devops-user-guide/use-devops/jenkins-system-settings/edit-jenkins.png and /dev/null differ