{ "apiVersion": "networking.k8s.io/v1", "kind": "NetworkPolicy", "metadata": { "name": "knowledge-web", "namespace": "knowledge" }, "spec": { "podSelector": { "matchLabels": { "app": "knowledge-web" } }, "policyTypes": [ "Ingress", "Egress" ], "ingress": [ { "from": [ { "namespaceSelector": { "matchLabels": { "kubernetes.io/metadata.name": "traefik-system" } } } ], "ports": [ { "port": 8080, "protocol": "TCP" } ] }, { "from": [ { "namespaceSelector": { "matchLabels": { "kubernetes.io/metadata.name": "monitoring" } } } ], "ports": [ { "port": 8080, "protocol": "TCP" } ] }, { "from": [ { "namespaceSelector": { "matchLabels": { "kubernetes.io/metadata.name": "fc-gateway" } } }, { "namespaceSelector": { "matchLabels": { "kubernetes.io/metadata.name": "intranet" } } } ], "ports": [ { "port": 8080, "protocol": "TCP" } ] } ], "egress": [ { "to": [ { "namespaceSelector": { "matchLabels": { "kubernetes.io/metadata.name": "kube-system" } } } ], "ports": [ { "port": 53, "protocol": "UDP" }, { "port": 53, "protocol": "TCP" } ] }, { "to": [ { "ipBlock": { "cidr": "0.0.0.0/0" } } ], "ports": [ { "port": 11434, "protocol": "TCP" } ] }, { "to": [ { "ipBlock": { "cidr": "0.0.0.0/0" } } ], "ports": [ { "port": 443, "protocol": "TCP" } ] } ] } }