- Understand Kubernetes Primitives API
- Create and Configure Basic Pods
kubectl get namespaces
kubectl create namespace mynamespace --dry-run=clieent -o yaml
kubectl get po -n mynamespace
kubectl get pods -all-namespaces
kubectl run hello-nginx --image=nginx -n mynamespace --restart=Never --dry-run=client -o yamlm > hello-nginx.yaml
kubectl apply -f hello-nginx.yaml
kubectl get pods -n mynamespace
# Get Information about Pod
kubectl describe pod hello-nginx
# Get Pod Logs
kubectl logs hello-nginx
# Update Image for Existing Pod
kubectl set image pod/hello-nginx nginx=nginx:1.17.1
# Verify Image Updates
kubectl describe pod hello-nginx
# Get IP Address of Pod
kubectl get po hello-nginx -o wide
# Using Temp BusyBox to Hit the Nginx Server
kubectl run buxybox --image=busybox --rm -it --restart=Never -- wget -O- <ip_address>
# Delete Pod
kubectl delete pod hello-nginx
kubectl expose po nginx --port=80 --target-port=9376 --type=NodePort
kubectl create deployment hello-nginx-deploy --image=nginx --dry-run=client -o yaml > hello-deploy.yamml kubectl apply -f hello-deploy.yaml