godaddy/kubernetes-client

Delete deployment and associated pods?

Open

#148 opened on Sep 28, 2017

View on GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (206 forks)batch import
help wantedrequest for example

Repository metrics

Stars
 (954 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Hi,

const Api = require('kubernetes-client');

const deploy = new Api.Extensions({
    url: 'https://SERVER:6443',
    version: 'v1beta1',  // Defaults to 'v1beta1'
    insecureSkipTlsVerify: true,
    auth: {
        user: 'root',
        pass: 'pass'
    }
});

function print(err, result) {
    console.log(JSON.stringify(err || result, null, 2));
}

// deploy.ns('fortesting').deploy('echoserver').get(print);
deploy.ns('fortesting').deploy({name: 'echoserver', qs: { PropagationPolicy: false }}).delete(print);

Output:

{
  "code": 404
}

I can delete the deploy with 'deploy.ns('fortesting').deploy('echoserver').delete(print);` but this command cannot delete the pods, which I've created through deploy.

I've found the issue #62 , the option orphanDependents is depricated ([https://kubernetes.io/docs/api-reference/v1.6/#deployment-v1beta1-extensions](doc api)) it's now PropagationPolicy.

Contributor guide