我有一个在 OpenShift 中运行的 Jenkins pod。
我根据http://appagile.io/2017/03/29/how-to-run-a-pod-as-root/为我的项目启用了 anyuid 。
但是,由于以下问题,我无法获取初始管理员密码
<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F' /><script>window.location.replace('/login?from=%2F');</script></head><body style='background-color:white; color:white;'>
Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:
Permission you need to have (but didn't): hudson.model.Hudson.Read
... which is implied by: hudson.security.Permission.GenericRead
... which is implied by: hudson.model.Hudson.Administer
-->
根据本文中提到的解决方案 - https://stackoverflow.com/a/41055670
我尝试将 jenkins 用户添加为 root 的一部分。
sudo usermod -a -G root jenkins
但是 sudo 包没有安装在 Jenkins pod 中。我试过 su -i 但它要求输入我不知道的 root 密码。
在 Docker 中,我使用 docker exec -u root 选项以 root 身份登录。但是我在 oc 中没有看到任何这样的选项。我们可以尝试解决此问题的任何其他选择吗?