{
    "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy",
    "locale": "en",
    "title": "NetworkPolicy: Knowledge hub | DeLaParra Services",
    "description": "A firewall for Pods. Declares which Pods may talk to which, by label and port. Without one, all Pods can reach all others.",
    "alternates": {
        "en": "https://delaparra-services.nl/knowledge-hub/networkpolicy",
        "nl": "https://delaparra-services.nl/nl/kennisbank/networkpolicy"
    },
    "formats": {
        "csv": "https://delaparra-services.nl/knowledge-hub/networkpolicy.csv",
        "md": "https://delaparra-services.nl/knowledge-hub/networkpolicy.md",
        "json": "https://delaparra-services.nl/knowledge-hub/networkpolicy.json",
        "zip": "https://delaparra-services.nl/knowledge-hub/networkpolicy.zip",
        "pdf": "https://delaparra-services.nl/knowledge-hub/networkpolicy.pdf"
    },
    "downloads": [
        {
            "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy.csv",
            "encodingFormat": "text/csv",
            "name": "networkpolicy.csv"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy.json",
            "encodingFormat": "application/json",
            "name": "networkpolicy.json"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy.md",
            "encodingFormat": "text/markdown",
            "name": "networkpolicy.md"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy.pdf",
            "encodingFormat": "application/pdf",
            "name": "networkpolicy.pdf"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy.zip",
            "encodingFormat": "application/zip",
            "name": "networkpolicy.zip"
        },
        {
            "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy/skills.zip",
            "encodingFormat": "application/zip",
            "name": "networkpolicy-skills.zip"
        }
    ],
    "markdown": "1. [Home](<https://delaparra-services.nl/>) \n1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) \n1. [NetworkPolicy](<https://delaparra-services.nl/knowledge-hub/networkpolicy>)\n\n  \n\nCategory: Kubernetes \n\n# NetworkPolicy\n\n  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    \n\n## What is NetworkPolicy?\n\n \n\nNetworkPolicy: A firewall for Pods. Declares which Pods may talk to which, by label and port. Without one, all Pods can reach all others. A NetworkPolicy is a firewall for pods in Kubernetes. It defines which pods may connect to which, using labels and ports. For example: only pods labelled ` app=api ` may reach the database on port 3306.\n\n \n\nDefinition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)\n\n \n\n## Frequently asked questions about NetworkPolicy\n\n  \n\n### How is NetworkPolicy used in practice?\n\n \n\nBy default, every pod in a cluster can reach every other pod. That is convenient, but it means one compromised container can talk to everything, including databases it has no business with.\n\n    \n\n### What should you keep in mind with NetworkPolicy?\n\n \n\nA good starting point is a default policy that blocks incoming traffic in a namespace, followed by specific policies that allow only the connections your application needs. Network policies require a network plugin that enforces them; most managed clusters support this, but check before relying on it. Test policies carefully, because a missing rule silently breaks connections.\n\n    \n\n### What does an example of NetworkPolicy look like?\n\n \n\n```\napiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: db-allow-api spec: podSelector: matchLabels: { app: db } ingress: - from: - podSelector: matchLabels: { app: api }\n```\n\n \n\n## At a glance\n\n   CategoryKubernetes Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026\n\n \n\n## More Kubernetes terms\n\n \n\n- [LoadBalancer](<https://delaparra-services.nl/knowledge-hub/loadbalancer>) \n- [logs](<https://delaparra-services.nl/knowledge-hub/logs>) \n- [Namespace](<https://delaparra-services.nl/knowledge-hub/namespace-kubernetes>) \n- [node](<https://delaparra-services.nl/knowledge-hub/node-kubernetes>) \n- [NodePort](<https://delaparra-services.nl/knowledge-hub/nodeport>) \n- [PersistentVolume (PV)](<https://delaparra-services.nl/knowledge-hub/persistentvolume-pv>)\n\n \n\n[All terms starting with N](<https://delaparra-services.nl/knowledge-hub#letter-n>)\n\n \n\n## Skills\n\n \n\n- ### Kubernetes Security Policies\n\n \n\nImplement Kubernetes security policies including NetworkPolicy, PodSecurityPolicy, and RBAC for production-grade security. Use when securing Kubernetes clusters, implementing network isolation, or enforcing pod security standards.\n\n [View skill](<https://delaparra-services.nl/skills/k8s-security-policies>) [Download zip](<https://delaparra-services.nl/skills/k8s-security-policies/download>) \n- ### Secrets Management\n\n \n\nImplement secure secrets management for CI/CD pipelines using Vault, AWS Secrets Manager, or native platform solutions. Use when handling sensitive credentials, rotating secrets, or securing CI/CD environments.\n\n [View skill](<https://delaparra-services.nl/skills/secrets-management>) [Download zip](<https://delaparra-services.nl/skills/secrets-management/download>) \n- ### Kubernetes Manifest Generator\n\n \n\nCreate production-ready Kubernetes manifests for Deployments, Services, ConfigMaps, and Secrets following best practices and security standards. Use when generating Kubernetes YAML manifests, creating K8s resources, or implementing production-grade Kubernetes configurations.\n\n [View skill](<https://delaparra-services.nl/skills/k8s-manifest-generator>) [Download zip](<https://delaparra-services.nl/skills/k8s-manifest-generator/download>)\n\n [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/networkpolicy/skills.zip>)\n\n \n\n## Manuals\n\n \n\n- [Kubernetes and Terraform: do you need them?](<https://delaparra-services.nl/manuals/kubernetes-en-terraform-heb-je-het-nodig>) \n- [.env and environment variables](<https://delaparra-services.nl/manuals/env-en-omgevingsvariabelen>)\n\n \n\n## Related services\n\n \n\n- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)\n\nPerhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet.\n\n \n\n## Need any help?\n\n \n\nStuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.\n\n  [Get in touch](<https://delaparra-services.nl/availability>)\n\n[HTML version](https://delaparra-services.nl/knowledge-hub/networkpolicy)\n",
    "structured_data": {
        "@context": "https://schema.org",
        "@graph": [
            {
                "@type": "Organization",
                "@id": "https://delaparra-services.nl/#practice",
                "logo": "https://delaparra-services.nl/logo.png",
                "name": "DeLaParra Services",
                "legalName": "DeLaParra Services",
                "url": "https://delaparra-services.nl/",
                "description": "Bespoke software, web applications and mobile apps, developed in Laravel by a single developer in Groningen. Fixed price agreed in advance, full source code provided upon delivery.",
                "email": "info@delaparra-services.nl",
                "address": {
                    "@type": "PostalAddress",
                    "addressLocality": "Groningen",
                    "addressRegion": "Groningen",
                    "addressCountry": "NL"
                },
                "areaServed": "Groningen, the Netherlands",
                "knowsLanguage": [
                    "en",
                    "nl"
                ],
                "knowsAbout": [
                    "Web design and development",
                    "App development",
                    "Custom software and web applications",
                    "OpenSpec",
                    "AI code review",
                    "Your own coding agent"
                ],
                "founder": {
                    "@id": "https://delaparra-services.nl/#person"
                }
            },
            {
                "@type": "FAQPage",
                "@id": "https://delaparra-services.nl/knowledge-hub/networkpolicy#webpage",
                "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy",
                "name": "NetworkPolicy: Knowledge hub | DeLaParra Services",
                "description": "A firewall for Pods. Declares which Pods may talk to which, by label and port. Without one, all Pods can reach all others.",
                "isPartOf": {
                    "@id": "https://delaparra-services.nl/#website"
                },
                "about": {
                    "@type": "DefinedTerm",
                    "@id": "https://delaparra-services.nl/knowledge-hub/networkpolicy#term",
                    "name": "NetworkPolicy",
                    "description": "A firewall for Pods. Declares which Pods may talk to which, by label and port. Without one, all Pods can reach all others.",
                    "termCode": "networkpolicy",
                    "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy",
                    "inLanguage": "en",
                    "keywords": "Kubernetes",
                    "dateModified": "2026-11-25T17:46:28+00:00",
                    "inDefinedTermSet": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#terms"
                    },
                    "isPartOf": {
                        "@id": "https://delaparra-services.nl/knowledge-hub#dataset"
                    },
                    "subjectOf": [
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/networkpolicy#webpage"
                        },
                        {
                            "@id": "https://delaparra-services.nl/knowledge-hub/networkpolicy#dataset"
                        }
                    ]
                },
                "inLanguage": "en",
                "breadcrumb": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/networkpolicy#breadcrumb"
                },
                "mainEntity": [
                    {
                        "@type": "Question",
                        "name": "What is NetworkPolicy?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "A firewall for Pods. Declares which Pods may talk to which, by label and port. Without one, all Pods can reach all others. A NetworkPolicy is a firewall for pods in Kubernetes. It defines which pods may connect to which, using labels and ports. For example: only pods labelled app=api may reach the database on port 3306."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "How is NetworkPolicy used in practice?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "By default, every pod in a cluster can reach every other pod. That is convenient, but it means one compromised container can talk to everything, including databases it has no business with."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What should you keep in mind with NetworkPolicy?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "A good starting point is a default policy that blocks incoming traffic in a namespace, followed by specific policies that allow only the connections your application needs. Network policies require a network plugin that enforces them; most managed clusters support this, but check before relying on it. Test policies carefully, because a missing rule silently breaks connections."
                        }
                    },
                    {
                        "@type": "Question",
                        "name": "What does an example of NetworkPolicy look like?",
                        "acceptedAnswer": {
                            "@type": "Answer",
                            "text": "apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: db-allow-api spec: podSelector: matchLabels: { app: db } ingress: - from: - podSelector: matchLabels: { app: api }"
                        }
                    }
                ],
                "author": {
                    "@id": "https://delaparra-services.nl/#person"
                },
                "mentions": [
                    {
                        "@id": "https://delaparra-services.nl/skills/k8s-security-policies#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/secrets-management#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/skills/k8s-manifest-generator#skill"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/kubernetes-en-terraform-heb-je-het-nodig#article"
                    },
                    {
                        "@id": "https://delaparra-services.nl/manuals/env-en-omgevingsvariabelen#article"
                    }
                ]
            },
            {
                "@type": "BreadcrumbList",
                "@id": "https://delaparra-services.nl/knowledge-hub/networkpolicy#breadcrumb",
                "itemListElement": [
                    {
                        "@type": "ListItem",
                        "position": 1,
                        "name": "Home",
                        "item": "https://delaparra-services.nl/"
                    },
                    {
                        "@type": "ListItem",
                        "position": 2,
                        "name": "Knowledge hub",
                        "item": "https://delaparra-services.nl/knowledge-hub"
                    },
                    {
                        "@type": "ListItem",
                        "position": 3,
                        "name": "NetworkPolicy"
                    }
                ]
            },
            {
                "@type": "Person",
                "@id": "https://delaparra-services.nl/#person",
                "name": "Reinier de la Parra",
                "url": "https://delaparra-services.nl/about"
            },
            {
                "@type": "Dataset",
                "@id": "https://delaparra-services.nl/knowledge-hub/networkpolicy#dataset",
                "name": "NetworkPolicy",
                "description": "A firewall for Pods. Declares which Pods may talk to which, by label and port. Without one, all Pods can reach all others.",
                "url": "https://delaparra-services.nl/knowledge-hub/networkpolicy",
                "identifier": "https://delaparra-services.nl/knowledge-hub/networkpolicy#dataset",
                "about": {
                    "@id": "https://delaparra-services.nl/knowledge-hub/networkpolicy#term"
                },
                "creator": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "publisher": {
                    "@id": "https://delaparra-services.nl/#practice"
                },
                "license": "https://creativecommons.org/licenses/by/4.0/",
                "creditText": "Coders Lingo (https://coderslingo.com/resources/open-dataset/), CC BY 4.0",
                "isAccessibleForFree": true,
                "inLanguage": "en",
                "keywords": "Kubernetes",
                "version": "2026-11-25",
                "dateModified": "2026-11-25T17:46:28+00:00",
                "isPartOf": {
                    "@type": "Dataset",
                    "@id": "https://delaparra-services.nl/knowledge-hub#dataset",
                    "name": "IT terms from A to Z",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "includedInDataCatalog": {
                    "@type": "DataCatalog",
                    "@id": "https://delaparra-services.nl/knowledge-hub#catalog",
                    "name": "Knowledge hub data catalog",
                    "url": "https://delaparra-services.nl/knowledge-hub"
                },
                "distribution": [
                    {
                        "@type": "DataDownload",
                        "name": "networkpolicy.csv",
                        "encodingFormat": "text/csv",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/networkpolicy.csv",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:28+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "networkpolicy.json",
                        "encodingFormat": "application/json",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/networkpolicy.json",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:28+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "networkpolicy.md",
                        "encodingFormat": "text/markdown",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/networkpolicy.md",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:28+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "networkpolicy.pdf",
                        "encodingFormat": "application/pdf",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/networkpolicy.pdf",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:28+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "networkpolicy.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/networkpolicy.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:28+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    },
                    {
                        "@type": "DataDownload",
                        "name": "networkpolicy-skills.zip",
                        "encodingFormat": "application/zip",
                        "contentUrl": "https://delaparra-services.nl/knowledge-hub/networkpolicy/skills.zip",
                        "inLanguage": "en",
                        "dateModified": "2026-11-25T17:46:28+00:00",
                        "license": "https://creativecommons.org/licenses/by/4.0/"
                    }
                ]
            }
        ]
    }
}