MountVolume.SetUp failed for volume "default-token-4gcr4" : object "jenkins"/"default-token-4gcr4" not registered

1/10/2020

I have an on-premise Kubernetes(v1.15.3) cluster(1 Master and 2 Worker nodes). I wanted to run Jenkins agents in the cluster using Kubernetes-plugin feature by keeping Jenkins(version. 2.176.2) master outside the cluster. Therefore, I created a new namespace (jenkins) and followed the configurations mentioned here. Then, I filled my Kubernetes credentials in the cloud field of Jenkins master configuration. The connection was established successfully. Now, when I tried to to run a Jenkins job as a pod in Kubernetes, the pod is not coming online. The logs from Kubernetes shows:

Kubernetes-log

enter image description here

kubectl get sa 
NAME      SECRETS   AGE
default   1         23h
jenkins   1         23h
kubectl get secrets
NAME                  TYPE                                  DATA   AGE
default-token-4gcr4   kubernetes.io/service-account-token   3      23h
jenkins-token-7nwbd   kubernetes.io/service-account-token   3      23h

The Console output from Jenkins job shows:

Jenkins-log

enter image description here

Has anyone encountered a similar error before?

-- user10323939
jenkins
kubernetes
kubernetes-pod

0 Answers