在jenkins中连接kubernetes集群

本文涉及的产品
容器服务 Serverless 版 ACK Serverless,952元额度 多规格
容器服务 Serverless 版 ACK Serverless,317元额度 多规格
简介: 在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: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQWRxZ0F3SUJBZ0lJY3FZaFRlSEh0eDR3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TURBMU1qa3hORFU0TlRSYUZ3MHlNVEExTWpreE5EVTROVGhhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTk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BZ0trTUE4R0ExVWRFd0VCCi93UUZNQU1CQWY4d0RRWUpLb1pJaHZjTkFRRUxCUUFEZ2dFQkFKZml6SVNDMWJ5UkRBaHlPZTJsK051eHF6cGkKVURxRlZSWHMzTEIzeUpWeE9PMUhlSTYwbzgwWndsSFJybVA0Mmt2QVdvcURwd3BXK1FUUUptemFXa0JtUllWRApqZkNxVVpJS0FjTENIY3duL1I3NnkySlE0TTdXR3c4VGc5dnRuMmdXRktrOWZabTM2c0ZLMjdYQTFxWVBrOGJsClBFRUd3RXYwbnBSUjZialJEdjladXZydkJQU1NhdFo5TzFoZHZ2bVJLWk95dHR6THFVOVVPUnAxemJ6OGFOSTcKVmNhN3ZFMnV5SnJvWnNLRmxvb05neVhhRnBtSEpNdzM2Smx3SEozcFRvMWMvQVl6TTY1QU81d0JrS3M4YStOYgpOcDRsS3Jtem9aaEZqeTNLL2FTK3Y4S3ZWOEVpVVJ3MXVJV1R4U1dydE9JeE9rdEQ0THZLb2pwM255az0KLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= | 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  LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM4akNDQWRxZ0F3SUJBZ0lJY3FZaFRlSEh0eDR3RFFZSktvWklodmNOQVFFTEJRQXdGVEVUTUJFR0ExVUUKQXhNS2EzVmlaWEp1WlhSbGN6QWVGdzB5TURBMU1qa3hORFU0TlRSYUZ3MHlNVEExTWpreE5EVTROVGhhTURReApGekFWQmdOVkJBb1REbk41YzNSbGJUcHRZWE4wWlhKek1Sa3dGd1lEVlFRREV4QnJkV0psY201bGRHVnpMV0ZrCmJXbHVNSUlCSWpBTkJna3Foa2lHOXcwQkFRRUZBQU9DQVE4QU1JSUJDZ0tDQVFFQXZLTi96cFRhRzlXRUpLWnoKN0NndUJ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TNDaXlkTTdJT2lmd084a21STU5LR1VDWmNyTzJISEZadAo2dVA3QWdMSUg2dzdia3VkamZ1NktYRmhCMjBsRC9BWU1FYkpQM1F1MFMyTkFUVEZySEZnTXc9PQotLS0tLUVORCBSU0EgUFJJVkFURSBLRVktLS0tLQo= | 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搭建和管理企业级网站应用
相关文章
|
22天前
|
JSON Kubernetes 容灾
ACK One应用分发上线:高效管理多集群应用
ACK One应用分发上线,主要介绍了新能力的使用场景
|
23天前
|
Kubernetes 持续交付 开发工具
ACK One GitOps:ApplicationSet UI简化多集群GitOps应用管理
ACK One GitOps新发布了多集群应用控制台,支持管理Argo CD ApplicationSet,提升大规模应用和集群的多集群GitOps应用分发管理体验。
|
1月前
|
Kubernetes Cloud Native 云计算
云原生之旅:Kubernetes 集群的搭建与实践
【8月更文挑战第67天】在云原生技术日益成为IT行业焦点的今天,掌握Kubernetes已成为每个软件工程师必备的技能。本文将通过浅显易懂的语言和实际代码示例,引导你从零开始搭建一个Kubernetes集群,并探索其核心概念。无论你是初学者还是希望巩固知识的开发者,这篇文章都将为你打开一扇通往云原生世界的大门。
120 17
|
1月前
|
Kubernetes 应用服务中间件 nginx
搭建Kubernetes v1.31.1服务器集群,采用Calico网络技术
在阿里云服务器上部署k8s集群,一、3台k8s服务器,1个Master节点,2个工作节点,采用Calico网络技术。二、部署nginx服务到k8s集群,并验证nginx服务运行状态。
453 1
|
1月前
|
Kubernetes Cloud Native 微服务
微服务实践之使用 kube-vip 搭建高可用 Kubernetes 集群
微服务实践之使用 kube-vip 搭建高可用 Kubernetes 集群
103 1
|
1月前
|
负载均衡 应用服务中间件 nginx
基于Ubuntu-22.04安装K8s-v1.28.2实验(二)使用kube-vip实现集群VIP访问
基于Ubuntu-22.04安装K8s-v1.28.2实验(二)使用kube-vip实现集群VIP访问
50 1
|
1月前
|
Kubernetes Cloud Native Ubuntu
云原生之旅:Kubernetes集群搭建与应用部署
【8月更文挑战第65天】本文将带你进入云原生的世界,通过一步步指导如何在本地环境中搭建Kubernetes集群,并部署一个简单的应用。我们将使用Minikube和Docker作为工具,探索云原生技术的魅力所在。无论你是初学者还是有经验的开发者,这篇文章都将为你提供有价值的信息和实践技巧。
|
2月前
|
存储 Kubernetes 关系型数据库
阿里云ACK备份中心,K8s集群业务应用数据的一站式灾备方案
阿里云ACK备份中心,K8s集群业务应用数据的一站式灾备方案
|
2月前
|
存储 Kubernetes 负载均衡
CentOS 7.9二进制部署K8S 1.28.3+集群实战
本文详细介绍了在CentOS 7.9上通过二进制方式部署Kubernetes 1.28.3+集群的全过程,包括环境准备、组件安装、证书生成、高可用配置以及网络插件部署等关键步骤。
401 3
CentOS 7.9二进制部署K8S 1.28.3+集群实战
|
2月前
|
Kubernetes 负载均衡 前端开发
二进制部署Kubernetes 1.23.15版本高可用集群实战
使用二进制文件部署Kubernetes 1.23.15版本高可用集群的详细教程,涵盖了从环境准备到网络插件部署的完整流程。
98 2
二进制部署Kubernetes 1.23.15版本高可用集群实战