Introduction
this is part 39 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.
Files for this lab
all the files can be found on the repository of this journey , if you already have it just pull if not clone it.
Files can be found here
Lab
the way to create deployment is very similar to replicasets instead we just change the kind to deployment.
here is a look at the app_039.yml
you can see it's the same we only change kind.
now to create our deployment we also do the same as replicas .
kubectl create -f app_039.yml
we got a message that our deployment successfully created.
kubectl get deployments
he can see we have 1 deployment that we created right now.
kubectl get rs
rs here is the shortcut of replicasets (yes we can use shortcuts in kubectl :D )
we can see he take the name of the deployment and give here and id.
kubectl get pods
we can see also he create 6 deployments for us (6 is what we specify in yml)
kubectl describe deployments myapp-deployment
we can describe the deployment using the command above (also we can describe the pod , I talk about it before).
here we got useful information about it as labels Image ports etc...
if we scroll down we see events , those are helpful in case we have errors , so we know where and when problem happens.
Take a stretch
Back to lab
now to see what versions I made in deployment (history) We type
kubectl rollout history deployment/myapp-deployment
we can see CHANGE-CAUSE is because I didn't record what I edit when I create the deployment.
Record is important (like git commit) to get information about what I do in these version in case I need to go back to it later.
let's delete our deployment and made new one with record
kubectl delete deployments myapp-deployment
he will delete all the things related to it , replicas , pods and history.
kubectl get pods
if we get the pods we see they start to terminate then deleted.
kubectl create -f app_039.yml --record
kubectl rollout history deployment/myapp-deployment
We can see in the History we have the record of what we do in this REVISION 1.
That's it for this one see ya in lab 2 :)
Top comments (0)