Schema-based autocompletion and validation for Cilium, Isovalent and
Kubernetes network policy YAML files in VS Code.
Features
- Autocompletion: Suggests field names, values, and structures based on CRD schemas
- Validation: Highlights invalid fields and values directly in the editor
- Auto-detection: Automatically applies the correct schema based on
apiVersion and kind in YAML files
Supported Policy Types
| Kind |
apiVersion |
CiliumNetworkPolicy |
cilium.io/v2 |
CiliumClusterwideNetworkPolicy |
cilium.io/v2 |
NetworkPolicy |
networking.k8s.io/v1 |
ClusterNetworkPolicy |
policy.networking.k8s.io/v1alpha2 |
IsovalentNetworkPolicy |
isovalent.com/v1 |
IsovalentClusterwideNetworkPolicy |
isovalent.com/v1 |
TetragonNetworkPolicy |
cilium.io/v1alpha1 |
TetragonNetworkPolicyNamespaced |
cilium.io/v1alpha1 |
SmartSwitchNetworkPolicy |
isovalent.com/v1alpha1 |
NetworkObjectGroup |
isovalent.com/v1alpha1 |
Requirements
Installation
The extension is published as isovalent.vscode-npt-extension:
- VS Code: install Network Policy Tools from the
Visual Studio Marketplace.
- Cursor, VSCodium and other editors using Open VSX: install it from
Open VSX.
- Offline: download the
.vsix of a release from the
releases page and
run code --install-extension vscode-npt-extension-<version>.vsix, or use
Extensions: Install from VSIX... from the command palette. The Red Hat
YAML extension has to be installed as well.
The extension is released together with Isovalent Hubble Timescape and shares
its version numbers.
How It Works
The extension registers JSON schemas with the Red Hat YAML extension. When you open a YAML file containing a recognized apiVersion and kind combination, the correct schema is applied automatically, providing:
- Field suggestions when pressing
Ctrl+Space
- Red squiggly underlines for unknown fields or invalid values
- Hover documentation showing field types
The Network Policy Tools settings section has a single option,
networkPolicyTools.enabled, to turn the schemas off.
Reporting Issues
Open an issue in the
issue tracker and
include:
- the extension version, shown in the Extensions view;
- the versions of VS Code, from Help: About, and of the Red Hat YAML
extension;
- a policy that reproduces the problem, with any sensitive names or addresses
removed, and the diagnostic you expected or got.
Report security vulnerabilities privately through your Isovalent support
channel instead of opening a public issue.
License
The extension is released under the MIT License, see LICENSE. The notices of
the third-party software included in the extension are in
ThirdPartyNotices.txt, which is shipped in the extension package and attached
to each release.