S04E03 Introduction to Microservices with .
Net and K8S – Cheat Sheet
Docker Commands Kubernetes Architecture
Don’t forget!
Build an Image
docker build -t <docker user id>/<image name>:<version> .
Push an Image to Docker Hub
docker push <docker user id>/<image name>:<version>
List Running Docker Containers
docker ps
Run a Docker Image
docker run -p <external port>:<internal port> -d <docker user id>/<image name>
Stop A Running Container
docker stop <container Id>
Re-start a Container
docker start <container Id>
Kubernetes Commands
Apply a “File” (E.g. a Deployment.yaml)
Kubectl apply -f <name of yaml file> Glossary
Restart Deployment
Cluster: Contains a set of "worker machines" called Nodes. Every cluster has at least 1 node.
Kubectl rollout restart deployment <name of deployment>
Cluster IP: A Service that exposes the container "internally" within the Cluster.
Get All Namespaces
Kubectl get namespace Container: An image that has been executed, containing the app and it's dependencies.
Get Pods in a Namespaces Image: The result of building an app and it's dependencies. Images are transferable units.
Kubectl get pods –namespace=<name of namespace>
Load Balancer: A Service that exposes a container externally.
Get All “Objects” (E.g. Get All Pods)
Node: A Node is "worker machine" that runs containerized applications.
Kubectl get <object type>
Node Port: A Service used for development purposes to expose containers externally.
Delete an “Object” (E.g. Delete a Deployment)
Kubectl delete <object type> <object name> Pod: Smallest K8S object. Represents a set of running containers.
dotnetplaybook.com