godaddy/kubernetes-client

.getStream() doesn't authenticate with refreshAuth

Open

#373 opened on Dec 15, 2018

View on GitHub
 (7 comments) (2 reactions) (0 assignees)JavaScript (954 stars) (206 forks)batch import
help wanted

Description

On an AWS EKS cluster calling:

        const stream = client.apis.apps.v1.watch.namespaces('default').deployments.getStream();
        const jsonStream = new JSONStream();
        stream.pipe(jsonStream);
        jsonStream.on('data', object => {
            console.log('Event: ', JSON.stringify(object, null, 2));
        });

Fails to authenticate with:

Event: { "kind": "Status", "apiVersion": "v1", "metadata": {}, "status": "Failure", "message": "deployments.apps is forbidden: User "system:anonymous" cannot watch deployments.apps in the namespace "tilloo"", "reason": "Forbidden", "details": { "group": "apps", "kind": "deployments" }, "code": 403 }

Workaround is to call any other API first. This may be related to: #248

Contributor guide