# ahmetb/kubernetes-network-policy-recipes

Example recipes for Kubernetes Network Policies that you can just copy paste

Repository: https://github.com/ahmetb/kubernetes-network-policy-recipes
Canonical: https://ross.abutalabs.com/products/kubernetes-network-policy-recipes
License: Apache-2.0
License Family: permissive
Topics: kubernetes, networking, security
Last push: 2025-02-07T08:38:37+00:00

## Health v2 (maintenance only)
Score: 34/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 5, release rhythm 35, longevity 100
- inputs: {"age_days": 3321, "days_push": 572, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6159, forks 1823 (observed 2026-08-28T04:09:36.724369+00:00)

## What it is
A collection of copy-paste-ready YAML recipes and tutorials for Kubernetes Network Policies, covering common traffic restriction scenarios. It serves as both documentation and a learning resource for securing pod-to-pod networking.

## Use cases
- deny all traffic to an application in kubernetes
- restrict pod traffic between namespaces
- learn kubernetes network policies with examples
- find sample networkpolicy yaml to copy
- secure kubernetes cluster networking
- allow only specific pods to reach a service

## When to choose
- you need ready-made NetworkPolicy YAML for common scenarios
- you are learning how Kubernetes NetworkPolicies work
- you want practical recipes for isolating namespaces or pods

## When to avoid
- you need a tool that generates or enforces policies automatically
- your cluster's CNI plugin does not support NetworkPolicies
- you need layer 7 (HTTP-level) traffic control

## Facets
- artifact type: learning-resource
- maturity: active
- function: security, networking, documentation
- domain: networking, security, developer-tools
- platform: cloud, self-hosted
- tags: network-policy, yaml-examples, copy-paste-recipes, k8s-security, kubernetes

## Member repositories
- ahmetb/kubernetes-network-policy-recipes (main) score 34

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:36.724369+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:47:29.007669+00:00, confidence not recorded.
  - readme: https://github.com/ahmetb/kubernetes-network-policy-recipes (fetched 2026-08-28T04:09:36.724369+00:00, sha 810a24220c8d)
- Data as of 2026-08-30T08:39:29.467469+00:00.
