Windows 10中Kubernetes(minikube)中的GoCD,容器错误CrashLoopBackOff,退出代码:111

时间:2019-02-22 04:47:46

标签: kubernetes minikube go-cd

我在Kubernetes中使用头盔安装GoCD,发现Pod状态为CrashLoopBackOff。我在Windows 10 Pro中将minikube与hyper-v一起使用。有什么问题?如何找到错误根?在哪里可以找到退出代码111的定义?

这是我的kubectl描述广告连播信息:

FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask. org/apache/hadoop/hbase/CompatibilityFactory
Intercepting System.exit(-101)
Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.HiveMain], exit code [-101]

我还使用kubectl描述节点检查了节点的状况,这就是结果

Name:               gocd-app-server-7fd8f8b48d-r6sn9
Namespace:          gocd
Priority:           0
PriorityClassName:  <none>
Node:               minikube/192.168.88.82
Start Time:         Thu, 21 Feb 2019 15:57:15 +0700
Labels:             app=gocd
                    component=server
                    pod-template-hash=7fd8f8b48d
                    release=gocd-app
Annotations:        <none>
Status:             Running
IP:                 172.17.0.16
Controlled By:      ReplicaSet/gocd-app-server-7fd8f8b48d
Containers:
  gocd-server:
    Container ID:   docker://907271ebbe383b533ef1eb892021eaabc4cf6264a7052e2e453fcf97fdb28de7
    Image:          gocd/gocd-server:v19.1.0
    Image ID:       docker-pullable://gocd/gocd-server@sha256:34204533eb0e0c6f7544c6aa29f2da815d972bd22124b32307ca4ca8f40abd61
    Ports:          8153/TCP, 8154/TCP
    Host Ports:     0/TCP, 0/TCP
    State:          Waiting
      Reason:       CrashLoopBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    111
      Started:      Fri, 22 Feb 2019 09:55:42 +0700
      Finished:     Fri, 22 Feb 2019 09:55:43 +0700
    Ready:          False
    Restart Count:  4
    Liveness:       http-get http://:8153/go/api/v1/health delay=90s timeout=1s period=15s #success=1 #failure=10
    Readiness:      http-get http://:8153/go/api/v1/health delay=90s timeout=1s period=15s #success=1 #failure=10
    Environment:
      GOCD_PLUGIN_INSTALL_kubernetes-elastic-agents:        https://github.com/gocd/kubernetes-elastic-agents/releases/download/2.1.0-123/kubernetes-elastic-agent-2.1.0-123.jar
      GOCD_PLUGIN_INSTALL_docker-registry-artifact-plugin:  https://github.com/gocd/docker-registry-artifact-plugin/releases/download/1.0.0-25/docker-registry-artifact-plugin-1.0.0-25.jar
    Mounts:
      /docker-entrypoint.d from goserver-vol (rw)
      /godata from goserver-vol (rw)
      /home/go from goserver-vol (rw)
      /preconfigure_server.sh from config-vol (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from gocd-app-token-kbdjx (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  config-vol:
    Type:      ConfigMap (a volume populated by a ConfigMap)
    Name:      gocd-app
    Optional:  false
  goserver-vol:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  gocd-app-server
    ReadOnly:   false
  gocd-app-token-kbdjx:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  gocd-app-token-kbdjx
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:          <none>

节点状况似乎还可以。

谢谢您的帮助。

1 个答案:

答案 0 :(得分:1)

尝试在Pod仍在运行时检查预配置日志:

kubectl -n gocd exec -it gocd-app-server-68bf7759b9-9dmr5 -c gocd-server cat  /godata/logs/preconfigure.log
kubectl -n gocd exec -it gocd-app-server-68bf7759b9-9dmr5 -c gocd-server cat  /godata/logs/preconfigure_complete.log

我的代码结尾处有一些错误,但代码不同,但这可以帮助您查找问题:

checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
HTTP/1.1 200 OK
Date: Sat, 09 Mar 2019 14:59:05 GMT
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-UA-Compatible: chrome=1
Set-Cookie: JSESSIONID=node01oiy3yzw700oc1kq79gazxg27m1.node0;Path=/go;Expires=Sat, 23-Mar-2019 14:59:05 GMT;Max-Age=1209600;HttpOnly
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Cache-Control: max-age=0, private, must-revalidate
Content-Type: application/vnd.go.cd.v1+json;charset=utf-8
ETag: "f710a37eb9543dcd53aa78be26c62ae6"
X-Runtime: 1248
Vary: Accept-Encoding, User-Agent
Transfer-Encoding: chunked

{
  "_links" : {
    "self" : {
      "href" : "http://localhost:8153/go/api/elastic/profiles/demo-app"
    },
    "doc" : {
      "href" : "https://api.gocd.org/19.2.0/#elastic-agent-profiles"
    },
    "find" : {
      "href" : "http://localhost:8153/go/api/elastic/profiles/:profile_id"
    }
  },
  "id" : "demo-app",
  "plugin_id" : "cd.go.contrib.elasticagent.kubernetes",
  "properties" : [ {
    "key" : "Image",
    "value" : "gocd/gocd-agent-docker-dind:v19.2.0"
  }, {
    "key" : "PodConfiguration",
    "value" : "apiVersion: v1\nkind: Pod\nmetadata:\n  name: pod-name-prefix-{{ POD_POSTFIX }}\n  labels:\n    app: web\nspec:\n  serviceAccountName: default\n  containers:\n    - name: gocd-agent-container-{{ CONTAINER_POSTFIX }}\n      image: gocd/gocd-agent-docker-dind:v19.2.0\n      securityContext:\n        privileged: true"
  }, {
    "key" : "SpecifiedUsingPodConfiguration",
    "value" : "true"
  }, {
    "key" : "Privileged",
    "value" : "true"
  } ]
}Trying to configure plugin settings.
HTTP/1.1 100 Continue

checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
checking if server has already been configured
No configuration found in cruise-config.xml. Using default preconfigure_server scripts to configure server
Trying to create an elastic profile now.
/ # command terminated with exit code 137

还有一些其他日志文件可以帮助您定义它:

/ # ls -l /godata/logs/
total 212
-rw-r--r--    1 go       go               0 Mar  9 14:53 go-server-perf.log
-rw-r--r--    1 go       go          105813 Mar  9 15:10 go-server.log
-rw-r--r--    1 go       go               0 Mar  9 14:53 go-shine.log
-rw-r--r--    1 go       go           26788 Mar  9 15:09 plugin-cd.go.artifact.docker.registry.log
-rw-r--r--    1 go       go            1482 Mar  9 15:09 plugin-cd.go.authentication.ldap.log
-rw-r--r--    1 go       go            1626 Mar  9 15:09 plugin-cd.go.authentication.passwordfile.log
-rw-r--r--    1 go       go           58970 Mar  9 15:09 plugin-cd.go.contrib.elasticagent.kubernetes.log

在我的情况下,plugin-cd.go.contrib.elasticagent.kubernetes.log中有错误

但是您也可以在values.yaml中禁用预配置

server:
  shouldPreconfigure: false

并用

重新部署
helm delete --purge gocd-app
helm install stable/gocd --name gocd-app --namespace gocd -f path/to/values.yaml
图表的

values.yaml,您可以在那里https://raw.githubusercontent.com/helm/charts/master/stable/gocd/values.yaml