Docker and Kubernetes

Introduction to Kubernetes

Frank Heilmann

Platform Architect and Freelance Instructor

Container Orchestration Tools

container orchestration tools

  • Modern software stacks typically consist of potentially thousands of individual containers
  • Managing all these containers is known as Container Orchestration, several container orchestration tools exist
  • Kubernetes has an estimated market share well above 95%
Introduction to Kubernetes

Kubernetes for Orchestration

  • Kubernetes solves the typical challenges of container orchestration, e.g.,
    • scheduling and networking (where to deploy a container and how to connect them)
    • how to attach storage to a container
  • To do that, Kubernetes interacts with Container Engines.

Kubernetes and Docker

Introduction to Kubernetes

The Relationship between Docker and Kubernetes

  • Often, Docker is your container engine of choice
  • Kubernetes interacts with Docker as a container engine to schedule and maintain containers
  • Docker is typically used for two tasks:
    • creating and updating Docker images
    • starting containers from such images
  • Kubernetes never creates Docker images, you use Docker for this
Introduction to Kubernetes

Kubernetes Manifests

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 5
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.25.4
        ports:
        - containerPort: 80
  • Kubernetes objects (e.g., containers) are described in so-called Kubernetes Manifests
  • Manifests are YAML files that describe which objects you want, how they should be configured, where they should be scheduled, and a lot more
  • Manifest are declarative, i.e., you describe what you want, or which state to achieve
  • They are not imperative, you do not describe how to achieve it
Introduction to Kubernetes

kubectl

kubectl and Kubernetes

  • kubectl is a command line tool to interact with Kubernetes
  • kubectl comes with many commands and options
  • kubectl reads your Manifest, sends them to Kubernetes via its API, and Kubernetes will compute what to do to achieve the state you want
  • Pronounced cube cuddle ;-)
Introduction to Kubernetes

Let's practice!

Introduction to Kubernetes

Preparing Video For Download...