【发布时间】:2020-10-31 18:50:56
【问题描述】:
我在 AWS EKS 中创建了一个集群和节点。我将部署应用到该集群,如下所示
kubectl apply -f deployment.yaml
deployment.yaml 包含容器的规范以及 DockerHub 存储库和图像
但是,我在deployment.yaml中犯了一个错误,我需要将它重新应用到配置中
我的问题是:
1 - 如何使用 kubectl 将 deployment.yaml 重新应用到 AWS EKS 集群?
只运行上面的命令是不行的(kubectl apply -f deployment.yaml)
2- 在我重新应用deployment.yaml后,节点会去拾取DockerHub镜像还是我还需要做其他事情(假设所有其他细节都可以)
下面的一些输出:
>> kubectl get pods
my-app-786dc95d8f-b6w4h 0/1 ImagePullBackOff 0 9h
my-app-786dc95d8f-w8hkg 0/1 ImagePullBackOff 0 9h
kubectl describe pod my-app-786dc95d8f-b6w4h
Name: my-app-786dc95d8f-b6w4h
Namespace: default
Priority: 0
Node: ip-192-168-24-13.ec2.internal/192.168.24.13
Start Time: Fri, 10 Jul 2020 12:54:38 -0400
Labels: app=my-app
pod-template-hash=786dc95d8f
Annotations: kubernetes.io/psp: eks.privileged
Status: Pending
IP: 192.168.7.235
IPs:
IP: 192.168.7.235
Controlled By: ReplicaSet/my-app-786dc95d8f
Containers:
simple-node:
Container ID:
Image: BAD_REPO/simple-node
Image ID:
Port: 80/TCP
Host Port: 0/TCP
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-mwwvl (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-mwwvl:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-mwwvl
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 BackOff 17m (x2570 over 9h) kubelet, ip-192-168-24-13.ec2.internal Back-off pulling image "BAD_REPO/simple-node"
Warning Failed 2m48s (x2634 over 9h) kubelet, ip-192-168-24-13.ec2.internal Error: ImagePullBackOff
BR
【问题讨论】:
-
“kubectl get pods”如何显示? “kubectl describe pod
”如何显示? -
@AbdennourTOUMI:嗨 Abdennour:我刚刚将请求的输出添加到问题中。
-
重新运行
kubectl apply -f应该会更新集群状态。当你说它不起作用时,实际上会发生什么? -
@David Maze:感谢您的回复。什么也没发生。集群保持与上述相同的状态
标签: amazon-web-services kubernetes amazon-eks