Completek8s Classroomnotes 08/Aug/2023

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
  • Create a Pod with
    • labels:
      • env: prod
      • tier: backend
    • image: nginx
    • name: business
  • Create a Pod with
    • labels:
      • env: dev
      • tier: frontend
    • image: httpd
    • name: web-dev
  • Create a Pod with
    • labels:
      • env: prod
      • tier: frontend
    • image: httpd
    • name: web
  • 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
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Responsive Web Designing Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Exit mobile version
%%footer%%