<p>Is there an easy way to enable <code>Network Policies</code> in <code>single-node k8s cluster</code> managed by <strong>Docker Desktop for Mac</strong>?</p>

Erkan Erol
<p>A <code>single-node k8s cluster</code> managed by <code>Docker Desktop for Mac</code> is imply a VM provisioned by the Docker for Mac Daemon that is then bootstrapped with a Kubernetes cluster. Docker has extended this solution in some ways to make it easier for developers to use but it is effectively similar to using <a href="https://kubernetes.io/docs/tasks/tools/install-minikube/" rel="noreferrer">Minikube</a>.</p>

<p>A <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/" rel="noreferrer">NetworkPolicy</a> is a Kubernetes resource and as you have discovered, it is not <em>enabled</em> in your environment by default. This is because the NetworkPolicy resource requires a <a href="https://kubernetes.io/docs/concepts/architecture/controller/" rel="noreferrer">controller</a> to be installed to enabled the enforcement of NetworkPolicy rules after they have been declared. Many applications can be installed to provide this functionality. The most common way is by installing a <a href="https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/" rel="noreferrer">CNI</a> like <a href="https://docs.projectcalico.org/getting-started/kubernetes/quickstart" rel="noreferrer">Calico</a>.</p>

<p>After you do this, Calico will be able to enforce your NetworkPolicy rules that you have defined. They will automatically move from the <code>Pending</code> to <code>Ready</code> state in the cluster.</p>
