# Kinds of Controllers

## ReplicaSets

* Specified number of replica pods are running at all times
* Else will start a new pod when it crashes
* Used within deployment

## Deployments

* Declarative updates for pods and ReplicaSets
* Describe desired state of deployment in yaml file and deployment controller aligns actual state to match
* Create/replace replicaSets
* Deployments manages ReplicaSets which manages Pods (quick and flexible rollback)
* Use Cases
  * Pod Management
  * Scaling a ReplicaSet
  * Pod Updates/Rollbacks
  * Pause (only updates are paused not traffic) /Resume deployments (larger change sets)
  * Status - pod health issues

## Daemon Sets

* Ensures all nodes run a copy of the specific pod
* Add/remove pods according to add/remove nodes in cluster
* Deleting this deletes all pods it created
* Use Case
  * Log aggregator
  * Monitoring agent on node

## Jobs

* Supervisor for pods carrying out batch jobs
* Cron job - specific job at specific time
* Eg. nightly report, database backups etc.

## Services

* Allows communication btw sets of deployment with another
* Unique IP (unchanging)
* Pods configured to rely on service IP
* Allows 2 deployments (set of pods) to talk&#x20;
* Types:
  * Internal: IP reach within cluster
  * External: EP available through Node IP: port (NodePort)
  * Load balancer: K8s in cloud


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://amdocs-1.gitbook.io/kubernetes-handbook/controllers/kinds-of-controllers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
