How to: Lab 9.5. Declare network policy
You may follow the [official declare network policy walkthrough](https://kubernetes.io/docs/tasks/administer-cluster/declare-network-policy/)

> ⚠ A _Network Policy_ will have no effect without a _network provider with network policy support (e.g. Calico)_ \
> ⚠ Minikube Calico plugin might conflict with future labs, so remember to disable Calico after this lab \
> ℹ You can prepend `https://k8s.io/examples/` to example filepaths from the official docs to use the file locally

1. Create a Kubernetes cluster in minikube with Calico enabled
   - delete existing cluster, or create an additional cluster, if Calico is not enabled
2. Confirm Calico is up and running
3. Create a Deployment called `webapp` using image `httpd`
4. Expose the Deployment on port 80
5. Review created resources and confirm pods running
6. Create a busybox Pod and connect an interactive shell
7. Run command in the Pod container `wget --spider --timeout=1 webapp`
8. Limit access to the Service so that only Pods with label `tier=frontend` have access - see official manifest example `service/networking/nginx-policy.yaml`
9. View more details of the _NetworkPolicy_ created
10. Create a busybox Pod and connect an interactive shell
11. Run command in the Pod container `wget --spider --timeout=1 webapp`
12. Create another busybox Pod with label `tier=frontend` and connect an interactive shell
13. Run command in the Pod container `wget --spider --timeout=1 webapp`
14. Delete created resources
15. Revert to a cluster without Calico
lab9.5 solution
```sh