pipeline { agent { kubernetes { yaml ''' apiVersion: v1 kind: Pod metadata: labels: some-label: some-label-value spec: containers: - name: maven image: maven:alpine command: - cat tty: true - name: terraform image: hashicorp/terraform:latest command: - cat tty: true - name: busybox image: busybox command: - cat tty: true ''' retries 2 } } stages { stage('Run maven') { steps { container('maven') { sh 'mvn -version' } container('busybox') { sh '/bin/busybox' } container('terraform') { sh 'terraform version' } } } } } // pipeline { // agent { // label 'jenkins-jenkins-agent' // } // // environment { // // //KUBECONFIG = credentials('kubernetes-config') // // } // stages { // // stage('Checkout') { // // steps { // // git 'https://gitea.nttdata-xlabs.com/wiegee/TestJenkins.git' // // } // // } // stage('TF Plan') { // // agent { // // docker { // // image 'hashicorp/terraform:latest' // // // Run the container on the node specified at the // // // top-level of the Pipeline, in the same workspace, // // // rather than on a new node entirely: // // args '--entrypoint="" -u root -v /opt/jenkins/.aws:/root/.aws' // // } // // } // steps { // container('terraform') { // sh 'terraform version' // } // } // } // // stage('Deploy Helm chart') { // // steps { // // sh "helm install ingress-nginx ./deploy/charts/ingress-nginx --namespace ingress-nginx --set controller.publishService.enabled=true --set controller.service.loadBalancerIP=${env.LB_IP}" // // } // // } // } // }