Kubernetes: Difference between revisions
No edit summary |
|||
Line 13: | Line 13: | ||
==kubectl== | ==kubectl== | ||
===nodes=== | |||
<pre> | |||
kubectl get nodes | |||
</pre> | |||
===pods=== | ===pods=== | ||
<pre> | <pre> | ||
kubectl get pods | kubectl get pods | ||
kubectl describe pods | kubectl describe pods | ||
</pre> | |||
===deployment=== | |||
<pre> | |||
kubectl get deployments | |||
# For one-off deployments of an image. | |||
kubectl create deployment <name> --image=<image> | |||
# Generate deployments | |||
kubectl apply -f <deployment_yaml_file> | |||
</pre> | </pre> | ||
Revision as of 01:36, 16 July 2021
Kubernetes, also known as K8s, is a container orchestration service by Google.
It supposedly has a harder learning curve than docker-swarm but is heavily inspired by Google's internal borg system.
Getting Started
Background
Kubernetes runs applications across nodes which are physical or virtual machines.
Each node contains a kubelet process, a container runtime (e.g. Docker), and possibly one or more pods.
Pods contain resources needed to host your application including volumes and one or more containers.
Installation
For local development, you can install minikube.
Otherwise, install kubeadm
.
kubectl
nodes
kubectl get nodes
pods
kubectl get pods kubectl describe pods
deployment
kubectl get deployments # For one-off deployments of an image. kubectl create deployment <name> --image=<image> # Generate deployments kubectl apply -f <deployment_yaml_file>
proxy
kubectl proxy
containers
kubectl logs $POD_NAME kubectl exec -it $POD_NAME -- bash
service
Resources
- Kubernetes Basics
- Scalable Microservices with Kubernetes Udacity Course
- Lesson 2 is on Docker and lessons 3-4 are on Kubernetes.