在jenkins中连接kubernetes集群

简介: 在jenkins中连接kubernetes集群

配置kubernetes plugin连接kubernetes集群

1.点击系统管理->系统设置-添加一个云,在下拉菜单中选择kubernets并添加

2.填写云kubernetes配置内容

注:Name值任意添加,Kubernetes URL值添加K8S apiserver连接地址和端口

配置云kubernetes连接K8S集群的验证文件


1.获取K8S的/root/.kube/config文件

cat  /root/.kube/config

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN5RENDQWJDZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJd01EVXlPVEUwTlRnMU5Gb1hEVE13TURVeU56RTBOVGcxTkZvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTWh6CmE5bkc5NFp1SVZNZEp0NGo1dGlYcEl2WmIvczFKMVNuTVhYREt0djVqQk4xU0NoMU1VU3dYWVNlLzdVWGtjUWwKTHlUTThQVmdtY0d5TFFiOGJxZDRvS3FRQW1ZR2UzNHRtN3FoYzExSEF5V2JvSWt4QmMyV21DNmwxc1U3MGlDNQpqY216ZGMrR3h2a0MyQmx2NE1Gam5YTmwxRkF2OTdhT0pIemh4UUJwanZhMUdrdkJoVWEvdDh6Mm5GVTlwVUVrClgzZGVoNWJmRi91WVVRRlJlUEVuZHdrdGxnd1V4VUN2ZDJNNFBsOWhQMDA0L3gvbGZOeEFBTGRpNkhMOCtoSFUKeWRSTjV5dEl2Wm5ib093MXEyUlJnWU9sVEVDUFRNYmFCZks0STBkVjFkYVZVK3l2OGo1QmVIWktabE1pbGxzNApuSWJFOXU4UlR0cjl5anNlbmRFQ0F3RUFBYU1qTUNFd0RnWURWUjBQQVFIL0JBUURBZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFKZml6SVNDMWJ5UkRBaHlPZTJsK051eHF6cGkKVURxRlZSWHMzTEIzeUpWeE9PMUhlSTYwbzgwWndsSFJybVA0Mmt2QVdvcURwd3BXK1FUUUptemFXa0JtUllWRApqZkNxVVpJS0FjTENIY3duL1I3NnkySlE0TTdXR3c4VGc5dnRuMmdXRktrOWZabTM2c0ZLMjdYQTFxWVBrOGJsClBFRUd3RXYwbnBSUjZialJEdjladXZydkJQU1NhdFo5TzFoZHZ2bVJLWk95dHR6THFVOVVPUnAxemJ6OGFOSTcKVmNhN3ZFMnV5SnJvWnNLRmxvb05neVhhRnBtSEpNdzM2Smx3SEozcFRvMWMvQVl6TTY1QU81d0JrS3M4YStOYgpOcDRsS3Jtem9aaEZqeTNLL2FTK3Y4S3ZWOEVpVVJ3MXVJV1R4U1dydE9JeE9rdEQ0THZLb2pwM255az0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
    server: https://192.168.0.6:6443
  name: kubernetes
contexts:
- context:
    cluster: kubernetes
    user: kubernetes-admin
  name: kubernetes-admin@kubernetes
current-context: kubernetes-admin@kubernetes
kind: Config
preferences: {}
users:
- name: kubernetes-admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQWRxZ0F3SUJBZ0lJY3FZaFRlSEh0eDR3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TURBMU1qa3hORFU0TlRSYUZ3MHlNVEExTWpreE5EVTROVGhhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXZLTi96cFRhRzlXRUpLWn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dFQkFKZml6SVNDMWJ5UkRBaHlPZTJsK051eHF6cGkKVURxRlZSWHMzTEIzeUpWeE9PMUhlSTYwbzgwWndsSFJybVA0Mmt2QVdvcURwd3BXK1FUUUptemFXa0JtUllWRApqZkNxVVpJS0FjTENIY3duL1I3NnkySlE0TTdXR3c4VGc5dnRuMmdXRktrOWZabTM2c0ZLMjdYQTFxWVBrOGJsClBFRUd3RXYwbnBSUjZialJEdjladXZydkJQU1NhdFo5TzFoZHZ2bVJLWk95dHR6THFVOVVPUnAxemJ6OGFOSTcKVmNhN3ZFMnV5SnJvWnNLRmxvb05neVhhRnBtSEpNdzM2Smx3SEozcFRvMWMvQVl6TTY1QU81d0JrS3M4YStOYgpOcDRsS3Jtem9aaEZqeTNLL2FTK3Y4S3ZWOEVpVVJ3MXVJV1R4U1dydE9JeE9rdEQ0THZLb2pwM255az0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= | base64 -d > /opt/crt/ca.crt


将ca.crt的内容填写到jenkins kubernetes的Kubernetes server certificate key栏中


3.获取/root/.kube/config中client-certificate-data和client-key-data的内容并转化成base64 encoded文件

echo  LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQWRxZ0F3SUJBZ0lJY3FZaFRlSEh0eDR3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TURBMU1qa3hORFU0TlRSYUZ3MHlNVEExTWpreE5EVTROVGhhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXZLTi96cFRhRzlXRUpLWnoKN0NndUJQZkdpODJYOWZ2YzdMeVdFVnp2aXFLV3N3c2lSZFNlLzNrZmVTTFJ3eE01Ykpvam8zL0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RmhCMjBsRC9BWU1FYkpQM1F1MFMyTkFUVEZySEZnTXc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= | base64 -d > /opt/crt/client.key


4.生产Client P12认证文件cert.pfx,并下载至本地

openssl pkcs12 -export -out /opt/crt/cert.pfx  -inkey  /opt/crt/client.key  -in  /opt/crt/client.crt  -certfile /opt/crt/ca.crt

Enter Export Password:

Verifying - Enter Export Password:

sz /opt/crt/cert.pfx

注:自定义一个password并牢记


5.在云kubernetes中添加凭证

注:Upload certificate上次刚生成并下载至本地的cert.pfx文件,Password值添加生成cert.pfx文件时输入的密钥


6.测试连接kubernetes集群

注:Kubernetes Namespace值添加/root/.kube/config文件中cluster部分中name的内容

相关实践学习
通过Ingress进行灰度发布
本场景您将运行一个简单的应用,部署一个新的应用用于新的发布,并通过Ingress能力实现灰度发布。
容器应用与集群管理
欢迎来到《容器应用与集群管理》课程,本课程是“云原生容器Clouder认证“系列中的第二阶段。课程将向您介绍与容器集群相关的概念和技术,这些概念和技术可以帮助您了解阿里云容器服务ACK/ACK Serverless的使用。同时,本课程也会向您介绍可以采取的工具、方法和可操作步骤,以帮助您了解如何基于容器服务ACK Serverless构建和管理企业级应用。 学习完本课程后,您将能够: 掌握容器集群、容器编排的基本概念 掌握Kubernetes的基础概念及核心思想 掌握阿里云容器服务ACK/ACK Serverless概念及使用方法 基于容器服务ACK Serverless搭建和管理企业级网站应用
相关文章
|
11天前
|
存储 Kubernetes 关系型数据库
阿里云ACK备份中心,K8s集群业务应用数据的一站式灾备方案
本文源自2024云栖大会苏雅诗的演讲,探讨了K8s集群业务为何需要灾备及其重要性。文中强调了集群与业务高可用配置对稳定性的重要性,并指出人为误操作等风险,建议实施周期性和特定情况下的灾备措施。针对容器化业务,提出了灾备的新特性与需求,包括工作负载为核心、云资源信息的备份,以及有状态应用的数据保护。介绍了ACK推出的备份中心解决方案,支持命名空间、标签、资源类型等维度的备份,并具备存储卷数据保护功能,能够满足GitOps流程企业的特定需求。此外,还详细描述了备份中心的使用流程、控制台展示、灾备难点及解决方案等内容,展示了备份中心如何有效应对K8s集群资源和存储卷数据的灾备挑战。
|
1月前
|
Kubernetes 监控 Cloud Native
Kubernetes集群的高可用性与伸缩性实践
Kubernetes集群的高可用性与伸缩性实践
71 1
|
2月前
|
JSON Kubernetes 容灾
ACK One应用分发上线:高效管理多集群应用
ACK One应用分发上线,主要介绍了新能力的使用场景
|
2月前
|
Kubernetes 持续交付 开发工具
ACK One GitOps:ApplicationSet UI简化多集群GitOps应用管理
ACK One GitOps新发布了多集群应用控制台,支持管理Argo CD ApplicationSet,提升大规模应用和集群的多集群GitOps应用分发管理体验。
|
2月前
|
Kubernetes Ubuntu Linux
Centos7 搭建 kubernetes集群
本文介绍了如何搭建一个三节点的Kubernetes集群,包括一个主节点和两个工作节点。各节点运行CentOS 7系统,最低配置为2核CPU、2GB内存和15GB硬盘。详细步骤包括环境配置、安装Docker、关闭防火墙和SELinux、禁用交换分区、安装kubeadm、kubelet、kubectl,以及初始化Kubernetes集群和安装网络插件Calico或Flannel。
203 4
|
2月前
|
Kubernetes Cloud Native 云计算
云原生之旅:Kubernetes 集群的搭建与实践
【8月更文挑战第67天】在云原生技术日益成为IT行业焦点的今天,掌握Kubernetes已成为每个软件工程师必备的技能。本文将通过浅显易懂的语言和实际代码示例,引导你从零开始搭建一个Kubernetes集群,并探索其核心概念。无论你是初学者还是希望巩固知识的开发者,这篇文章都将为你打开一扇通往云原生世界的大门。
138 17
|
2月前
|
Kubernetes 应用服务中间件 nginx
搭建Kubernetes v1.31.1服务器集群,采用Calico网络技术
在阿里云服务器上部署k8s集群,一、3台k8s服务器,1个Master节点,2个工作节点,采用Calico网络技术。二、部署nginx服务到k8s集群,并验证nginx服务运行状态。
927 1
|
2月前
|
Kubernetes Cloud Native 流计算
Flink-12 Flink Java 3分钟上手 Kubernetes云原生下的Flink集群 Rancher Stateful Set yaml详细 扩容缩容部署 Docker容器编排
Flink-12 Flink Java 3分钟上手 Kubernetes云原生下的Flink集群 Rancher Stateful Set yaml详细 扩容缩容部署 Docker容器编排
92 3
|
2月前
|
Kubernetes Cloud Native 微服务
微服务实践之使用 kube-vip 搭建高可用 Kubernetes 集群
微服务实践之使用 kube-vip 搭建高可用 Kubernetes 集群
131 1
|
2月前
|
负载均衡 应用服务中间件 nginx
基于Ubuntu-22.04安装K8s-v1.28.2实验(二)使用kube-vip实现集群VIP访问
基于Ubuntu-22.04安装K8s-v1.28.2实验(二)使用kube-vip实现集群VIP访问
71 1
下一篇
DataWorks