k8s管理 jenkins集群彈性伸縮

2020-09-04 小白一起學IT

碼雲現成

https://gitee.com/q7104475/k8s-jenkins-ci

k8s-jenkins-ci

介紹/參考文章

在Kubernetes上部署和伸縮Jenkins

鏡像內置常用插件/常用命令/mvn npm

參考文章-在Kubernetes上部署和伸縮Jenkins

安裝教程

構建鏡像

docker build -f Dockerfile-jenkins-master -t 7104475/jenkins-master:v1.0 . && \docker build -f Dockerfile-jenkins-slave-jnlp1 -t 7104475/jenkins-slave-jnlp1:v1.0 . && \docker build -f Dockerfile-jenkins-slave-jnlp2 -t 7104475/jenkins-slave-jnlp2:v1.0 . && \docker build -f Dockerfile-jenkins-slave-jnlp3 -t 7104475/jenkins-slave-jnlp3:v1.0 . && \docker build -f Dockerfile-jenkins-slave-jnlp4 -t 7104475/jenkins-slave-jnlp4:v1.0 . && \docker build -f Dockerfile-jenkins-slave-jnlp5 -t 7104475/jenkins-slave-jnlp5:v1.0 . && \docker build -f Dockerfile-jenkins-slave-jnlp6 -t 7104475/jenkins-slave-jnlp6:v1.0 .

打tag推送到鏡像倉庫

docker tag 7104475/jenkins-master:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-master:v1.1docker tag 7104475/jenkins-slave-jnlp1:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp1:v1.1docker tag 7104475/jenkins-slave-jnlp2:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp2:v1.1docker tag 7104475/jenkins-slave-jnlp3:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp3:v1.1docker tag 7104475/jenkins-slave-jnlp4:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp4:v1.1docker tag 7104475/jenkins-slave-jnlp5:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp5:v1.1docker tag 7104475/jenkins-slave-jnlp6:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp6:v1.1master_jenkins_docker_file換國內源cat > sources.list << EOFdeb http://mirrors.aliyun.com/debian/ stretch main non-free contribdeb-src http://mirrors.aliyun.com/debian/ stretch main non-free contribdeb http://mirrors.aliyun.com/debian-security stretch/updates maindeb-src http://mirrors.aliyun.com/debian-security stretch/updates maindeb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contribdeb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contribdeb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contribdeb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contribEOFcat >Dockerfile-jenkins-master << &39;FROM jenkins/jenkins:ltsUSER rootCOPY plugins.txt /usr/local/bin/COPY sources.list /usr/local/bin/RUN /usr/local/bin/install-plugins.sh greenballs39;EOF&RUN /usr/local/bin/install-plugins.sh ansicolorRUN /usr/local/bin/install-plugins.sh kubernetesENV MAVEN_HOME=/usr/local/maven/apache-maven-3.6.3ENV PATH=${MAVEN_HOME}/bin:${PATH}ENV NODE_HOME=/usr/local/nodeENV PATH=$NODE_HOME/bin:$PATHRUN cd /usr/local/bin/ && \ ./install-plugins.sh < plugins.txt || true && \ cd /opt &&\ wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz && \ mkdir -pv /usr/local/maven/ && \ tar xzvf apache-maven-3.6.3-bin.tar.gz -C /usr/local/maven/ && \ apt update && \ apt install gcc -y &&\ apt install pbzip2 -y && \ apt install vim zip -y && \ apt install sshpass -y && \ wget https://npm.taobao.org/mirrors/node/latest-v13.x/node-v13.9.0-linux-x64.tar.gz && \ tar xzvf node-v13.9.0-linux-x64.tar.gz -C /usr/local/ && \ cd /usr/local/ && \ mv node-v13.9.0-linux-x64/ node && \ export NODE_HOME=/usr/local/node && \ export PATH=$NODE_HOME/bin:$PATH && \ /usr/local/node/bin/npm install -g cnpm --registry=https://registry.npm.taobao.org && \ /usr/local/node/bin/npm config set registry https://registry.npm.taobao.org && \ /usr/local/node/bin/npm update && \ cnpm update && \ cd /opt && \ rm -rfv /opt/* && apt-get clean && rm -rf /var/lib/apt/lists/*EOFcat >Dockerfile-jenkins-slave-jnlp2 << &39;FROM jenkins/jnlp-slaveCOPY empty-test-file /jenkins-slave2USER rootCOPY plugins.txt /usr/local/bin/COPY sources.list /usr/local/bin/RUN /usr/local/bin/install-plugins.sh greenballs39;EOF&RUN /usr/local/bin/install-plugins.sh ansicolorRUN /usr/local/bin/install-plugins.sh kubernetesENV MAVEN_HOME=/usr/local/maven/apache-maven-3.6.3ENV PATH=${MAVEN_HOME}/bin:${PATH}ENV NODE_HOME=/usr/local/nodeENV PATH=$NODE_HOME/bin:$PATHRUN cd /usr/local/bin/ && \ ./install-plugins.sh < plugins.txt || true && \ cd /opt &&\ wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz && \ mkdir -pv /usr/local/maven/ && \ tar xzvf apache-maven-3.6.3-bin.tar.gz -C /usr/local/maven/ && \ apt update && \ apt install gcc -y &&\ apt install pbzip2 -y && \ apt install vim zip -y && \ apt install sshpass -y && \ wget https://npm.taobao.org/mirrors/node/latest-v13.x/node-v13.9.0-linux-x64.tar.gz && \ tar xzvf node-v13.9.0-linux-x64.tar.gz -C /usr/local/ && \ cd /usr/local/ && \ mv node-v13.9.0-linux-x64/ node && \ export NODE_HOME=/usr/local/node && \ export PATH=$NODE_HOME/bin:$PATH && \ /usr/local/node/bin/npm install -g cnpm --registry=https://registry.npm.taobao.org && \ /usr/local/node/bin/npm config set registry https://registry.npm.taobao.org && \ /usr/local/node/bin/npm update && \ cnpm update && \ cd /opt && \ rm -rfv /opt/* && apt-get clean && rm -rf /var/lib/apt/lists/*EOFcat >Dockerfile-jenkins-slave-jnlp4 << &39;FROM jenkins/jnlp-slaveCOPY empty-test-file /jenkins-slave4USER rootCOPY plugins.txt /usr/local/bin/COPY sources.list /usr/local/bin/RUN /usr/local/bin/install-plugins.sh greenballs39;EOF&RUN /usr/local/bin/install-plugins.sh ansicolorRUN /usr/local/bin/install-plugins.sh kubernetesENV MAVEN_HOME=/usr/local/maven/apache-maven-3.6.3ENV PATH=${MAVEN_HOME}/bin:${PATH}ENV NODE_HOME=/usr/local/nodeENV PATH=$NODE_HOME/bin:$PATHRUN cd /usr/local/bin/ && \ ./install-plugins.sh < plugins.txt || true && \ cd /opt &&\ wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz && \ mkdir -pv /usr/local/maven/ && \ tar xzvf apache-maven-3.6.3-bin.tar.gz -C /usr/local/maven/ && \ apt update && \ apt install gcc -y &&\ apt install pbzip2 -y && \ apt install sshpass -y && \ apt install vim zip -y && \ wget https://npm.taobao.org/mirrors/node/latest-v13.x/node-v13.9.0-linux-x64.tar.gz && \ tar xzvf node-v13.9.0-linux-x64.tar.gz -C /usr/local/ && \ cd /usr/local/ && \ mv node-v13.9.0-linux-x64/ node && \ export NODE_HOME=/usr/local/node && \ export PATH=$NODE_HOME/bin:$PATH && \ /usr/local/node/bin/npm install -g cnpm --registry=https://registry.npm.taobao.org && \ /usr/local/node/bin/npm config set registry https://registry.npm.taobao.org && \ /usr/local/node/bin/npm update && \ cnpm update && \ cd /opt && \ rm -rfv /opt/* && apt-get clean && rm -rf /var/lib/apt/lists/*EOFcat >Dockerfile-jenkins-slave-jnlp6 << &39;FROM jenkins/jnlp-slaveCOPY empty-test-file /jenkins-slave6USER rootCOPY plugins.txt /usr/local/bin/COPY sources.list /usr/local/bin/RUN /usr/local/bin/install-plugins.sh greenballsdocker tag 7104475/jenkins-master:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-master:v1.1docker tag 7104475/jenkins-slave-jnlp1:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp1:v1.1docker tag 7104475/jenkins-slave-jnlp2:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp2:v1.1docker tag 7104475/jenkins-slave-jnlp3:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp3:v1.1docker tag 7104475/jenkins-slave-jnlp4:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp4:v1.1docker tag 7104475/jenkins-slave-jnlp5:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp5:v1.1docker tag 7104475/jenkins-slave-jnlp6:v1.0 registry.cn-chengdu.aliyuncs.com/7104475/jenkins-slave-jnlp6:v1.139;EOF& - name: jenkins-mvn-conf subPath: settings.xml volumes: - name: jenkins-home hostPath: path: /data/jenkins_master type: &34; - name: jenkins-m2 hostPath: path: /data/jenkins_master/m2 type: &34; - name: jenkins-npm hostPath: path: /data/jenkins_master/npm type: &34; - name: jenkins-docker-01 hostPath: path: /usr/bin/docker type: &34; - name: jenkins-docker-02 hostPath: path: /var/run/docker.sock type: &34; configMap:39;EOF&備用apiVersion: v1kind: Servicemetadata: name: jenkinsspec: type: NodePort ports: - port: 8080 nodePort: 37878 selector: app: jenkins---apiVersion: v1kind: Servicemetadata: name: jenkins-jnlpspec: type: ClusterIP ports: - port: 50000 targetPort: 50000 selector: app: jenkinsconfigmapapiVersion: v1kind: ConfigMapmetadata: name: jenkins-cmdata: settings.xml: |- <?xml version=&34; encoding=&34;?> <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the &34;); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &34; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <!-- | This is the configuration file for Maven. It can be specified at two levels: | | 1. User Level. This settings.xml file provides configuration for a single user, | and is normally provided in ${user.home}/.m2/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -s /path/to/user/settings.xml | | 2. Global Level. This settings.xml file provides configuration for all Maven | users on a machine (assuming they&39;s normally provided in | ${maven.conf}/settings.xml. | | NOTE: This location can be overridden with the CLI option: | | -gs /path/to/global/settings.xml | | The sections in this sample file are intended to give you a running start at | getting the most out of your Maven installation. Where appropriate, the default | values (values used when the setting is not specified) are provided. | |--> <settings xmlns=&34; xmlns:xsi=&34; xsi:schemaLocation=&34;> <!-- localRepository | The path to the local repository maven will use to store artifacts. | | Default: ${user.home}/.m2/repository <localRepository>/path/to/local/repo</localRepository> --> <!-- interactiveMode | This will determine whether maven prompts you when it needs input. If set to false, | maven will use a sensible default value, perhaps based on some other setting, for | the parameter in question. | | Default: true <interactiveMode>true</interactiveMode> --> <!-- offline | Determines whether maven should attempt to connect to the network when executing a build. | This will have an effect on artifact downloads, artifact deployment, and others. | | Default: false <offline>false</offline> --> <!-- pluginGroups | This is a list of additional group identifiers that will be searched when resolving plugins by their prefix, i.e. | when invoking a command line like &34;. Maven will automatically add the group identifiers | &34; and &34; if these are not already contained in the list. |--> <pluginGroups> <!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. <pluginGroup>com.your.plugins</pluginGroup> --> </pluginGroups> <!-- proxies | This is a list of proxies which can be used on this machine to connect to the network. | Unless otherwise specified (by system property or command-line switch), the first proxy | specification in this list marked as active will be used. |--> <proxies> <!-- proxy | Specification for one proxy, to be used in connecting to the network. | <proxy> <id>optional</id> <active>true</active> <protocol>http</protocol> <username>proxyuser</username> <password>proxypass</password> <host>proxy.host.net</host> <port>80</port> <nonProxyHosts>local.net|some.host.com</nonProxyHosts> </proxy> --> </proxies> <!-- servers | This is a list of authentication profiles, keyed by the server-id used within the system. | Authentication profiles can be used whenever maven must make a connection to a remote server. |--> <servers> <!-- server | Specifies the authentication information to use when connecting to a particular server, identified by | a unique name within the system (referred to by the &39; attribute below). | | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are | used together. | <server> <id>deploymentRepo</id> <username>repouser</username> <password>repopwd</password> </server> --> <!-- Another sample, using keys to authenticate. <server> <id>siteServer</id> <privateKey>/path/to/private/key</privateKey> <passphrase>optional; leave empty if not used.</passphrase> </server> --> </servers> <!-- mirrors | This is a list of mirrors to be used in downloading artifacts from remote repositories. | | It works like this: a POM may declare a repository to use in resolving certain artifacts. | However, this repository may have problems with heavy traffic at times, so people have mirrored | it to several places. | | That repository definition will have a unique id, so we can create a mirror reference for that | repository, to be used as an alternate download site. The mirror site will be the preferred | server for that repository. |--> <mirrors> <!-- mirror | Specifies a repository mirror site to use instead of a given repository. The repository that | this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used | for inheritance and direct lookup purposes, and must be unique across the set of mirrors. | <mirror> <id>mirrorId</id> <mirrorOf>repositoryId</mirrorOf> <name>Human Readable Name for this Mirror.</name> <url>http://my.repository.com/repo/path</url> </mirror> --> <mirror> <id>aliyunmaven</id> <mirrorOf>*</mirrorOf> <name>阿里雲公共倉庫</name> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors> <!-- profiles | This is a list of profiles which can be activated in a variety of ways, and which can modify | the build process. Profiles provided in the settings.xml are intended to provide local machine- | specific paths and repository locations which allow the build to work in the local environment. | | For example, if you have an integration testing plugin - like cactus - that needs to know where | your Tomcat instance is installed, you can provide a variable here such that the variable is | dereferenced during the build process to configure the cactus plugin. | | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles | section of this document (settings.xml) - will be discussed later. Another way essentially | relies on the detection of a system property, either matching a particular value for the property, | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a | value of &39; might activate a profile when the build is executed on a JDK version of &39;. | Finally, the list of active profiles can be specified directly from the command line. | | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact | repositories, plugin repositories, and free-form properties to be used as configuration | variables for plugins in the POM. | |--> <profiles> <!-- profile | Specifies a set of introductions to the build process, to be activated using one or more of the | mechanisms described above. For inheritance purposes, and to activate profiles via <activatedProfiles/> | or the command line, profiles have to have an ID that is unique. | | An encouraged best practice for profile identification is to use a consistent naming convention | for profiles, such as &39;, &39;, &39;, &39;, &39;, etc. | This will make it more intuitive to understand what the set of introduced profiles is attempting | to accomplish, particularly when you only have a list of profile id&39;target-env&39;dev&39;target-env' to | anything, you could just leave off the <value/> inside the activation-property. | <profile> <id>env-dev</id> <activation> <property> <name>target-env</name> <value>dev</value> </property> </activation> <properties> <tomcatPath>/path/to/tomcat/instance</tomcatPath> </properties> </profile> --> </profiles> <!-- activeProfiles | List of profiles that are active for all builds. | <activeProfiles> <activeProfile>alwaysActiveProfile</activeProfile> <activeProfile>anotherAlwaysActiveProfile</activeProfile> </activeProfiles> --> </settings>

相關焦點

  • Jenkins master位於k8s集群外,實現jenkins slave的動態構建
    基於&34;與k8s集成,可以使Jenkins slave以pod的形式在k8s集群內部動態構建、運行、銷毀等。通過 jenkinsci/kubernetes-plugin 了解到,Jenkins master既可以運行在k8s集群內,也可運行在k8s集群外,但是Jenkins slave的整個生命周期都是在k8s集群內,並且通過JNLP與Jenkins master連接。
  • k8s集群CI&CD集成介紹四:Jenkins部署應用到rancher集群
    容器編排從幾年前群雄割據、各方亂戰,到如今Google的k8s一統天下。能迅速力挽狂瀾,已說明其技術實力。但k8s複雜的架構,不太友好的文檔,確實讓一些初學者望而卻步。近期正好一直在學習k8s的東西,走了一些彎路。整理出來以備參考。
  • k8s集群CI/CD集成介紹四:Jenkins部署應用到rancher集群
    容器編排從幾年前群雄割據、各方亂戰,到如今Google的k8s一統天下。能迅速力挽狂瀾,已說明其技術實力。但k8s複雜的架構,不太友好的文檔,確實讓一些初學者望而卻步。近期正好一直在學習k8s的東西,走了一些彎路。整理出來以備參考。由於內容過多,本文將分多章介紹k8s集群構建過程,並發布demo到k8s集群,簡單演示一個完整CI/CD的自動化過程。
  • 手把手帶你玩轉k8s-jenkins安裝與流水線
    前言本系列教程最主要的目地是使用k8s做持續集成,從本文開始,才算是正式進入主題。5分鐘在阿里雲Kubernetes服務上搭建jenkins環境並完成應用構建到部署的流水線作業為了通用性,這裡並沒有使用ack-jenkins,而是使用官方的 jenkinsci/blueocean鏡像。jenkins中文官網因為後面要講的jenkins內容需要聯網,但是之前購買的伺服器是沒有綁定公網ip的,這裡也不想購買綁定了(省錢)。
  • k8s集群CI/CD集成介紹二:rancher搭建k8s集群環境
    容器編排從幾年前群雄割據、各方亂戰,到如今Google的k8s一統天下。能迅速力挽狂瀾,已說明其技術實力。但k8s複雜的架構,不太友好的文檔,確實讓一些初學者望而卻步。近期正好一直在學習k8s的東西,走了一些彎路。整理出來以備參考。由於內容過多,本文將分多章介紹k8s集群構建過程,並發布demo到k8s集群,簡單演示一個完整CI/CD的自動化過程。
  • 基於Kubernetes Jenkins CICD
    基於Kubernetes Jenkins CICDJenkins一、在Kubernetes 安裝 Jenkins優點目前很多公司採用Jenkins集群搭建複合需求的CI/CD流程,但是會存在一些問題主Master發生單點故障時,整個流程都不可用每個Slave的環境配置不一樣,來完成不同語言的編譯打包,但是這些差異化的配置導致管理起來不方便
  • 5分鐘了解K8S POD彈性伸縮
    K8S彈性伸縮式K8S中的一大亮點功能,當負載大的時候,可以對應用進行擴容,提升pod的副本數來應對大量的流量功能是通過Kubernetes HPA(Horizontal Pod Autoscaling)Pod水平自動伸縮來實現,只需簡單的配置,集群便可以利用監控指標(cpu使用率等)自動的擴容或者縮容服務中Pod數量,當業務需求增加時,系統將會無縫地自動增加適量容器 ,提高系統穩定性。
  • K8S+Jenkins實現SpringBoot項目CI/CD
    一、Kubernetes CLI此插件允許在Jenkins Job中通過kubectl與k8s集群進行交互,主要是通過kubectl執行各種命令。通過&34;來使用插件:Credentials:使用前面文章在devops命令空間中的sa--jenkins
  • k8s集群CI/CD集成介紹一:環境準備
    容器編排從幾年前群雄割據、各方亂戰,到如今Google的k8s一統天下。能迅速力挽狂瀾,已說明其技術實力。但k8s複雜的架構,不太友好的文檔,確實讓一些初學者望而卻步。近期正好一直在學習k8s的東西,走了一些彎路。整理出來以備參考。由於內容過多,本文將分多章介紹k8s集群構建過程,並發布demo到k8s集群,簡單演示一個完整CI/CD的自動化過程。
  • k8s集群CI/CD集成介紹三:rancher應用部署
    容器編排從幾年前群雄割據、各方亂戰,到如今Google的k8s一統天下。能迅速力挽狂瀾,已說明其技術實力。但k8s複雜的架構,不太友好的文檔,確實讓一些初學者望而卻步。近期正好一直在學習k8s的東西,走了一些彎路。整理出來以備參考。由於內容過多,本文將分多章介紹k8s集群構建過程,並發布demo到k8s集群,簡單演示一個完整CI/CD的自動化過程。
  • 手把手教你用 Jenkins+K8S 打造流水線環境
    安裝 K8S 插件 登錄 Jenkins,系統管理 插件管理 搜索 kubernetes,選擇第二個 配置 K8S 集群的對接 登錄 Jenkins,點擊 系統管理 系統配置 滑動到頁面最下面
  • k8s+jenkins中使用自定義maven鏡像
    簡述在k8s中使用工具不能像傳統方式那樣,在宿主機yum或編譯安裝,然後再掛載到容器中使用了;因為pod運行的節點不是固定的,如果繼續按照傳統方式,需要在pod可能運行的每個節點上都安裝工具,這無疑非常繁瑣!
  • 企業微服務項目如何進入K8S的全過程
    應該是持續集成的唯一選擇了,功能非常強大,強大的插件功能;不同的團隊應用jenkins的方式也不盡相同。很多網上有harbor的高可用,以及集群的架構方案,老顧認為沒有必要,應該harbor是在內部使用,高可用的需求不強烈。我們只要保證鏡像文件不丟失即可,正好harbor的複製管理即可完成此功能。
  • 聽說生鮮領軍企業k8s集群都上雲了,魚會飛了?
    也就是說,可以將運行 Linux 容器的多組主機聚集在一起,由 Kubernetes 幫助我們輕鬆高效地管理這些集群。而且,這些集群可跨公共雲、私有雲或混合雲部署主機。小明:k8s就是為容器服務而生的一個可移植容器的編排管理工具,就相當於你家有相當於一個足球隊的孩子(當然,超生是不提倡的,請大家響應國家計生政策!!!),然後你需要一個專職保姆來幫你管理這些孩子的起居生活。
  • 新Jenkins實踐-第3章 為JENKINS添加靜態AGENT節點
    首先,我們在Jenkins Server頁面>節點管理菜單中添加一個Jenkins Agent。kind: DeploymentapiVersion: apps/v1metadata: labels:   k8s-app: jenkinsagent-test01 name: jenkinsagent-test01 namespace: devopsspec: replicas: 1 revisionHistoryLimit: 10 selector
  • 阿里內部超高質量的k8s+Jenkins筆記,技術與實戰齊飛
    什麼是k8s?Kubernetes是一個用於容器集群的自動化部署、擴容以及運維的開源平臺。k8s孕育的初衷是培育出一個組件及工具的生態,幫助大家減輕在公有雲及私有雲上運行應用的負擔,換言之,使得大型分布式應用的構建和運維變得更加簡單(當然,越簡單的表面意味著越複雜的內部細節)。什麼是Jenkins?
  • 集群外部署Prometheus+Grafana監控K8S解析
    簡介Prometheus+Grafana作為監控K8S的解決方案,大都是在K8S集群內部部署,這樣可以直接調用集群內的cert及各種監控url,但是增加了集群的資源開銷。因此在資源有限的情況下,我更傾向於K8S集群外獨立部署Prometheus+Grafana。
  • k8s集群搭建
    kubeadmkubeadm 是官方社區推出的一個用於快速部署 kubernetes 集群的工具。這個工具能通過兩條指令完成一個 kubernetes 集群的部署:創建一個Master節點kubernetes init
  • 新Jenkins實踐-第2章 JENKINS SERVER的安裝部署方式
    :     k8s-app: jenkins template:   metadata:     labels:       k8s-app: jenkins     namespace: devops     name: jenkins   spec: