DevOps Classroomnotes 27/Apr/2023

Controllers in K8s

  • Controllers are k8s objects which run other k8s resources. This k8s resource will be part of specification generally in template section.
  • Controllers maintain desired state.
  • Some of the controllers are
    • Replication Controller/Replica Set
    • Stateful Sets
    • Deployments
    • Jobs
    • Cron Jobs
    • Daemonset

K8s Jobs

  • Refer Here for official docs
  • K8s has two types of jobs
    • Job: Run an activity/script to completion
    • CronJob: Run an activity/script to completion at specific time period or intervals.
  • Refer Here for the manifests with job and cronjob
  • For jobs restartPolicy cannot be Always as job will never finish
  • Jobs have backoffLimit to limit number of restarts and activeDeadline seconds to limit timeperiod of execution.
  • Running job and waiting for completion

  • Cronjob manifest which we have written create a job every minute and waits for completion


Lets go back to Pods

  • Lets run a alpine pod
  • Now if we want to execute a command in the container of alpine pod
  • To access the terminal
  • Exercise: If we have a pod with 2 container how exec a command on a specific container
  • Lets run a pod which run application on some port
  • Now if we want to access the application in container we can do port-forward (not recommended approach)
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

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

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company
Exit mobile version
%%footer%%