kubectl -h
kubectl create -h
kubectl run -h
kubectl explain deploy.spec
Create resources
Help
Output YAML
kubectl create deploy [deploy_name] --image=nginx --dry-run -o yaml > deploy.yaml
kubectl get po [pod_name] -o yaml --export > pod.yaml
interaction
kubectl run [pod_name] --image=busybox --rm -it --restart=Never --sh
Create a stateless application
kubectl create -f [name_of_file]
kubectl apply -f [name_of_file]
kubectl create deploy [deploy_name] --image=nginx
Create Service
kubectl create svc nodeport [svc_name] --tcp=8080:80
Create pod
kubectl create -f [name_of_file]
kubectl apply -f [name_of_file]
kubectl run [pod_name] --image=nginx --restart=Never
kubectl run [pod_name] --generator=run-pod/v1 --image=nginx
kubectl run [pod_name] --image=nginx --restart=Never
Comments