On this post, I will continue to add important references, concepts , Q/A while doing DevOps
A POD is not a scalable unit. A Deployment that schedules PODs is.
A Deployment is meant to represent a single group of PODs fulfilling a single purpose together.
You can have many Deployments work together in the virtual network of the cluster.
For accessing a Deployment that may consist of many PODs running on different nodes you have to create a Service.
Deployments are meant to contain stateless services. If you need to store a state you need to create StatefulSet instead (e.g. for a database service).
- Imperative commands – a user operates directly on live objects of a cluster, for example
kubectl create deployment <name-of-deployment> --image nginx kubectl edit deployment <name-of-deployment>
https://kubernetes.io/docs/tasks/manage-kubernetes-objects/imperative-command/
- Imperative object configuration – the kubectl command specifies the operation, optional flags and at least one file name. The file specified must contain a full definition of the object in YAML or JSON format, for example
kubectl create -f nginx.yaml kubectl replace -f nginx.yaml kubectl delete -f nginx.yaml
https://kubernetes.io/docs/tasks/manage-kubernetes-objects/imperative-config/
- Declarative object configuration – a user operates on object configuration files stored locally, however the user does not define the operations to be taken on the files. Create, update, and delete operations are automatically detected per-object by
kubectl
, for examplekubectl apply -f nginx.yaml kubectl apply -f configs/
https://kubernetes.io/docs/tasks/manage-kubernetes-objects/declarative-config/
For Multiple Deployment At once : create multiple copies of the deployment config into directory “deployments”, amending the names and command and then running:
kubectl create -f deployments/
Currently, all containers in a Pod are being started in parallel and there is no way to define that one container must be started after other container.
References :
https://www.mirantis.com/blog/multi-container-pods-and-container-communication-in-kubernetes/
How do i handle multiple deployment environments with minimal effort in kubernetes?