helm jenkins kubernetes配置记录

1、用户相对目录cat ~/.kube/config
echo (certificate-authority-data的数据)| base64 > ca.crt
echo (client-certificate-data的数据) | base64 > client.crt
echo (client-key-data的数据) | base64 > client.key

2、Manage Jenkins->Manage nodes and clouds ->config clouds

3、选择X.509 client Certificate

4、
在这里插入图片描述
5、Jenkins 地址:填写kubectl get ep jenkins(服务)

6、Manage Jenkins->config global security->agents:
选择fix:50000,勾选Inbound TCP Agent Protocol/4

7、在pipeline中写入脚本:
def label = “mypod-${UUID.randomUUID().toString()}”
podTemplate(label: label, cloud: ‘kubernetes’) {
node(label) {
stage(‘Run shell’) {
sh ‘sleep 130s’
sh ‘echo hello world.’
}
}
}
8、运行脚本

猜你喜欢

转载自blog.csdn.net/u013326684/article/details/122435132