gpt4 book ai didi

debugging - 如何调试minikube错误?

转载 作者:行者123 更新时间:2023-12-02 11:58:42 25 4
gpt4 key购买 nike

我正在尝试使用Cassandra数据库运行pod,以下是其部署说明:

- apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: cassandra
namespace: test
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
app: cassandra
template:
metadata:
labels:
app: cassandra
spec:
containers:
- env:
- name: MAX_HEAP_SIZE
value: 1024M
- name: HEAP_NEWSIZE
value: 1024M
image: cassandra:3.10
name: cassandra
ports:
- containerPort: 9042
protocol: TCP

容器已创建,然后进入CrashLoopBackOff。当我尝试 kubectl describe时,我看到的是:
Name:           cassandra-6b5f5c46cf-zpwlx
Namespace: test
Node: minikube/192.168.99.102
Start Time: Thu, 18 Jan 2018 15:26:05 +0200
Labels: app=cassandra
pod-template-hash=2619170279
Annotations: kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"test","name":"cassandra-6b5f5c46cf","uid":"22f28f45-fc53-11e7-ae64-08002798f...
Status: Running
IP: 172.17.0.7
Controlled By: ReplicaSet/cassandra-6b5f5c46cf
Containers:
cassandra:
Container ID: docker://b3477788391622145350e870c00e19561ee662946aa5a307cc8bea28fc874544
Image: cassandra:3.10
Image ID: docker-pullable://cassandra@sha256:af21476b230507c6869d758e4dec134886210bd89d56deade90bc835a1c0af37
Port: 9042/TCP
State: Terminated
Reason: Error
Exit Code: 137
Started: Thu, 18 Jan 2018 15:26:26 +0200
Finished: Thu, 18 Jan 2018 15:26:28 +0200
Last State: Terminated
Reason: Error
Exit Code: 137
Started: Thu, 18 Jan 2018 15:26:11 +0200
Finished: Thu, 18 Jan 2018 15:26:14 +0200
Ready: False
Restart Count: 2
Environment:
MAX_HEAP_SIZE: 1024M
HEAP_NEWSIZE: 1024M
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-77lfg (ro)
Conditions:
Type Status
Initialized True
Ready False
PodScheduled True
Volumes:
default-token-77lfg:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-77lfg
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 28s default-scheduler Successfully assigned cassandra-6b5f5c46cf-zpwlx to minikube
Normal SuccessfulMountVolume 28s kubelet, minikube MountVolume.SetUp succeeded for volume "default-token-77lfg"
Normal Pulled 7s (x3 over 27s) kubelet, minikube Container image "cassandra:3.10" already present on machine
Normal Created 7s (x3 over 27s) kubelet, minikube Created container
Normal Started 6s (x3 over 27s) kubelet, minikube Started container
Warning BackOff 4s (x2 over 18s) kubelet, minikube Back-off restarting failed container
Warning FailedSync 4s (x2 over 18s) kubelet, minikube Error syncing pod

错误报告是完全没有用的:它只是一些通用消息,无法说明问题。

pod的描述中有一个可疑的段落:卷。我没有要求为此容器安装任何卷。但是,在进行一些网络搜索之后,我认为此容器中安装的任何内容都只是Kubernetes工作方式的某些技术方面,没有任何实际意义。

不管是什么情况:如何从minikube获得有关它试图做什么以及失败的更多信息?

最佳答案

您的广告连播处于CrashLoopBackoff状态。这意味着您的pod内的容器正在终止其执行,kubernetes正在尝试再次运行它,但是它再次终止,给了您Crash Loop

我建议您通过运行以下命令来查看容器的输出:

kubectl -n test logs -f cassandra-6b5f5c46cf-zpwlx

那应该是cassandra的输出,并应该解释cassandra没有运行的原因。

关于debugging - 如何调试minikube错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48322576/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com