The Kubernetes Book
Common tasks with kubernetes
How to apply a deployment using kubectl
$ kubectl apply -f posts.yamlapiVersion: v1
kind: Pod
metadata:
name: posts
spec:
containers:
- name: posts
image: debugme/posts:0.0.1
env:
- name: PORT
value: "3001"
- name: EVENTS_PORT
value: "3005"
- name: HOST
value: "http://localhost"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?

How to access a pod from outside of a cluster
Last updated