配置:
jenkins:mode: EXCLUSIVEnumExecutors: 5scmCheckoutRetryCount: 2clouds:- kubernetes:name: "kubernetes"serverUrl: "https://kubernetes.default"skipTlsVerify: truenamespace: "kubesphere-devops-system"credentialsId: "k8s-service-account"jenkinsUrl: "http://ks-jenkins.kubesphere-devops-system:80"jenkinsTunnel: "ks-jenkins-agent.kubesphere-devops-system:50000"containerCapStr: "100"connectTimeout: "60"readTimeout: "60"maxRequestsPerHostStr: "32"templates:- name: "base"namespace: "kubesphere-devops-system"label: "base"nodeUsageMode: "NORMAL"idleMinutes: 0containers:- name: "base"image: "kubesphere/builder-base:v3.1.0"command: "cat"args: ""ttyEnabled: trueresourceRequestCpu: "100m"resourceLimitCpu: "4000m"resourceRequestMemory: "100Mi"resourceLimitMemory: "8192Mi"- name: "jnlp"image: "jenkins/jnlp-slave:3.27-1"command: "jenkins-slave"args: "^${computer.jnlpmac} ^${computer.name}"resourceRequestCpu: "50m"resourceRequestMemory: "400Mi"resourceLimitMemory: "1536Mi"workspaceVolume:emptyDirWorkspaceVolume:memory: falsevolumes:- hostPathVolume:hostPath: "/var/run/docker.sock"mountPath: "/var/run/docker.sock"- hostPathVolume:hostPath: "/var/data/jenkins_sonar_cache"mountPath: "/root/.sonar/cache"yaml: "spec:\r\n affinity:\r\n nodeAffinity:\r\n preferredDuringSchedulingIgnoredDuringExecution:\r\n - weight: 1\r\n preference:\r\n matchExpressions:\r\n - key: node-role.kubernetes.io/worker\r\n operator: In\r\n values:\r\n - ci\r\n tolerations:\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"NoSchedule\"\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"PreferNoSchedule\"\r\n containers:\r\n - name: \"base\"\r\n resources:\r\n requests:\r\n ephemeral-storage: \"1Gi\"\r\n limits:\r\n ephemeral-storage: \"10Gi\"\r\n securityContext:\r\n fsGroup: 1000\r\n "- name: "nodejs"namespace: "kubesphere-devops-system"label: "nodejs"nodeUsageMode: "EXCLUSIVE"idleMinutes: 0containers:- name: "nodejs"image: "kubesphere/builder-nodejs:v3.1.0"command: "cat"args: ""ttyEnabled: trueresourceRequestCpu: "100m"resourceLimitCpu: "4000m"resourceRequestMemory: "100Mi"resourceLimitMemory: "8192Mi"- name: "jnlp"image: "jenkins/jnlp-slave:3.27-1"command: "jenkins-slave"args: "^${computer.jnlpmac} ^${computer.name}"resourceRequestCpu: "50m"resourceRequestMemory: "400Mi"resourceLimitMemory: "1536Mi"workspaceVolume:emptyDirWorkspaceVolume:memory: falsevolumes:- hostPathVolume:hostPath: "/var/run/docker.sock"mountPath: "/var/run/docker.sock"- hostPathVolume:hostPath: "/var/data/jenkins_nodejs_yarn_cache"mountPath: "/root/.yarn"- hostPathVolume:hostPath: "/var/data/jenkins_nodejs_npm_cache"mountPath: "/root/.npm"- hostPathVolume:hostPath: "/var/data/jenkins_sonar_cache"mountPath: "/root/.sonar/cache"yaml: "spec:\r\n affinity:\r\n nodeAffinity:\r\n preferredDuringSchedulingIgnoredDuringExecution:\r\n - weight: 1\r\n preference:\r\n matchExpressions:\r\n - key: node-role.kubernetes.io/worker\r\n operator: In\r\n values:\r\n - ci\r\n tolerations:\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"NoSchedule\"\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"PreferNoSchedule\"\r\n containers:\r\n - name: \"nodejs\"\r\n resources:\r\n requests:\r\n ephemeral-storage: \"1Gi\"\r\n limits:\r\n ephemeral-storage: \"10Gi\"\r\n securityContext:\r\n fsGroup: 1000\r\n "- name: "nodejs-14.8.0"namespace: "kubesphere-devops-system"label: "nodejs-14.8.0"nodeUsageMode: "EXCLUSIVE"idleMinutes: 0containers:- name: "nodejs"image: "bytest-harbor.ur.com.cn/base-image/nodejs:14.8.0"command: "cat"args: ""ttyEnabled: trueresourceRequestCpu: "100m"resourceLimitCpu: "4000m"resourceRequestMemory: "100Mi"resourceLimitMemory: "8192Mi"- name: "jnlp"image: "jenkins/jnlp-slave:3.27-1"command: "jenkins-slave"args: "^${computer.jnlpmac} ^${computer.name}"resourceRequestCpu: "50m"resourceRequestMemory: "400Mi"resourceLimitMemory: "1536Mi"workspaceVolume:emptyDirWorkspaceVolume:memory: falsevolumes:- hostPathVolume:hostPath: "/var/run/docker.sock"mountPath: "/var/run/docker.sock"- hostPathVolume:hostPath: "/var/data/jenkins_nodejs_yarn_cache"mountPath: "/root/.yarn"- hostPathVolume:hostPath: "/var/data/jenkins_nodejs_npm_cache"mountPath: "/root/.npm"- hostPathVolume:hostPath: "/var/data/jenkins_sonar_cache"mountPath: "/root/.sonar/cache"yaml: "spec:\r\n affinity:\r\n nodeAffinity:\r\n preferredDuringSchedulingIgnoredDuringExecution:\r\n - weight: 1\r\n preference:\r\n matchExpressions:\r\n - key: node-role.kubernetes.io/worker\r\n operator: In\r\n values:\r\n - ci\r\n tolerations:\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"NoSchedule\"\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"PreferNoSchedule\"\r\n containers:\r\n - name: \"nodejs\"\r\n resources:\r\n requests:\r\n ephemeral-storage: \"1Gi\"\r\n limits:\r\n ephemeral-storage: \"10Gi\"\r\n securityContext:\r\n fsGroup: 1000\r\n "- name: "nodejs-14.19.0"namespace: "kubesphere-devops-system"label: "nodejs-14.19.0"nodeUsageMode: "EXCLUSIVE"idleMinutes: 0containers:- name: "nodejs"image: "bytest-harbor.ur.com.cn/base-image/node:14.19.1"command: "cat"args: ""ttyEnabled: trueresourceRequestCpu: "100m"resourceLimitCpu: "4000m"resourceRequestMemory: "100Mi"resourceLimitMemory: "8192Mi"- name: "jnlp"image: "jenkins/jnlp-slave:3.27-1"command: "jenkins-slave"args: "^${computer.jnlpmac} ^${computer.name}"resourceRequestCpu: "50m"resourceRequestMemory: "400Mi"resourceLimitMemory: "1536Mi"workspaceVolume:emptyDirWorkspaceVolume:memory: falsevolumes:- hostPathVolume:hostPath: "/var/run/docker.sock"mountPath: "/var/run/docker.sock"- hostPathVolume:hostPath: "/var/data/jenkins_nodejs_yarn_cache"mountPath: "/root/.yarn"- hostPathVolume:hostPath: "/var/data/jenkins_nodejs_npm_cache"mountPath: "/root/.npm"- hostPathVolume:hostPath: "/var/data/jenkins_nodejs_pnpm_cache"mountPath: "/home/jenkins/agent/.pnpm-store"- hostPathVolume:hostPath: "/var/data/jenkins_sonar_cache"mountPath: "/root/.sonar/cache"yaml: "spec:\r\n affinity:\r\n nodeAffinity:\r\n preferredDuringSchedulingIgnoredDuringExecution:\r\n - weight: 1\r\n preference:\r\n matchExpressions:\r\n - key: node-role.kubernetes.io/worker\r\n operator: In\r\n values:\r\n - ci\r\n tolerations:\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"NoSchedule\"\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"PreferNoSchedule\"\r\n containers:\r\n - name: \"nodejs\"\r\n resources:\r\n requests:\r\n ephemeral-storage: \"1Gi\"\r\n limits:\r\n ephemeral-storage: \"10Gi\"\r\n securityContext:\r\n fsGroup: 1000\r\n "- name: "maven"namespace: "kubesphere-devops-system"label: "maven"nodeUsageMode: "EXCLUSIVE"idleMinutes: 0containers:- name: "maven"image: "kubesphere/builder-maven:v3.1.0"command: "cat"args: ""ttyEnabled: trueresourceRequestCpu: "100m"resourceLimitCpu: "4000m"resourceRequestMemory: "100Mi"resourceLimitMemory: "8192Mi"- name: "jnlp"image: "jenkins/jnlp-slave:3.27-1"command: "jenkins-slave"args: "^${computer.jnlpmac} ^${computer.name}"resourceRequestCpu: "50m"resourceRequestMemory: "400Mi"resourceLimitMemory: "1536Mi"workspaceVolume:emptyDirWorkspaceVolume:memory: falsevolumes:- hostPathVolume:hostPath: "/var/run/docker.sock"mountPath: "/var/run/docker.sock"- hostPathVolume:hostPath: "/var/data/jenkins_maven_cache"mountPath: "/root/.m2"- hostPathVolume:hostPath: "/var/data/jenkins_sonar_cache"mountPath: "/root/.sonar/cache"yaml: "spec:\r\n affinity:\r\n nodeAffinity:\r\n preferredDuringSchedulingIgnoredDuringExecution:\r\n - weight: 1\r\n preference:\r\n matchExpressions:\r\n - key: node-role.kubernetes.io/worker\r\n operator: In\r\n values:\r\n - ci\r\n tolerations:\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"NoSchedule\"\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"PreferNoSchedule\"\r\n containers:\r\n - name: \"maven\"\r\n resources:\r\n requests:\r\n ephemeral-storage: \"1Gi\"\r\n limits:\r\n ephemeral-storage: \"10Gi\"\r\n volumeMounts:\r\n - name: config-volume\r\n mountPath: /opt/apache-maven-3.5.3/conf/settings.xml\r\n subPath: settings.xml\r\n volumes:\r\n - name: config-volume\r\n configMap:\r\n name: ks-devops-agent\r\n items:\r\n - key: MavenSetting\r\n path: settings.xml\r\n securityContext:\r\n fsGroup: 1000\r\n "- name: "go"namespace: "kubesphere-devops-system"label: "go"nodeUsageMode: "EXCLUSIVE"idleMinutes: 0containers:- name: "go"image: "kubesphere/builder-go:v3.1.0"command: "cat"args: ""ttyEnabled: trueresourceRequestCpu: "100m"resourceLimitCpu: "4000m"resourceRequestMemory: "100Mi"resourceLimitMemory: "8192Mi"- name: "jnlp"image: "jenkins/jnlp-slave:3.27-1"command: "jenkins-slave"args: "^${computer.jnlpmac} ^${computer.name}"resourceRequestCpu: "50m"resourceRequestMemory: "400Mi"resourceLimitMemory: "1536Mi"workspaceVolume:emptyDirWorkspaceVolume:memory: falsevolumes:- hostPathVolume:hostPath: "/var/run/docker.sock"mountPath: "/var/run/docker.sock"- hostPathVolume:hostPath: "/var/data/jenkins_go_cache"mountPath: "/home/jenkins/go/pkg"- hostPathVolume:hostPath: "/var/data/jenkins_sonar_cache"mountPath: "/root/.sonar/cache"yaml: "spec:\r\n affinity:\r\n nodeAffinity:\r\n preferredDuringSchedulingIgnoredDuringExecution:\r\n - weight: 1\r\n preference:\r\n matchExpressions:\r\n - key: node-role.kubernetes.io/worker\r\n operator: In\r\n values:\r\n - ci\r\n tolerations:\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"NoSchedule\"\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"PreferNoSchedule\"\r\n containers:\r\n - name: \"go\"\r\n resources:\r\n requests:\r\n ephemeral-storage: \"1Gi\"\r\n limits:\r\n ephemeral-storage: \"10Gi\"\r\n securityContext:\r\n fsGroup: 1000\r\n "- name: "gradle"namespace: "kubesphere-devops-system"label: "gradle"nodeUsageMode: "EXCLUSIVE"idleMinutes: 0containers:- name: "gradle"image: "bytest-harbor.ur.com.cn/kubesphere/builder-gradle:v3.1.0"command: "cat"args: ""ttyEnabled: trueresourceRequestCpu: "100m"resourceLimitCpu: "4000m"resourceRequestMemory: "100Mi"resourceLimitMemory: "8192Mi"- name: "jnlp"image: "jenkins/jnlp-slave:3.27-1"command: "jenkins-slave"args: "^${computer.jnlpmac} ^${computer.name}"resourceRequestCpu: "50m"resourceRequestMemory: "400Mi"resourceLimitMemory: "1536Mi"workspaceVolume:emptyDirWorkspaceVolume:memory: falsevolumes:- hostPathVolume:hostPath: "/var/run/docker.sock"mountPath: "/var/run/docker.sock"- hostPathVolume:hostPath: "/var/data/jenkins_gradle_cache"mountPath: "/home/gradle/.gradle"- hostPathVolume:hostPath: "/var/data/jenkins_android_sdk"mountPath: "/usr/local/android-sdk-linux"- hostPathVolume:hostPath: "/var/data/jenkins_sonar_cache"mountPath: "/root/.sonar/cache"yaml: "spec:\r\n affinity:\r\n nodeAffinity:\r\n preferredDuringSchedulingIgnoredDuringExecution:\r\n - weight: 1\r\n preference:\r\n matchExpressions:\r\n - key: node-role.kubernetes.io/worker\r\n operator: In\r\n values:\r\n - ci\r\n tolerations:\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"NoSchedule\"\r\n - key: \"node.kubernetes.io/ci\"\r\n operator: \"Exists\"\r\n effect: \"PreferNoSchedule\"\r\n containers:\r\n - name: \"gradle\"\r\n resources:\r\n requests:\r\n ephemeral-storage: \"1Gi\"\r\n limits:\r\n ephemeral-storage: \"10Gi\"\r\n securityContext:\r\n fsGroup: 1000\r\n "securityRealm:ldap:configurations:- displayNameAttributeName: "uid"mailAddressAttributeName: "mail"inhibitInferRootDN: falsemanagerDN: "cn=admin,dc=kubesphere,dc=io"managerPasswordSecret: "admin"rootDN: "dc=kubesphere,dc=io"userSearchBase: "ou=Users"userSearch: "(&(objectClass=inetOrgPerson)(|(uid={0})(mail={0})))"groupSearchBase: "ou=Groups"groupSearchFilter: "(&(objectClass=posixGroup)(cn={0}))"server: "ldap://openldap.kubesphere-system.svc:389"disableMailAddressResolver: falsedisableRolePrefixing: trueunclassified:location:url: "http://jenkins.devops.kubesphere.local:30180/"kubespheretokenauthglobalconfiguration:cacheConfiguration:size: 20ttl: 300enabled: trueserver: "http://ks-apiserver.kubesphere-system.svc/"gitLabServers:servers:- credentialsId: "pipeline-user-gitlab-token"name: "ur-dev-gitlab"secretToken: "{AQAAABAAAAAQdaToIBkc7yxaeORxWOIMsiYhMg3gZlsg4vhCkY5gg/4=}"serverUrl: "https://git.ur.com.cn"jobs:- script: >pipelineJob('init-job') {definition {cps {script("""\pipeline {agent anystages {stage ('hello') {steps {echo "hello"}}}}""".stripIndent())}}}

echo y|sdkmanager "platform-tools" "platforms;android-32" "build-tools;32.0.0"
手动更新添加Linux android 编译工具到ci节点机器,然后挂载到流水线容器里
镜像
docker pull liweiming0611/builder-gradle:v3.1.0
