• DevOps
  • 有人知道为什么每天凌晨3点jenkins的agent的 jnlp容器都会断开吗?

有人知道为什么每天凌晨3点jenkins的agent的 jnlp容器都会断开?
因为一些原因,需要把jenkins agent 的 pod 保留很久,但是发现每天凌晨pod里面的jnlp都会断开 error



附个jnlp的配置
- name: jnlp
image: 'registry.cn-beijing.aliyuncs.com/kubesphereio/jnlp-slave:3.27-1'
command:
- jenkins-slave
args:
- 694bde00b2d4a9d435ac5777760e2ae608bba3a570a72b7d1896e3ec03665097
- android-k9fzx
workingDir: /home/agent
env:
- name: JENKINS_SECRET
value: 694bde00b2d4a9d435ac5777760e2ae608bba3a570a72b7d1896e3ec03665097
- name: JENKINS_TUNNEL
value: 'ks-jenkins-agent.kubesphere-devops-system:50000'
- name: JENKINS_AGENT_NAME
value: android-k9fzx
- name: ANDROID_NDK_HOME
value: /home/android-ndk-r22
- name: JENKINS_NAME
value: android-k9fzx
- name: JENKINS_AGENT_WORKDIR
value: /home/agent
- name: JENKINS_URL
value: 'http://ks-jenkins.kubesphere-devops-system:80/'
- name: ANDROID_HOME
value: /home/android-sdk
resources:
limits:
memory: 7036Mi
requests:
cpu: 400m
memory: 3536Mi
volumeMounts:
- name: volume-7
mountPath: /etc/localtime
- name: volume-6
mountPath: /root/.sonar/cache
- name: volume-5
mountPath: /var/run/docker.sock
- name: workspace-volume
mountPath: /home/agent
- name: default-token-jndcr
readOnly: true
mountPath: /var/run/secrets/kubernetes.io/serviceaccount
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
restartPolicy: Never
terminationGracePeriodSeconds: 30
activeDeadlineSeconds: 18000000
dnsPolicy: ClusterFirst
nodeSelector:
kubernetes.io/os: linux
serviceAccountName: default
serviceAccount: default
nodeName: node1
securityContext:
runAsUser: 0
runAsGroup: 0
schedulerName: default-scheduler
tolerations:
- key: node.kubernetes.io/not-ready
operator: Exists
effect: NoExecute
tolerationSeconds: 300
- key: node.kubernetes.io/unreachable
operator: Exists
effect: NoExecute
tolerationSeconds: 300
priority: 0
enableServiceLinks: true
preemptionPolicy: PreemptLowerPriority

构建节点并不适合长期运行某个服务,Jenkins 原本就是这么设计的。建议采用其他方案来解决你们的业务需求。