You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. Generate a simple Pod Yaml file
$ sudo kubectl run nginx --image=nginx --dry-run=client -o yaml > nginx.yaml
# 2. Add a NodeSelector to specify that the pod runs on the server node.
$ nano nginx.yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
nodeSelector: # add
node-role.kubernetes.io/control-plane: "true" # add
status: {}
# 3. Run Pod
$ sudo kubectl apply -f nginx.yaml
# 4. Check Pod is running on server node
$ sudo kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
nginx 1/1 Running 0 4s 10.42.2.12 k3d-bobo-server-0 <none> <none>
# 5. Stop K3d Cluster
$ sudo k3d cluster stop bobo
# 6. Start K3d Cluster
$ sudo k3d cluster start bobo
# 7. Check Pod Status
$ sudo kubectl get pods -o wide
No resources found in default namespace.
# 8. Check Events
$ sudo kubectl get events --field-selector involvedObject.name=nginx --sort-by='{.metadata.creationTimestamp}'
LAST SEEN TYPE REASON OBJECT MESSAGE
119s Normal Scheduled pod/nginx Successfully assigned default/nginx to k3d-bobo-server-0
119s Normal Pulling pod/nginx Pulling image "nginx"
105s Normal Pulled pod/nginx Successfully pulled image "nginx" in 13.736s (13.736s including waiting)
105s Normal Created pod/nginx Created container nginx
105s Normal Started pod/nginx Started container nginx
86s Normal Killing pod/nginx Stopping container nginx
What did you expect to happen
Naked Pod should still running on server node after k3d cluster is restarted.
I tested running a naked pod on agent node with the exact same steps, and the pod is still running after k3d Cluster reboot.
I also found that if I shut down the Podman Host machine directly and start the k3d cluster after booting, the naked pod on the Server node is not automatically deleted.
What did you do
How was the cluster created?
sudo k3d cluster create bobo --servers 1 --agents 2
What did you do afterwards?
What did you expect to happen
Naked Pod should still running on server node after k3d cluster is restarted.
I tested running a naked pod on agent node with the exact same steps, and the pod is still running after k3d Cluster reboot.
Which OS & Architecture
Which version of
k3d
Which version of podman
The text was updated successfully, but these errors were encountered: