# deploying nginx

[Nginx](http://nginx.org/en/), pronounced engine x, is an HTTP and reverse proxy server[.](http://nginx.org/en/)

### Deploying nginx application

* Deploying demo: `$ microk8s.kubectl create deployment nginx --image=nginx`
* Get all pods: `$ microk8s.kubectl get pods`

### Accessing nginx pod

* Run `$ microk8s.kubectl get pods` copy the name of the pod and set the variable manually `$ export POD_NAME=nginx-XXXXX`
* Enabling proxy access to debug pods `$ microk8s.kubectl proxy`
  * Get information from the created pod (from another terminal) `$ curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/`
* Get environment variables `$ microk8s.kubectl exec $POD_NAME -- env`
* Run terminal of the pod `$ microk8s.kubectl exec -ti $POD_NAME bash`
  * Type `exit` to leave the section

### Troubleshooting

* Describe pod `$ microk8s.kubectl describe pod/$POD_NAME`

### Removing nginx deployment

* Removing `$ microk8s.kubectl delete deployment.apps/nginx`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cleberjamaral.gitbook.io/mind/knowledge/it/containers/deploying-nginx.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
