为了安装Docker,我尝试自定义jenkins/jenkins:latest映像,以便能够在jenkins管道中运行对接器,但是当我使用以下文件运行下面的代码时,pods,jenkins,以"Error“结束,而不输出任何有意义的日志。
Dockerfile (custom_image:latest)
FROM jenkins/jenkins:latest
USER jenkins(即使这个Dockerfile没有安装停靠程序,也会发生同样的错误)
values.yaml
jenkins:
name:
image: custom_image:latesthelm repo add jenkins https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/chart
helm install jenkins jenkins/jenkins-operator -n jenkins -f values.yaml输出..。
kubectl描述pod/jenkins-jenkins
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 12s default-scheduler Successfully assigned jenkins/jenkins-jenkins to minikube
Normal Pulled 11s kubelet Container image "docker-jenkins:latest" already present on machine
Normal Created 11s kubelet Created container jenkins-master
Normal Started 11s kubelet Started container jenkins-master
Normal Pulled 11s kubelet Container image "virtuslab/jenkins-operator-backup-pvc:v0.1.0" already present on machine
Normal Created 11s kubelet Created container backup
Normal Started 11s kubelet Started container backup
Normal Killing 8s kubelet Stopping container backupkubectl木荚/jenkins-jenkins
...
Defaulted container "jenkins-master" out of: jenkins-master, backup
+ '[' '' == true ']'
+ echo 'To print debug messages set environment variable '\''DEBUG_JENKINS_OPERATOR'\'' to '\''true'\'''
+ mkdir -p /var/lib/jenkins/init.groovy.d
To print debug messages set environment variable 'DEBUG_JENKINS_OPERATOR' to 'true'
+ cp -n /var/jenkins/init-configuration/createOperatorUser.groovy /var/lib/jenkins/init.groovy.d
+ mkdir -p /var/lib/jenkins/scripts
+ cp /var/jenkins/scripts/init.sh /var/jenkins/scripts/install-plugins.sh /var/lib/jenkins/scripts
+ chmod +x /var/lib/jenkins/scripts/init.sh /var/lib/jenkins/scripts/install-plugins.sh
Installing plugins required by Operator - begin
+ echo 'Installing plugins required by Operator - begin'
+ cat
+ [[ -z '' ]]
+ install-plugins.sh
WARN: install-plugins.sh has been removed, please switch to jenkins-plugin-clikubectl描述pod/jenkins-jenkins-operator-7c4cd6dc7b-g6m7z
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 18h default-scheduler Successfully assigned jenkins/jenkins-jenkins-operator-7c4cd6dc7b-g6m7z to minikube
Normal Pulled 18h kubelet Container image "virtuslab/jenkins-operator:v0.7.1" already present on machine
Normal Created 18h kubelet Created container jenkins-operator
Normal Started 18h kubelet Started container jenkins-operator
Normal SandboxChanged 3m56s kubelet Pod sandbox changed, it will be killed and re-created.
Warning BackOff 3m23s kubelet Back-off restarting failed container
Normal Pulled 3m11s (x2 over 3m55s) kubelet Container image "virtuslab/jenkins-operator:v0.7.1" already present on machine
Normal Created 3m11s (x2 over 3m55s) kubelet Created container jenkins-operator
Normal Started 3m10s (x2 over 3m55s) kubelet Started container jenkins-operatorkubectl日志jenkins-jenkins-operator-7c4cd6dc7b-g6m7z
2022-11-22T20:00:50.544Z DEBUG controller-jenkins Jenkins HTTP Service is present {"cr": "jenkins"}
2022-11-22T20:00:50.545Z DEBUG controller-jenkins Jenkins slave Service is present {"cr": "jenkins"}
2022-11-22T20:00:50.545Z DEBUG controller-jenkins Kubernetes resources are present {"cr": "jenkins"}
2022-11-22T20:00:50.545Z DEBUG controller-jenkins Jenkins master pod is present {"cr": "jenkins"}
2022-11-22T20:00:50.545Z DEBUG controller-jenkins Jenkins master pod is terminating {"cr": "jenkins"}
2022-11-22T20:00:55.546Z DEBUG controller-jenkins Reconciling Jenkins {"cr": "jenkins"}
2022-11-22T20:00:55.546Z DEBUG controller-jenkins Operator credentials secret is present {"cr": "jenkins"}
2022-11-22T20:00:55.552Z DEBUG controller-jenkins Scripts config map is present {"cr": "jenkins"}
2022-11-22T20:00:55.555Z DEBUG controller-jenkins Init configuration config map is present {"cr": "jenkins"}
2022-11-22T20:00:55.562Z DEBUG controller-jenkins Base configuration config map is present {"cr": "jenkins"}
2022-11-22T20:00:55.562Z DEBUG controller-jenkins GroovyScripts Secret and ConfigMap added watched labels {"cr": "jenkins"}
2022-11-22T20:00:55.562Z DEBUG controller-jenkins ConfigurationAsCode Secret and ConfigMap added watched labels {"cr": "jenkins"}
2022-11-22T20:00:55.562Z DEBUG controller-jenkins createServiceAccount with annotations map[] {"cr": "jenkins"}
2022-11-22T20:00:55.582Z DEBUG controller-jenkins Service account, role and role binding are present {"cr": "jenkins"}
2022-11-22T20:00:55.582Z DEBUG controller-jenkins Extra role bindings are present {"cr": "jenkins"}
2022-11-22T20:00:55.583Z DEBUG controller-jenkins Jenkins HTTP Service is present {"cr": "jenkins"}
2022-11-22T20:00:55.584Z DEBUG controller-jenkins Jenkins slave Service is present {"cr": "jenkins"}
2022-11-22T20:00:55.585Z DEBUG controller-jenkins Kubernetes resources are present {"cr": "jenkins"}
2022-11-22T20:00:55.585Z DEBUG controller-jenkins Jenkins master pod is present {"cr": "jenkins"}
2022-11-22T20:00:55.585Z DEBUG controller-jenkins Jenkins master pod is terminating {"cr": "jenkins"}发布于 2022-11-23 10:59:28
我看不出你分享的日志有什么问题。您可以尝试使用舵机图表而不是操作员来安装Jenkins。
我在码头代理中的詹金斯码头工人文章中总结了如何做到这一点。您也可以读到在Jenkins管道中使用Docker的情况。
https://stackoverflow.com/questions/74526647
复制相似问题