Difficulty: beginner
Estimated Time: 10-15 minutes

Digital Academy Logo

Welcome to the Digital Academy's "Kubernetes Fundamentals" series. This is Module 5 - Deployment Types.

In this lab, we will examine how to run Pods using different deployment types.

For more information, see the Kubernetes documentation.

Developer(s): William Hearn and Zachary Seguin

Module 5 - Deployment Types

Step 1 of 3

Step 1

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
  name: http-deployment
    app: http
  replicas: 2
      app: http
        app: http
      - name: http
        image: katacoda/docker-http-server
        - 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/http-deployment.yaml

kubectl get pods,deploy,rs

Notice that 2 pods, a deployment and a replicaset were all created from that one manifest file.

Before we move on, lets query the pods to see that they are different.

Run kubectl get pods -o wide and copy the pod IP for each and run a curl. Notice that the pods return different IDs inside tutum. This will come in handy in Module 5 when we discuss services.

curl POD_IP (you will need to manually enter this command with you Pod IPs)