我已经创建了我的docker镜像,它是一个flask服务器。在创建部署文件以使用以下代码在集群的所有节点上创建此Pod之后:
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: DaemonSet
metadata:
name: nvf2
labels:
app: nvf2
spec:
selector:
matchLabels:
app: nvf2
template:
metadata:
labels:
app: nvf2
spec:
containers:
- name: nvf2
image: 8e467b093efc #name of the image with docker image ls
ports:
- containerPort: 4000
然后我将文件应用到kubectl apply -f deployment.yaml
如果我检查:
kubectl get pods
NAME READY STATUS RESTARTS AGE
nvf2-78zll 0/1 ContainerCreating 0 2m34s
nvf2-w9xqx 0/1 ContainerCreating 0 2m34s
使用kubectl describe daemonsets nvf2
Name: nvf2
Selector: app=nvf2
Node-Selector: <none>
Labels: app=nvf2
Annotations: deprecated.daemonset.template.generation: 2
kubectl.kubernetes.io/last-applied-configuration:
{"apiVersion":"apps/v1","kind":"DaemonSet","metadata":{"annotations":{},"labels":{"app":"nvf2"},"name":"nvf2","namespace":"default"},"spec...
Desired Number of Nodes Scheduled: 2
Current Number of Nodes Scheduled: 2
Number of Nodes Scheduled with Up-to-date Pods: 2
Number of Nodes Scheduled with Available Pods: 0
Number of Nodes Misscheduled: 0
Pods Status: 0 Running / 0 Waiting / 0 Succeeded / 0 Failed
Pod Template:
Labels: app=nvf2
Containers:
nvf2:
Image: 8e467b093efc
Port: 4000/TCP
Host Port: 0/TCP
Environment: <none>
Mounts: <none>
Volumes: <none>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal SuccessfulDelete 2m2s daemonset-controller Deleted pod: nvf2-5vvjm
Normal SuccessfulDelete 2m2s daemonset-controller Deleted pod: nvf2-cfhkq
Normal SuccessfulCreate 119s daemonset-controller Created pod: nvf2-w9xqx
Normal SuccessfulCreate 119s daemonset-controller Created pod: nvf2-78zll
我真的不知道在哪里搜索。如果有人可以帮助,那就太好了。
谢谢