<p style="visibility: visible;"> 做这个实验目标是往kubernetes集群里交付dubbo服务,采用jenkins+maven+gitee实现,jenkins使用的是v2.303.1,maven使用3.6.3。jenkins数据存储在nfs目录中。如下图所示:</p><table style="visibility: visible;"><tbody style="visibility: visible;"><tr style="visibility: visible;"><td width="268" valign="top" style="word-break: break-all; visibility: visible;">主机名</td><td width="268" valign="top" style="word-break: break-all; visibility: visible;">提供服务</td></tr><tr style="visibility: visible;"><td width="268" valign="top" style="word-break: break-all; visibility: visible;">host11</td><td width="268" valign="top" style="word-break: break-all; visibility: visible;">nginx-proxy、dns</td></tr><tr style="visibility: visible;"><td width="268" valign="top" style="word-break: break-all; visibility: visible;">host21</td><td width="268" valign="top" style="word-break: break-all; visibility: visible;">kubernetes node(v.1.15.2)</td></tr><tr style="visibility: visible;"><td valign="top" colspan="1" rowspan="1" style="word-break: break-all; visibility: visible;">host22</td><td valign="top" colspan="1" rowspan="1" style="word-break: break-all; visibility: visible;">kubernetes node(v1.15.2)</td></tr><tr style="visibility: visible;"><td valign="top" colspan="1" rowspan="1" style="word-break: break-all; visibility: visible;">host200</td><td valign="top" colspan="1" rowspan="1" style="word-break: break-all; visibility: visible;">harbor、httpd、nfs</td></tr></tbody></table><p style="visibility: visible;"><img data-ratio="0.6642424242424242" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZRLxUbuj0cbEbETOrOulZiap1anpIMnw8Ju8wXMOCfZqnH1vmmmpvHdg/640?wx_fmt=png" data-type="png" data-w="825" _width="677px" class="" src="https://upload-images.jianshu.io/upload_images/10964343-9a20e3e3ff6bc6fd.png" style="width: 677px !important; height: auto !important; visibility: visible !important;" crossorigin="anonymous" alt="图片" data-fail="0"></p><p><span style="color: rgb(255, 0, 0);"><strong>01 jenkins镜像准备</strong></span></p><p>1)在host200上下载jenkins镜像</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">docker pull jenkins/jenkins:2.303.1</span></code></pre></section><p>2)添加tag,上传到自己的镜像仓库</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">docker tag 619aabbe0502 harbor.od.com/public/jenkins:2.303.1</span></code><code><span class="code-snippet_outer">docker push harbor.od.com/public/jenkins:2.303.1</span></code></pre></section><p>3)准备dockerfile,以官方镜像为底包,构建能和docker联动的镜像</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">mkdir -pv /data/dockerfile/jenkins</span></code><code><span class="code-snippet_outer">cd /data/dockerfile/jenkins</span></code></pre></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="properties"><code><span class="code-snippet_outer"><span class="code-snippet__comment"># 准备sshkey</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">ssh-keygen -t rsa -b 2048 -C "yunweishaonian@yeah.net" -N "" -f /root/.ssh/id_rsa</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># 将key复制到当前目录下</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">cp -a /root/.ssh/id_rsa .</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># 获取get-docker.sh,主要是给jenkens安装docker客户端</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">curl -fsSL get.docker.com -o /data/dockerfile/jenkins/get-docker.sh</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># 复制docker的配置文件</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">cp</span> <span class="code-snippet__string">-a /root/.docker/config.json .</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># 添加config文件,后卖就可以绵密登录gitee了</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">vi</span> <span class="code-snippet__string">config</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">Host</span> <span class="code-snippet__string">gitee.com</span></span></code><code><span class="code-snippet_outer"> <span class="code-snippet__attr">HostName</span> <span class="code-snippet__string">gitee.com</span></span></code><code><span class="code-snippet_outer"> <span class="code-snippet__attr">User</span> <span class="code-snippet__string">git</span></span></code><code><span class="code-snippet_outer"> <span class="code-snippet__attr">PreferredAuthentications</span> <span class="code-snippet__string">publickey</span></span></code><code><span class="code-snippet_outer"> <span class="code-snippet__attr">IdentityFile</span> <span class="code-snippet__string">/root/.ssh/id_rsa</span></span></code><code><span class="code-snippet_outer"></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># 编辑dockerfile</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">vi</span> <span class="code-snippet__string">/data/dockerfile/jenkins/Dockerfile</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">FROM</span> <span class="code-snippet__string">harbor.od.com/public/jenkins:2.303.1</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">USER</span> <span class="code-snippet__string">root</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">RUN</span> <span class="code-snippet__string">/bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime &&\</span></span></code><code><span class="code-snippet_outer"> echo 'Asia/Shanghai' > /etc/timezone</span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">ADD</span> <span class="code-snippet__string">id_rsa /root/.ssh/id_rsaADD config.json /root/.docker/config.json</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">ADD</span> <span class="code-snippet__string">get-docker.sh /get-docker.sh</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">ADD config /root/.ssh/config</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attr">RUN</span> <span class="code-snippet__string">echo " StrictHostKeyChecking no" >> /etc/ssh/ssh_config &&\</span></span></code><code><span class="code-snippet_outer"> /get-docker.sh</span></code></pre></section><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="apache"><code><span class="code-snippet_outer"># build成一个新镜像</span></code><code><span class="code-snippet_outer">docker build . -t harbor.od.com/infra/jenkins:v2.303.1</span></code><code><span class="code-snippet_outer"># 上传至harbor</span></code><code><span class="code-snippet_outer">docker push harbor.od.com/infra/jenkins:v2.303.1</span></code></pre></section><p><span style="display: none;line-height: 0px;"></span></p><p>4)在gitee配置公钥</p><p><img data-ratio="0.514670896114195" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZ03L2G5xPLIRK1vHXZGLsVKzqZ3sovVF35O3DPxgkmne83icJKmKtHQA/640?wx_fmt=png" data-type="png" data-w="1261" _width="677px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-454b445411f98508.png" style="width: 677px !important; height: 349.403px !important;" crossorigin="anonymous" alt="图片"></p><p>5)测试jenkens镜像是否可用</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer"># 返回成功即可</span></code><code><span class="code-snippet_outer">docker -run --rm harbor.od.com/infra/jenkins:v2.303.1 ssh -T git@gitee.com</span></code></pre></section><p><span style="color: rgb(255, 0, 0);"><strong>02 kubernetes 准备</strong></span></p><p>1)创建namespace</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="cs"><code><span class="code-snippet_outer"># 创建namespace</span></code><code><span class="code-snippet_outer">kubectl create namespace infra</span></code><code><span class="code-snippet_outer"># 创建secret,这里的密码为harbor的密码</span></code><code><span class="code-snippet_outer">kubectl create secret docker-registry harbor --docker-server=harbor.od.com --docker-username=admin --docker-password=xxxxx -n infra</span></code></pre></section><p><strong><span style="color: rgb(255, 0, 0);">03 nfs准备</span></strong></p><p>1)每个节点都安装nfs-utils</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">yum install nfs-utils -y</span></code></pre></section><p>2)在host200上创建共享目录</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">mkdir -p /data/nfs-volume/jenkins_home</span></code></pre></section><p>3)host200配置nfs</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="java"><code><span class="code-snippet_outer">vi /etc/exports</span></code><code><span class="code-snippet_outer">/data/nfs-volume 192.168.122.0/24(rw,no_root_squash)</span></code></pre></section><p>4)host200启动nfs服务</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">systemctl enable nfs</span></code><code><span class="code-snippet_outer">systemctl start nfs</span></code></pre></section><p>5)测试</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="cs"><code><span class="code-snippet_outer">[root@host200 ~]# showmount -e</span></code><code><span class="code-snippet_outer">Export list for host200.yunwei.com:</span></code><code><span class="code-snippet_outer">/data/nfs-volume 192.168.122.0/24 # node地址段</span></code></pre></section><p><strong><span style="color: rgb(255, 0, 0);">04 资源配置清单</span></strong></p><p>1)创建目录(/data/k8s-yaml/jenkins == http://k8s-yaml.od.com/jenkins/)</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer">mkdir /data/k8s-yaml/jenkins/</span></code></pre></section><p>2)创建dp.yaml</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="properties"><code><span class="code-snippet_outer">kind: Deployment</span></code><code><span class="code-snippet_outer">apiVersion: extensions/v1beta1</span></code><code><span class="code-snippet_outer">metadata:</span></code><code><span class="code-snippet_outer"> name: jenkins </span></code><code><span class="code-snippet_outer"> namespace: infra</span></code><code><span class="code-snippet_outer"> labels: </span></code><code><span class="code-snippet_outer"> name: jenkins</span></code><code><span class="code-snippet_outer">spec:</span></code><code><span class="code-snippet_outer"> replicas: 1</span></code><code><span class="code-snippet_outer"> selector:</span></code><code><span class="code-snippet_outer"> matchLabels: </span></code><code><span class="code-snippet_outer"> name: jenkins</span></code><code><span class="code-snippet_outer"> template:</span></code><code><span class="code-snippet_outer"> metadata:</span></code><code><span class="code-snippet_outer"> labels: </span></code><code><span class="code-snippet_outer"> app: jenkins </span></code><code><span class="code-snippet_outer"> name: jenkins</span></code><code><span class="code-snippet_outer"> spec:</span></code><code><span class="code-snippet_outer"> volumes:</span></code><code><span class="code-snippet_outer"> - name: data # 创建一个卷</span></code><code><span class="code-snippet_outer"> nfs: # 卷类型是nfs</span></code><code><span class="code-snippet_outer"> server: host200 # nfs服务器地址</span></code><code><span class="code-snippet_outer"> path: /data/nfs-volume/jenkins_home</span></code><code><span class="code-snippet_outer"> - name: docker # 创建一个卷</span></code><code><span class="code-snippet_outer"> hostPath: # 类型是hostpath,即本节点路径</span></code><code><span class="code-snippet_outer"> path: /run/docker.sock # 将物理节点的docker.sock挂在到jenkins里,这样jenkins就可以通过socket和物理节点的docker通信了 </span></code><code><span class="code-snippet_outer"> type: ''</span></code><code><span class="code-snippet_outer"> containers:</span></code><code><span class="code-snippet_outer"> - name: jenkins</span></code><code><span class="code-snippet_outer"> image: harbor.od.com/infra/jenkins:v2.303.1</span></code><code><span class="code-snippet_outer"> imagePullPolicy: IfNotPresent # 镜像拉去策略 awlays 不管本地有没有,都从远程拉,never只从本地拉,IfNotPresent 优先本地,本地没有去远程拉</span></code><code><span class="code-snippet_outer"> ports:</span></code><code><span class="code-snippet_outer"> - containerPort: 8080 </span></code><code><span class="code-snippet_outer"> protocol: TCP</span></code><code><span class="code-snippet_outer"> env:</span></code><code><span class="code-snippet_outer"> - name: JAVA_OPTS</span></code><code><span class="code-snippet_outer"> value: -Xmx512m -Xms512m</span></code><code><span class="code-snippet_outer"> volumeMounts:</span></code><code><span class="code-snippet_outer"> - name: data</span></code><code><span class="code-snippet_outer"> mountPath: /var/jenkins_home # 将host200:/data/nfs-volume/jenkins_home挂在到容器里的/var/jenkins_home</span></code><code><span class="code-snippet_outer"> - name: docker</span></code><code><span class="code-snippet_outer"> mountPath: /run/docker.sock # 将物理主机的/run/docker.sock挂在到容器的/run/docker.sock</span></code><code><span class="code-snippet_outer"> imagePullSecrets:</span></code><code><span class="code-snippet_outer"> - name: harbor # 镜像仓库 之前用kubectl create secret docker-registry harbor --docker-server=harbor.od.com --docker-username=admin --docker-password=xxxxx -n infra 定义了</span></code><code><span class="code-snippet_outer"></span></code><code><span class="code-snippet_outer"> securityContext: </span></code><code><span class="code-snippet_outer"> runAsUser: 0</span></code><code><span class="code-snippet_outer"> strategy:</span></code><code><span class="code-snippet_outer"> type: RollingUpdate # 滚动升级</span></code><code><span class="code-snippet_outer"> rollingUpdate: </span></code><code><span class="code-snippet_outer"> maxUnavailable: 1</span></code><code><span class="code-snippet_outer"> maxSurge: 1</span></code><code><span class="code-snippet_outer"> revisionHistoryLimit: 7 # 保留7份滚动版本 ,以便回退</span></code><code><span class="code-snippet_outer"> progressDeadlineSeconds: 600 # 启动超时时间</span></code></pre></section><p>3)创建svc.yaml</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="properties"><code><span class="code-snippet_outer">kind: Service</span></code><code><span class="code-snippet_outer">apiVersion: v1</span></code><code><span class="code-snippet_outer">metadata: </span></code><code><span class="code-snippet_outer"> name: jenkins</span></code><code><span class="code-snippet_outer"> namespace: infra</span></code><code><span class="code-snippet_outer">spec:</span></code><code><span class="code-snippet_outer"> ports:</span></code><code><span class="code-snippet_outer"> - protocol: TCP</span></code><code><span class="code-snippet_outer"> port: 80 # cluterip的80端口转换到容器的8080</span></code><code><span class="code-snippet_outer"> targetPort: 8080</span></code><code><span class="code-snippet_outer"> selector:</span></code><code><span class="code-snippet_outer"> app: jenkins</span></code></pre></section><p>4)ingress.yaml</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="properties"><code><span class="code-snippet_outer">kind: Ingress</span></code><code><span class="code-snippet_outer">apiVersion: extensions/v1beta1</span></code><code><span class="code-snippet_outer">metadata: </span></code><code><span class="code-snippet_outer"> name: jenkins</span></code><code><span class="code-snippet_outer"> namespace: infra</span></code><code><span class="code-snippet_outer">spec:</span></code><code><span class="code-snippet_outer"> rules:</span></code><code><span class="code-snippet_outer"> - host: jenkins.od.com</span></code><code><span class="code-snippet_outer"> http:</span></code><code><span class="code-snippet_outer"> paths:</span></code><code><span class="code-snippet_outer"> - path: /</span></code><code><span class="code-snippet_outer"> backend: </span></code><code><span class="code-snippet_outer"> serviceName: jenkins</span></code><code><span class="code-snippet_outer"> servicePort: 80</span></code></pre></section><p><strong><span style="color: rgb(255, 0, 0);">05 将jenkins交付到kubernetes集群</span></strong></p><p>1)任意一个node创建资源</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="sql"><code><span class="code-snippet_outer">kubectl create -f http://k8s-yaml.od.com/jenkins/dp.yaml</span></code><code><span class="code-snippet_outer">kubectl create -f http://k8s-yaml.od.com/jenkins/svc.yaml</span></code><code><span class="code-snippet_outer">kubectl create -f http://k8s-yaml.od.com/jenkins/ingress.yaml</span></code></pre></section><p>2)查看资源情况</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="perl"><code><span class="code-snippet_outer">[root@host21 ~]# kubectl get all -n infra</span></code><code><span class="code-snippet_outer">NAME READY STATUS RESTARTS AGE</span></code><code><span class="code-snippet_outer">pod/jenkins-7df8bf4ff9-qj85m 1/1 Running 0 10h</span></code><code><span class="code-snippet_outer"></span></code><code><span class="code-snippet_outer"></span></code><code><span class="code-snippet_outer">NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE</span></code><code><span class="code-snippet_outer">service/jenkins ClusterIP 10.254.129.207 <none> 80/TCP 13h</span></code><code><span class="code-snippet_outer"></span></code><code><span class="code-snippet_outer"></span></code><code><span class="code-snippet_outer">NAME READY UP-TO-DATE AVAILABLE AGE</span></code><code><span class="code-snippet_outer">deployment.apps/jenkins 1/1 1 1 10h</span></code><code><span class="code-snippet_outer"></span></code><code><span class="code-snippet_outer">NAME DESIRED CURRENT READY AGE</span></code><code><span class="code-snippet_outer">replicaset.apps/jenkins-7df8bf4ff9 1 1 1 10h</span></code></pre></section><p><strong><span style="color: rgb(255, 0, 0);">06 验证jenkins</span></strong></p><p>1)验证jenkins镜像的用户</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer">[root@host21 ~]# kubectl exec -it pod/jenkins-7df8bf4ff9-qj85m -n infra /bin/bash</span></code><code><span class="code-snippet_outer">root@jenkins-7df8bf4ff9-qj85m:/# whoami</span></code><code><span class="code-snippet_outer">root</span></code></pre></section><p>2)验证是否可以登录git</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer">root@jenkins-7df8bf4ff9-qj85m:/# ssh -i /root/.ssh/id_rsa -T git@gitee.com</span></code><code><span class="code-snippet_outer">Hi yunweishaonian! You've successfully authenticated, but GITEE.COM does not provide shell access.</span></code></pre></section><p>3)验证jenkins是否可以联动host的docker</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="ruby"><code><span class="code-snippet_outer">root@jenkins-7df8bf4ff9-qj85m:/# docker image ls</span></code><code><span class="code-snippet_outer">REPOSITORY TAG IMAGE ID CREATED SIZE</span></code><code><span class="code-snippet_outer">harbor.od.com/app/dubbo-demo-service master_211002_2213 a8f3cec136fc About an hour ago 377MB</span></code></pre></section><p><span style="color: rgb(255, 0, 0);"><strong>07 配置jenkins</strong></span></p><p>1)在host11添加解析</p><section class="code-snippet__fix code-snippet__js"><ul class="code-snippet__line-index code-snippet__js"><li></li><li></li><li></li><li></li><li></li></ul><pre class="code-snippet__js" data-lang="nginx"><code><span class="code-snippet_outer"><span class="code-snippet__comment"># 添加解析</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__attribute">vi</span> /var/named/od.com.zone</span></code><code><span class="code-snippet_outer">jenkins A <span class="code-snippet__number">192.168.122.10</span></span></code><code><span class="code-snippet_outer"><span class="code-snippet__comment"># 重启dns</span></span></code><code><span class="code-snippet_outer">systemctl restart named</span></code></pre></section><p>2)打开网页,查看提示的文件,将密码输入</p><p><img data-ratio="0.4977973568281938" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZ0AiaicVFKHbXRWL2oMia5NZ9Y0eVEsLuQXQCEPRDE6py1ib5HnCvD7rsEQ/640?wx_fmt=png" data-type="png" data-w="681" _width="677px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-261df721d3abbd4a.png" style="width: 677px !important; height: 338.013px !important;" crossorigin="anonymous" alt="图片"></p><p>3)选推荐安装的插件,安装完成后创建admin用户即可</p><p><img data-ratio="0.3374233128834356" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZge2GPjfCQ91oUgCCKTej0bEtshELf38PeqibFiaSweNKBmNKKooWfpwg/640?wx_fmt=png" data-type="png" data-w="652" _width="652px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-974ce098d9768169.png" style="width: 652px !important; height: 221.325px !important;" crossorigin="anonymous" alt="图片"></p><p>4)进入jenkins</p><p><img data-ratio="0.7205452775073028" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZsdblBRfTwlbjFkOCRHDcSiaD99LsticbTo5JT5591Bl90oh6nAD3sUSQ/640?wx_fmt=png" data-type="png" data-w="1027" _width="677px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-8b08584939563fec.png" style="width: 677px !important; height: 488.368px !important;" crossorigin="anonymous" alt="图片"></p><p>5)修改安全参数</p><p><img data-ratio="0.5699020480854853" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZjv8WiamPibgyBr9icM0yEn3gjfVDgHUnn9ia10287fpO35HBv6ct9Qib84w/640?wx_fmt=png" data-type="png" data-w="1123" _width="677px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-3753694851f8369e.png" style="width: 677px !important; height: 386.684px !important;" crossorigin="anonymous" alt="图片"><img data-ratio="0.1525096525096525" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZXRTkxYLpGsiaiaGVLfL4dSDYdtaW3RFexjUSGqJAmSWbklRdBXMVHvWg/640?wx_fmt=png" data-type="png" data-w="1554" _width="677px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-378be8a220521deb.png" style="width: 677px !important; height: 104.944px !important;" crossorigin="anonymous" alt="图片"></p><p>6)下载blue ocean插件</p><p><img data-ratio="0.5017964071856288" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZmQOwiaQAiatHwHlRPHFLBoFEhZ0d8TOR5Z0AVdM6AyCew0wV9ric9EHkQ/640?wx_fmt=png" data-type="png" data-w="1670" _width="677px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-430956709b910f71.png" style="width: 677px !important; height: 340.713px !important;" crossorigin="anonymous" alt="图片"></p><p>7)在[可选插件]中搜索blue ocean 选择下面的安装后重启</p><p><img data-ratio="0.5347355003186743" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZ4Cics6tbvdzrpAYqMGR6UcOzYiaqYJ8ibpQapS4n4TQIq9fcv9BRrXYKQ/640?wx_fmt=png" data-type="png" data-w="1569" _width="677px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-b99965658be00484.png" style="width: 677px !important; height: 362.946px !important;" crossorigin="anonymous" alt="图片"></p><p>8)安装完成后选择restart</p><p><img data-ratio="0.20385674931129477" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZVrfseIIW2eatZrjgVaZoxfFOlibNbb04h2riaib0x1Qd0CaZRb9udwbCw/640?wx_fmt=png" data-type="png" data-w="363" _width="363px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-36d56e58c67e25c9.png" style="width: 363px !important; height: 75.5923px !important;" crossorigin="anonymous" alt="图片"></p><p>9)一切就绪后,你就可以在首页看到blue ocean了</p><p><img data-ratio="1.6075581395348837" data-src="https://mmbiz.qpic.cn/sz_mmbiz_png/jOGaDndiaKEcUXnQT26JvGMMRoSGgJAgZTnn0yv0DlRfw8OahsXj4aQtEZuBibPHzStOG7YrOHQmpx0SIbaKNMEg/640?wx_fmt=png" data-type="png" data-w="344" _width="344px" class="img_loading" src="https://upload-images.jianshu.io/upload_images/10964343-96baf7e649184a40.png" style="width: 344px !important; height: 551.785px !important;" crossorigin="anonymous" alt="图片"></p><blockquote><p>本文使用 <a href="https://www.jianshu.com/p/5709df6fb58d" class="internal">文章同步助手</a> 同步</p></blockquote>
2022-04-01
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 做这个实验目标是往kubernetes集群里交付dubbo服务,采用jenkins+maven+gitee实现,j...
- 写在前面 最近在 K8S 1.18.2 版本的集群上搭建DevOps环境,期间遇到了各种坑。目前,搭建环境的过程中...
- 说明:本文主要介绍通过Ansible来部署Openshift 3.9 一、准备 系统准备 注:在安装时可以通过an...
- 现有混合云平台的场景下,即有线下和线上的环境,又有测试与正式的场景,而且结合了Docker,导致打包内容有所区分,...