jenkins对接K8S

创建连接K8S的凭据

查看需要使用到的命名空间
[root@k8s ~]# kubectl get ns |grep arts-system
arts-system       Active   16d
创建service accounts
[root@k8s ~]# kubectl create sa jenkins-k8s -n arts-system
serviceaccount/jenkins-k8s created
[root@k8s ~]# kubectl get sa -n arts-system |grep jenkins
jenkins-k8s   1         14s
对jenkins做cluster-admin绑定
[root@k8s ~]# kubectl create clusterrolebinding jenkins-k8s-role-binding --clusterrole cluster-admin --serviceaccount=arts-system:jenkins-k8s -n arts-system
clusterrolebinding.rbac.authorization.k8s.io/jenkins-k8s-role-binding created
[root@k8s ~]# kubectl get clusterrolebinding -n arts-system
NAME                       AGE
jenkins-k8s-role-binding   29s
system:coredns             3y264d
查看arts-system命名空间中的sa和secret
[root@k8s ~]# kubectl get sa,secret -n arts-system
NAME                         SECRETS   AGE
serviceaccount/default       1         16d
serviceaccount/jenkins-k8s   1         3m30sNAME                             TYPE                                  DATA   AGE
secret/default-token-scbjb       kubernetes.io/service-account-token   3      16d
secret/jenkins-k8s-token-qjr6p   kubernetes.io/service-account-token   3      3m30s
提取token
[root@k8s ~]# kubectl describe secrets jenkins-k8s-token-qjr6p -n arts-system
Name:         jenkins-k8s-token-qjr6p
Namespace:    arts-system
Labels:       <none>
Annotations:  kubernetes.io/service-account.name: jenkins-k8skubernetes.io/service-account.uid: e7d1633d-3419-4a95-b8e8-e4f1956989e8Type:  kubernetes.io/service-account-tokenData
====
namespace:  11 bytes
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6IlNybzBGYzNoYklYWlJlM2NsU0VWNTY2TGZlM2E3a1RUYm5ObmJxLXFZMjAifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJhcnRzLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJqZW5raW5zLWs4cy10b2tlbi1xanI2cCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJqZW5raW5zLWs4cyIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6ImU3ZDE2MzNkLTM0MTktNGE5NS1iOGU4LWU0ZjE5NTY5ODllOCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDphcnRzLXN5c3RlbTpqZW5raW5zLWs4cyJ9.wIPNdnYKqNGdUv0bYwDgGFW4_EhR3vKcFdHsmrQFbtiWomLBQERZe9xs1adO4qJm5V40sCozWJWiv6yE9ZN8stEI_FTJcaLDeLJDqYe-2BAuGXG6sDOUsjk2vc7K4NJb2xi508xyof5xuS2mTBwMXiyO_zhefrXVq9NrQd9hrUFQOhcod_SoWu965unOA4uDqxi9Sgll4RW-yG9lN5PK18xaGEHvJHldS_vT8JhvQ1lvjxDWxZkYvXJLN9i0Yp0bHal6GNCl4tDaMmTCyvuhuhBWldB57fwNrO71hrl1rN8BKy0ngeJ4SUr3TqA0cSpDXyAdS01OnwaokiVt3APM-A
ca.crt:     1099 bytes

jenkins上创建连接K8S的凭证

请添加图片描述

jenkins连接K8S

请添加图片描述

配置连接k8s需要的kubeconfig文件

获取k8s的kubecofnig文件
[root@k8s kubernetes]# cat kubeconfig
Version: v1
kind: Config
users:
- name: controllermanageruser:client-certificate: /var/lib/kubernetes/cs_client.crtclient-key: /var/lib/kubernetes/cs_client.key
clusters:
- name: localcluster:certificate-authority: /var/lib/kubernetes/ca.crtserver: https://192.168.73.100:6443
contexts:
- context:cluster: localuser: controllermanagername: my-context
current-context: my-context
将kubecofig文件中的认证填写到该文件中
### 获取认证文件内容并进行base64编码
[root@k8s kubernetes]# cat /var/lib/kubernetes/cs_client.crt | base64 | tr -d '\n'
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUNwakNDQVk0Q0NRQytLb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RhRHdJREFRQUJvMUF3VGpBZEJnTlZIUTRFRmdRVU9kZFI1dlhYCk5kaWZWRmFNWjRUZ0FQY0U3L1F3SHdZRFZSMGpCQmd3Rm9BVU9kZFI1dlhYTmRpZlZGYU1aNFRnQVBjRTcvUXcKREFZRFZSMFRCQVV3QXdFQi96QU5CZ2txaGtpRzl3MEJBUXNGQUFPQ0FRRUFXTnA2Nm05QjJOZWUyaHdLbmo1awp6WDY2d0YrbkFrQlVFbEhQeDlsZDBKcVhDaDRUZ2RNcGR0ckRaNG1CUS9oUXVpaThtQjQ2TFlDM2VtVGYvRGJMCkxnSUN2eVhlLythWjY1MkVBeFNtUndpU3FOaHFGc09hcUx1UlVialpRKzNvRmt0WVlVN0pFcWs2bnlub3hUR0oKeDFBQU45cFdXdkRPT09tNHpscGdxY3Y4cnpEL1MweEZoaWFWVnR6N29KeGVsdllpTzFlclJybDB3a2Y0SnlJVwpPTlNIZ0VXaVFTRTFUNHp2WHV3MHI2MndXRUs2ZktFYXZHYWtHU3B5YWxjcFVPTE01YmE3dnZzOWRTRWVGZEhhClZUL0xXWTA1RmJBN1hzOXd4SnNMS2djeEVzM2Y3dkVaaGhQRTJjZHpPeG9ra3B6NjdqZHN6QVZCbzZWQlA5SHoKR1E9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==server: https://192.168.73.100:6443
contexts:
- context:cluster: localuser: controllermanagername: my-context
current-context: my-context
安装 配置文件管理 插件

请添加图片描述

添加kubecofnig文件

请添加图片描述
请添加图片描述

请添加图片描述

请添加图片描述

生成一个流水

请添加图片描述

生成的流水脚本如下
configFileProvider([configFile(fileId: '1af5255e-d0db-4009-8218-12448ede43e3', targetLocation: 'arts-system.kubeconfig')]) {// some block
}
完善流水脚本,进行一个测试
pipeline {agent anystages {stage('测试部署') {steps {script{configFileProvider([configFile(fileId: '1af5255e-d0db-4009-8218-12448ede43e3', targetLocation: 'arts-system.kubeconfig')]) {sh '''kubectl get node --kubeconfig=arts-system.kubeconfig'''}}}}}
}
创建一个流水然后进行测试的结果如下

请添加图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/652553.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

一键批量处理,轻松为HTML文本添加所需内容

你是否曾经遇到过需要批量处理大量HTML文本的情况&#xff1f;是否曾经因为一个个编辑而感到繁琐和无趣&#xff1f;现在&#xff0c;这些问题都可以得到轻松解决&#xff01;我们的文本批量处理工具&#xff0c;为你提供一站式的服务&#xff0c;让你告别重复繁琐的操作&#…

java eazyexcel 实现excel的动态多级联动下拉列表(2)使用MATCH+OFFSET函数

原理 同样是将数据源放到一个新建的隐藏的sheet中&#xff0c;第一行是第一个列表的数据&#xff0c;第二行是每一个有下级菜单的菜单&#xff0c;他下面的行就是他下级菜单的每一值使用MATCH函数从第二行找到上级菜单对应的列根据OFFSET函数从2中获取的列&#xff0c;取得下级…

深度学习之处理多维特征的输入

我们首先来看一个糖尿病的数据集&#xff1a; 在数据集中&#xff0c;我们称每一行叫做sample&#xff0c;表示一个样本&#xff0c;称每一列是feature&#xff0c;也就是特征在数据库里面这就是一个关系表&#xff0c;每一行叫做记录&#xff0c;每一列叫做字段。 每一个样本都…

2024年第一篇博客

这是2024年的第一篇博客&#xff0c;2023年笔者经历了一连串的生活、工作、学习上的转折和调整&#xff0c;跌跌撞撞时光飞逝&#xff0c;转眼间就踏着元旦的钟声步入了2024年&#xff0c;前思后想、辗转反侧、犹豫再三不知道从哪里开始博客新的篇章&#xff0c;这个问题坦诚说…

ARL灯塔vps云服务器安装

前提是vps服务器已经安装好docker 1、下载压缩包到本地 2、解除不能扫描edu等域名的限制 解压docker_arl.zip&#xff0c;打开docker_arl/config-docker.yaml文件 删除掉edu.cn等限制域名(图中已删除) 3、上传至vps云服务器 将docker_arl文件上传到云服务器opt目录下 这里我…

使用Pinctrl 和 Gpio 子系统 配置引脚

1. 关于Pinctrl 和 GPIO 子系统 1.1 Pinctrl 子系统 Pinctrl 子系统 主要负责处理SOC(System on chip )的引脚控制&#xff0c;现代MCU中很多引脚 都是多功能的&#xff0c;可以配置成不同的角色&#xff08;GPIO,I2C,SPI,UART,PWM等&#xff09; Pinctrl 子系统就是用来管理…

【智能家居】6、语音控制及网络控制代码实现

一、语音控制 1、指令结构体编写 这个结构体定义了一个命令输入的模型。在这个模型中,包含以下几个部分: cmdName:一个长度为128的字符串,用于存储命令名称。dvicesName:一个长度为128的字符串,用于存储设备名称。cmd:一个长度为32的字符串,用于存储具体的命令。Init:…

言传身留:NLP技术引领机器翻译革新

NLP技术引领机器翻译革新 一. 引言1.1 背景介绍1.2 目的和重要性1.2.1 NLP技术在机器翻译中的关键作用1.2.2 如何改善搜索引擎、语音助手等领域的应用 二. NLP技术在机器翻译中的应用2.1 文本理解2.1.1 情感分析2.1.2 上下文理解 2.2 语言生成2.2.1 自动生成翻译2.2.2 提高翻译…

qt初入门6:QChar和QString相关接口练习

简单了解编码&#xff1a; ​ latin1&#xff08;ISO 8859-1&#xff09;字符集是对ASCII基本字符集的扩展&#xff0c;都是1字节编码。 Unicode编码有多重存储方案&#xff0c;utf-8使用1~4字节编码&#xff0c;最少1字节&#xff1b;utf-16使用2-4字节编码&#xff0c;最少2字…

数据湖技术之发展现状篇

一. 大数据处理架构&#xff1a; 大数据处理架构的发展过程具体可以分为三个主要阶段&#xff1a;批处理架构、混合处理架构&#xff08;Lambda、Kappa架构&#xff09;、湖仓一体。首先是随着Hadoop生态相关技术的大量应用&#xff0c;批处理架构应运而生&#xff0c;借助离线…

Python在无人飞天航母

Python在无人飞天航母研发开发中发挥着重要的作用。无人飞天航母是一种未来战争装备&#xff0c;可以完成各种任务&#xff0c;包括反潜、侦查、打击、支援等。Python作为一种高级编程语言&#xff0c;具有以下重要性&#xff1a; 快速原型开发&#xff1a;Python具有简洁的语法…

中国新能源汽车持续跑出发展“加速度”,比亚迪迎来向上突破

2023年已经过去&#xff0c;对于汽车圈而言&#xff0c;2023年是中国车市的分水岭&#xff0c;在这一年&#xff0c;中国汽车工业70年以来首次进入全球序列&#xff0c;自主品牌强势霸榜&#xff0c;销量首次超过合资车。要知道&#xff0c;这是自大众于1984年进入中国市场成立…

sql server 2008 安装问题

1、sql server 2008 安装程序支持文件后安装界面就消失&#xff1a; 打开cmd以管理员身份运行 复制或者手动输入以下命令&#xff1a;secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose运行完成后&#xff0c;重新安装 卸载需删除注册表这几个…

【面试】测试开发面试题

帝王之气&#xff0c;定是你和万里江山&#xff0c;我都护得周全 文章目录 前言1. 网络原理get与post的区别TCP/IP各层是如何传输数据的IP头部包含哪些内容TCP头部为什么有浮动网络层协议1. 路由协议2. 路由信息3. OSPF与RIP的区别Cookie与Session&#xff0c;Token的区别http与…

计算方法实验1:熟悉MATLAB 环境

一、问题描述 熟悉MATLAB 环境。 二、实验目的 了解Matlab 的主要功能&#xff0c;熟悉Matlab 命令窗口及文件管理&#xff0c;Matlab 帮助系统。掌握命令行的输入及编辑&#xff0c;用户目录及搜索路径的配置。了解Matlab 数据的特点&#xff0c;熟悉Matlab 变量的命名规则&a…

Android 基础技术——m3u8格式与mp4格式的区别

笔者希望做一个系列&#xff0c;整理 Android 基础技术&#xff0c;本章是关于 m3u8格式与mp4格式的区别 m3u8是苹果公司推出的视频播放标准&#xff0c;是m3u的一种&#xff0c;只是编码格式采用的是UTF-8。 m3u8准确来说是一种索引文件&#xff0c;使用m3u8文件实际上是通过它…

什么是Java中的NIO?NIO与IO有什么区别?

什么是Java中的NIO&#xff1f;NIO与IO有什么区别&#xff1f; Java NIO&#xff0c;全称New IO&#xff0c;是Java 1.4版本中引入的一种新的IO处理方式。NIO与IO虽然有相同的作用和目的&#xff0c;但实现方式却大不相同。在传统的IO中&#xff0c;数据读取和写入是以字节流或…

MAVEN(1)

分模块开发与设计 分模块开发意义 将原始模块按照功能拆分成若干个子模块&#xff0c;方便模块间相互调用&#xff0c;接口共享 步骤示例 这里以之前开发的SpringMVC_ssm中的domain模块为例 第一步、创建Maven模块 父项改为none&#xff0c;文件存储位置需要做出相应调整 …

Android App开发-简单控件(3)——常用布局

3.3 常用布局 本节介绍常见的几种布局用法&#xff0c;包括在某个方向上顺序排列的线性布局&#xff0c;参照其他视图的位置相对排列的相对布局&#xff0c;像表格那样分行分列显示的网格布局&#xff0c;CommonLayouts以及支持通过滑动操作拉出更多内容的滚动视图。 3.3.1 线…

flink源码分析 - 简单解析命令行参数

flink版本: flink-1.11.2 提取主类代码位置: org.apache.flink.api.java.utils.MultipleParameterTool#fromArgs 代码逻辑比较简单&#xff0c;此处不再赘述&#xff0c;在此记录方便后续使用 完整代码: /** Licensed to the Apache Software Foundation (ASF) under one* o…