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>
- 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
- 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 example
kubectl apply -f nginx.yaml kubectl apply -f configs/
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.
How do i handle multiple deployment environments with minimal effort in kubernetes?