Hi,
I am trying to deploy windows images as kubernetes pods in K8S cluster through jenkins by using Jenkinsfile.
So this is my Jenkinsfile
pipeline {
agent {
kubernetes {
cloud ‘windows-cluster’
label ‘windows-agent’
yaml “”"
apiVersion: v1
kind: Pod
metadata:
labels:
app: windows-agent
spec:
containers:
- name: jnlp
image: jenkins/inbound-agent:windowsservercore-ltsc2019
- name: dotnet
image: mcr.microsoft.com/dotnet/sdk:6.0
command: [‘cmd’]
args: [‘k’]
tty: true
nodeSelector:
kubernetes.io/os: windows
"""
}
}
stages {
stage('Build') {
steps {
container('dotnet') {
bat 'dotnet --version'
}
}
}
// stage('Run .net commands') {
// steps {
// container('dotnet-pod') {
// bat 'dotnet build'
// }
// }
// }
}
}
whatever I have mentioned in Jenkinsfile I have configured in backed cloud configuration(kubernetes cloud).
so when I try to run this Job. In log file it is showing
still waiting to schedule task waiting for next available executor for 1 to 2 hours so finally aborted that job.
this is the issue i am facing. If anyone know the solution please reply to this question.
Thanks