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: http-deployment
  labels:
    app: http
spec:
  replicas: 2
  selector:
    matchLabels:
      app: http
  template:
    metadata:
      labels:
        app: http
    spec:
      containers:
      - name: http
        image: katacoda/docker-http-server
        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/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)

This tab will not be visible to users and provides only information to help authors when creating content.

Creating Katacoda Scenarios

Thanks for creating Katacoda scenarios. This tab is designed to help you as an author have quick access the information you need when creating scenarios.

Here are some useful links to get you started.

Running Katacoda Workshops

If you are planning to use Katacoda for workshops, please contact [email protected] to arrange capacity.

Debugging Scenarios

Below is the response from any background scripts run or files uploaded. This stream can aid debugging scenarios.

If you still need assistance, please contact [email protected]