# Introduction to Kubernetes

## Challenges maintaining Containerized Applications

In the Previous chapter we talked about how Containers help development pipelines and operations maintain systems. However, there are other challenges to run containerized applications.

* **What happens if a running container has a problem/dies?**&#x20;
* **How to expose containers sitting within a host to external/Ingress traffic?**
* **How to determine AND scale  '*****n*****' no. of containers when application workloads increase?**
* **How to isolate two containers sitting on the same host such that they do not talk to each other?**
* **How to migrate Containers from one host to another for host maintenance?**

The above could be handled by stitching together complex config management scripts with tools that handle operations and deployments.

**OR**

A platform can automate all of the above and more by a declarative text file that defines HOW a containerized application is expected to RUN

## Enter Kubernetes!

Kubernetes helps orchestrate containerized applications to run on a cluster of hosts.

\
Its a  system that automates the deployment and management of containerized applications .\
Kubernetes manages all the moving pieces necessary to optimize the use of computing resources, to maintain the desired state, and to scale containers on demand. In addition to scheduling the deployment and automating the management of containerized applications, a key benefit of Kubernetes is that it maintains the desired state—the state that an administrator specifies the application should be in. Kubernetes takes the desired state of an application via a text file (YAML) and will ensure even if a container/pod dies it will spin the container back up.

To understand Kubernetes in 5 Minutes, watch the video

{% embed url="<https://www.youtube.com/watch?v=PH-2FfFD2PU>" %}

Kubernetes uses various resource constructs to work with containers. These resources help define simple tasks like how many instances of a container need to run at all times, how to trigger auto-scale, how to route ingress traffic to a set of container images. How to define a load balancer to distribute traffic between multiple container images etc.

The Powerpoint below introduces a couple of Kubernetes resources that are most widely used.

{% embed url="<https://www.slideshare.net/BoskeySavla/kubernetes-overview-101>" %}
Kubernetes 101
{% endembed %}


---

# 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://tanzu-solutions.gitbook.io/cloud-native-solutions/the-why-and-what-of-kubernetes/introduction-to-kubernetes.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.
