当前位置:首页 > linux > 正文内容

Jenkins在k8s 部署中,Nodeport服务类型非5000端口如何访问?

root4年前 (2022-05-24)linux1643

k8s部署Jenkins,server中有两个端口一个是http端口,一个是ssh 端口

http端口就不说了,随便映射。

在服务类型是NodePort下,对外映射端口如果非50000,slave连接出现异常


首先在Jenkins的web界面设置了端口

Manage Jenkins 

    - Configure Global Security 

        - Agents 

            - TCP port for inbound agents 

设置端口为映射端口,发现无法连接,同事k8s内部应用也无法连接,内部走的是默认端口50000

很明显是不对的,修改为50000 默认端口


然后去修改slave机器的配置

    Node 

        - your Node

                -Configure 

  点击advanced 

        设置一下

            Tunnel connection through 
           填写为   :port   例如   :50001

image.png


只需要把ssh的端口填写到这里就可以了。
Slave 会通过这个配置找到隧道的端口,也就是k8s NodePort 

通过这个端口相当于非k8s服务开了一个隧道,能够访问到k8s 的pod级的端口服务

扫描二维码推送至手机访问。

版权声明:本文由一叶知秋发布,如需转载请注明出处。

本文链接:https://www.zhiqiu.top/?id=227

分享给朋友:

相关文章

Ubuntu apt-get彻底卸载软件包

apt-get的卸载相关的命令有remove/purge/autoremove/clean/autoclean等。具体来说:apt-get purge / apt-get –purge remove 删除已安装包(不保留配置文件)...

linux添加用户,修改用户密码,设置文件/文件夹的归属用户和用户组 、 hostname

添加用户useradd  username  修改用户密码passwd username修改文件用户和用户组chown -R username:group  /project/修改归属用户chown&...

Cannot uninstall 'ipaddress'. It is a distutils installed project and thus

强制升级:sudo pip install --ignore-installed +模块名...

设置linux时间自动同步世界标准时间

因为主机时间没有自动同步有9.8s的误差。导致了出现负时间的问题首先手动校准时间ntpdate cn.pool.ntp.org开启时间自动更新服务systemctl start ntpd查看服务状态systemctl status ntpd...

git 忽略文件不起作用 .gitignore

git rm -r --cached . git add .   git commit -m "update .gitignore"  git status查看是否是"working di...

linux创建用户和用户组

添加用户和组groupadd testuseradd -r -g test test删除用户和组userdel testgroupdel test给文件添加用户组和用户归属chown -R test:test test_file...