Hello all am trying to launch the Jenkins container assigning the Hostpath but i . . .

Lokesh Sai:
hello all am trying to launch the Jenkins container assigning the Hostpath but it’s not launching
please can any one help me in this please correct me anything worng
Yaml script :
apiVersion: v1
kind: Pod
metadata:
name: jenkins-pod
spec:
containers:

  • name: jenkins
    image: jenkins
    volumeMounts:
    • name: jenkins-volume
      mountPath: var/jenkins_home
      volumes:
  • name: jenkins-volume
    hostPath:
    path: /var/jenkins
    type: Directory

Tej_Singh_Rana:
Hello, @Lokesh Sai
please have a look at volumeMounts. Path is not looks correct.

 volumeMounts:
      - name: jenkins-volume
        mountPath: var/jenkins_home

I think it should be /var/jenkins_home. You missed slash.

Tej_Singh_Rana:
One more error is, not able to pull the jenkins image.

Lokesh Sai:
yes

Lokesh Sai:
actually i need to store the jenkins jobs in my localhost using host volume

Basavraj Nilkanthe:
@Lokesh Sai Do we have specific image called as jenkins??

Lokesh Sai:
@Basavraj Nilkanthe

Tej_Singh_Rana:
installed docker or ?

Basavraj Nilkanthe:
You can try with adding slash and let us know

Lokesh Sai:
@Tej_Singh_Rana yes it installed

Lokesh Sai:
@Tej_Singh_Rana have added the slash

Tej_Singh_Rana:
that’s not the issue.

Lokesh Sai:
@Basavraj Nilkanthe /@Tej_Singh_Rana apiVersion: v1
kind: Pod
metadata:
name: jenkins-pod
spec:
containers:

  • name: jenkins
    image: jenkins
    volumeMounts:
    • name: jenkins-volume
      mountPath: /var/jenkins_home
      volumes:
  • name: jenkins-volume
    hostPath:
    path: /var/jenkins
    type: Directory

Tej_Singh_Rana:
that’s not the case. Main issue is, it’s not able to pull the image.

Tej_Singh_Rana:
run the command in the terminal

Tej_Singh_Rana:
docker pull nginx

Basavraj Nilkanthe:
Ok

Tej_Singh_Rana:
what is the o/p of the above command? able to pull?

Lokesh Sai:
@Tej_Singh_Rana nginx pulled

Lokesh Sai:
@Tej_Singh_Rana please help me sir