{"id":21190,"date":"2022-12-06T02:03:04","date_gmt":"2022-12-06T02:03:04","guid":{"rendered":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/"},"modified":"2022-12-06T02:03:04","modified_gmt":"2022-12-06T02:03:04","slug":"securing-kubernetes-cluster-traffic-with-pod-network-policies","status":"publish","type":"post","link":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/","title":{"rendered":"Securing Kubernetes Cluster Traffic With Pod Network Policies"},"content":{"rendered":"<p> <a href=\"https:\/\/go.fiverr.com\/visit\/?bta=1052423&nci=17043\" Target=\"_Top\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" src=\"https:\/\/fiverr.ck-cdn.com\/tn\/serve\/?cid=40081059\" loading=\"lazy\"  width=\"601\" height=\"201\"><\/a>\n<\/p>\n<div>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage alignnone size-full wp-image-803403\" data-pagespeed-no-defer=\"\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/Kubernetes.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" loading=\"lazy\" alt=\"Kubernetes logo\" width=\"1602\" height=\"902\"\/><\/p>\n<p>Kubernetes Pods can freely communicate with each other by default. This poses a security risk when your cluster\u2019s used for multiple applications or teams. Errant behavior or malicious access in one Pod could direct traffic to the other Pods in your cluster.<\/p>\n<p>This article will teach you how to avoid this scenario by setting up <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/network-policies\">network policies<\/a>. These rules let you control Pod-to-Pod traffic flows at the IP address level (<a href=\"https:\/\/www.howtogeek.com\/devops\/the-7-osi-networking-layers-explained\">OSI layer<\/a> 3 or 4). You can precisely define the ingress and egress sources permitted for each Pod.<\/p>\n<h2 id=\"creating-a-network-policy\">Creating a Network Policy<\/h2>\n<p>Network policies are created by adding <code>NetworkPolicy<\/code> objects to your cluster. Each policy defines the Pods it applies to and one or more ingress and egress rules. Here\u2019s a basic policy manifest:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><strong class=\"co3\">apiVersion<\/strong><strong class=\"sy2\">: <\/strong>networking.k8s.io\/v1<strong class=\"co3\">\nkind<\/strong><strong class=\"sy2\">: <\/strong>NetworkPolicy<strong class=\"co4\">\nmetadata<\/strong>:<strong class=\"co3\">\n  name<\/strong><strong class=\"sy2\">: <\/strong>network-policy<strong class=\"co3\">\n  namespace<\/strong><strong class=\"sy2\">: <\/strong>app<strong class=\"co4\">\nspec<\/strong>:<strong class=\"co4\">\n  podSelector<\/strong>:<strong class=\"co4\">\n    matchLabels<\/strong>:<strong class=\"co3\">\n      component<\/strong><strong class=\"sy2\">: <\/strong>database<strong class=\"co4\">\n  policyTypes<\/strong><strong class=\"sy2\">:\n<\/strong>    - Ingress\n    - Egress<strong class=\"co4\">\n  ingress<\/strong>:<strong class=\"co4\">\n    - from<\/strong>:<strong class=\"co4\">\n      - podSelector<\/strong>:<strong class=\"co4\">\n          matchLabels<\/strong>:<strong class=\"co3\">\n            component<\/strong><strong class=\"sy2\">: <\/strong>api<strong class=\"co4\">\n  egress<\/strong>:<strong class=\"co4\">\n    - to<\/strong>:<strong class=\"co4\">\n        - podSelector<\/strong>:<strong class=\"co4\">\n            matchLabels<\/strong>:<strong class=\"co3\">\n              component<\/strong><strong class=\"sy2\">: <\/strong>api<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This network policy applies to any Pod with a <code>component: database<\/code> label in the <code>app<\/code> namespace. It states that ingress (incoming) and egress (outgoing) traffic is only allowed from and to Pods with a <code>component: api<\/code> label. Any requests originating from other Pods, such as <code>component: web-frontend<\/code>, will be blocked.<\/p>\n<p>Network policies can be applied like any other object by using Kubectl. They\u2019ll take effect immediately after they\u2019re created. You can add the networking policy before you start the Pods it selects.<\/p>\n<pre>$ kubectl apply -f policy.yaml&#13;\nnetworkingpolicy.networking.k8s.io\/network-policy created<\/pre>\n<h2 id=\"how-network-policies-work\">How Network Policies Work<\/h2>\n<p>Network policies are implemented by your cluster\u2019s active <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/extend-kubernetes\/compute-storage-net\/network-plugins\">networking plugin<\/a>. Your policies won\u2019t have any effect if your plugin doesn\u2019t support the feature. Most popular options such as <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/administer-cluster\/network-policy-provider\/calico-network-policy\">Calico<\/a> and <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/administer-cluster\/network-policy-provider\/cilium-network-policy\">Cilium<\/a> ship with network policy support enabled.<\/p>\n<p>When a network policy applies to a Pod, the plugin will inspect its traffic to check it\u2019s compliant with the policy\u2019s requirements. Any connections that don\u2019t meet the criteria will be disallowed. The Pod that tried to initiate the connection will find the remote host is unreachable, either because it was trying to access a resource blocked by an egress rule, or because a remote Pod denied the incoming connection using an ingress rule.<\/p>\n<p>A successful connection between two Pods can only be established when the network policies on <em>both<\/em> of them permit it. The connection could be forbidden by an egress rule of the initiating Pod, or an ingress rule on the target.<\/p>\n<p>Network policies are always <em>additive<\/em> in nature. When multiple policies select the same Pod, the list of permitted ingress and egress sources will be the combination of all the policies.<\/p>\n<h2 id=\"example-network-policies\">Example Network Policies<\/h2>\n<p>Network policies support many different options for customizing the Pods they target and the types of connection that are allowed. The following examples showcase several common use cases.<\/p>\n<h3 id=\"apply-a-policy-to-every-pod-in-the-namespace-only-allowing-ingress-traffic-from-a-specific-ip-address-block\">Apply a policy to every Pod in the namespace, only allowing Ingress traffic from a specific IP address block<\/h3>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><strong class=\"co3\">apiVersion<\/strong><strong class=\"sy2\">: <\/strong>networking.k8s.io\/v1<strong class=\"co3\">\nkind<\/strong><strong class=\"sy2\">: <\/strong>NetworkPolicy<strong class=\"co4\">\nmetadata<\/strong>:<strong class=\"co3\">\n  name<\/strong><strong class=\"sy2\">: <\/strong>network-policy<strong class=\"co3\">\n  namespace<\/strong><strong class=\"sy2\">: <\/strong>app<strong class=\"co4\">\nspec<\/strong>:<strong class=\"co3\">\n  podSelector<\/strong><strong class=\"sy2\">: <\/strong><strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><strong class=\"co4\">\n  policyTypes<\/strong><strong class=\"sy2\">:\n<\/strong>    - Ingress<strong class=\"co4\">\n  ingress<\/strong>:<strong class=\"co4\">\n    - from<\/strong>:<strong class=\"co4\">\n        - ipBlock<\/strong>:<strong class=\"co3\">\n            cidr<\/strong><strong class=\"sy2\">: <\/strong>172.17.0.0\/16<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The empty <code>podSelector<\/code> block means all the namespace\u2019s Pods are targeted by the policy. The <code>ipBlock<\/code> rule restricts ingress traffic to Pods with an IP address in the specified range. Egress traffic is not blocked.<\/p>\n<h3 id=\"allow-ingress-traffic-from-an-ip-address-block-but-exclude-some-specific-ips\">Allow Ingress traffic from an IP address block, but exclude some specific IPs<\/h3>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><strong class=\"co3\">apiVersion<\/strong><strong class=\"sy2\">: <\/strong>networking.k8s.io\/v1<strong class=\"co3\">\nkind<\/strong><strong class=\"sy2\">: <\/strong>NetworkPolicy<strong class=\"co4\">\nmetadata<\/strong>:<strong class=\"co3\">\n  name<\/strong><strong class=\"sy2\">: <\/strong>network-policy<strong class=\"co3\">\n  namespace<\/strong><strong class=\"sy2\">: <\/strong>app<strong class=\"co4\">\nspec<\/strong>:<strong class=\"co3\">\n  podSelector<\/strong><strong class=\"sy2\">: <\/strong><strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><strong class=\"co4\">\n  policyTypes<\/strong><strong class=\"sy2\">:\n<\/strong>    - Ingress<strong class=\"co4\">\n  ingress<\/strong>:<strong class=\"co4\">\n    - from<\/strong>:<strong class=\"co4\">\n        - ipBlock<\/strong>:<strong class=\"co3\">\n            cidr<\/strong><strong class=\"sy2\">: <\/strong>172.17.0.0\/16<strong class=\"co4\">\n            except<\/strong><strong class=\"sy2\">:\n<\/strong>              - 172.17.0.1\/24\n              - 172.17.0.2\/24\n              - 172.17.0.3\/24<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p><code>ipBlock<\/code> rules support an <code>except<\/code> field to exclude traffic originating from, or being directed to, specific IPs.<\/p>\n<h3 id=\"allow-ingress-traffic-from-all-pods-in-the-namespace-but-only-from-a-specific-port\">Allow Ingress traffic from all Pods in the namespace, but only from a specific port<\/h3>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><strong class=\"co3\">apiVersion<\/strong><strong class=\"sy2\">: <\/strong>networking.k8s.io\/v1<strong class=\"co3\">\nkind<\/strong><strong class=\"sy2\">: <\/strong>NetworkPolicy<strong class=\"co4\">\nmetadata<\/strong>:<strong class=\"co3\">\n  name<\/strong><strong class=\"sy2\">: <\/strong>network-policy<strong class=\"co3\">\n  namespace<\/strong><strong class=\"sy2\">: <\/strong>app<strong class=\"co4\">\nspec<\/strong>:<strong class=\"co3\">\n  podSelector<\/strong><strong class=\"sy2\">: <\/strong><strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><strong class=\"co4\">\n  policyTypes<\/strong><strong class=\"sy2\">:\n<\/strong>    - Ingress<strong class=\"co4\">\n  ingress<\/strong>:<strong class=\"co4\">\n    - from<\/strong>:<strong class=\"co3\">\n        - podSelector<\/strong><strong class=\"sy2\">: <\/strong><strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><strong class=\"co4\">\n          ports<\/strong>:<strong class=\"co3\">\n            - protocol<\/strong><strong class=\"sy2\">: <\/strong>TCP<strong class=\"co3\">\n              port<\/strong><strong class=\"sy2\">: <\/strong>443<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The <code>ports<\/code> field is available on ingress and egress rules. It defines the ports that traffic can be received from and sent to. You can optionally specify a range of ports, such as 3000 \u2013 3500, by setting the <code>endPort<\/code> field (3500) in addition to <code>port<\/code> (3000).<\/p>\n<h3 id=\"allow-traffic-from-pods-with-a-specific-label-that-exist-in-a-different-namespace\">Allow traffic from Pods with a specific label that exist in a different namespace<\/h3>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><strong class=\"co3\">apiVersion<\/strong><strong class=\"sy2\">: <\/strong>networking.k8s.io\/v1<strong class=\"co3\">\nkind<\/strong><strong class=\"sy2\">: <\/strong>NetworkPolicy<strong class=\"co4\">\nmetadata<\/strong>:<strong class=\"co3\">\n  name<\/strong><strong class=\"sy2\">: <\/strong>network-policy<strong class=\"co3\">\n  namespace<\/strong><strong class=\"sy2\">: <\/strong>database<strong class=\"co4\">\nspec<\/strong>:<strong class=\"co3\">\n  podSelector<\/strong><strong class=\"sy2\">: <\/strong><strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><strong class=\"co4\">\n  policyTypes<\/strong><strong class=\"sy2\">:\n<\/strong>    - Ingress<strong class=\"co4\">\n  ingress<\/strong>:<strong class=\"co4\">\n    - from<\/strong>:<strong class=\"co4\">\n        - namespaceSelector<\/strong>:<strong class=\"co4\">\n            matchLabels<\/strong>:<strong class=\"co3\">\n              application<\/strong><strong class=\"sy2\">: <\/strong>demo-app<strong class=\"co4\">\n          podSelector<\/strong>:<strong class=\"co4\">\n            matchLabels<\/strong>:<strong class=\"co3\">\n              component<\/strong><strong class=\"sy2\">: <\/strong>database<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>The policy states that any Pod labelled <code>component: database<\/code> can reach all the Pods in the <code>database<\/code> namespace, if its own namespace is labelled <code>demo-app<\/code>.<\/p>\n<p>You can allow traffic from <em>all<\/em> the Pods in an external namespace by creating a rule that only includes a <code>namespaceSelector<\/code> field.<\/p>\n<h3 id=\"explicitly-allow-all-traffic\">Explicitly allow all traffic<\/h3>\n<p>Sometimes you might want to explicitly allow all traffic of a particular type within a namespace. Include the type in your policy but supply an empty Pod selector and no rules:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><strong class=\"co3\">apiVersion<\/strong><strong class=\"sy2\">: <\/strong>networking.k8s.io\/v1<strong class=\"co3\">\nkind<\/strong><strong class=\"sy2\">: <\/strong>NetworkPolicy<strong class=\"co4\">\nmetadata<\/strong>:<strong class=\"co3\">\n  name<\/strong><strong class=\"sy2\">: <\/strong>network-policy<strong class=\"co3\">\n  namespace<\/strong><strong class=\"sy2\">: <\/strong>app<strong class=\"co4\">\nspec<\/strong>:<strong class=\"co3\">\n  podSelector<\/strong><strong class=\"sy2\">: <\/strong><strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><strong class=\"co4\">\n  policyTypes<\/strong><strong class=\"sy2\">:\n<\/strong>    - Ingress\n    - Egress<strong class=\"co4\">\n  ingress<\/strong><strong class=\"sy2\">:\n<\/strong>    - <strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><strong class=\"co4\">\n  egress<\/strong><strong class=\"sy2\">:\n<\/strong>    - <strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>All the Pods in the namespace can freely communicate, as if there was no policy. Creating the policy anyway lets you indicate your intentions to other cluster users. They might question the presence of a namespace with unrestricted networking in a cluster which has otherwise been secured.<\/p>\n<h2 id=\"when-to-use-network-policies\">When to Use Network Policies<\/h2>\n<p>Network policies should be created for each of the namespaces and Pods in your cluster. This better isolates your Pods and puts you in control of traffic flow.<\/p>\n<p>Try to make your policies as granular as possible. Widening access too much, such as allowing access between all Pods in a namespace, leaves you exposed to risks if one of your containers is compromised. Consider using precise selectors to identify individual ingress and egress remotes for sensitive Pods such as authentication services, databases, and payment handlers.<\/p>\n<p>Kubernetes doesn\u2019t enable any network policies by default which can allow oversights to occur, even if you intend all Pods to be protected by a policy. You can mitigate against this risk by adding a catch-all policy to your namespaces. This policy selects every Pod in the namespace and applies a rule that forbids all network communication:<\/p>\n<div class=\"wp-geshi-highlight-wrap5\">\n<div class=\"wp-geshi-highlight-wrap4\">\n<div class=\"wp-geshi-highlight-wrap3\">\n<div class=\"wp-geshi-highlight-wrap2\">\n<div class=\"wp-geshi-highlight-wrap\">\n<div class=\"wp-geshi-highlight\">\n<div class=\"yaml\">\n<pre class=\"de1\"><strong class=\"co3\">apiVersion<\/strong><strong class=\"sy2\">: <\/strong>networking.k8s.io\/v1<strong class=\"co3\">\nkind<\/strong><strong class=\"sy2\">: <\/strong>NetworkPolicy<strong class=\"co4\">\nmetadata<\/strong>:<strong class=\"co3\">\n  name<\/strong><strong class=\"sy2\">: <\/strong>deny-<strong class=\"kw1\">all<\/strong><strong class=\"co3\">\n  namespace<\/strong><strong class=\"sy2\">: <\/strong>app<strong class=\"co4\">\nspec<\/strong>:<strong class=\"co3\">\n  podSelector<\/strong><strong class=\"sy2\">: <\/strong><strong class=\"br0\">{<\/strong><strong class=\"br0\">}<\/strong><strong class=\"co4\">\n  policyTypes<\/strong><strong class=\"sy2\">:\n<\/strong>    - Ingress\n    - Egress<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>Network policies are always scoped to namespaces so you\u2019ll need to create a separate catch-all for each one.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>Kubernetes allows all the Pods in your cluster to communicate with each other. This is too permissive for real-world applications running in multi-purpose clusters. Network policies address this problem by providing a firewall-like system for managing the ingress sources and egress targets that each Pod accepts.<\/p>\n<p>It\u2019s good practice to configure a network policy on all of your Pods. This will secure your cluster so only legitimate traffic flows are permitted. Network policies are only one part of Kubernetes security, however: other <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/administer-cluster\/securing-a-cluster\">protection mechanisms<\/a> such as <a href=\"https:\/\/www.howtogeek.com\/devops\/how-to-get-started-with-kubernetes-rbac\">RBAC<\/a> and Pod <a href=\"https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/security-context\">security contexts<\/a> are also essential tools for hardening your environment.<\/p>\n<\/div>\n<iframe data-lazy=\"true\" data-src=\"https:\/\/www.fiverr.com\/gig_widgets?id=U2FsdGVkX18x7XQvttUTrv1oEqmGNGTgvvCUiUoJ\/AP4z\/UyMz8lXGOLpu15jIMxBbTR0gmD5uBoFvhC4KWeALQRp3h\/X\/AwcVD0K8Wj9H\/ZzYKzcCNHosB9oS4SCJJFWiN85P9ICAc4OgCoE\/wHKIY7CDkf2\/DQ1vqGvk4smVe5cRDEmrLPCWi4FC8p40VUhSmWQ5udCm0zoJtorgWv3vbDQw0kKYkwn39ozAnQXDe+YvWMxkLFWA+O3TFwkJvdkIK+\/AUSnRssPKt5WHY0FhNOxnSPcLslEL4G4\/RfP95ve99U+kRnDy3X+KtzdQLY+u935ghON\/o3UE4IMv9oN6JX9RnxzL\/LRcOgnHigxStSGPKsZYtnz8RWNVT\/rOLAibqiWJadC5MYHRbekF3eg6FOGrQGkXYbsn0+a5aovnlLCbLwIqY9fcS17UX8J235iQ6cdmHNbrPeS84CMm34RA==&affiliate_id=1052423&strip_google_tagmanager=true\" loading=\"lazy\" data-with-title=\"true\" class=\"fiverr_nga_frame\" frameborder=\"0\" height=\"350\" width=\"100%\" referrerpolicy=\"no-referrer-when-downgrade\" data-mode=\"random_gigs\" onload=\" var frame = this; var script = document.createElement('script'); script.addEventListener('load', function() { window.FW_SDK.register(frame); }); script.setAttribute('src', 'https:\/\/www.fiverr.com\/gig_widgets\/sdk'); document.body.appendChild(script); \" ><\/iframe>\n<br \/><a href=\"https:\/\/www.howtogeek.com\/devops\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Kubernetes Pods can freely communicate with each other by default. This poses a security risk when your cluster\u2019s used for multiple applications or teams. Errant&#8230;<\/p>\n","protected":false},"author":1,"featured_media":21191,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-21190","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech-universe"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Securing Kubernetes Cluster Traffic With Pod Network Policies - mailinvest.blog<\/title>\n<meta name=\"description\" content=\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Securing Kubernetes Cluster Traffic With Pod Network Policies - mailinvest.blog\" \/>\n<meta property=\"og:description\" content=\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/\" \/>\n<meta property=\"og:site_name\" content=\"mailinvest.blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/freelanceracademic\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-06T02:03:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/Kubernetes-scaled.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1439\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin@mailinvest.blog\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin@mailinvest.blog\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/\"},\"author\":{\"name\":\"admin@mailinvest.blog\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/person\\\/012701c4c204d4e4ebd34f926cfd31a4\"},\"headline\":\"Securing Kubernetes Cluster Traffic With Pod Network Policies\",\"datePublished\":\"2022-12-06T02:03:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/\"},\"wordCount\":975,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Kubernetes-scaled.jpg\",\"articleSection\":[\"Tech Universe\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/\",\"name\":\"Securing Kubernetes Cluster Traffic With Pod Network Policies - mailinvest.blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Kubernetes-scaled.jpg\",\"datePublished\":\"2022-12-06T02:03:04+00:00\",\"description\":\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/#primaryimage\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Kubernetes-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Kubernetes-scaled.jpg\",\"width\":2560,\"height\":1439},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/2022\\\/12\\\/06\\\/securing-kubernetes-cluster-traffic-with-pod-network-policies\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mailinvest.blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Securing Kubernetes Cluster Traffic With Pod Network Policies\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#website\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/\",\"name\":\"mailinvest.blog\",\"description\":\"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis. mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.\",\"publisher\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mailinvest.blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#organization\",\"name\":\"mailinvest\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/default.png\",\"contentUrl\":\"https:\\\/\\\/mailinvest.blog\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/default.png\",\"width\":1000,\"height\":1000,\"caption\":\"mailinvest\"},\"image\":{\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/freelanceracademic\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/mailinvest.blog\\\/#\\\/schema\\\/person\\\/012701c4c204d4e4ebd34f926cfd31a4\",\"name\":\"admin@mailinvest.blog\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g\",\"caption\":\"admin@mailinvest.blog\"},\"sameAs\":[\"https:\\\/\\\/mailinvest.blog\",\"admin@mailinvest.blog\"],\"url\":\"https:\\\/\\\/mailinvest.blog\\\/index.php\\\/author\\\/adminmailinvest-blog\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Securing Kubernetes Cluster Traffic With Pod Network Policies - mailinvest.blog","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/","og_locale":"en_US","og_type":"article","og_title":"Securing Kubernetes Cluster Traffic With Pod Network Policies - mailinvest.blog","og_description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","og_url":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/","og_site_name":"mailinvest.blog","article_publisher":"https:\/\/www.facebook.com\/freelanceracademic\/","article_published_time":"2022-12-06T02:03:04+00:00","og_image":[{"width":2560,"height":1439,"url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/Kubernetes-scaled.jpg","type":"image\/jpeg"}],"author":"admin@mailinvest.blog","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin@mailinvest.blog","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/#article","isPartOf":{"@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/"},"author":{"name":"admin@mailinvest.blog","@id":"https:\/\/mailinvest.blog\/#\/schema\/person\/012701c4c204d4e4ebd34f926cfd31a4"},"headline":"Securing Kubernetes Cluster Traffic With Pod Network Policies","datePublished":"2022-12-06T02:03:04+00:00","mainEntityOfPage":{"@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/"},"wordCount":975,"commentCount":0,"publisher":{"@id":"https:\/\/mailinvest.blog\/#organization"},"image":{"@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/#primaryimage"},"thumbnailUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/Kubernetes-scaled.jpg","articleSection":["Tech Universe"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/","url":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/","name":"Securing Kubernetes Cluster Traffic With Pod Network Policies - mailinvest.blog","isPartOf":{"@id":"https:\/\/mailinvest.blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/#primaryimage"},"image":{"@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/#primaryimage"},"thumbnailUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/Kubernetes-scaled.jpg","datePublished":"2022-12-06T02:03:04+00:00","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis.mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what's new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","breadcrumb":{"@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/#primaryimage","url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/Kubernetes-scaled.jpg","contentUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/12\/Kubernetes-scaled.jpg","width":2560,"height":1439},{"@type":"BreadcrumbList","@id":"https:\/\/mailinvest.blog\/index.php\/2022\/12\/06\/securing-kubernetes-cluster-traffic-with-pod-network-policies\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mailinvest.blog\/"},{"@type":"ListItem","position":2,"name":"Securing Kubernetes Cluster Traffic With Pod Network Policies"}]},{"@type":"WebSite","@id":"https:\/\/mailinvest.blog\/#website","url":"https:\/\/mailinvest.blog\/","name":"mailinvest.blog","description":"Technology is forever changing, and there are always new pieces of technology to replace obsolete ones. Tons of people enjoy reading tech blogs on a daily basis. mailinvest.blog tracks all the latest consumer technology breakthroughs and shows you what&#039;s new, what matters and how technology can enrich your life. mailinvest.blog also provides the information, tools, and advice that helps when deciding what to buy.","publisher":{"@id":"https:\/\/mailinvest.blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mailinvest.blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/mailinvest.blog\/#organization","name":"mailinvest","url":"https:\/\/mailinvest.blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mailinvest.blog\/#\/schema\/logo\/image\/","url":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/01\/default.png","contentUrl":"https:\/\/mailinvest.blog\/wp-content\/uploads\/2022\/01\/default.png","width":1000,"height":1000,"caption":"mailinvest"},"image":{"@id":"https:\/\/mailinvest.blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/freelanceracademic\/"]},{"@type":"Person","@id":"https:\/\/mailinvest.blog\/#\/schema\/person\/012701c4c204d4e4ebd34f926cfd31a4","name":"admin@mailinvest.blog","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/98ed217bd0f3d6a6dcae2d9b0c76e305b049a07275e315e1407e19ec8b08e139?s=96&d=mm&r=g","caption":"admin@mailinvest.blog"},"sameAs":["https:\/\/mailinvest.blog","admin@mailinvest.blog"],"url":"https:\/\/mailinvest.blog\/index.php\/author\/adminmailinvest-blog\/"}]}},"_links":{"self":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts\/21190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/comments?post=21190"}],"version-history":[{"count":0,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/posts\/21190\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/media\/21191"}],"wp:attachment":[{"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/media?parent=21190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/categories?post=21190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailinvest.blog\/index.php\/wp-json\/wp\/v2\/tags?post=21190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}