PHP Helm

PHP Helm Processor is a process wrapper for Kubernetes' Helm v3 CLI. You can run programmatically Helm v3 commands, directly from PHP, with a simple syntax.

PHP Helm Processor is a process wrapper for Kubernetes' Helm v3 CLI. You can run programmatically Helm v3 commands, directly from PHP, with a simple syntax.

๐Ÿš€ Installation

You can install the package via composer:

composer require renoki-co/php-helm

For Laravel, you may Publish the config:

php artisan vendor:publish --provider="RenokiCo\PhpHelm\PhpHelmServiceProvider" --tag="config"

๐Ÿ™Œ Usage

use RenokiCo\PhpHelm\Helm;

$helm = Helm::repoAdd(
    'add',
    'stable',
    'https://charts.helm.sh/stable'
);

$helm->run();

// The process is based on symfony/process
echo $helm->getOutput();

Flags & Environment Variables

You might want to pass flags to the commands:

use RenokiCo\PhpHelm\Helm;

$helm = Helm::repoAdd(
    'stable',
    'https://charts.helm.sh/stable',
    ['--no-update' => true]
);

$helm->run();

A third parameter is used for envs:

use RenokiCo\PhpHelm\Helm;

$helm = Helm::repoAdd(
    'stable',
    'https://charts.helm.sh/stable',
    ['--no-update' => true],
    ['SOME_ENV' => '1234']
);

$helm->run();

Add Repo

use RenokiCo\PhpHelm\Helm;

$helm = Helm::addRepo('stable', 'https://charts.helm.sh/stable', [
    '--no-update' => true,
    '--debug' => true,
]);

$helm->run();

Install/Upgrade Release

use RenokiCo\PhpHelm\Helm;

$helm = Helm::install('my-release', 'stable/postgres');

$helm->run();
use RenokiCo\PhpHelm\Helm;

$helm = Helm::upgrade('my-release', 'stable/postgres');

$helm->run();

Specifying Binary Path

You can call it once to set the path to the binary to the helm cli:

use RenokiCo\PhpHelm\Helm;

Helm::setHelmPath('/usr/bin/my-path/helm');

For Laravel, you might simply publish the config and set the HELM_PATH env variable:

HELM_PATH=/usr/bin/my-path/helm

Last updated