Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Section 2.1 Issue with manually deleting Docker container #45

Open
nick-symon opened this issue Jun 15, 2022 · 3 comments
Open

Section 2.1 Issue with manually deleting Docker container #45

nick-symon opened this issue Jun 15, 2022 · 3 comments

Comments

@nick-symon
Copy link

nick-symon commented Jun 15, 2022

This section begins by creating a pod with restart=Never flag
$ kubectl run hello-kiamol --image=kiamol/ch02-hello-kiamol --restart=Never

Then we are instructed to manually delete the container in the pod
$ docker container rm -f $(docker container ls -q --filter label=io.kubernetes.container.name=hello-kiamol)

Then the chapter indicates that the pod should automatically re-scale the pod after it is deleted. However, this does not happen

$ kubectl get pod hello-kiamol                                                                                       
NAME           READY   STATUS                   RESTARTS   AGE
hello-kiamol   0/1     ContainerStatusUnknown   1          7m18s

The subsequent exercises in this chapter can't be run because the container is not running. While I'm not certain, I imagine that run the pod with the restart=Never option prevents the container from restarting after deletion, although I'm not 100% certain on this.

Is this an error or due to a change in k8s version? Frankly an issue this early on makes me want to consider using another resource to learn k8s

@jaoxford
Copy link

jaoxford commented Jul 6, 2022

Also happened to me and my colleague.

His solution was to destroy the pod, restart everything from docker-desktop, and then to skip this exercise.

@jaoxford
Copy link

jaoxford commented Jul 6, 2022

Destroy the pod with kubectl delete pod hello-kiamol

Then you can re-run the pod and skip that exercise.

@Jaafar-Nasrallah
Copy link

Jaafar-Nasrallah commented Oct 31, 2022

The following two options work.

  1. Delete the pod, then rerun and continue
  2. run it from the beginning without --restart=Never, then if works as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants