PhpStorm 2018.1 Help

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.

FeatureYAMLJSON
Auto-completionSupportedSupported
Quick documentationSupportedSupported
Inspections and quick fixes
  • Invalid, missing, and duplicated keys
  • Non-editable (read-only) keys and resources
  • Deprecated keys and resources
  • Invalid integer and enum key values
  • Invalid, missing, and duplicated properties
Live templates

Predefined templates for common configuration kinds:

  • kcm: ConfigMap
  • kdep: Deployment
  • kpod: Pod
  • kres: Generic resource
  • kser: Service
No predefined live templates
Smart completionSupportedNot supported
Label definitions and selectorsNavigation using gutter icons, find usages, and renamingNot supported
Enhancements of the original Kubernetes modelEnums instead of plain strings where applicableNone

Resource configuration files

PhpStorm recognizes Kubernetes resource configuration files using the following mandatory fields:

  • apiVersion: identifies the versioned schema of the object representation
  • kind: 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.

Last modified: 27 July 2018