Difficulty: intermediate
Estimated Time: 10 minutes

This is a workshop in debugging application execution problems in Kubernete.

Mårten Svantesson

Kubernetes Debugging

Step 1 of 4

Launch Cluster

launch.sh

This will create a local Kubernetes cluster.

Deploy application

As a reference start deploying a simple working application:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 2
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        resources:
          limits:
            memory: "128Mi"
            cpu: "500m"
        ports:
        - containerPort: 80

kubectl apply -f nginx-with-request.yaml

To get details about the deployment:

kubectl get pods

You get more information about the pods use:

kubectl describe pod

If you are fast you will see that first the containers have not started yet and when running this repeatedly you will see that it takes a while to get the container running and messages about the progress are displayed in the bottom event section of the describe output.

Also try doing describe one a specific pod. Show the previous command with the up arrow key and then you can use tab autocompletion.

nginx-with-request.yaml
nginx-broken.yaml
nginx-resource.yaml
nginx-probe.yaml