Pod Contd…
- Pod has 3 types of containers
- containers: (Our main application)
- init containers: (Preconditions or Prep)
- ephemeral containers (to be discussed later)
Labeling and annoting the Pods
- Labels are key/value pairs that you can attach to created objects and later use these labels for querying objects

- k8s also uses another type of metadata called Annotations. Annotations are very similar to labels (they alsor are key/value pairs).
- Labels are intended to identify resources
- Annotations are used to provide contextual information to the resource to be used by cluster or third party tools
- Refer Here for labels docs and Refer Here for annotations
Exercise
- Create a Pod with
- labels:
- env: dev
- tier: backend
- image: nginx
- name: business-dev
- labels:
- Create a Pod with
- labels:
- env: prod
- tier: backend
- image: nginx
- name: business
- labels:
- Create a Pod with
- labels:
- env: dev
- tier: frontend
- image: httpd
- name: web-dev
- labels:
- Create a Pod with
- labels:
- env: prod
- tier: frontend
- image: httpd
- name: web
- labels:
- Refer Here for the specs.
- Now create all the pods

- Labels can be queried using selectors Refer Here

- In Kubernetes we have objects which maintain Pods as part of their desired state
- Job
- CronJob
- DaemonSet
- ReplicaSet
- ReplicationController
- Deployment
- StatefulSet
ReplicaSet
- ReplicaSet is a kubernetes object which allows us to run replicas of pods
- In the Desired state, we mention
- number of replicas
- PodSpecification
- Refer Here for the replicaset added

Exercise
- Do the same by using imperative syntaxes
- Figure out the differences between ReplicaSet and ReplicationController
