Deploying nginx sample application
Nginxarrow-up-right, pronounced engine x, is an HTTP and reverse proxy server.arrow-up-right
Deploying demo: $ microk8s.kubectl create deployment nginx --image=nginx
$ microk8s.kubectl create deployment nginx --image=nginx
Get all pods: $ microk8s.kubectl get pods
$ microk8s.kubectl get pods
Run $ microk8s.kubectl get pods copy the name of the pod and set the variable manually $ export POD_NAME=nginx-XXXXX
$ export POD_NAME=nginx-XXXXX
Enabling proxy access to debug pods $ microk8s.kubectl proxy
$ microk8s.kubectl proxy
Get information from the created pod (from another terminal) $ curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/
$ curl http://localhost:8001/api/v1/namespaces/default/pods/$POD_NAME/proxy/
Get environment variables $ microk8s.kubectl exec $POD_NAME -- env
$ microk8s.kubectl exec $POD_NAME -- env
Run terminal of the pod $ microk8s.kubectl exec -ti $POD_NAME bash
$ microk8s.kubectl exec -ti $POD_NAME bash
Type exit to leave the section
exit
Describe pod $ microk8s.kubectl describe pod/$POD_NAME
$ microk8s.kubectl describe pod/$POD_NAME
Removing $ microk8s.kubectl delete deployment.apps/nginx
$ microk8s.kubectl delete deployment.apps/nginx
Last updated 5 years ago