YouTube2Text

How to use ClusterNetworkPolicy in GKE to secure network access across your cluster — Transcript

by Google Cloud Tech · 808 words · 147 segments · language en · Watch on YouTube

Full transcript

  1. 0:00In Kubernetes, standard network policies
  2. 0:03control pod communication at the
  3. 0:05namespace level. However, this is not
  4. 0:07enforced across the entire cluster. This
  5. 0:10is where cluster network policies come
  6. 0:13in.
  7. 0:14Welcome to Networking Everything, where
  8. 0:16we discuss networking everything. My
  9. 0:19name is Ahmed and joining me today is
  10. 0:21Harika. Today we'll be covering the
  11. 0:23topic of cluster network policies in
  12. 0:26Google Kubernetes Engine. Let's get
  13. 0:29started.
  14. 0:30[music]
  15. 0:36While standard network policies apply to
  16. 0:38pods in a single namespace, cluster
  17. 0:40network policies let administrators
  18. 0:43configure global traffic rules across an
  19. 0:45entire cluster. These rules can match
  20. 0:48and filter protocols like TCP, UDP, and
  21. 0:51SCTP. To understand the concept better,
  22. 0:54let's look at three personas. So first
  23. 0:57up, the cluster administrator. They
  24. 0:59protect cluster infrastructure and set
  25. 1:01baseline guard rails working in both
  26. 1:04admin and baseline tiers.
  27. 1:06Second, the namespace administrator.
  28. 1:09They manage security for specific
  29. 1:11namespaces using standard network
  30. 1:14policy. And third, the application
  31. 1:17developer.
  32. 1:18They secure individual application
  33. 1:20workloads also using standard network
  34. 1:23policy.
  35. 1:25Now, let me pass you over to Harika to
  36. 1:27take a deeper dive into this topic. Over
  37. 1:30to you, Harika.
  38. 1:31>> Thanks, Ahmed. Let me dive into the
  39. 1:33flow. Every packet in your cluster is
  40. 1:36evaluated top to bottom through distinct
  41. 1:38steps. [music]
  42. 1:38First is the admin tier powered by
  43. 1:40cluster network policy. This is where
  44. 1:43platform admins set non-negotiable rules
  45. 1:45like isolating sensitive namespaces
  46. 1:47[music]
  47. 1:48or guaranteeing cluster DNS access.
  48. 1:50Second is a network policy tier. This is
  49. 1:53the developer playground and home to
  50. 1:54standard namespace network policies and
  51. 1:57fully qualified domain name policies.
  52. 1:59Third is baseline tier, which is another
  53. 2:02cluster network policy layer [music]
  54. 2:04used by admins to set default fallbacks
  55. 2:06like a cluster wide default deny. And
  56. 2:09fourth, if no policy in any of these
  57. 2:12three tier makes a decision, Kubernetes
  58. 2:14[music] falls back to its default
  59. 2:16behavior, which implicitly allows all
  60. 2:18traffic.
  61. 2:19Unlike standard network policy which can
  62. 2:21only allow traffic, cluster network
  63. 2:23policy introduces [music] three explicit
  64. 2:25actions, accept, deny and pass.
  65. 2:29When a rule triggers accept or deny, the
  66. 2:31decision is final. [music] The traffic
  67. 2:33is immediately allowed or dropped and no
  68. 2:35further evaluation happens in any
  69. 2:37[music] lower tier.
  70. 2:39But pass is like a secret weapon for
  71. 2:41platform teams. If an admin tier rule
  72. 2:44matches traffic with action pass, it
  73. 2:46skips all remaining admin rules and
  74. 2:49immediately delegates the decision down
  75. 2:51to the network policy tier.
  76. 2:54This lets admin says I am not blocking
  77. 2:56certain port. For example, [music] I am
  78. 2:58explicitly handing control over to the
  79. 3:01namespace owners. Let's see how this
  80. 3:03solves real world cluster security.
  81. 3:05[music] Imagine you want a zero trust
  82. 3:07cluster. First, in the admin tier you
  83. 3:10create two high priority rules. Priority
  84. 3:1210 completely isolates your sensitive
  85. 3:14namespace with an explicit deny [music]
  86. 3:17and priority 20 uses accept to ensure
  87. 3:19every pod can always reach kube-dns on
  88. 3:22port 53 [music] so developers can never
  89. 3:25accidentally break any DNS.
  90. 3:28Next, instead of forcing every developer
  91. 3:30to write boilerplate deny rules, you
  92. 3:32drop a single policy into the baseline
  93. 3:35tier at priority 100 that denies all
  94. 3:38ingress traffic across the entire
  95. 3:40cluster, [music]
  96. 3:41instant zero trust. Now, how does a
  97. 3:44developer expose their front end app?
  98. 3:46They just deploy a standard Kubernetes
  99. 3:48network policy in their own namespace
  100. 3:51[music] allowing ingress nginx.
  101. 3:53Because the network policy tier is
  102. 3:55evaluated before the baseline tier, the
  103. 3:58developers rule succeeds and overrides
  104. 4:01your baseline deny without ever being
  105. 4:03able to bypass your admin tiered guard
  106. 4:06rails.
  107. 4:07Before you write your first policy, keep
  108. 4:09three pro tips in mind.
  109. 4:11Number one, priority number runs from
  110. 4:13zero to 1000. A lower number means
  111. 4:16higher precedence. If policy A has
  112. 4:18priority 10 and policy B has priority 50
  113. 4:21in the same tier, policy A is evaluated
  114. 4:24first. [music] Within a single policy,
  115. 4:26rules are evaluated top to bottom. Once
  116. 4:29a rule matches like allowing traffic,
  117. 4:32the evaluation stops. Number two, use
  118. 4:35name ports instead of hardcoding ports
  119. 4:37like 8080 in your security policies.
  120. 4:40[music]
  121. 4:40Match on destination name port HTTP web.
  122. 4:44If an app team changes their container
  123. 4:46port for any reason, your security
  124. 4:49policies keep working without a single
  125. 4:51edit.
  126. 4:52And three, external CIDR egress. Need to
  127. 4:56control access to corporate intranets
  128. 4:58outside the cluster? Use the networks
  129. 5:01peer type in your egress rules to allow
  130. 5:03or block specific [music] IP ranges.
  131. 5:06To recap, use the admin tier for
  132. 5:08non-negotiable guard rails and DNS. Use
  133. 5:11the baseline tier for a cluster wide
  134. 5:13default deny and let developers
  135. 5:16self-serve [music] in the middle using
  136. 5:18standard network policies.
  137. 5:22>> Wow, that was awesome. Thank you so
  138. 5:24much, Harika. Now it's time for you to
  139. 5:27explore and learn more about cluster
  140. 5:29network policy. Please check the links
  141. 5:31in the description. And thank you so
  142. 5:33much for watching this episode of
  143. 5:35Networking Everything where we discuss
  144. 5:37networking everything.
  145. 5:40Bye.
  146. 5:43>> [music]
  147. 5:52[music]

About this transcript

This page contains the full transcript of How to use ClusterNetworkPolicy in GKE to secure network access across your cluster by Google Cloud Tech, generated from the public captions YouTube serves with the video. The transcript has 808 words across 147 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.