gpt4 book ai didi

Kubernetes-Tolerations : node. kubernetes.io/unreachable:NoExecute for 300s

转载 作者:行者123 更新时间:2023-12-02 11:35:08 26 4
gpt4 key购买 nike

我是 Kubernetes 的新手,并且遇到了一些错误。我想在我的本地系统(mac)上创建 Kubernetes 集群。

我的部署.yaml --

apiVersion: apps/v1
kind: Deployment
metadata:
name: sv-premier
spec:
selector:
matchLabels:
app: sv-premier
template:
metadata:
labels:
app: sv-premier
spec:
volumes:
- name: google-cloud-key
secret:
secretName: gcp-key
containers:
- name: sv-premier
image: gcr.io/proto/premiercore1:latest
imagePullPolicy: Always
command: ["/bin/sh"]
args: ["-c", "while true; do echo Done Deploying sv-premier; sleep 3600;done"]
volumeMounts:
- name: google-cloud-key
mountPath: /var/secrets/google
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/google/key.json
ports:
- containerPort: 8080
imagePullSecrets:
- name: imagepullsecretkey

我创建了部署 - kubectl apply -f deployment.yaml

kubectl get pods


NAME                          READY   STATUS    RESTARTS   AGE
sv-premier-5cc8f599f6-9lrtq 1/1 Running 0 11s

kubectl describe pods sv-premier-5cc8f599f6-9lrtq


Name:           sv-premier-5cc8f599f6-9lrtq
Namespace: default
Priority: 0
Node: docker-desktop/192.168.65.3
Start Time: Tue, 11 Feb 2020 19:04:21 +0530
Labels: app=sv-premier
pod-template-hash=5cc8f599f6
Annotations: <none>
Status: Running
IP: 10.1.0.54
IPs: <none>
Controlled By: ReplicaSet/sv-premier-5cc8f599f6
Containers:
sv-premier:
Container ID: docker://b8993b4fc43197947649c7409b37e6d381a8d4cbbe56e550bca83931747ddd3e
Image: gcr.io/proto/premiercore1:latest
Image ID: docker-pullable://gcr.io/proto/premiercore1@sha256:664778c72c3f79147c4c5b73914292a124009591f479a5e3acf42c444eb62860
Port: 4343/TCP
Host Port: 0/TCP
Command:
/bin/sh
Args:
-c
while true; do echo Done Deploying sv-premier; sleep 3600;done
State: Running
Started: Tue, 11 Feb 2020 19:04:24 +0530
Ready: True
Restart Count: 0
Environment:
GOOGLE_APPLICATION_CREDENTIALS: /var/secrets/google/key.json
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-s4jgd (ro)
/var/secrets/google from google-cloud-key (rw)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
google-cloud-key:
Type: Secret (a volume populated by a Secret)
SecretName: gcp-key
Optional: false
default-token-s4jgd:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-s4jgd
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:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 67s default-scheduler Successfully assigned default/sv-premier-5cc8f599f6-9lrtq to docker-desktop
Normal Pulling 66s kubelet, docker-desktop Pulling image "gcr.io/proto/premiercore1:latest"
Normal Pulled 64s kubelet, docker-desktop Successfully pulled image "gcr.io/proto/premiercore1:latest"
Normal Created 64s kubelet, docker-desktop Created container sv-premier
Normal Started 64s kubelet, docker-desktop Started container sv-premier

为什么我得到这个——
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s

比我更有经验的人请帮忙

最佳答案

Note Kubernetes automatically adds a toleration for node.kubernetes.io/not-ready and node.kubernetes.io/unreachable.

Kubernetes automatically adds a toleration for node.kubernetes.io/not-ready with tolerationSeconds=300 unless the pod configuration provided by the user already has a toleration for node.kubernetes.io/not-ready. Likewise it adds a toleration for node.kubernetes.io/unreachable with tolerationSeconds=300 unless the pod configuration provided by the user already has a toleration for node.kubernetes.io/unreachable.

These automatically-added tolerations ensure that the default pod behavior of remaining bound for 5 minutes after one of these problems is detected is maintained.



阅读 Complete details here

以下污点内置于 :
node.kubernetes.io/not-ready: Node is not ready .这对应于 NodeCondition Ready 为“False”。
node.kubernetes.io/unreachable :节点无法从节点 Controller 访问。这对应于 NodeCondition Ready 为“未知”。

更多如下:
node.kubernetes.io/out-of-disk : 节点磁盘不足。
node.kubernetes.io/memory-pressure : 节点有内存压力。
node.kubernetes.io/disk-pressure : 节点有磁盘压力。
node.kubernetes.io/network-unavailable : 节点网络不可用。
node.kubernetes.io/unschedulable : 节点不可调度。
node.cloudprovider.kubernetes.io/uninitialized :当 kubelet 使用“外部”云提供商启动时,此污点会在节点上设置以将其标记为不可用。在来自 cloud-controller-manager 的 Controller 初始化此节点后,kubelet 会删除此污点。

关于Kubernetes-Tolerations : node. kubernetes.io/unreachable:NoExecute for 300s,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60170501/

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