The Kubernetes Book

Common tasks with kubernetes

How to apply a deployment using kubectl

$ kubectl apply -f posts.yaml

How to see what pods are running in your cluster

$ kubectl get pods
NAME    READY   STATUS    RESTARTS   AGE
posts   1/1     Running   0          5m24s
$ 

How to see what files are inside your pod

$ kubectl exec posts -- ls
index.js
node_modules
package-lock.json
package.json
$ 

How to see the logs for your pod

How to delete a pod

How to apply a deployment file

How to delete a deployment

How to get a list of deployments

How to get a description of a deployment

How to update a deployment

What are the different types of Service objects?

A service is used to allow communications between pods within a cluster or from outside a cluster to a specific pod

How to access a pod from outside of a cluster

Last updated