renoki-co/php-k8s

View on GitHub
src/Traits/Resource/CanScale.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

namespace RenokiCo\PhpK8s\Traits\Resource;

trait CanScale
{
    /**
     * Scale the current resource to a specific number of replicas.
     *
     * @param  int  $replicas
     * @return \RenokiCo\PhpK8s\Kinds\K8sScale
     */
    public function scale(int $replicas)
    {
        $scaler = $this->scaler();

        $scaler->setReplicas($replicas)->update();

        return $scaler;
    }
}