This is the first in a multi-part series that will show how to easily get Kubernetes up and running in Windows and deploy a sample application. Almost everything also applies to Linux, MacOS, etc.
The source code for this example can be found at https://github.com/cleverswine/hello-k8s-win
These posts are based on an intoductory presentation that I gave to my company.
Consider a simple message processing application, as shown here:
Flow:
Requirements for the Sample Application
Docker gives us the ability to “containerize” our applications.
(from docker.com) A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.
Portable across multiple environments
Separation of concerns
Container can be single deployable unit generated as artifact from repeatable build process
Facilitates use of microservices architecture
Startup is significantly faster than a VM (ephemeral workloads)
Kubernetes (k8s) is a platform for automating deployment, scaling, and management of containerized applications.
Core concepts
Pod: A Pod represents a unit of deployment: a single instance of an application in Kubernetes, which might consist of either a single container or a small number of containers that are tightly coupled and that share resources.
Service: A Kubernetes Service is an abstraction which defines a logical set of Pods and a policy by which to access them - sometimes called a micro-service.
Deployment: You describe a desired state in a Deployment object, and the Deployment controller changes the actual state to the desired state at a controlled rate.
Architecture of a Kubernetes Cluster
credit https://en.wikipedia.org/wiki/Kubernetes
How to get Kubernetes
Cloud Hosted: Azure: Azure Kubernetes Service, Google: Google Kubernetes Engine, Amazon: Elastic Container Service for Kubernetes, and many more.
On-premise: Kubeadm, Kubespray, OpenShift, and many more.
For developers: Minikube, Docker Desktop, and many more.
(see Picking the Right Solution - kubernetes.io)
Kubernetes and the Sample Application
Kubernetes deployments are described by YAML files, and deployments are as simple as: kubectl apply -f my-app.yaml
What types of build artifacts do we need for each application?
How do we interact with Kubernetes?
Next: Part 2