我的目标是使集群在树莓派4b上运行。 目前,我正在尝试/测试/在流浪汉中玩kubernetes。 我的项目在这里: https://github.com/kentahikaru/vagranttraining/tree/master/kubernetes_testing
我能够初始化master并将节点连接到集群。
但是我在部署boinc客户端时遇到了麻烦,我想要这样。 我正在使用的部署在这里: https://github.com/kentahikaru/vagranttraining/blob/master/kubernetes_testing/Testing/boinc/boinc_client_deploy.yaml 它在github上的上传方式,正在运行。我可以部署它,它将切换到“运行”状态。 但是,当我取消注释“ command”和“ args”(因为我希望它自动连接到我的帐户)时,它将崩溃并且我不知道为什么:
vagrant@master:~$ kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
boincclient-69cdf887dc-7phr2 0/1 CrashLoopBackOff 1 12s 10.244.2.69 node2 <none> <none>
从docker登录节点(/ var / log / containers):
{"log":"can't connect to local host\n","stream":"stderr","time":"2020-11-11T22:27:35.708789661Z"}
{"log":"can't connect to local host\n","stream":"stderr","time":"2020-11-11T22:27:35.711018367Z"}
{"log":"can't connect to local host\n","stream":"stderr","time":"2020-11-11T22:27:35.714129251Z"}
{"log":"can't connect to local host\n","stream":"stderr","time":"2020-11-11T22:27:35.714160084Z"}
我也无法弄清楚“ kubectl日志”为什么不起作用:
vagrant@master:~$ kubectl -v=8 logs boincclient-69cdf887dc-7phr2
I1111 22:30:27.452750 31588 loader.go:375] Config loaded from file: /home/vagrant/.kube/config
I1111 22:30:27.464024 31588 round_trippers.go:420] GET https://172.16.0.21:6443/api/v1/namespaces/default/pods/boincclient-69cdf887dc-7phr2
I1111 22:30:27.464082 31588 round_trippers.go:427] Request Headers:
I1111 22:30:27.464095 31588 round_trippers.go:431] Accept: application/json, */*
I1111 22:30:27.464105 31588 round_trippers.go:431] User-Agent: kubectl/v1.19.3 (linux/amd64) kubernetes/1e11e4a
I1111 22:30:27.483934 31588 round_trippers.go:446] Response Status: 200 OK in 19 milliseconds
I1111 22:30:27.484300 31588 round_trippers.go:449] Response Headers:
I1111 22:30:27.484514 31588 round_trippers.go:452] Cache-Control: no-cache, private
I1111 22:30:27.485035 31588 round_trippers.go:452] Content-Type: application/json
I1111 22:30:27.485382 31588 round_trippers.go:452] Date: Wed, 11 Nov 2020 22:30:27 GMT
I1111 22:30:27.486128 31588 request.go:1097] Response Body: {"kind":"Pod","apiVersion":"v1","metadata":{"name":"boincclient-69cdf887dc-7phr2","generateName":"boincclient-69cdf887dc-","namespace":"default","selfLink":"/api/v1/namespaces/default/pods/boincclient-69cdf887dc-7phr2","uid":"1f7ae333-07e5-429c-bb37-3430cc648170","resourceVersion":"683632","creationTimestamp":"2020-11-11T22:25:43Z","labels":{"app":"boincclient","pod-template-hash":"69cdf887dc"},"ownerReferences":[{"apiVersion":"apps/v1","kind":"ReplicaSet","name":"boincclient-69cdf887dc","uid":"b6e765bf-f38a-4c55-92a2-68ae87d8adef","controller":true,"blockOwnerDeletion":true}],"managedFields":[{"manager":"kube-controller-manager","operation":"Update","apiVersion":"v1","time":"2020-11-11T22:25:43Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:generateName":{},"f:labels":{".":{},"f:app":{},"f:pod-template-hash":{}},"f:ownerReferences":{".":{},"k:{\"uid\":\"b6e765bf-f38a-4c55-92a2-68ae87d8adef\"}":{".":{},"f:apiVersion":{},"f:blockOwnerDeletion":{},"f:controller":{},"f:kind":{},"f:name":{},"f:uid":{}}}}, [truncated 4851 chars]
I1111 22:30:27.501641 31588 round_trippers.go:420] GET https://172.16.0.21:6443/api/v1/namespaces/default/pods/boincclient-69cdf887dc-7phr2/log
I1111 22:30:27.501978 31588 round_trippers.go:427] Request Headers:
I1111 22:30:27.502183 31588 round_trippers.go:431] Accept: application/json, */*
I1111 22:30:27.502463 31588 round_trippers.go:431] User-Agent: kubectl/v1.19.3 (linux/amd64) kubernetes/1e11e4a
I1111 22:30:27.508414 31588 round_trippers.go:446] Response Status: 404 Not Found in 5 milliseconds
I1111 22:30:27.508462 31588 round_trippers.go:449] Response Headers:
I1111 22:30:27.508473 31588 round_trippers.go:452] Cache-Control: no-cache, private
I1111 22:30:27.508501 31588 round_trippers.go:452] Content-Type: application/json
I1111 22:30:27.508525 31588 round_trippers.go:452] Content-Length: 270
I1111 22:30:27.508546 31588 round_trippers.go:452] Date: Wed, 11 Nov 2020 22:30:27 GMT
I1111 22:30:27.508587 31588 request.go:1097] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource ( pods/log boincclient-69cdf887dc-7phr2)","reason":"NotFound","details":{"name":"boincclient-69cdf887dc-7phr2","kind":"pods/log"},"code":404}
I1111 22:30:27.509597 31588 helpers.go:216] server response object: [{
"metadata": {},
"status": "Failure",
"message": "the server could not find the requested resource ( pods/log boincclient-69cdf887dc-7phr2)",
"reason": "NotFound",
"details": {
"name": "boincclient-69cdf887dc-7phr2",
"kind": "pods/log"
},
"code": 404
}]
F1111 22:30:27.509663 31588 helpers.go:115] Error from server (NotFound): the server could not find the requested resource ( pods/log boincclient-69cdf887dc-7phr2)
感谢您的帮助。
答案 0 :(得分:0)
所以解决方案是从dockerfile调用入口点命令。