...

/

Deploy the Application to Kubernetes

Deploy the Application to Kubernetes

Learn how to deploy an application on Kubernetes.

The first thing to know about deploying containers to Kubernetes is that they have to be wrapped in Pods. For now, think of a Pod as a lightweight wrapper that allows Kubernetes to run containers.

Press + to interact
A Kubernetes Pod
A Kubernetes Pod

The above figure shows a Pod called first-pod wrapping a single container called web. The Pod only adds metadata to assist with scheduling.

First Kubernetes Pod

The Pod we’ll deploy is defined in a YAML file called pod.yml.

The file can have any name, but its contents follow strict YAML rules. YAML is a popular language for configuration files and is very strict about indentation.

apiVersion: v1
kind: Pod
metadata:
  name: first-pod
  labels:
    project: qsk-book
spec:
  containers:
    - name: web
      image: nigelpoulton/qsk-book:1.0
      ports:
        - containerPort: 8080
Playground
...