Kubernetes Certification Training Course : Lecture 3

For updating anything in the object patch command can be used.

Another type of controller in Kubernetes is Daemon Set. In this script replicas are not mentioned. Daemon Set runs one replica on each Node, hence the number of replicas is equal to number of nodes in the cluster. Daemon Set is useful for launching logging agents, monitoring agents, when one and only one replica is required on each Node. When a new Node is added to the cluster, replica is automatically run on a new Node.

Some pods run continuously. And some pods complete an activity, and finish executing after that. This is where controllers called Job come into the limelight. A Job creates one or more pods and ensures that a specified number of them successfully terminate. As pods successfully complete, the job tracks the successful completions. When a specified number of successful completions is reached, the task (i.e. Job) is complete. Deleting a Job will clean up pods it created. yaml example of creating Job is in this script. backoffLimit parameter value shows the number of attempts to rerun the pod (by restarting the container) if pod creation fails before stopping its attempts.

kubectl get jobs – command that shows all jobs in the cluster

Pod(s) launched by the job have Completed status (not running status)

kubectl logs <kubernetes object name> – shows the output of the object

CronJob is a controller for executing Job by predefined schedule (like a crontab feature in Unix). yaml example of creating CronJob is here. It does not have backoffLimit parameter, but has schedule parameter that defines the frequency of Job execution and uses the common cron syntax (like in Unix). Note that minimum gap between job starts in 1 minute. Each time cronjob creates new job, does not reuse existing.

kubectl get cronjobs – command that shows all cronjobs in the cluster

kubectl get command can have multiple options (for example, kubectl get cronjobs,jobs,pods).

Previous

Leave a Reply

Your email address will not be published. Required fields are marked *