<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] ## 準備部署的yml文件 ```yml apiVersion: apps/v1 kind: Deployment metadata: namespace: test name: pipeline labels: app: pipeline spec: replicas: 2 selector: matchLabels: app: pipeline template: metadata: labels: app: pipeline spec: containers: - name: pipeline image: 192.168.11.102:80/repo/pipeline:v4.0.0 imagePullPolicy: Always ports: - containerPort: 8080 --- apiVersion: v1 kind: Service metadata: namespace: test labels: app: pipeline name: pipeline spec: selector: app: pipeline ports: - port: 8081 targetPort: 8080 type: NodePort --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: namespace: test name: pipeline spec: ingressClassName: ingress rules: - host: mashibing.pipeline.com http: paths: - path: / pathType: Prefix backend: service: name: pipeline port: number: 8081 ``` ### Harbor私服配置 在嘗試用kubernetes的yml文件啟動pipeline服務時,會出現Kubernetes無法拉取鏡像的問題,這里需要在kubernetes所在的Linux中配置Harbor服務信息,并且保證Kubernetes可以拉取Harbor上的鏡像 - 設置Master和Worker的私服地址信息 | 設置Harbor私服地址 | | :------------------------------------------: | | ![](https://img.kancloud.cn/7b/5e/7b5e889b43568771faae215702a04e9c_1696x426.png) | - 在Kuboard上設置私服密文信息 | 設置密文并測試 | | :------------------------------------------: | | ![](https://img.kancloud.cn/58/eb/58eb317ec208a97817472acc442f67ff_1918x923.png) | 按照復制指令的位置測試認證,效果如下 | 測試效果 | | :------------------------------------------: | | ![](https://img.kancloud.cn/c6/3a/c63afc47dedd5c30bcba1cd24d961563_1202x233.png) | ### 測試使用效果 執行kubectl命令,基于yml啟動服務,并且基于部署后服務的提示信息以及Ingress的設置,直接訪問 | | | -------------------------------------------- | | ![](https://img.kancloud.cn/9c/e9/9ce91a28d5e3644b5a17184a7a5b96f0_1038x152.png) | | ![](https://img.kancloud.cn/a5/77/a57772403d9ac7fcd409e22367593562_632x136.png) | ### Jenkins遠程調用 - 將pipeline.yml配置到Gitlab中 | 配置yml文件 | | :------------------------------------------: | | ![](https://img.kancloud.cn/81/4d/814d924ada2845d261f595c635730c4a_1255x948.png) | - 配置Jenkins的目標服務器,可以將yml文件傳輸到K8s的Master上 | 設置目標服務器 | | :------------------------------------------: | | ![](https://img.kancloud.cn/b6/1d/b61db6e5c02708fcf32de08598ceee1f_1901x563.png) | - 修改Jenkinsfile,重新設置流水線任務腳本,并測試效果 | 傳遞yml文件腳本 | | :------------------------------------------: | | ![](https://img.kancloud.cn/a5/bc/a5bc9cd872cb424e60fcad1f36ab0e56_1187x379.png)| |![](https://img.kancloud.cn/a0/52/a052a39d71eb3a93ceae0a5d0dd7821d_1826x673.png) | - 設置Jenkins無密碼登錄k8s-master 將Jenkins中公鑰信息復制到k8s-master的~/.ssh/authorized_keysz中,保證遠程連接無密碼 | 遠程執行命令無需密碼 | | :------------------------------------------: | | ![](https://img.kancloud.cn/82/9c/829c4392de4d5595cd00f6ff7bdc46ca_808x76.png) | - 設置執行kubectl的腳本到Jenkinsfile | 設置Jenkinsfile | | :------------------------------------------: | | ![](https://img.kancloud.cn/1f/48/1f48f8ad67c4b230edf218e369d73bc3_1118x243.png)| - 執行查看效果 | 執行流水線 | | :------------------------------------------: | | ![](https://img.kancloud.cn/80/25/80258bf631b270aa2f5f70ba270cfcff_1828x679.png) | 可以查看到yml文件是由變化的, 這樣k8s就會重新加載 - 查看效果 | 效果 | | :------------------------------------------: | | ![](https://img.kancloud.cn/ac/42/ac428a388407768e99b2999204df4595_535x93.png)| Ps:這種方式更適應與CD操作,將項目將基于某個版本部署到指定的目標服務器
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看