kubectl run¶
kubectl run is a command-line tool used to create a Pod within a Kubernetes cluster^[03.pod__README.md]. This command allows for the rapid deployment of a specific container image.
Syntax and Usage¶
The basic syntax requires specifying a name for the resource and the container image to run^[03.pod__README.md].
[kubectl](<./kubectl.md>) run <name> --image=<image-name>
For example, to create a Pod named mynginx using the official nginx image, the following command is used^[03.pod__README.md]:
[kubectl](<./kubectl.md>) run mynginx --image=nginx
Verification¶
After executing the command, the status of the newly created Pod can be verified using kubectl get pods^[03.pod__README.md]. The output will display the state of the Pod, such as Running and the number of ready containers^[03.pod__README.md].
Management¶
Detailed information about the Pod, such as its IP address, node assignment, and events, can be retrieved using the kubectl describe command^[03.pod__README.md]. To remove the Pod, the kubectl delete command is used^[03.pod__README.md].
Sources¶
^[03.pod__README.md]