Formatting didn't come out great
I improved the formatting but can't help with the problem itself. The issue should perhaps be moved from INFRA to JENKINS though, if the problem occurs on your own Jenkins instance rather than on one maintained by the Jenkins project. |
|
|
|
Hi, Hi, I'm trying to get windows pods working on GKE but for both the _jnlp_ and _shell_ container I get the following errors: ``` {quote} Error: failed to start container "jnlp": Error response from daemon: CreateComputeSystem jnlp: The system cannot find the file specified. ``` ``` {quote}
{quote} Error: failed to start container "shell": Error response from daemon: CreateComputeSystem shell: The system cannot find the file specified. ``` {quote}
This is using the sample pipeline: ``` {code:groovy} /* * Runs a build on a Windows pod. * Tested in EKS: https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html */ podTemplate(yaml: ''' apiVersion: v1kind v1 kind : Podspec Pod spec : containers: - name: jnlp image: jenkins/jnlp-agent:latest-windows - name: shell image: mcr.microsoft.com/powershell:preview-windowsservercore-1809 command: - powershell args: - Start-Sleep - 999999 nodeSelector: beta.kubernetes.io/os: windows ''') \ { node(POD_LABEL) { container('shell') { powershell 'Get-ChildItem Env: | Sort Name' } } } ``` {code}
Here's an outline the commands I used to setup the cluster: ``` {code:sh} gcloud beta container clusters create jenkins-cd \ --num-nodes 2 \ --machine-type n1-standard-2 \ --scopes "https://www.googleapis.com/auth/source.read_write,cloud-platform" \ --enable-ip-alias \ --release-channel=rapid gcloud container clusters get-credentials jenkins-cd gcloud beta container node-pools create windows-pool \ --cluster=jenkins-cd \ --image-type=WINDOWS_SAC \ --no-enable-autoupgrade \ --machine-type=n1-standard-2 ``` ``` {code}
{code:sh} wget https://get.helm.sh/helm-v2.16.1-linux-amd64.tar.gz tar zxfv helm-v2.16.1-linux-amd64.tar. gzcp gz cp linux-amd64/helm . kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account) kubectl create serviceaccount tiller --namespace kube- systemkubectl system kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller ./helm init --service-account=tiller ./helm update ./helm version ``` ``` {code}
{code:sh} ./helm install -n cd stable/jenkins -f jenkins/values.yaml --version 1.2.2 --wait kubectl get pods export POD_NAME=$(kubectl get pods -l "app.kubernetes.io/component=jenkins-master" -o jsonpath=" \ {.items[0].metadata.name}") kubectl port-forward $POD_NAME 8080:8080 >> /dev/null & kubectl get svc printf $(kubectl get secret cd-jenkins -o jsonpath=" \ {.data.jenkins-admin-password}" | base64 --decode);echo ``` {code}
Then I login into Jenkins and try to run the sample pipeline for windows but I cannot get it to work. The following error also appears in the jenkins master log: ``` {noformat} Error in provisioning; agent=KubernetesSlave name: windows-test-8-hn1vc-q3pg0-k4x83, template=PodTemplate \ {, name='windows-test_8-hn1vc-q3pg0', namespace='default', label='windows-test_8-hn1vc', nodeUsageMode=EXCLUSIVE, workspaceVolume=EmptyDirWorkspaceVolume [memory=false], annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821, org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@c92c82e4]} java.lang.IllegalStateException: Pod has terminated containers: default/windows-test-8-hn1vc-q3pg0-k4x83 (jnlp, shell) at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.periodicAwait(AllContainersRunningPodWatcher.java:183) at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.periodicAwait(AllContainersRunningPodWatcher.java:204) at org.csanchez.jenkins.plugins.kubernetes.AllContainersRunningPodWatcher.await(AllContainersRunningPodWatcher.java:144) at org.csanchez.jenkins.plugins.kubernetes.KubernetesLauncher.launch(KubernetesLauncher.java:139) at hudson.slaves.SlaveComputer.lambda$_connect$0(SlaveComputer.java:292) at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46) at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) ``` {noformat}
I can deploy an image via ` {{ kubectl apply -f jenkins-windows.yaml ` }} with the following template successfully: ``` {code:none} apiVersion: apps/ v1kind v1 kind : Deploymentmetadata Deployment metadata : name: jenkins-windows labels: app: jenkins- windowsspec windows spec : replicas: 0 selector: matchLabels: app: jenkins-windows template: metadata: labels: app: jenkins-windows spec: nodeSelector: kubernetes.io/os: windows containers: - name: jnlp image: jenkins/jnlp-agent:latest-windows - name: shell image: mcr.microsoft.com/powershell:preview-windowsservercore-1809 ports: - containerPort: 80 ``` {code}
I'm not sure how to debug this really. The error says ` {{ The system cannot find the file specified ` }} but I am not sure what file this refers to. Is it related to workspaceVolume not being set? I would have thought the sample pipeline would work without that though (and I don't yet know how to configure that). Any help would be really appreciated else I will have to drop Kubernetes and just use VMs. For good measure here is also the log from the job: ``` {noformat} Created Pod: windows-test-9-mdt6s-t2kj3-dsr2n in namespace defaultStill default Still waiting to schedule task ‘windows-test-9-mdt6s-t2kj3-dsr2n’ is offlineCreated offline Created Pod: windows-test-9-mdt6s-t2kj3-dcqvw in namespace defaultCreated default Created Pod: windows-test-9-mdt6s-t2kj3-kvr05 in namespace defaultCreated default Created Pod: windows-test-9-mdt6s-t2kj3-k9v52 in namespace defaultCreated default Created Pod: windows-test-9-mdt6s-t2kj3-tbn3g in namespace defaultCreated default Created Pod: windows-test-9-mdt6s-t2kj3-2qv1t in namespace defaultAborted default Aborted by admin ``` {noformat} |
|
|