我有一个在OpenShift中运行的Jenkins吊舱。
我已根据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容器中。 我尝试了su -i,但它要求输入我不知道的root密码。
在Docker中,我使用docker exec -u root选项以root用户身份登录。 但是我在oc中看不到任何这样的选项。我们还有其他选择可以解决此问题吗?