How to: Lab 5.6 Namespaces
You can also follow the [admin guide doc for namespaces](https://kubernetes.io/docs/tasks/administer-cluster/namespaces/)

> Remember you can connect a shell to a Pod with `kubectl exec` and try one of `netstat -tulpn` or `ss -tulpn` in the container, if installed, to show open ports.

1. Create a Namespace `myns`
2. Create a webserver Pod in the `myns` Namespace
3. Review created resources and confirm `myns` Namespace is assigned to the Pod
4. Delete resources created
5. Review the `NAMESPACED` column of the Kubernetes API resources
6. Review the Namespace object and the Namespace spec
lab5.6 solution
```sh
kubectl create ns myns --dry-run=client -o yaml > lab5-6.yaml
echo --- >> lab5-6.yaml
kubectl run mypod --image=httpd:alpine -n myns --dry-run=client -o yaml >> lab5-6.yaml
kubectl apply -f lab5-6.yaml
kubectl get pods
kubectl describe -f lab5-6.yaml | less
kubectl delete -f lab5-6.yaml
kubectl api-resources | less
kubectl explain namespace | less
kubectl explain namespace --recursive | less
kubectl explain namespace.spec | less
```
> Remember that namespaced resources are not visible by default unless the namespace is specified \
> 💡 `kubectl get pods` - only shows resources in the `default` namespace \
> 💡 `kubectl get pods -n mynamespace` - shows resources in the `mynamespace` namespace