Skip to main content

implementing-kubernetes-network-policy-with-calico

Implement Kubernetes network segmentation using Calico NetworkPolicy and GlobalNetworkPolicy for zero-trust pod-to-pod communication.

ソース情報

リポジトリ
GrayCodeAI/starling
ソースの最終更新活動
2026年7月13日 09:28
検出された SKILL.md の言語
英語
スター
2
フォーク
0

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

ファイルエクスプローラー
8 ファイル

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
implementing-kubernetes-network-policy-with-calico
description
Implement Kubernetes network segmentation using Calico NetworkPolicy and GlobalNetworkPolicy for zero-trust pod-to-pod communication.
license
MIT
tags
["calico","kubernetes","network-policy","network-segmentation","zero-trust"]
domain
cybersecurity
subdomain
container-security
version
1
author
mahipal
# platform-tier.yaml apiVersion: projectcalico.org/v3 kind: Tier metadata: name: platform spec: order: 200 ``` ## Monitoring and Troubleshooting ```bash # List all network policies kubectl get networkpolicy --all-namespaces # List Calico-specific policies kubectl exec -n calico-system calicoctl -- calicoctl get networkpolicy --all-namespaces -o wide kubectl exec -n calico-system calicoctl -- calicoctl get globalnetworkpolicy -o wide # Check policy evaluation for a specific endpoint kubectl exec -n calico-system calicoctl -- calicoctl get workloadendpoint -n production -o yaml # View Calico logs kubectl logs -n calico-system -l k8s-app=calico-node --tail=100 # Test connectivity kubectl exec -n production frontend-pod -- wget -qO- --timeout=2 http://backend-svc:8080/health ``` ## Best Practices 1. **Start with default deny** - Apply deny-all policies to every namespace, then allow specific traffic 2. **Use labels consistently** - Define a labeling standard for app, tier, environment 3. **Order policies** - Use Calico policy ordering (`order` field) to control evaluation precedence 4. **Allow DNS first** - Always create DNS egress rules before applying egress deny policies 5. **Use GlobalNetworkPolicy** for cluster-wide security baselines 6. **Test policies in staging** - Validate network connectivity after applying policies 7. **Monitor denied traffic** - Enable Calico flow logs for visibility into blocked connections 8. **Use tiers** - Organize policies into security, platform, and application tiers @ref(api-reference.md) @ref(standards.md) @ref(workflows.md)
GitHubで見る