安装完kubesphere后,直接在扩展市场安装DevOps组件:
安装完后,我就以为就能用了,到自建的一个企业空间中,创建DevOps项目时,提示当前集群未安装DevOps,到官方网站文档也没有看到相关提示,这时候再回到安装页面,原来这个组件的介绍里面还提到了好几个配置需要配置下:
进入组件的详细介绍页面,有如下说明,按里面的说明改成自己的地址后就能用了:
配置
访问 jenkins
-
请检查扩展组件配置里
jenkins.securityRealm.openIdConnect.kubesphereCoreApi
和jenkins.securityRealm.openIdConnect.jenkinsURL
,确保已经分别修改为 ks-console 和 devops-jenkins 服务实际可访问的地址,如果不是,请修改并等待组件更新完成。jenkins: securityRealm: openIdConnect: # The kubesphere-core api used for jenkins OIDC # If you want to access to jenkinsWebUI, the kubesphereCoreApi must be specified and browser-accessible # Modifying this configuration will take effect only during installation # If you wish for changes to take effect after installation, you need to update the jenkins-casc-config ConfigMap, copy the securityRealm configuration from jenkins.yaml to jenkins_user.yaml, save, and wait for approximately 70 seconds for the changes to take effect. kubesphereCoreApi: "http://192.168.1.1:30880" # The jenkins web URL used for OIDC redirect jenkinsURL: "http://192.168.1.1:30180"
-
请检查配置字典
jenkins-casc-config
中jenkins_user.yaml
下securityRealm.oic
的所有地址,确保已经改为与jenkins.yaml
下securityRealm.oic
里一样的,都改成 kubesphere-console 实际可访问的地址,如果不一样,请修改并等待 70s 左右使其生效。securityRealm: oic: clientId: "jenkins" clientSecret: "jenkins" tokenServerUrl: "http://192.168.1.1:30880/oauth/token" authorizationServerUrl: "http://192.168.1.1:30880/oauth/authorize" userInfoServerUrl: "http://192.168.1.1:30880/oauth/userinfo" endSessionEndpoint: "http://192.168.1.1:30880/oauth/logout" logoutFromOpenidProvider: true scopes: openid profile email fullNameFieldName: url userNameField: preferred_username
-
请检查配置字典
kubesphere-config
中的authentication.issuer.url
,确保已经修改为 kubesphere-console 实际可访问的地址,如果不是,请修改并重启 Deployment ks-apiserver 使其生效。authentication: issuer: url: "http://192.168.1.1:30880"
kubectl -n kubesphere-system rollout restart deploy ks-apiserver