• jenkins-on-k8s 动态创建jenkins-slave


    一、安装kubernetes-plugin插件

      系统管理  -->  系统配置 --> Cloud

    二、测试创建pipline

      新建任务  -->  jenkins-slave-test   -->  流水线

    pipeline{
      agent{
        kubernetes{
          label "jenkins-slave"
          cloud 'kubernetes'
          yaml '''
    apiVersion: v1
    kind: Pod
    metadata:
      name: jenkins-slave
      namespace: kube-ops
      labels:
        app: jenkins-slave 
    spec:
      containers:
        - name: jenkins-slave
          image: 172.20.48.53/kube-ops/jenkins-slave:v1
          imagePullPolicy: Always
          resources:
            requests:
              cpu: "500m"
              memory: "512Mi"
          volumeMounts:
            - name: docker-sock
              mountPath: /var/run/docker.sock
          imagePullSecrets:
          - name: harbor-admin
      volumes:
        - name: docker-sock
          hostPath:
          path: /var/run/docker.sock
          type: File
    '''
        }
     }
     stages{
     	stage("test"){
     		steps{
     			script{
     				sh "echo 111"
     			}
     		}
     	}
     }
    }
    

      build  --> consoleOut

  • 相关阅读:
    Redis持久化
    Redis数据淘汰策略
    Redis事务
    Redis发布订阅
    WPS生成多级编号
    VMware 网络介绍
    3、Linux目录操作
    2、Shell命令学习笔记
    2、线程的状态和调度学习笔记
    1、Linux安装前的准备
  • 原文地址:https://www.cnblogs.com/lxc123/p/14457257.html
Copyright © 2020-2023  润新知