Difficulty: Beginner
Estimated Time: 10 minutes

BoxBoat Logo

Welcome to the BoxBoat "Kubernetes Training" Basics series. This is Module 4, Kubernetes Deployments. In this lab we will cover the different types of deployments.

If you have not already, please start with Module 1 on our website and work your way to here.

Module 1 Blog: https://boxboat.com/2018/12/13/kubernetes-training-module-1/

Kubernetes Basic Training: Module 4 - Kubernetes Deployments

Step 1 of 4

Step 1

Welcome to the BoxBoat "Kubernetes Training" Basics series. This is Module 4, Kubernetes Deployments. In this lab we will cover the different types of deployments.

It is important to note that Deployments leverage and automatically create "ReplicaSets" and use these to automatically restart pods if they crash as well an maintain the desired number of pods.

More about ReplicaSets and Deployments: Deployments: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ ReplicaSets: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/

Replicasets can be managed outside of deployments, but that is outside the scope of this training.

There are 3 basic types of deployments. Deployment, DaemonSet and StatefulSet.

In this next step, we will show standard Deployment file written in YAML and how we can interact with this deployment.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: tutum-deployment
  labels:
    app: tutum
spec:
  replicas: 2
  selector:
    matchLabels:
      app: tutum
  template:
    spec:
      containers:
      - name: tutum
        image: tutum/hello-world
        ports:
        - containerPort: 80

This is a basic Deployment file and that includes the additional instructions to run a ReplicaSet of 2 pods.

Let's deploy this pod from the pre-created manifest file and then see all of the components that were created. kubectl apply -f ./resources/tutum-deployment.yaml

kubectl get pods,deploy,rs

Notice that a pod, a deployment and a replicaset were all created from that one file.