function allocateWorkers(execution) {
        const kr = new K8sResource(
            'deployments', 'worker', context.sysconfig.teraslice, execution
        );

        const workerDeployment = kr.resource;

        logger.debug(`workerDeployment:\n\n${JSON.stringify(workerDeployment, null, 2)}`);

        return k8s.post(workerDeployment, 'deployment')
            .then(result => logger.debug(`k8s worker deployment submitted: ${JSON.stringify(result)}`))
            .catch((err) => {
                const error = new TSError(err, {
                    reason: 'Error submitting k8s worker deployment'
                });
                return Promise.reject(error);
            });
    }
function allocateWorkers(execution) {
        const kr = new K8sResource(
            'deployments', 'worker', context.sysconfig.teraslice, execution
        );

        const workerDeployment = kr.resource;

        logger.debug(`workerDeployment:\n\n${JSON.stringify(workerDeployment, null, 2)}`);

        return k8s.post(workerDeployment, 'deployment')
            .then(result => logger.debug(`k8s worker deployment submitted: ${JSON.stringify(result)}`))
            .catch((err) => {
                const error = new TSError(err, {
                    reason: 'Error submitting k8s worker deployment'
                });
                return Promise.reject(error);
            });
    }
function allocateWorkers ( execution ) { const kr = new K8sResource ( 'deployments' , 'worker' , context . sysconfig . teraslice , execution ) ; const workerDeployment = kr . resource ; logger . debug ( ` \n \n ${ JSON . stringify ( workerDeployment , null , 2 ) } ` ) ; return k8s . post ( workerDeployment , 'deployment' ) . then ( result => logger . debug ( ` ${ JSON . stringify ( result ) } ` ) ) . catch ( ( err ) => { const error = new TSError ( err , { reason : 'Error submitting k8s worker deployment' } ) ; return Promise . reject ( error ) ; } ) ; }
Creates k8s deployment that executes Teraslice workers for specified
Execution.
@param  {Object} execution  Object that contains information of Execution
@return {Promise}           [description]
Creates k8s deployment that executes Teraslice workers for specified Execution .