吊舱活动/准备状态错误

时间:2020-09-24 07:50:50

标签: kubernetes kubernetes-pod

我的吊舱的活动/准备状态错误。我已经将其与其他豆荚进行了比较。

破碎的豆荚看起来像这样:

Liveness:   http-get http://:http/login delay=90s timeout=5s period=10s #success=1 #failure=12
Readiness:  http-get http://:http/login delay=60s timeout=1s period=10s #success=1 #failure=3

工作舱如下:

Liveness:    tcp-socket :8200 delay=0s timeout=1s period=10s #success=1 #failure=3
Readiness:   tcp-socket :8200 delay=0s timeout=1s period=10s #success=1 #failure=3

这是我的豆荚豆

# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "39"
  creationTimestamp: 2019-11-22T14:51:14Z
  generation: 39
  labels:
    chart: jenkins-0.35.1
    component: jenkins-jenkins-master
    heritage: Tiller
    release: jenkins
  name: jenkins
  namespace: infrastructure
  resourceVersion: "160120363"
  selfLink: /apis/extensions/v1beta1/namespaces/infrastructure/deployments/jenkins
  uid: 881d0559-0d37-11ea-9864-0a7b1d347c8a
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      component: jenkins-jenkins-master
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        checksum/config: a3f3fc9f3aebd131542f03b1ff74248217ba1e75cd6bc592fa9c5aab7d48f257
      creationTimestamp: null
      labels:
        app: jenkins
        chart: jenkins-0.35.1
        component: jenkins-jenkins-master
        heritage: Tiller
        release: jenkins
    spec:
      containers:
      - args:
        - --argumentsRealm.passwd.$(ADMIN_USER)=$(ADMIN_PASSWORD)
        - --argumentsRealm.roles.$(ADMIN_USER)=admin
        env:
        - name: JAVA_OPTS
        - name: JENKINS_OPTS
        - name: JENKINS_SLAVE_AGENT_PORT
          value: "50000"
        - name: ADMIN_PASSWORD
          valueFrom:
            secretKeyRef:
              key: jenkins-admin-password
              name: jenkins
        - name: ADMIN_USER
          valueFrom:
            secretKeyRef:
              key: jenkins-admin-user
              name: jenkins
        image: jenkins/jenkins:lts
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 12
          httpGet:
            path: /login
            port: http
            scheme: HTTP
          initialDelaySeconds: 90
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 5
        name: jenkins
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 50000
          name: slavelistener
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /login
            port: http
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          limits:
            cpu: 1280m
            memory: 3Gi
          requests:
            cpu: 50m
            memory: 256Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /var/jenkins_home
          name: jenkins-home
        - mountPath: /var/jenkins_config
          name: jenkins-config
          readOnly: true
        - mountPath: /usr/share/jenkins/ref/plugins/
          name: plugin-dir
        - mountPath: /usr/share/jenkins/ref/secrets/
          name: secrets-dir
        - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
          name: default-token-5tbbb
          readOnly: true
      dnsPolicy: ClusterFirst
      initContainers:
      - command:
        - sh
        - /var/jenkins_config/apply_config.sh
        env:
        - name: ADMIN_PASSWORD
          valueFrom:
            secretKeyRef:
              key: jenkins-admin-password
              name: jenkins
        - name: ADMIN_USER
          valueFrom:
            secretKeyRef:
              key: jenkins-admin-user
              name: jenkins
        image: jenkins/jenkins:lts
        imagePullPolicy: Always
        name: copy-default-config
        resources:
          limits:
            cpu: 1280m
            memory: 3Gi
          requests:
            cpu: 50m
            memory: 256Mi
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /var/jenkins_home
          name: jenkins-home
        - mountPath: /var/jenkins_config
          name: jenkins-config
        - mountPath: /var/jenkins_plugins
          name: plugin-dir
        - mountPath: /usr/share/jenkins/ref/secrets/
          name: secrets-dir
        - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
          name: default-token-5tbbb
          readOnly: true
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext:
        runAsUser: 0
      serviceAccount: default
      serviceAccountName: default
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          defaultMode: 420
          name: jenkins
        name: jenkins-config
      - emptyDir: {}
        name: plugin-dir
      - emptyDir: {}
        name: secrets-dir
      - name: jenkins-home
        persistentVolumeClaim:
          claimName: jenkins
      - name: default-token-5tbbb
        secret:
          defaultMode: 420
          secretName: default-token-5tbbb
status:
  conditions:
  - lastTransitionTime: 2020-09-23T06:56:15Z
    lastUpdateTime: 2020-09-23T06:56:15Z
    message: Deployment does not have minimum availability.
    reason: MinimumReplicasUnavailable
    status: "False"
    type: Available
  - lastTransitionTime: 2020-09-24T06:32:38Z
    lastUpdateTime: 2020-09-24T06:32:38Z
    message: ReplicaSet "jenkins-5589d85c76" has timed out progressing.
    reason: ProgressDeadlineExceeded
    status: "False"
    type: Progressing
  observedGeneration: 39
  replicas: 1
  unavailableReplicas: 1
  updatedReplicas: 1

我遇到的问题是我的詹金斯(Jenkins)吊舱无法获取插件,因此吊舱无法启动。

我在豆荚的日志中看到了这个

Downloading plugin: scm-api from https://updates.jenkins.io/dynamic-2.248//latest/scm-api.hpi
Downloading plugin: ssh-credentials from https://updates.jenkins.io/dynamic-2.248//latest/ssh-credentials.hpi
Skipping optional dependency token-macro
cp: overwrite '/var/jenkins_home/config.xml'? cp: overwrite '/var/jenkins_home/jenkins.CLI.xml'? cp: overwrite '/var/jenkins_home/jenkins.model.JenkinsLocationConfiguration.xml'? curl: (28) Resolving timed out after 20531 milliseconds
07:03:45 Failure (28) Retrying in 1 seconds...
curl: (28) Resolving timed out after 20537 milliseconds
07:03:45 Failure (28) Retrying in 1 seconds...
curl: (28) Resolving timed out after 20527 milliseconds
07:03:46 Failure (28) Retrying in 1 seconds...
curl: (28) Resolving timed out after 20530 milliseconds
07:03:46 Failure (28) Retrying in 1 seconds...

更新:

我试图在其他工作正常的吊舱上设置就绪/活跃度。

        readinessProbe:
          failureThreshold: 3
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: 8200
          timeoutSeconds: 1

        livenessProbe:
          failureThreshold: 3
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: 8200
          timeoutSeconds: 1

日志仍然看起来一样。

我还尝试了编辑部署,因此根本没有设置就绪/活跃性,但日志中的输出仍然相同。

1 个答案:

答案 0 :(得分:0)

如果我的理解正确-这也不是from PyQt5 import QtCore, QtGui, QtWidgets, QtChart from PyQt5.QtCore import * from PyQt5.QtChart import * data = ((0, 7380, 7520, 7380, 7510, 7324), (1, 7520, 7580, 7410, 7440, 7372), (2, 7440, 7650, 7310, 7520, 7434), (3, 7450, 7640, 7450, 7550, 7480), (4, 7510, 7590, 7460, 7490, 7502), (5, 7500, 7590, 7480, 7560, 7512), (6, 7560, 7830, 7540, 7800, 7584)) mas = [7380, 7520, 7440, 7450, 7510, 7500, 7560] x = len(mas) class MainWindow(QtWidgets.QMainWindow): def __init__(self, parent=None): super().__init__(parent) central_widget = QtWidgets.QWidget() self.setCentralWidget(central_widget) self.open_btn = QtWidgets.QPushButton("Open") self.open_btn.clicked.connect(self.add_chartview) self.close_btn = QtWidgets.QPushButton("Close") self.close_btn.clicked.connect(self.remove_chartview) hbox = QtWidgets.QHBoxLayout() hbox.addWidget(self.open_btn) hbox.addWidget(self.close_btn) series = QCandlestickSeries() tm = [] for num, o, h, l, c, m in data: series.append(QCandlestickSet(o, h, l, c)) tm.append(str(num)) self.chart = QChart() self.chart.addSeries(series) self.chart.createDefaultAxes() self.chart.legend().hide() self.chart_view = QChartView(self.chart) self.chart.axisX(series).setCategories(tm) self.splitter = QtWidgets.QSplitter(QtCore.Qt.Vertical) self.splitter.addWidget(self.chart_view) self.lay = QtWidgets.QVBoxLayout(central_widget) self.lay.insertLayout(0, hbox) self.lay.addWidget(self.splitter, stretch=1) self.resize(640, 480) def add_chartview(self): chart_view = self.splitter.widget(0) chart = chart_view.chart() self.scatter = QtChart.QScatterSeries() self.scatter.append(float(3), mas[3]) self.scatter.append(float(5), mas[5]) chart.addSeries(self.scatter) chart_view.setChart(chart) self.splitter.addWidget(chart_view) axisX = QValueAxis() chart.addAxis(axisX, Qt.AlignBottom) self.scatter.attachAxis(axisX) chart.axisX(self.scatter).setRange(0, 6) def remove_chartview(self): chart_view = self.splitter.widget(0) chart = chart_view.chart() r = chart.series() if len(r) > 1: delete = r[1] delete.deleteLater() if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) w = MainWindow() w.show() sys.exit(app.exec_()) ,也没有readinessProbe问题。 例如,有可能在github上找到仍未解决的问题

Jenkins init container cannot resolve dnsstable/jenkins 1.9.17 plugins not found 404 #20738

对于那些在代理后面的人-必须在部署之前在helm / jenkins-values.yml中添加代理。我知道那不是你的情况。

默认情况下,Jenkins将尝试在安装时安装一系列插件,如果失败/超时,将导致安装未完成且失败。您可以尝试做的是添加一个空的安装插件列表。为此,您可以在部署之前将空的livenessProbe添加到installPlugins:中。

jenkins/values.yaml example

尝试一下,让我知道您是否至少能够启动吊舱。