Let's begin with writing a 'deployment.yaml' file, we can directly write yaml for a pod but that is not recommended. In the deployment yaml, we can specify the pod template and even the replication factor
Deployment Definition Yaml
Here the "Kind:" specifies what kind of k8s resource it is, in this case it is 'Deployment'. It has the metadata and the spec information inside the definition document.
Applying the deployment
Execute the deployment yaml using the below command
$ kubectl apply -f k8s-deployment.yaml
Upon executing, we should see something like below
Monitoring container logs
$kubectl logs -f add-service-deployment-59996d5779-5q8kj
We can use above log command to see the container logs inside the particular pod.
For rolling updates, we can execute the above commands to recreate the pods with new version of the container. The old pods will be gracefully terminated while the new one is gradually created.
Rolling update
$ kubectl set image deployments/add-service-deployment add-service=venkateshm/add-service:3
For rolling updates, we can execute the above commands to recreate the pods with new version of the container. The old pods will be gracefully terminated while the new one is gradually created.
Follow on https://venkateshbook.blogspot.com/2019/05/02-kubernetes-service-definition.html for kubernetes service definition
its new articles for me its a valuable information.
ReplyDeleteFull Stack Training in Chennai | Certification | Online Training Course | Full Stack Training in Bangalore | Certification | Online Training Course | Full Stack Training in Hyderabad | Certification | Online Training Course | Full Stack Training in Pune | Certification | Online Training Course | Full Stack Training | Certification | Full Stack Online Training Course