Introduction
this is part 32 from the journey it's a long journey(360 day) so go please check previous parts , and if you need to walk in the journey with me please make sure to follow because I may post more than once in 1 Day but surely I will post daily at least one 😍.
And I will cover lot of tools as we move on.
lab
in last part we create a pod . we are going to delete this pod using
kubectl delete first-pod
As we see the pod got deleted , now I am going to use another random container from docker hub , I found an container called simple-api you can take a look at it here
let's create a pod from it
kubectl run first-pod --image=emondek/simple-api:latest --restart=Never
let's take a look
kubectl get pods
we can see status creating container , if we need more info about it we type
kubectl describe pods/first-pod
if we scroll down we can see events it's now on image pulling phase
after pulling we can see now that status is RUNNING
now to run this pod in browser we need services(will talk about them later) but we have a nice hack to run it for now
kubectl port-forward pods/first-pod 8080
8080 is the port the we decide to use in dockerfile
if we go to the browser and type http://localhost:8080/
we have our pod running
we can also access this pod using
kubectl exec -it first-pod -- bash
We use -- to separate the commands that related to kubectl and linux. And every change we make to this pod will be discarded just like container so also we need volumes here :D