Posts

Showing posts from September, 2023

Kubernetes for Micro Services

Image
(Special thanks to Stephen Grider) Cluster - Whole wrapper Node - A virtual machine Pod - Container wrapper. There can be multiple containers inside a Pod Deployment - Monitor set of Pods. If something down, then this will restart them to make sure it is running Service - Provide nice URLs for containers How to create a Pod directly? Create Pod using configuration file - kubectl apply -f posts.yml  Note: This apply use for any type of cluster change Example of posts.yml apiVersion : v1 kind : Pod metadata : name : posts spec : containers : - name : post image : dilumdarshana/posts:0.0.1 Get all pods running - kubectl get pods Delete Pods -  kubectl delete -f posts.yml General important Pod commands: kubectl exec -it <pod name> <command> kubectl logs <pod name> kubectl delete pod <pod name> kubectl describe pod <pod name> How to create Pods via deployment ? kubectl apply -f <deployement.yml> Example of deployment.yml apiVersion : apps/v1