Prerequisites
Before you begin, ensure you have:Kubernetes Cluster
Kubernetes Cluster
- Kubernetes v1.19 or later
- Linux nodes with kernel 6.2+ (for eBPF support)
kubectlconfigured and connected to your cluster
Helm (Recommended)
Helm (Recommended)
- Helm v3.0 or later
- Or use raw manifests if you prefer
Cluster Permissions
Cluster Permissions
- Admin access to install the controller (DaemonSet, RBAC, etc.)
- Permission to create resources in your target namespaces
Kernel Version Check: kguardian requires Linux kernel 6.2+ for eBPF functionality. Run
uname -r on your nodes to verify.Step 1: Install the Controller
The kguardian controller runs as a DaemonSet and uses eBPF to observe your workloads.- Helm (Recommended)
- Specific Version
- Custom Values
The controller will automatically start monitoring pods across your cluster (excluding kube-system and kguardian namespaces by default).
Verify Installation
Check that all components are running:All pods should show
Running status. If not, see Troubleshooting.Step 2: Install the CLI Plugin
The kguardian CLI is a kubectl plugin for generating policies.- Quick Install Script (Recommended)
- Krew
- Manual Download
Step 3: Let Your Workloads Run
kguardian learns from actual runtime behavior, so let your applications run normally for 5-15 minutes to collect meaningful data.1
Deploy Test Workload (Optional)
If you don’t have existing workloads, deploy a simple app:
2
Monitor Data Collection
Check that the broker is receiving data:
The longer you let workloads run, the more comprehensive your policies will be.
Step 4: Generate Your First Network Policy
Now generate a network policy based on observed traffic:Success! kguardian automatically discovered that your nginx pod receives traffic from the curl-pod on port 80 and makes DNS queries.
Apply the Policy
Review the generated policy and apply it:Step 5: Generate a Seccomp Profile
Generate a seccomp profile to restrict syscalls:Apply the Seccomp Profile
To use the profile, you need to:-
Copy to nodes (for local profiles):
-
Update your deployment to reference it:
Future versions will support automatic seccomp profile management via the Security Profiles Operator.
Next Steps
Explore the UI
Visualize pod communication in real-time
Generate Cilium Policies
Create enhanced L7-aware policies
Batch Generation
Generate policies for all pods at once
GitOps Integration
Integrate with your CI/CD pipeline
Common Issues
No traffic data found
No traffic data found
Solution: Ensure your pods have been running and generating traffic for at least 5 minutes. Check broker logs:
Controller pods not starting
Controller pods not starting
Solution: Verify kernel version (6.2+) and that nodes support eBPF:
CLI can't connect to broker
CLI can't connect to broker
Solution: The CLI auto-discovers the broker via port-forwarding. Ensure you have permissions:
Learn more about kguardian's architecture
Understand how the components work together →