> For the complete documentation index, see [llms.txt](https://dev7days.gitbook.io/dev7days/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev7days.gitbook.io/dev7days/pod.md).

# Pod

It is the smallest instance in Kubernetes that running application. It has 1 or multiple containers inside in case that be helper container (helper container will be destroyed when the pod is destroyed).

**CheatSheet Command**

1. &#x20;Get Pods :  `kubectl get pods`
2. Create Pod: `kubectl run <pod_name> --image=<image_name>`
3. Describe information of Pod: `kubectl describe po <pod_name or container_name>`
4. Delete Pod: `kubectl delete po <pod_name or container_name>`
5. Create template for creating Pod `kubectl run <pod_name> --image=<image_name> --dry-run=client -o yaml > <file_name>.yaml` (this command only generated template file because of `--dry-run=client` option)&#x20;
6. Check the apiVersion  of the template: `kubectl explain po`
7. Execute command from file `kubectl apply -f <file_name>.yaml`
8. Create Pod using file definition:

```yaml
# Pod Template
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.14.2
    # For command it is entryPoint in docker if you add this property,it will override
    # entrypoint within image  
    command: ["sleep"]
    # For args it is CMD in docker if you add this property,it will override
    # CMD within image
    args: ["10"]
    ports:
    - containerPort: 80
    
```

9. Force edit pod: `kubectl replace --force -f <tmp_file_name>.yaml`
10. Create pod with args: `kubectl run <pod_name> --image=<image_name> -- --color=green(example)`&#x20;
