create_network_policy
Create Kubernetes NetworkPolicies using basic configuration or raw YAML manifests to control pod network traffic.
Instructions
Creates a new NetworkPolicy. Use either basic configuration or provide a raw YAML manifest.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"namespace": "<namespace>"
},
"name": "create_network_policy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dryRun | No | If true, simulates the action without making changes | |
| cluster | No | Target cluster name (default: 'default') | |
| namespace | Yes | The Kubernetes namespace | |
| policyName | No | The name of the NetworkPolicy | |
| podSelector | No | Label selector for the pods this policy applies to | |
| policyTypes | No | List of policy types (Ingress, Egress) | |
| yamlManifest | No | Full YAML manifest for advanced NetworkPolicy creation |