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 app39 you can see it's the same we only change kind.

now to create our deployment we also do the same as replicas . create

kubectl create -f app_039.yml

we got a message that our deployment successfully created. dep

kubectl get deployments

he can see we have 1 deployment that we created right now. rs

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. pods

kubectl get pods

we can see also he create 6 deployments for us (6 is what we specify in yml) desc1

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... desc2 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

stretch


Back to lab

now to see what versions I made in deployment (history) We type roll-out

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 del

kubectl delete deployments myapp-deployment

he will delete all the things related to it , replicas , pods and history. delete

kubectl get pods

if we get the pods we see they start to terminate then deleted. record

kubectl create -f app_039.yml --record

We recreate it with --record his

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 :)

This post is also available on DEV.