<p>I've decided to run a podTemplate with one container of main.</p>
<ol>
<li>Why does my pod template configuration include JNLP? What is needed for? can I have only my pod with my container with my image?</li>
<li>How do I overwrite the JNLP image with my image instead of inbound image?</li>
<li>How do I run my job on my pod/container of 'main' and not JNLP?</li>
</ol>
<p><a href="https://i.stack.imgur.com/6UvEm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6UvEm.png" alt="enter image description here" /></a>
<a href="https://i.stack.imgur.com/aRYV2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aRYV2.png" alt="enter image description here" /></a></p>
<p>My Jenkins configuration as code -</p>
<pre><code>  Jenkins:cluster: non-prod
  Jenkins:secrets:
    create: true
    secretsList:
      - name: jenkins-github-token-non-prod
        value: /us-west-2-non-prod/jenkins/secrets/github-token
      - name: jenkins-slack-token-non-prod
        value: /us-west-2-non-prod/jenkins/secrets/slack-token
  Jenkins:config:
    chart: jenkins
    namespace: default
    repo: https://charts.jenkins.io
    values:
      agent:
        enabled: true
        podTemplates:
          jenkins-slave-pod: |
            - name: jenkins-slave-pod
              label: jenkins-slave-pod
              containers:
                - name: main
                  image: '805787217936.dkr.ecr.us-west-2.amazonaws.com/aba-jenkins-slave:ecs-global-node_master_57'
                  command: &quot;sleep&quot;
                  args: &quot;30d&quot;
                  privileged: true
        master.JCasC.enabled: true
        master.JCasC.defaultConfig: true
        kubernetesConnectTimeout: 5
        kubernetesReadTimeout: 15
        maxRequestsPerHostStr: &quot;32&quot;
        namespace: default
        image: &quot;805787217936.dkr.ecr.us-west-2.amazonaws.com/aba-jenkins-slave&quot;
        tag: &quot;ecs-global-node_master_57&quot;
        workingDir: &quot;/home/jenkins/agent&quot;
        nodeUsageMode: &quot;NORMAL&quot;
        # name of the secret to be used for image pulling
        imagePullSecretName:
        componentName: &quot;eks-global-slave&quot;
        websocket: false
        privileged: false
        runAsUser:
        runAsGroup:
        resources:
          requests:
            cpu: &quot;512m&quot;
            memory: &quot;512Mi&quot;
          limits:
            cpu: &quot;512m&quot;
            memory: &quot;512Mi&quot;
        podRetention: &quot;Never&quot;
        volumes: [ ]
        workspaceVolume: { }
        envVars: [ ]
        # - name: PATH
        #   value: /usr/local/bin
        command:
        args: &quot;${computer.jnlpmac} ${computer.name}&quot;
        # Side container name
        sideContainerName: &quot;jnlp&quot;
        # Doesn't allocate pseudo TTY by default
        TTYEnabled: true
        # Max number of spawned agent
        containerCap: 10
        # Pod name
        podName: &quot;jnlp&quot;
        # Allows the Pod to remain active for reuse until the configured number of
        # minutes has passed since the last step was executed on it.
        idleMinutes: 0
        # Timeout in seconds for an agent to be online
        connectTimeout: 100
      serviceAccount:
        annotations: {}
      controller:
        numExecutors: 1
        additionalExistingSecrets: []
        JCasC:
          securityRealm: |
            local:
                  allowsSignup: false
                  users:
                    - id: &quot;aba&quot;
                      password: &quot;aba&quot;
#          securityRealm: |
#            saml:
#              binding: &quot;urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect&quot;
#              displayNameAttributeName: &quot;http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name&quot;
#              groupsAttributeName: &quot;http://schemas.xmlsoap.org/claims/Group&quot;
#              idpMetadataConfiguration:
#                period: 0
#                url: &quot;https://aba.onelogin.com/saml/metadata/34349e62-799f-4378-9d2a-03b870cbd965&quot;
#              maximumAuthenticationLifetime: 86400
#              usernameCaseConversion: &quot;none&quot;
#          authorizationStrategy: |-
#            roleBased:
#              forceExistingJobs: true
          configScripts:
            credentials: |
              credentials:
                system:
                  domainCredentials:
                    - credentials:
                        - string:
                            scope: GLOBAL
                            id: slack-token
                            description: &quot;Slack access token&quot;
                            secret: &quot;${jenkins-slack-token-non-prod-value}&quot;
                        - usernamePassword:
                            id: &quot;github-credentials&quot;
                            password: &quot;aba&quot;
                            scope: GLOBAL
                            username: &quot;aba&quot;
            plugin-config: |
              jenkins:
                disabledAdministrativeMonitors:
                  - &quot;hudson.model.UpdateCenter$CoreUpdateMonitor&quot;
                  - &quot;jenkins.diagnostics.ControllerExecutorsNoAgents&quot;
              security:
                updateSiteWarningsConfiguration:
                  ignoredWarnings:
                    - &quot;core-2_263&quot;
                    - &quot;SECURITY-2617-extended-choice-parameter&quot;
                    - &quot;SECURITY-2170&quot;
                    - &quot;SECURITY-2796&quot;
                    - &quot;SECURITY-2169&quot;
                    - &quot;SECURITY-2332&quot;
                    - &quot;SECURITY-2232&quot;
                    - &quot;SECURITY-1351&quot;
                    - &quot;SECURITY-1350&quot;
                    - &quot;SECURITY-2888&quot;
              unclassified:
                slackNotifier:
                  teamDomain: &quot;superops&quot;
                  baseUrl: &quot;https://superops.slack.com/services/hooks/jenkins-ci/&quot;
                  tokenCredentialId: &quot;slack-token&quot;
                globalLibraries:
                  libraries:
                    - defaultVersion: &quot;master&quot;
                      allowVersionOverride: true
                      name: &quot;aba-jenkins-library&quot;
                      implicit: true
                      retriever:
                        modernSCM:
                          scm:
                            git:
                              credentialsId: &quot;github-credentials&quot;
                              id: &quot;shared-library-creds&quot;
                              remote: &quot;https://github.com/aba-aba/aba-jenkins-library.git&quot;
                              traits:
                                - &quot;gitBranchDiscovery&quot;
                                - &quot;cleanBeforeCheckoutTrait&quot;
                                - &quot;ignoreOnPushNotificationTrait&quot;
        additionalPlugins:
        - junit:1119.1121.vc43d0fc45561
        - prometheus:2.0.11
        - saml:4.352.vb_722786ea_79d
        - role-strategy:546.ve16648865996
        - blueocean-web:1.25.5
        - github-branch-source:1677.v731f745ea_0cf
        - git-changelog:3.23
        - scriptler:3.5
        - sshd:3.249.v2dc2ea_416e33
        - rich-text-publisher-plugin:1.4
        - matrix-project:785.v06b_7f47b_c631
        - build-failure-analyzer:2.3.0
        - testng-plugin:555.va0d5f66521e3
        - allure-jenkins-plugin:2.30.2
        - timestamper:1.18
        - ws-cleanup:0.42
        - build-timeout:1.21
        - slack:616.v03b_1e98d13dd
        - email-ext:2.91
        - docker-commons:1.19
        - docker-workflow:521.v1a_a_dd2073b_2e
        - rundeck:3.6.11
        - parameter-separator:1.3
        - extended-choice-parameter:346.vd87693c5a_86c
        - uno-choice:2.6.3
        adminPassword: &quot;&quot;
        ingress:
          enabled: true
          hostName: jenkins.non-prod.us-west-2.int.isappcloud.com
          ingressClassName: nginx-int
        installPlugins:
        - kubernetes:3883.v4d70a_a_a_df034
        - workflow-aggregator:590.v6a_d052e5a_a_b_5
        - git:5.0.0
        - configuration-as-code:1569.vb_72405b_80249
        jenkinsUrlProtocol: https
        prometheus:
          enabled: true
        resources:
          limits:
            cpu: &quot;4&quot;
            memory: 8Gi
          requests:
            cpu: &quot;2&quot;
            memory: 4Gi
        sidecars:
          configAutoReload:
            resources:
              requests:
                cpu: 128m
                memory: 256Mi
        statefulSetAnnotations:
          pulumi.com/patchForce: &quot;true&quot;
          Name: eks-non-prod-us-west-2-jenkins
          department: aba
          division: enterprise
          environment: non-prod
          owner: devops
          project: eks-non-prod-us-west-2-jenkins
          team: infra
        tag: 2.362-jdk11
    version: 4.1.13
  Jenkins:stackTags:
    Name: eks-non-prod-us-west-2-jenkins
    department: aba
    division: enterprise
    environment: non-prod
    owner: devops
    project: eks-non-prod-us-west-2-jenkins
    team: infra
  aws:region: us-west-2
</code></pre>

EilonA
<p>The kubernetes plugin has a summary of what the JNLP is used for.  It's recommended to retain the JNLP container, and the name is JNLP mostly for historical reasons.  It sounds like it's not JWS.</p>
<blockquote>
<p>The Kubernetes plugin allocates Jenkins agents in Kubernetes pods. Within these pods, there is always one special container jnlp that is running the Jenkins agent. Other containers can run arbitrary processes of your choosing, and it is possible to run commands dynamically in any container in the agent pod...
Commands will be executed by default in the jnlp container, where the Jenkins agent is running. (The jnlp name is historical and is retained for compatibility.)
...In addition to that, in the Kubernetes Pod Template section, we need to configure the image that will be used to spin up the agent pod. We do not recommend overriding the jnlp container except under unusual circumstances.</p>
</blockquote>
<p><a href="https://plugins.jenkins.io/kubernetes/" rel="nofollow noreferrer">https://plugins.jenkins.io/kubernetes/</a></p>
<p>To customize the jnlp image you specify that in the agent block then using the container label in the container block to run on that container:</p>
<pre><code>pipeline {
  agent {
    kubernetes {
      yaml '''
        apiVersion: v1
        kind: Pod
        metadata:
          labels:
            some-label: some-label-value
        spec:
          containers:
          - name: jnlp
            image: 'jenkins/inbound-agent'     // your image you want to override
            args: ['\$(JENKINS_SECRET)', '\$(JENKINS_NAME)']
          - name: maven
            image: maven:alpine
            command:
            - cat
            tty: true
          - name: busybox
            image: busybox
            command:
            - cat
            tty: true
        '''
      retries 2
    }
  }
  stages {
    stage('Run maven') {
      steps {
        container('maven') { // specify which container to run this on
          sh 'mvn -version'
        }
        container('busybox') {
          sh '/bin/busybox'
        }
      }
    }
  }
}
</code></pre>
