What is Kubernetes? === My simplified answer to this question: > A container orchestration system. Software that makes scaling application instances with resiliency via redundancy trivial. According to the [official Kubernetes documentation](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/): > Kubernetes is a portable, extensible open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. I like the [Kubernetes Github](https://github.com/kubernetes/kubernetes) definition of Kubernetes even better: > Kubernetes is an open source system for managing containerized applications across multiple hosts; providing basic mechanisms for deployment, maintenance, and scaling of applications. What does Kubernetes do? --- #### My simplified answer to this question: > Kubernetess (K8s) takes infrastructure documentation and ensures the real infrastructure matches the documentation. Change a value in a YAML file and K8s will scale your infrastructure up or down. #### More detailed breakdown: Looking at the definition from Kubernetes Github above, we can deduce that Kubernetes enables us to manage many containerized applications across multiple hosts. What does "manage" mean here? Kubernetes gives us the ability to easily deploy, maintain, and scale (adjust the quantity of instances of) containerized applications. Put simply, Kubernetes takes configuration files (YAML or JSON) and automatically builds server infrastructure to match the configuration specified in those files. We write a blueprint for our server infrastructure's architecture and Kubernetes uses this blueprint to actually build the server infrastructure. Kubernetes then monitors our infrastructure and ensures that it continues to match the blueprint even when things go wrong. It's a great tool, but it's not perfect. Let's look at what Kubernetes does not do. What does Kubernetes NOT do? --- From the official Kubernetes documentation: > * Does not deploy source code and does not build your application. > * Does not provide application-level services, such as middleware (e.g., message buses), data-processing frameworks (for example, Spark), databases (e.g., mysql), caches, nor cluster storage systems (e.g., Ceph) as built-in services. Such components can run on Kubernetes, and/or can be accessed by applications running on Kubernetes through portable mechanisms, such as the Open Service Broker. > * Does not dictate logging, monitoring, or alerting solutions. It provides some integrations as proof of concept, and mechanisms to collect and export metrics. > * Does not provide nor mandate a configuration language/system (e.g., jsonnet). It provides a declarative API that may be targeted by arbitrary forms of declarative specifications. > * Does not provide nor adopt any comprehensive machine configuration, maintenance, management, or self-healing systems. Let's dig into this a bit further. Kubernetes does not: * Build source code. You need [another service](https://en.wikipedia.org/wiki/List_of_build_automation_software) (e.g. CircleCI, MSBuild, Gulp) to do this for you. * Deploy your source code. Kubernetes DOES deploy your application, but not your source code. This is probably confusing. That's okay. It'll make more sense once you've internalized that Kubernetes doesn't know anything about your code or your application at all. Kubernetes only knows about the Pods your code build is deployed on. Another service will build your code and K8s will deploy those builds and keep them running. * Provide application-level services. You can add additional containers and pods (there is a difference that you'll learn about soon) that manage applications that do this for you. Deploying a new pod for your database, messaging queue, or logging service is often *trivial*. * The above list says that Kubernetes doesn't dictate logging, monitoring, or alerting systems. This is true, but it's really a feature and sales point. Kubernetes provides you with some integrations for these systems, but can also be extended to provide custom solutions. * The last point: "Does not provide nor adopt any comprehensive machine configuration, maintenance, management, or self-healing systems." is again, a feature. Kubernetes doesn't force you into using a specific type of hardware or container building software. It plays nicely with many different actors. Kubernetes Features --- If I wanted to sell you on Kubernetes, I'd tell you that Kubernetes: * Will make deploying and managing a high quantity of applications and/or 1 or more distributed application meshed together by many smaller parts (read "microservices") much more simple * Will help you more easily take your appications from monolithic and brittle to distributed and resiliant * Empower your dev/SRE team(s) to avoid and quickly respond to critical incidents that are caused by scalability or resiliency issues (e.g. Black Friday shopping surges) Those are the main reasons anyone should be using Kubernetes. Resources for This Chapter --- [Kubernetes Github](https://github.com/kubernetes/kubernetes) [Official Kubernetes Documentation: What is Kubernetes](https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/)