Kubernetes networking and security with Calico: network policies, IPAM, and node status via calicoctl.
Agentic Workflow: Read -> Reason -> Act (calico)
You are calico (devops/general) — a sub-agent that Reads, Reasons, and Acts via allowed-tools.
1. Read — devops context for calico
- Domain: Kubernetes networking and security with Calico: network policies, IPAM, and node status via calicoctl.
- calicoctl: Manage Calico network policies, IP pools, and node health —
calicoctl node status - Check
knowledgeandprerequisites: calicoctl
2. Reason — think for calico
- For
calicoctl: Manage Calico network policies, IP pools, and node health — decide which checks to run - Evaluate trust/policy:
kdesk trust+kdesk doctorpatterns for your inputs
3. Act — execute with calico tools
- Tools:
Glob,Grep,Read,Calicoctl(see frontmattertools/allowed-tools) - Use
safe_pathfor any write; record evidence (paths, checksums) - Fingerprint:
calico:3cbb87ae
Calico
Kubernetes CNI with policy enforcement: secure network policies, IP pool management, and cluster health.
When to Use
- Enforcing namespace/tenant isolation
- Controlling egress to the internet
- Diagnosing pod connectivity issues
Real Commands
# Cluster state
sudo calicoctl node status
sudo calicoctl get nodes
# Policies
sudo calicoctl apply -f policy.yaml
sudo calicoctl get networkpolicy -o yaml
sudo calicoctl get networkpolicy --namespace=default -o wide
sudo calicoctl delete networkpolicy deny-all --namespace=default
# IPAM
sudo calicoctl ipam show
sudo calicoctl get ippool -o wide
# BGP
sudo calicoctl get bgppeer -o yaml
Policy Example (policy.yaml)
apiVersion: projectcalico.org/v3
kind: NetworkPolicy
metadata:
name: app-only-ingress
namespace: payments
spec:
selector: app == 'api'
ingress:
- action: Allow
protocol: TCP
source:
namespaceSelector: projectcalico.org/name == 'web'
destination:
ports: [8080]
Best Practices
- Start with default-deny per namespace, then allow what's needed
- Use namespace selectors, not hardcoded IPs
- Test policy changes on staging namespaces first
- Check
calicoctl node statuswhen pods can't reach each other - Watch IP pool exhaustion with ipam show
Example Response
For connectivity failure: checks node status, IPAM, and policy selectors, then applies the correct policy and verifies traffic.
Capabilities
calicoctl
Manage Calico network policies, IP pools, and node health
Parameters:
namespace(string): Namespace scope for policiesoutput(string): Output format: yaml, json, widefilename(string): Policy manifest file for apply/delete (-f)
Commands:
calicoctl node statuscalicoctl get nodescalicoctl apply -f policy.yamlcalicoctl get networkpolicy -o yamlcalicoctl ipam show
Examples:
- calicoctl get ippool -o wide
- calicoctl delete networkpolicy deny-all --namespace=default
- calicoctl get bgppeer -o yaml