Coder Social home page Coder Social logo

jenkins's Introduction

Jenkins on Amazon Kubernetes

For running Jenkins on AMAZON, start here

Jenkins on Local (Docker Windows \ Minikube \ etc)

jenkins

For running Jenkins on Local Docker for Windows or Minikube
Watch the video

Setting up Jenkins Agent

After installing kubernetes-plugin for Jenkins

  • Go to Manage Jenkins | Bottom of Page | Cloud | Kubernetes (Add kubenretes cloud)
  • Fill out plugin values
    • Name: kubernetes
    • Kubernetes URL: https://kubernetes.default:443
    • Kubernetes Namespace: jenkins
    • Credentials | Add | Jenkins (Choose Kubernetes service account option & Global + Save)
    • Test Connection | Should be successful! If not, check RBAC permissions and fix it!
    • Jenkins URL: http://jenkins
    • Tunnel : jenkins:50000
    • Apply cap only on alive pods : yes!
    • Add Kubernetes Pod Template
      • Name: jenkins-slave
      • Namespace: jenkins
      • Service Account: jenkins
      • Labels: jenkins-slave (you will need to use this label on all jobs)
      • Containers | Add Template
        • Name: jnlp
        • Docker Image: aimvector/jenkins-slave
        • Command to run :
        • Arguments to pass to the command:
        • Allocate pseudo-TTY: yes
        • Add Volume
          • HostPath type
          • HostPath: /var/run/docker.sock
          • Mount Path: /var/run/docker.sock
      • Timeout in seconds for Jenkins connection: 300
  • Save

Test a build

To run docker commands inside a jenkins agent you will need a custom jenkins agent with docker-in-docker working. Take a look and build the docker file in ./dockerfiles/jenkins-agent Push it to a registry and use it instead of above configured * Docker Image: jenkins/jnlp-slave If you do not use the custom image, the below pipeline will not work because default * Docker Image: jenkins/jnlp-slave public image does not have docker ability.

  • Add a Jenkins Pipeline
node('jenkins-slave') {
    
     stage('unit-tests') {
        sh(script: """
            docker run --rm alpine /bin/sh -c "echo hello world"
        """)
    }
}

jenkins's People

Contributors

alonmoor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.