Kubernetes
Installation with k3s.io
curl -sfL https://get.k3s.io | sh -Basic Commands
# kubectl version
Client Version: v1.29.4+k3s1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.4+k3s1
# kubectl help | head
kubectl controls the Kubernetes cluster manager.
Find more information at: https://kubernetes.io/docs/reference/kubectl/
Basic Commands (Beginner):
create Create a resource from a file or from stdin
expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes service
run Run a particular image on the cluster
set Set specific features on objects
# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s Ready control-plane,master 3d2h v1.29.4+k3s1
# kubectl get nodes -o wide
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
k8s Ready control-plane,master 3d2h v1.29.4+k3s1 157.90.144.2 <none> Ubuntu 22.04.4 LTS 5.15.0-105-generic containerd://1.7.15-k3s1
# kubectl api-resources | head
NAME SHORTNAMES APIVERSION NAMESPACED KIND
bindings v1 true Binding
componentstatuses cs v1 false ComponentStatus
configmaps cm v1 true ConfigMap
endpoints ep v1 true Endpoints
events ev v1 true Event
limitranges limits v1 true LimitRange
namespaces ns v1 false Namespace
nodes no v1 false Node
persistentvolumeclaims pvc v1 true PersistentVolumeClaimKind Versions
Kind
Version
Pods
What is a Pod?
Pod Example
Pod Commands
ReplicaSets
How a ReplicaSet works
When to use a ReplicaSet
ReplicaSet Example
ReplicaSet Commands
Scaling a ReplicaSet
Scaling Example
Scaling Commands
Deployments
Use Case
Deployment Example
Deployment Commands
Upgrade an application
Service
Service Example
Service Commands
DeamonSet
DaemonSet Example
DaemonSet Commands
StatefulSets
StatefulSet Example
StatefulSet Commands
StatefulSet Example with Volumes
Last updated