Kubernetes
Kubernetes enables deployment, scaling, and management of containerized applications. PhpStorm provides support for Kubernetes resource configuration files via the Kubernetes plugin.
The Kubernetes plugin supports Kubernetes API starting from version 1.5. It provides rich support for resource configuration files in YAML, and only basic support for the JSON format.
Feature | YAML | JSON |
---|---|---|
Auto-completion | Supported | Supported |
Quick documentation | Supported | Supported |
Inspections and quick fixes |
|
|
Live templates | Predefined templates for common configuration kinds:
| No predefined live templates |
Smart completion | Supported | Not supported |
Label definitions and selectors | Navigation using gutter icons, find usages, and renaming | Not supported |
Enhancements of the original Kubernetes model | Enums instead of plain strings where applicable | None |
Resource configuration files
PhpStorm recognizes Kubernetes resource configuration files using the following mandatory fields:
apiVersion
: identifies the versioned schema of the object representationkind
: identifies the object kind (for example,Service
,Pod
,Deployment
, etc.)
If both of the previous fields are present in a YAML or JSON file, PhpStorm will mark the file with the corresponding Kubernetes icon and enable all available features:
For YAML files, you can also use predefined Live Templates to create the necessary type of configuration:
To see available Live Templates and create new ones, open the Settings/Preferences dialog (Ctrl+Alt+S), click Editor, then click Live Templates, and expand the Kubernetes group in the list.