How to enable Network Policies in Docker for Mac with Kubernetes
Asked Answered
N

1

11

Is there an easy way to enable Network Policies in single-node k8s cluster managed by Docker Desktop for Mac?

Nga answered 13/1, 2019 at 10:45 Comment(1)
I opened an issue about this Document whether or not NetworkPolicy works in Docker Desktop for Mac.Pushy
P
7

A single-node k8s cluster managed by Docker Desktop for Mac 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 Minikube.

A NetworkPolicy is a Kubernetes resource and as you have discovered, it is not enabled in your environment by default. This is because the NetworkPolicy resource requires a controller 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 CNI like Calico.

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

Pinnatiped answered 28/3, 2020 at 19:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.