Pods & Deployments Flashcards
What’s a POD in kubernetes ?
The smallest deployable unit in the Kubernetes object model.
Can we run container in kubernetes directly or outside the POD ?
No, containers always deployed within the POD.
Which object in Kubernetes act as “environment” for containers ?
PODS
Which properties of a POD are shared by containers within the POD?
Each container in a POD can share:
1. IP address
2. CPU
3. Memory
4. Storage
Which object in Kubernetes is required to scale PODS horizontally ?
POD replica sets
Does Kubernetes modifies/change a POD if it goes unhealthy ?
No, PODs are immutable. Kubernetes always replaces an un-healthy POD with healthy one, but never revives it.
What are replicas ?
Replicas are copies or clones of a pod. It is the way to horizontally scale a POD.
Does a sidecar container and main container within a POD can have same PORT ?
NO.
If there are more than one container inside a POD, then they must have different PORTS.
What is one-container-per-pod approach ?
This says, each POD can contain only one container. This is the standard approach in any production environment.
Can we span a single POD across nodes ?
NO.
A POD can only lie within a NODE due to limitation of IP address allocation.
What is imperative vs declarative way of creating any resource in Kubernetes?
In “imperative” way, a programmer calls all the APIs exposed by the kubernetes to create and manage the resource.
In “declarative” way, a programmer just declare the state of the resource in an YAML and the rest is being done by Kubernetes.
How to created a POD using imperative command?
> > > kubectl run [podName] –image=nginx:alpine
What’s the command to show all pods running in cluster?
> > > kubectl get pods
How to retrieve all resources running in a cluster?
> > > kubectl get all
Can we access POD IP address outside the cluster ?
NO.
It is accessible within the cluster.