Search by

processmaker / laravel-helm

processmaker

Laravel wrapper for HELM v3

Package info

github.com/ProcessMaker/laravel-helm

pkg:composer/processmaker/laravel-helm

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

dev-main 2026-10-29 16:07 UTC

This package is auto-updated.

Last update: 2026-10-29 16:07:09 UTC


README

GitHub License Codecov Packagist Version

This package provides a wrapper to invoke Helm v3 commands using PHP code.

Installing

Installing can be done through a variety of methods, although Composer is recommended.

Composer (recommended)

Include the following snipped into the composer.json file.

"require": {
  "processmaker/laravel-helm": "^1.0"
}

or by using the composer require command:

composer require processmaker/laravel-helm

Github

Releases are available on Github.

Configuration

In order to use the Laravel Helm package, Helm v3 binary must be installed on your system. It is required to setup the right path where the Helm binary is located on the server.

Laravel Helm uses the path /usr/bin/helm by default, but it can be configured using an environment variable defined into the .env

HELM_BINARY_PATH=/path/to/helm/binary

Other configurations

# Set the internal `Process` timeout, default=3600
HELM_PROCESS_TIMEOUT=3600

How to use

All Helm commands follow this pattern:

  1. Call a static factory method (e.g., Helm::install())
  2. Call run() to execute the command
  3. Check isSuccessful() to verify execution
  4. Use getOutput() to get command output

The current version of the package implements the following commands:

  • helm version
  • helm install
  • helm upgrade
  • helm delete
  • helm uninstall

Also implements a method rawCommand where any other command can be executed.

Helm::version

use ProcessMaker\LaravelHelm\Helm;
...
$helm = Helm::version();
$helm->run();
// Prints the command response for the command 'helm version'
$version = $helm->getOutput();
...

Helm::install($name, $chart, $options, $environments)

Parameters:

  • name: installation name (required)
  • chart: helm chart (required)
  • options: options array (optional)
  • environments: environment variables array (optional)
use ProcessMaker\LaravelHelm\Helm;
...
$helm = Helm::install(
    'releasename',
    'oci://registry-1.docker.io/bitnamicharts/redis',
    [
        "--version" => '16.18.2'
    ]
);
$helm->run();
// To check the command was executed successfully
if ($helm->isSuccessful()) {
    // HELM app installed
    ...
}
...

Helm::upgrade($name, $chart, $options, $environments)

Parameters:

  • name: installation name (required)
  • chart: helm chart (required)
  • options: options array (optional)
  • environments: environment variables array (optional)
use ProcessMaker\LaravelHelm\Helm;
...
$helm = Helm::upgrade(
    'releasename',
    'oci://registry-1.docker.io/bitnamicharts/redis',
    [
        "--version" => '16.18.2',
        '--install'
    ]
);
$helm->run();
// To check the command was executed successfully
if ($helm->isSuccessful()) {
    // HELM app upgraded
    ...
}
...

Helm::delete($name, $options, $environments)

Parameters:

  • name: installation name (required)
  • options: options array (optional)
  • environments: environment variables array (optional)
use ProcessMaker\LaravelHelm\Helm;
...
$helm = Helm::delete('releasename');
$helm->run();
// To check the command was executed successfully
if ($helm->isSuccessful()) {
    // HELM app uninstalled
    ...
}
...

Helm::uninstall($name, $options, $environments)

Parameters:

  • name: installation name (required)
  • options: options array (optional)
  • environments: environment variables array (optional)
use ProcessMaker\LaravelHelm\Helm;
...
$helm = Helm::uninstall('releasename');
$helm->run();
// To check the command was executed successfully
if ($helm->isSuccessful()) {
    // HELM app uninstalled
    ...
}
...

Helm::rawCommand($command, $options, $environments)

Parameters:

  • command: string command to be executed (required)
  • options: options array (optional)
  • environments: environment variables array (optional)
use ProcessMaker\LaravelHelm\Helm;
...
// Example using simple commands
$helm = Helm::rawCommand('list');
$helm->run();

// Example using commands with parameters
$helm = Helm::rawCommand('list --all');
$helm->run();

// Example combining with $options
$helm = Helm::rawCommand('list --output json', ['--all']);
$helm->run();
...

Parsing $options array

The most of the methods for the Helm object uses the $options array. This is an example how the option are being parsed:

use ProcessMaker\LaravelHelm\Helm;
...
// Define options array
$options = [
    '--version' => '1.0.0', // include parameters using --name=value
    '--create-namespace', // include single --parameters
    'app.host' => 'https://10.0.0.1', // values from values.yaml file
    '-n' => 'default', // -name value parameters
    '-A', // single - parameters
    'dry-run' // fix invalid inputs 
];
$helm = Helm::install(
    'myredis',
    'oci://registry-1.docker.io/bitnamicharts/redis',
    $options
);
$helm->run();
// the command parsed will be:
// helm install myredis oci://registry-1.docker.io/bitnamicharts/redis --version=1.0.0 
//   --create-namespace --set app.host=https://10.0.0.1 -n default -A --dry-run
...

Injecting environment variables using $environments

If is required to include environment variables to the helm execution context, this can be done using the $environments array.

use ProcessMaker\LaravelHelm\Helm;
...
// List all helm applications pointing to a different cluster
$helm = Helm::rawCommand(
    'list --all',
    [],
    [
        'KUBECONFIG' => '/path/to/another/cluster/kubeconfig'
    ]
);
// Executing helm with the KUBECONFIG env vars enabled
$helm->run();
...

Error Handling

Always check if the command was successful after execution:

use ProcessMaker\LaravelHelm\Helm;
...
$helm = Helm::install('myapp', 'chart/name');
$helm->run();

if (!$helm->isSuccessful()) {
    $error = $helm->getErrorOutput();
    // Handle error appropriately
    ...
}
...

Important Notes

  • Commands are lazy - they don't execute until run() is called
  • The Helm instance proxies methods to Symfony Process, so you can use any Process methods
  • Process timeout defaults to 3600 seconds (1 hour), configurable via HELM_PROCESS_TIMEOUT
  • Default Helm binary path is /usr/bin/helm, configurable via HELM_BINARY_PATH
  • All methods return a Helm instance, allowing method chaining

Best Practices

  1. Always check isSuccessful() after running commands
  2. Use rawCommand() for commands not covered by specific methods
  3. Use environment variables for multi-cluster scenarios
  4. Set appropriate timeouts for long-running operations
  5. Handle errors gracefully and log command outputs for debugging

Testing

In order to validate that the package is fully functional always we can run:

composer test

License

Laravel Helm package is licensed under the Apache 2.0. See the LICENSE file for details. 2026

Support

Issues can be opened directly in Github.