Choose Jenkins Agent

    A podTemplate is a template of a Pod that is used to create agents. Users can define a podTemplate to use in the Kubernetes plugin.

    At the same time, KubeSphere has some built-in podTemplates, so that users can avoid writing YAML files, greatly reducing learning costs.

    You can use the built-in podTemplate by specifying the label for an agent. For example, to use the nodejs podTemplate, you can set the label to nodejs when creating the Pipeline, as shown in the example below.

    1. agent {
    2. label 'nodejs'
    3. }
    4. }
    5. stages {
    6. stage('nodejs hello') {
    7. steps {
    8. sh 'yarn -v'
    9. sh 'node -v'
    10. sh 'docker version'
    11. sh 'docker images'
    12. }
    13. }
    14. }
    15. }