简体   繁体   English

使用命令行配置Jenkins

[英]Jenkins configuration using command line

I am trying to move the complete eco-system of our SAAS product to Kubernetes (and use Docker containers). 我正在尝试将SAAS产品的完整生态系统移至Kubernetes(并使用Docker容器)。

I am supposed to give a bash script which will set up everything. 我应该给出一个bash脚本,它将设置所有内容。 Only manual intervention should be setting up the Kubernetes cluster and mounting Persistent Volumes. 只有手动干预才能设置Kubernetes集群并安装Persistent Volumes。

We were using Jenkins for code deployment and cron jobs. 我们使用Jenkins进行代码部署和cron作业。 I am able to create the Jenkins service but I can not find ways to configure it using the command line. 我能够创建Jenkins服务,但我找不到使用命令行配置它的方法。 Tried finding ways online but can not find any good documentation. 尝试在线找到方法,但找不到任何好的文档。

First welcome to kubernetes, second, there are a lot of tools, templates over there, I would recommend you to check what is Helm 首先欢迎来到kubernetes,第二,那边有很多工具,模板,我建议你检查什么是Helm

This is the Jenkins chart if you want to check: https://github.com/helm/charts/tree/master/stable/jenkins 这是Jenkins图表,如果你想检查: https//github.com/helm/charts/tree/master/stable/jenkins

There is also a "fork" of jenkins for containerized environments, that I like, you can check more about Jenkins-X here 对于容器化环境,还有一个jenkins的“分叉”,我喜欢,你可以在这里查看更多有关Jenkins-X的内容

You can use helm package manager and simply install the Jenkin stable version. 您可以使用helm包管理器并只安装Jenkin稳定版。

Before using helm you have to setup tiller on kubernetes cluster. 在使用helm之前,你必须在kubernetes集群上设置tiller。

$ helm install --name my-release stable/jenkins

here stable version of jenkin using helm. 这里稳定版的jenkin使用helm。

https://github.com/helm/charts/tree/master/stable/jenkins https://github.com/helm/charts/tree/master/stable/jenkins

I can add that you can store Jenkins home folder as well as plugins and artifacts folder on persistent volume and mount that volume to Jenkins pod as a part of Helm installation. 我可以补充说,您可以在永久卷上存储Jenkins主文件夹以及插件和工件文件夹,并将该卷作为Helm安装的一部分安装到Jenkins pod。 You can also make daily snapshots/backups of Jenkins disk. 您还可以制作Jenkins磁盘的每日快照/备份。 In this way Jenkins deployment becomes very smooth, quick and reliable. 通过这种方式,Jenkins部署变得非常流畅,快速和可靠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM