Recreate

In this type of very simple deployment, all of the old pods are killed all at once and get replaced all at once with the new ones.


to create this recreate type of deployment we cab use below YAML file


vim recreatedeploy.yaml


apiVersion: apps/v1
kind: Deployment
metadata:
  name: firstdeploy
  labels:
    name: firstdeploy
spec:
     replicas: 10
	 stratergy:
	  type : recreate
	 selector:
	   matchlabels:
	      app: myapp
	 template:
	   metadata
	      name: dpod
		  labels:
		    app: myapp
		  spec:
		    containers:
			 - name: container
			   image: coolgourav147/nginx-custom:v1


kubectl apply -f recreatedeploy.yaml


Note: this strategy we use when we need a much faster deployment and we are not concerned about the down time, so ee mostly use this strategy for development environment